|
|
|
@ -176,7 +176,8 @@ bool videoAVLIBSource::_stop(void){ |
|
|
|
bool videoAVLIBSource::_open(char *URI, bool ShowDeviceMenu, float framerate, int inputPin, int width, int height, bool scaled, int s_width, int s_height ){ |
|
|
|
if (m_pVideoState == NULL) return false; |
|
|
|
if (m_pVideoState->m_bStatus == MS_INIT){ |
|
|
|
char Buffer[256]; |
|
|
|
char Buffer[256] = {0}; |
|
|
|
char tChar[128] = {0}; |
|
|
|
sprintf(m_pCookie, "%s", MD5String(URI)); |
|
|
|
m_pVideoState->m_bStatus = MS_OPENING; |
|
|
|
if( strncmp( URI, "video=", 6 ) == 0 ){ |
|
|
|
@ -193,12 +194,10 @@ bool videoAVLIBSource::_open(char *URI, bool ShowDeviceMenu, float framerate, in |
|
|
|
//av_dict_set(&options, "pixel_format", "yuyv422", 0 );
|
|
|
|
av_dict_set(&options, "video_codec", "mjpeg", 0 ); |
|
|
|
if( inputPin != -1 ){ |
|
|
|
char tChar[4]; |
|
|
|
sprintf(tChar, "%d", inputPin); |
|
|
|
av_dict_set(&options, "crossbar_video_input_pin_number", tChar, 0); |
|
|
|
}; |
|
|
|
if( framerate != -1 ){ |
|
|
|
char tChar[4]; |
|
|
|
sprintf(tChar, "%f", framerate); |
|
|
|
av_dict_set(&options, "framerate", tChar, 0); |
|
|
|
}; |
|
|
|
@ -258,7 +257,6 @@ bool videoAVLIBSource::_open(char *URI, bool ShowDeviceMenu, float framerate, in |
|
|
|
AVDictionary *options = NULL; |
|
|
|
if( width != -1 && height != -1 ){ |
|
|
|
m_bSizeIsAutomatic = false; |
|
|
|
char tChar[32]; |
|
|
|
sprintf(tChar, "%dx%d", width, height); |
|
|
|
av_dict_set(&options, "video_size", tChar, 0); |
|
|
|
} else { |
|
|
|
@ -270,7 +268,6 @@ bool videoAVLIBSource::_open(char *URI, bool ShowDeviceMenu, float framerate, in |
|
|
|
av_dict_set(&options, "fflags", "nobuffer", 0); |
|
|
|
//av_dict_set(&options, "analyzeduration", "1000000", 0);
|
|
|
|
if( framerate != -1 ){ |
|
|
|
char tChar[10]; |
|
|
|
sprintf(tChar, "%0.2f", framerate); |
|
|
|
//sprintf(tChar, "120" );
|
|
|
|
av_dict_set(&options, "framerate", tChar, 0); |
|
|
|
|