$OpenBSD$ https://github.com/openscenegraph/osg/commit/876cb95fada9a2ea5821e6473c185338ec28a914 --- src/osgPlugins/ffmpeg/FFmpegParameters.cpp.orig Fri Jul 15 12:25:12 2011 +++ src/osgPlugins/ffmpeg/FFmpegParameters.cpp Fri Jul 5 10:27:40 2013 @@ -8,40 +8,37 @@ #if LIBAVCODEC_VERSION_MAJOR >= 53 extern "C" { - #include + #include } #define av_parse_video_frame_size av_parse_video_size #define av_parse_video_frame_rate av_parse_video_rate #endif -#if LIBAVCODEC_VERSION_MAJOR >= 53 || \ - (LIBAVCODEC_VERSION_MAJOR==52 && LIBAVCODEC_VERSION_MINOR>=49) - - extern "C" - { - #include - } +extern "C" +{ + #include +} - inline PixelFormat osg_av_get_pix_fmt(const char *name) { return av_get_pix_fmt(name); } +inline PixelFormat osg_av_get_pix_fmt(const char *name) { return av_get_pix_fmt(name); } -#else - inline PixelFormat osg_av_get_pix_fmt(const char *name) { return avcodec_get_pix_fmt(name); } -#endif - namespace osgFFmpeg { FFmpegParameters::FFmpegParameters() : + m_context(0), + m_options(0), m_format(0) { - memset(&m_parameters, 0, sizeof(m_parameters)); + // Initialize the dictionary + av_dict_set(&m_options, "foo", "bar", 0); } - FFmpegParameters::~FFmpegParameters() -{} +{ + av_dict_free(&m_options); +} void FFmpegParameters::parse(const std::string& name, const std::string& value) @@ -50,50 +47,19 @@ void FFmpegParameters::parse(const std::string& name, { return; } - else if (name == "format") + if (name == "format") { +#ifndef ANDROID avdevice_register_all(); +#endif m_format = av_find_input_format(value.c_str()); if (!m_format) OSG_NOTICE<<"Failed to apply input video format: "<> audio_sample_rate; - m_parameters.sample_rate = audio_sample_rate; - } + av_dict_set(&m_options, "framerate", value.c_str(), 0); + else + av_dict_set(&m_options, name.c_str(), value.c_str(), 0); }