implement 180,270 rorations and cleanup
parent
943a4cef73
commit
c11a92efdd
|
@ -36,7 +36,7 @@ VideoStore::VideoStore(const char *filename_in, const char *format_in,
|
||||||
AVStream *input_st,
|
AVStream *input_st,
|
||||||
AVStream *inpaud_st,
|
AVStream *inpaud_st,
|
||||||
int64_t nStartTime,
|
int64_t nStartTime,
|
||||||
Monitor::Orientation p_orientation
|
Monitor::Orientation orientation
|
||||||
) {
|
) {
|
||||||
|
|
||||||
AVDictionary *pmetadata = NULL;
|
AVDictionary *pmetadata = NULL;
|
||||||
|
@ -76,9 +76,19 @@ VideoStore::VideoStore(const char *filename_in, const char *format_in,
|
||||||
|
|
||||||
dsr = av_dict_set(&pmetadata, "title", "Zoneminder Security Recording", 0);
|
dsr = av_dict_set(&pmetadata, "title", "Zoneminder Security Recording", 0);
|
||||||
if (dsr < 0) Warning("%s:%d: title set failed", __FILE__, __LINE__ );
|
if (dsr < 0) Warning("%s:%d: title set failed", __FILE__, __LINE__ );
|
||||||
if ( p_orientation == Monitor::ROTATE_90 ) {
|
if ( orientation ) {
|
||||||
dsr = av_dict_set(&pmetadata, "rotate", "90", 0);
|
if ( orientation == Monitor::ROTATE_90 ) {
|
||||||
if (dsr < 0) Warning("%s:%d: title set failed", __FILE__, __LINE__ );
|
dsr = av_dict_set(&pmetadata, "rotate", "90", 0);
|
||||||
|
if (dsr < 0) Warning("%s:%d: title set failed", __FILE__, __LINE__ );
|
||||||
|
} else if ( orientation == Monitor::ROTATE_180 ) {
|
||||||
|
dsr = av_dict_set(&pmetadata, "rotate", "180", 0);
|
||||||
|
if (dsr < 0) Warning("%s:%d: title set failed", __FILE__, __LINE__ );
|
||||||
|
} else if ( orientation == Monitor::ROTATE_270 ) {
|
||||||
|
dsr = av_dict_set(&pmetadata, "rotate", "270", 0);
|
||||||
|
if (dsr < 0) Warning("%s:%d: title set failed", __FILE__, __LINE__ );
|
||||||
|
} else {
|
||||||
|
Warning( "Unsupported Orientation(%d)", orientation );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
oc->metadata = pmetadata;
|
oc->metadata = pmetadata;
|
||||||
|
|
|
@ -17,25 +17,23 @@ private:
|
||||||
|
|
||||||
const char *filename;
|
const char *filename;
|
||||||
const char *format;
|
const char *format;
|
||||||
|
|
||||||
Monitor::Orientation orientation;
|
|
||||||
|
|
||||||
bool keyframeMessage;
|
bool keyframeMessage;
|
||||||
int keyframeSkipNumber;
|
int keyframeSkipNumber;
|
||||||
|
|
||||||
int64_t startTime;
|
int64_t startTime;
|
||||||
int64_t startPts;
|
int64_t startPts;
|
||||||
int64_t startDts;
|
int64_t startDts;
|
||||||
int64_t prevDts;
|
int64_t prevDts;
|
||||||
int64_t filter_in_rescale_delta_last;
|
int64_t filter_in_rescale_delta_last;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
VideoStore(const char *filename_in, const char *format_in, AVStream *input_st, AVStream *inpaud_st, int64_t nStartTime, Monitor::Orientation p_orientation );
|
VideoStore(const char *filename_in, const char *format_in, AVStream *input_st, AVStream *inpaud_st, int64_t nStartTime, Monitor::Orientation p_orientation );
|
||||||
~VideoStore();
|
~VideoStore();
|
||||||
|
|
||||||
int writeVideoFramePacket(AVPacket *pkt, AVStream *input_st);//, AVPacket *lastKeyframePkt);
|
int writeVideoFramePacket(AVPacket *pkt, AVStream *input_st);//, AVPacket *lastKeyframePkt);
|
||||||
int writeAudioFramePacket(AVPacket *pkt, AVStream *input_st);
|
int writeAudioFramePacket(AVPacket *pkt, AVStream *input_st);
|
||||||
void dumpPacket( AVPacket *pkt );
|
void dumpPacket( AVPacket *pkt );
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue