diff --git a/subprojects/gst-plugins-bad/sys/amfcodec/gstamfencoder.cpp b/subprojects/gst-plugins-bad/sys/amfcodec/gstamfencoder.cpp index 63c8b3dc1d..fd1484938d 100644 --- a/subprojects/gst-plugins-bad/sys/amfcodec/gstamfencoder.cpp +++ b/subprojects/gst-plugins-bad/sys/amfcodec/gstamfencoder.cpp @@ -28,7 +28,7 @@ #include #include #include -#include +#include /* *INDENT-OFF* */ using namespace Microsoft::WRL; @@ -1006,7 +1006,6 @@ gst_amf_encoder_propose_allocation (GstVideoEncoder * encoder, GstQuery * query) guint size; GstStructure *config; GstCapsFeatures *features; - gboolean is_d3d11 = FALSE; gst_query_parse_allocation (query, &caps, nullptr); if (!caps) { @@ -1024,7 +1023,6 @@ gst_amf_encoder_propose_allocation (GstVideoEncoder * encoder, GstQuery * query) GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY)) { GST_DEBUG_OBJECT (self, "upstream support d3d11 memory"); pool = gst_d3d11_buffer_pool_new (device); - is_d3d11 = TRUE; } else { pool = gst_d3d11_staging_buffer_pool_new (device); } diff --git a/subprojects/gst-plugins-bad/sys/amfcodec/gstamfh264enc.cpp b/subprojects/gst-plugins-bad/sys/amfcodec/gstamfh264enc.cpp index d043daabf3..fbc64af2d9 100644 --- a/subprojects/gst-plugins-bad/sys/amfcodec/gstamfh264enc.cpp +++ b/subprojects/gst-plugins-bad/sys/amfcodec/gstamfh264enc.cpp @@ -1331,7 +1331,7 @@ gst_amf_h264_enc_create_class_data (GstD3D11Device * device, num_val = in_iocaps->GetNumOfFormats (); GST_LOG_OBJECT (device, "Input format count: %d", num_val); - for (guint i = 0; i < num_val; i++) { + for (amf_int32 i = 0; i < num_val; i++) { AMF_SURFACE_FORMAT format; amf_bool native; @@ -1351,7 +1351,7 @@ gst_amf_h264_enc_create_class_data (GstD3D11Device * device, num_val = in_iocaps->GetNumOfMemoryTypes (); GST_LOG_OBJECT (device, "Input memory type count: %d", num_val); - for (guint i = 0; i < num_val; i++) { + for (amf_int32 i = 0; i < num_val; i++) { AMF_MEMORY_TYPE type; amf_bool native; @@ -1383,7 +1383,7 @@ gst_amf_h264_enc_create_class_data (GstD3D11Device * device, in_min_width, in_max_width, in_min_height, in_max_height); #define QUERY_CAPS_PROP(prop,val) G_STMT_START { \ - amf_int64 _val; \ + amf_int64 _val = 0; \ result = amf_caps->GetProperty (prop, &_val); \ if (result == AMF_OK) { \ GST_INFO_OBJECT (device, G_STRINGIFY (val) ": %" G_GINT64_FORMAT, _val); \ diff --git a/subprojects/gst-plugins-bad/sys/amfcodec/gstamfh265enc.cpp b/subprojects/gst-plugins-bad/sys/amfcodec/gstamfh265enc.cpp index 17224ec0f2..e231e98bd8 100644 --- a/subprojects/gst-plugins-bad/sys/amfcodec/gstamfh265enc.cpp +++ b/subprojects/gst-plugins-bad/sys/amfcodec/gstamfh265enc.cpp @@ -522,18 +522,6 @@ update_enum (GstAmfH265Enc * self, gint * old_val, const GValue * new_val) self->property_updated = TRUE; } -static void -update_bool (GstAmfH265Enc * self, gboolean * old_val, const GValue * new_val) -{ - gboolean val = g_value_get_boolean (new_val); - - if (*old_val == val) - return; - - *old_val = val; - self->property_updated = TRUE; -} - static void gst_amf_h265_enc_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec) @@ -979,7 +967,7 @@ gst_amf_h265_enc_create_class_data (GstD3D11Device * device, num_val = in_iocaps->GetNumOfFormats (); GST_LOG_OBJECT (device, "Input format count: %d", num_val); - for (guint i = 0; i < num_val; i++) { + for (amf_int32 i = 0; i < num_val; i++) { AMF_SURFACE_FORMAT format; amf_bool native; @@ -999,7 +987,7 @@ gst_amf_h265_enc_create_class_data (GstD3D11Device * device, num_val = in_iocaps->GetNumOfMemoryTypes (); GST_LOG_OBJECT (device, "Input memory type count: %d", num_val); - for (guint i = 0; i < num_val; i++) { + for (amf_int32 i = 0; i < num_val; i++) { AMF_MEMORY_TYPE type; amf_bool native; @@ -1031,7 +1019,7 @@ gst_amf_h265_enc_create_class_data (GstD3D11Device * device, in_min_width, in_max_width, in_min_height, in_max_height); #define QUERY_CAPS_PROP(prop,val) G_STMT_START { \ - amf_int64 _val; \ + amf_int64 _val = 0; \ result = amf_caps->GetProperty (prop, &_val); \ if (result == AMF_OK) { \ GST_INFO_OBJECT (device, G_STRINGIFY (val) ": %" G_GINT64_FORMAT, _val); \ diff --git a/subprojects/gst-plugins-bad/sys/amfcodec/meson.build b/subprojects/gst-plugins-bad/sys/amfcodec/meson.build index 6f3da435f9..66c59dbe10 100644 --- a/subprojects/gst-plugins-bad/sys/amfcodec/meson.build +++ b/subprojects/gst-plugins-bad/sys/amfcodec/meson.build @@ -13,6 +13,7 @@ endif platform_deps = [] extra_args = ['-DGST_USE_UNSTABLE_API'] +extra_cpp_args = [] if host_system == 'windows' if not gstd3d11_dep.found() if amf_option.enabled() @@ -37,8 +38,12 @@ if host_system == 'windows' # Encoder needs to do sleep() by API design winmm_lib = cc.find_library('winmm', required: amf_option) - if not winmm_lib.found() or not cc.has_header('timeapi.h') - subdir_done() + if not winmm_lib.found() or not cc.has_header('mmsystem.h') + if amf_option.enabled() + error('Required winmm dependency is not available') + else + subdir_done() + endif endif platform_deps += [gstd3d11_dep, winmm_lib] @@ -50,17 +55,23 @@ else endif endif -# and MinGW 32bits compiler seems to be complaining about redundant-decls -if cc.get_id() != 'msvc' - extra_args += cc.get_supported_arguments([ +if cxx.get_id() != 'msvc' + extra_cpp_args = cxx.get_supported_arguments([ + # and MinGW 32bits compiler seems to be complaining about redundant-decls '-Wno-redundant-decls', + # Various SDK header issue + '-Wno-class-memaccess', + '-Wno-attributes', + '-Wno-format', + '-Wno-format-nonliteral', + '-Wno-format-security', ]) endif gstamfcodec = library('gstamfcodec', amf_sources, c_args : gst_plugins_bad_args + extra_args, - cpp_args : gst_plugins_bad_args + extra_args, + cpp_args : gst_plugins_bad_args + extra_args + extra_cpp_args, include_directories : [configinc, include_directories('include')], dependencies : [gstbase_dep, gstvideo_dep, gstpbutils_dep, gstcodecparsers_dep, gmodule_dep] + platform_deps, install : true,