diff options
author | U. Artie Eoff <ullysses.a.eoff@intel.com> | 2019-10-29 15:13:44 -0700 |
---|---|---|
committer | GStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org> | 2019-12-11 21:27:48 +0000 |
commit | b384593d3d7a6ac5e300768340ecd4def6ed7d51 (patch) | |
tree | 89abc6ea8fee7fa8f209887653f7cbfdba5081d8 /gst | |
parent | f4fc37ccc5d4762b15971983fb2920bc78a9a0eb (diff) |
plugins: use plugin base macros to access pad specific data
Don't access base struct fields directly since the underlying
definition can change. Instead, use the accessor macros.
Diffstat (limited to 'gst')
-rw-r--r-- | gst/vaapi/gstvaapidecode.c | 12 | ||||
-rw-r--r-- | gst/vaapi/gstvaapiencode.c | 2 | ||||
-rw-r--r-- | gst/vaapi/gstvaapipluginbase.h | 8 | ||||
-rw-r--r-- | gst/vaapi/gstvaapipostproc.c | 9 |
4 files changed, 22 insertions, 9 deletions
diff --git a/gst/vaapi/gstvaapidecode.c b/gst/vaapi/gstvaapidecode.c index f4798f28..3acfe4f9 100644 --- a/gst/vaapi/gstvaapidecode.c +++ b/gst/vaapi/gstvaapidecode.c @@ -499,7 +499,9 @@ is_src_allocator_dmabuf (GstVaapiDecode * decode) if (!GST_VAAPI_PLUGIN_BASE_SRC_PAD_CAN_DMABUF (plugin)) return FALSE; - return gst_vaapi_is_dmabuf_allocator (plugin->srcpad_allocator); + return + gst_vaapi_is_dmabuf_allocator (GST_VAAPI_PLUGIN_BASE_SRC_PAD_ALLOCATOR + (plugin)); } static GstFlowReturn @@ -596,9 +598,11 @@ gst_vaapidecode_push_decoded_frame (GstVideoDecoder * vdec, GstBuffer *sys_buf, *va_buf; va_buf = out_frame->output_buffer; - sys_buf = gst_buffer_new_allocate (plugin->other_srcpad_allocator, - GST_VIDEO_INFO_SIZE (&plugin->srcpad_info), - &plugin->other_allocator_params); + sys_buf = + gst_buffer_new_allocate (GST_VAAPI_PLUGIN_BASE_OTHER_ALLOCATOR + (plugin), + GST_VIDEO_INFO_SIZE (GST_VAAPI_PLUGIN_BASE_SRC_PAD_INFO (plugin)), + &GST_VAAPI_PLUGIN_BASE_OTHER_ALLOCATOR_PARAMS (plugin)); if (!sys_buf) goto error_no_sys_buffer; diff --git a/gst/vaapi/gstvaapiencode.c b/gst/vaapi/gstvaapiencode.c index d833f79e..46b4737d 100644 --- a/gst/vaapi/gstvaapiencode.c +++ b/gst/vaapi/gstvaapiencode.c @@ -888,7 +888,7 @@ gst_vaapiencode_init (GstVaapiEncode * encode) GstVaapiPluginBase *const plugin = GST_VAAPI_PLUGIN_BASE (encode); gst_vaapi_plugin_base_init (GST_VAAPI_PLUGIN_BASE (encode), GST_CAT_DEFAULT); - gst_pad_use_fixed_caps (plugin->srcpad); + gst_pad_use_fixed_caps (GST_VAAPI_PLUGIN_BASE_SRC_PAD (plugin)); } static void diff --git a/gst/vaapi/gstvaapipluginbase.h b/gst/vaapi/gstvaapipluginbase.h index 9faa0639..774c4c3b 100644 --- a/gst/vaapi/gstvaapipluginbase.h +++ b/gst/vaapi/gstvaapipluginbase.h @@ -85,6 +85,14 @@ typedef struct _GstVaapiPluginBaseClass GstVaapiPluginBaseClass; (&GST_VAAPI_PLUGIN_BASE(plugin)->srcpad_info) #define GST_VAAPI_PLUGIN_BASE_SRC_PAD_CAN_DMABUF(plugin) \ (GST_VAAPI_PLUGIN_BASE(plugin)->srcpad_can_dmabuf) +#define GST_VAAPI_PLUGIN_BASE_SRC_PAD_BUFFER_POOL(plugin) \ + (GST_VAAPI_PLUGIN_BASE(plugin)->srcpad_buffer_pool) +#define GST_VAAPI_PLUGIN_BASE_SRC_PAD_ALLOCATOR(plugin) \ + (GST_VAAPI_PLUGIN_BASE(plugin)->srcpad_allocator) +#define GST_VAAPI_PLUGIN_BASE_OTHER_ALLOCATOR(plugin) \ + (GST_VAAPI_PLUGIN_BASE(plugin)->other_srcpad_allocator) +#define GST_VAAPI_PLUGIN_BASE_OTHER_ALLOCATOR_PARAMS(plugin) \ + (GST_VAAPI_PLUGIN_BASE(plugin)->other_allocator_params) #define GST_VAAPI_PLUGIN_BASE_COPY_OUTPUT_FRAME(plugin) \ (GST_VAAPI_PLUGIN_BASE(plugin)->copy_output_frame) diff --git a/gst/vaapi/gstvaapipostproc.c b/gst/vaapi/gstvaapipostproc.c index 82c6b5fc..d40f3995 100644 --- a/gst/vaapi/gstvaapipostproc.c +++ b/gst/vaapi/gstvaapipostproc.c @@ -379,7 +379,7 @@ create_output_buffer (GstVaapiPostproc * postproc) GstBuffer *outbuf; GstBufferPool *const pool = - GST_VAAPI_PLUGIN_BASE (postproc)->srcpad_buffer_pool; + GST_VAAPI_PLUGIN_BASE_SRC_PAD_BUFFER_POOL (postproc); GstFlowReturn ret; g_return_val_if_fail (pool != NULL, NULL); @@ -412,9 +412,10 @@ create_output_dump_buffer (GstVaapiPostproc * postproc) { GstVaapiPluginBase *const plugin = GST_VAAPI_PLUGIN_BASE (postproc); - return gst_buffer_new_allocate (plugin->other_srcpad_allocator, - GST_VIDEO_INFO_SIZE (&plugin->srcpad_info), - &plugin->other_allocator_params); + return + gst_buffer_new_allocate (GST_VAAPI_PLUGIN_BASE_OTHER_ALLOCATOR (plugin), + GST_VIDEO_INFO_SIZE (GST_VAAPI_PLUGIN_BASE_SRC_PAD_INFO (plugin)), + &GST_VAAPI_PLUGIN_BASE_OTHER_ALLOCATOR_PARAMS (plugin)); } static void |