mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 04:56:14 +00:00
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.
This commit is contained in:
parent
f4fc37ccc5
commit
b384593d3d
4 changed files with 22 additions and 9 deletions
|
@ -499,7 +499,9 @@ is_src_allocator_dmabuf (GstVaapiDecode * decode)
|
||||||
|
|
||||||
if (!GST_VAAPI_PLUGIN_BASE_SRC_PAD_CAN_DMABUF (plugin))
|
if (!GST_VAAPI_PLUGIN_BASE_SRC_PAD_CAN_DMABUF (plugin))
|
||||||
return FALSE;
|
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
|
static GstFlowReturn
|
||||||
|
@ -596,9 +598,11 @@ gst_vaapidecode_push_decoded_frame (GstVideoDecoder * vdec,
|
||||||
GstBuffer *sys_buf, *va_buf;
|
GstBuffer *sys_buf, *va_buf;
|
||||||
|
|
||||||
va_buf = out_frame->output_buffer;
|
va_buf = out_frame->output_buffer;
|
||||||
sys_buf = gst_buffer_new_allocate (plugin->other_srcpad_allocator,
|
sys_buf =
|
||||||
GST_VIDEO_INFO_SIZE (&plugin->srcpad_info),
|
gst_buffer_new_allocate (GST_VAAPI_PLUGIN_BASE_OTHER_ALLOCATOR
|
||||||
&plugin->other_allocator_params);
|
(plugin),
|
||||||
|
GST_VIDEO_INFO_SIZE (GST_VAAPI_PLUGIN_BASE_SRC_PAD_INFO (plugin)),
|
||||||
|
&GST_VAAPI_PLUGIN_BASE_OTHER_ALLOCATOR_PARAMS (plugin));
|
||||||
if (!sys_buf)
|
if (!sys_buf)
|
||||||
goto error_no_sys_buffer;
|
goto error_no_sys_buffer;
|
||||||
|
|
||||||
|
|
|
@ -888,7 +888,7 @@ gst_vaapiencode_init (GstVaapiEncode * encode)
|
||||||
GstVaapiPluginBase *const plugin = GST_VAAPI_PLUGIN_BASE (encode);
|
GstVaapiPluginBase *const plugin = GST_VAAPI_PLUGIN_BASE (encode);
|
||||||
|
|
||||||
gst_vaapi_plugin_base_init (GST_VAAPI_PLUGIN_BASE (encode), GST_CAT_DEFAULT);
|
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
|
static void
|
||||||
|
|
|
@ -85,6 +85,14 @@ typedef struct _GstVaapiPluginBaseClass GstVaapiPluginBaseClass;
|
||||||
(&GST_VAAPI_PLUGIN_BASE(plugin)->srcpad_info)
|
(&GST_VAAPI_PLUGIN_BASE(plugin)->srcpad_info)
|
||||||
#define GST_VAAPI_PLUGIN_BASE_SRC_PAD_CAN_DMABUF(plugin) \
|
#define GST_VAAPI_PLUGIN_BASE_SRC_PAD_CAN_DMABUF(plugin) \
|
||||||
(GST_VAAPI_PLUGIN_BASE(plugin)->srcpad_can_dmabuf)
|
(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) \
|
#define GST_VAAPI_PLUGIN_BASE_COPY_OUTPUT_FRAME(plugin) \
|
||||||
(GST_VAAPI_PLUGIN_BASE(plugin)->copy_output_frame)
|
(GST_VAAPI_PLUGIN_BASE(plugin)->copy_output_frame)
|
||||||
|
|
||||||
|
|
|
@ -379,7 +379,7 @@ create_output_buffer (GstVaapiPostproc * postproc)
|
||||||
GstBuffer *outbuf;
|
GstBuffer *outbuf;
|
||||||
|
|
||||||
GstBufferPool *const pool =
|
GstBufferPool *const pool =
|
||||||
GST_VAAPI_PLUGIN_BASE (postproc)->srcpad_buffer_pool;
|
GST_VAAPI_PLUGIN_BASE_SRC_PAD_BUFFER_POOL (postproc);
|
||||||
GstFlowReturn ret;
|
GstFlowReturn ret;
|
||||||
|
|
||||||
g_return_val_if_fail (pool != NULL, NULL);
|
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);
|
GstVaapiPluginBase *const plugin = GST_VAAPI_PLUGIN_BASE (postproc);
|
||||||
|
|
||||||
return gst_buffer_new_allocate (plugin->other_srcpad_allocator,
|
return
|
||||||
GST_VIDEO_INFO_SIZE (&plugin->srcpad_info),
|
gst_buffer_new_allocate (GST_VAAPI_PLUGIN_BASE_OTHER_ALLOCATOR (plugin),
|
||||||
&plugin->other_allocator_params);
|
GST_VIDEO_INFO_SIZE (GST_VAAPI_PLUGIN_BASE_SRC_PAD_INFO (plugin)),
|
||||||
|
&GST_VAAPI_PLUGIN_BASE_OTHER_ALLOCATOR_PARAMS (plugin));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in a new issue