Commit efa2baed authored by Ilya Lavrenov's avatar Ilya Lavrenov Committed by Dikay900

TCP instead of UDP

Conflicts:
	modules/highgui/src/cap_ffmpeg_impl.hpp
parent c9481b0f
...@@ -270,6 +270,10 @@ struct CvCapture_FFMPEG ...@@ -270,6 +270,10 @@ struct CvCapture_FFMPEG
and so the filename is needed to reopen the file on backward seeking. and so the filename is needed to reopen the file on backward seeking.
*/ */
char * filename; char * filename;
#if LIBAVFORMAT_BUILD >= CALC_FFMPEG_VERSION(52, 111, 0)
AVDictionary *dict;
#endif
}; };
void CvCapture_FFMPEG::init() void CvCapture_FFMPEG::init()
...@@ -290,6 +294,10 @@ void CvCapture_FFMPEG::init() ...@@ -290,6 +294,10 @@ void CvCapture_FFMPEG::init()
avcodec = 0; avcodec = 0;
frame_number = 0; frame_number = 0;
eps_zero = 0.000025; eps_zero = 0.000025;
#if LIBAVFORMAT_BUILD >= CALC_FFMPEG_VERSION(52, 111, 0)
dict = NULL;
#endif
} }
...@@ -347,6 +355,11 @@ void CvCapture_FFMPEG::close() ...@@ -347,6 +355,11 @@ void CvCapture_FFMPEG::close()
packet.data = NULL; packet.data = NULL;
} }
#if LIBAVFORMAT_BUILD >= CALC_FFMPEG_VERSION(52, 111, 0)
if (dict != NULL)
av_dict_free(&dict);
#endif
init(); init();
} }
...@@ -554,6 +567,7 @@ bool CvCapture_FFMPEG::open( const char* _filename ) ...@@ -554,6 +567,7 @@ bool CvCapture_FFMPEG::open( const char* _filename )
close(); close();
#if LIBAVFORMAT_BUILD >= CALC_FFMPEG_VERSION(52, 111, 0) #if LIBAVFORMAT_BUILD >= CALC_FFMPEG_VERSION(52, 111, 0)
av_dict_set(&dict, "rtsp_transport", "tcp", 0);
int err = avformat_open_input(&ic, _filename, NULL, NULL); int err = avformat_open_input(&ic, _filename, NULL, NULL);
#else #else
int err = av_open_input_file(&ic, _filename, NULL, 0, NULL); int err = av_open_input_file(&ic, _filename, NULL, 0, NULL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment