timeapi.h header might not be missing depending on toolchain.
Also do hard meson error if winmm dep is not available but
amfcodec is explicitly enabled.
And fixing various GCC build warning errors.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2155>
#include <gst/d3d11/gstd3d11.h>
#include <wrl.h>
#include <string.h>
-#include <timeapi.h>
+#include <mmsystem.h>
/* *INDENT-OFF* */
using namespace Microsoft::WRL;
guint size;
GstStructure *config;
GstCapsFeatures *features;
- gboolean is_d3d11 = FALSE;
gst_query_parse_allocation (query, &caps, nullptr);
if (!caps) {
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);
}
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;
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;
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); \
}
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)
{
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;
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;
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); \
platform_deps = []
extra_args = ['-DGST_USE_UNSTABLE_API']
+extra_cpp_args = []
if host_system == 'windows'
if not gstd3d11_dep.found()
if amf_option.enabled()
# 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]
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,