diff --git a/cmake/FindBaseDependencies.cmake b/cmake/FindBaseDependencies.cmake index 021d440f..2db5bf6e 100644 --- a/cmake/FindBaseDependencies.cmake +++ b/cmake/FindBaseDependencies.cmake @@ -23,6 +23,7 @@ endfunction(FindGlib) function(FindGstreamer libs) pkg_check_modules (GSTREAMER REQUIRED gstreamer-1.0>=1.6) + pkg_search_module (GST_PLUGINS_BAD gstreamer-plugins-bad-1.0) pkg_check_modules (GSTREAMER_VIDEO REQUIRED gstreamer-video-1.0>=1.6) pkg_check_modules (GSTREAMER_ALLOCATORS REQUIRED gstreamer-allocators-1.0>=1.6) pkg_check_modules (GSTREAMER_GL gstreamer-gl-1.0) @@ -47,6 +48,11 @@ function(FindGstreamer libs) include_directories (${GSTREAMER_GL_INCLUDE_DIRS}) add_definitions(-DHAVE_GST_GL_LIBS) endif() + + if (${GST_PLUGINS_BAD_VERSION} VERSION_GREATER_EQUAL "1.18") + add_compile_options(-DUSE_GST_PLUGINS_BAD_1_18) + endif() + set(${libs} ${GST_LIBS} PARENT_SCOPE) endfunction(FindGstreamer) diff --git a/gst-libs/mfx/gstmfxdecoder.c b/gst-libs/mfx/gstmfxdecoder.c index f0122d6a..44e64956 100644 --- a/gst-libs/mfx/gstmfxdecoder.c +++ b/gst-libs/mfx/gstmfxdecoder.c @@ -552,7 +552,11 @@ gst_mfx_decoder_handle_avc_codec_data (GstMfxDecoder * decoder, nalu.data = decoder->codec_data->data; nalu.size = decoder->codec_data->len; +#ifdef USE_GST_PLUGINS_BAD_1_18 + if (GST_H264_PARSER_OK == gst_h264_parse_sps(&nalu, &sps) && +#else if (GST_H264_PARSER_OK == gst_h264_parse_sps(&nalu, &sps, TRUE) && +#endif sps.vui_parameters_present_flag && sps.vui_parameters.max_dec_frame_buffering == 16) decoder->sync_out_surf = TRUE; diff --git a/meson.build b/meson.build index 2cb76e09..f32e9129 100644 --- a/meson.build +++ b/meson.build @@ -90,6 +90,10 @@ endif mfx_decoder = get_option('MFX_DECODER') if mfx_decoder mfx_c_args += ['-DMFX_DECODER'] + + if dependency('gst-plugins-bad', version: '>1.18').found() + mfx_c_args += ['-DUSE_GST_PLUGINS_BAD_1_18'] + endif endif mfx_sink = get_option('MFX_SINK')