implement 180,270 rorations and cleanup

pull/1480/head
Isaac Connor 2016-05-13 15:11:17 -04:00
parent 943a4cef73
commit c11a92efdd
2 changed files with 24 additions and 16 deletions

View File

@ -36,7 +36,7 @@ VideoStore::VideoStore(const char *filename_in, const char *format_in,
AVStream *input_st,
AVStream *inpaud_st,
int64_t nStartTime,
Monitor::Orientation p_orientation
Monitor::Orientation orientation
) {
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);
if (dsr < 0) Warning("%s:%d: title set failed", __FILE__, __LINE__ );
if ( p_orientation == Monitor::ROTATE_90 ) {
if ( orientation ) {
if ( orientation == Monitor::ROTATE_90 ) {
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;

View File

@ -18,8 +18,6 @@ private:
const char *filename;
const char *format;
Monitor::Orientation orientation;
bool keyframeMessage;
int keyframeSkipNumber;