mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 03:35:21 +00:00
pad: Add functions to safely access GstProbeInfo data pointer
This is so that introspection based bindings can access it. https://bugzilla.gnome.org/show_bug.cgi?id=684402
This commit is contained in:
parent
72dfd25e5f
commit
25b3e02b94
4 changed files with 77 additions and 0 deletions
|
@ -1676,6 +1676,11 @@ GST_PAD_PROBE_INFO_BUFFER_LIST
|
|||
GST_PAD_PROBE_INFO_EVENT
|
||||
GST_PAD_PROBE_INFO_QUERY
|
||||
|
||||
gst_pad_probe_info_get_buffer
|
||||
gst_pad_probe_info_get_buffer_list
|
||||
gst_pad_probe_info_get_event
|
||||
gst_pad_probe_info_get_query
|
||||
|
||||
GST_PAD_PROBE_INFO_OFFSET
|
||||
GST_PAD_PROBE_INFO_SIZE
|
||||
|
||||
|
|
63
gst/gstpad.c
63
gst/gstpad.c
|
@ -5312,3 +5312,66 @@ join_failed:
|
|||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_pad_probe_info_get_event:
|
||||
* @info: a #GstPadProbeInfo
|
||||
*
|
||||
* Returns: (transfer none): The #GstEvent from the probe
|
||||
*/
|
||||
|
||||
GstEvent *
|
||||
gst_pad_probe_info_get_event (GstPadProbeInfo * info)
|
||||
{
|
||||
g_return_val_if_fail (info->type & (GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM |
|
||||
GST_PAD_PROBE_TYPE_EVENT_UPSTREAM), NULL);
|
||||
|
||||
return GST_PAD_PROBE_INFO_EVENT (info);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* gst_pad_probe_info_get_query:
|
||||
* @info: a #GstPadProbeInfo
|
||||
*
|
||||
* Returns: (transfer none): The #GstQuery from the probe
|
||||
*/
|
||||
|
||||
GstQuery *
|
||||
gst_pad_probe_info_get_query (GstPadProbeInfo * info)
|
||||
{
|
||||
g_return_val_if_fail (info->type & (GST_PAD_PROBE_TYPE_QUERY_DOWNSTREAM |
|
||||
GST_PAD_PROBE_TYPE_QUERY_UPSTREAM), NULL);
|
||||
|
||||
return GST_PAD_PROBE_INFO_QUERY (info);
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_pad_probe_info_get_buffer:
|
||||
* @info: a #GstPadProbeInfo
|
||||
*
|
||||
* Returns: (transfer none): The #GstBuffer from the probe
|
||||
*/
|
||||
|
||||
GstBuffer *
|
||||
gst_pad_probe_info_get_buffer (GstPadProbeInfo * info)
|
||||
{
|
||||
g_return_val_if_fail (info->type & GST_PAD_PROBE_TYPE_BUFFER, NULL);
|
||||
|
||||
return GST_PAD_PROBE_INFO_BUFFER (info);
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_pad_probe_info_get_bufferlist:
|
||||
* @info: a #GstPadProbeInfo
|
||||
*
|
||||
* Returns: (transfer none): The #GstBufferlist from the probe
|
||||
*/
|
||||
|
||||
GstBufferList *
|
||||
gst_pad_probe_info_get_buffer_list (GstPadProbeInfo * info)
|
||||
{
|
||||
g_return_val_if_fail (info->type & GST_PAD_PROBE_TYPE_BUFFER_LIST, NULL);
|
||||
|
||||
return GST_PAD_PROBE_INFO_BUFFER_LIST (info);
|
||||
}
|
||||
|
|
|
@ -547,6 +547,11 @@ struct _GstPadProbeInfo
|
|||
#define GST_PAD_PROBE_INFO_OFFSET(d) ((d)->offset)
|
||||
#define GST_PAD_PROBE_INFO_SIZE(d) ((d)->size)
|
||||
|
||||
GstEvent* gst_pad_probe_info_get_event (GstPadProbeInfo * info);
|
||||
GstQuery* gst_pad_probe_info_get_query (GstPadProbeInfo * info);
|
||||
GstBuffer* gst_pad_probe_info_get_buffer (GstPadProbeInfo * info);
|
||||
GstBufferList* gst_pad_probe_info_get_buffer_list (GstPadProbeInfo * info);
|
||||
|
||||
/**
|
||||
* GstPadProbeCallback:
|
||||
* @pad: the #GstPad that is blocked
|
||||
|
|
|
@ -705,6 +705,10 @@ EXPORTS
|
|||
gst_pad_peer_query_duration
|
||||
gst_pad_peer_query_position
|
||||
gst_pad_presence_get_type
|
||||
gst_pad_probe_info_get_buffer
|
||||
gst_pad_probe_info_get_buffer_list
|
||||
gst_pad_probe_info_get_event
|
||||
gst_pad_probe_info_get_query
|
||||
gst_pad_probe_return_get_type
|
||||
gst_pad_probe_type_get_type
|
||||
gst_pad_proxy_query_accept_caps
|
||||
|
|
Loading…
Reference in a new issue