mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 19:51:11 +00:00
basetransform: Add a method to let subclasses cleanly update srcpad caps
API: gst_base_transform_update_src https://bugzilla.gnome.org/show_bug.cgi?id=734424
This commit is contained in:
parent
5bed94924a
commit
506afa54df
3 changed files with 33 additions and 0 deletions
|
@ -361,6 +361,7 @@ gst_base_transform_get_allocator
|
|||
gst_base_transform_get_buffer_pool
|
||||
gst_base_transform_reconfigure_sink
|
||||
gst_base_transform_reconfigure_src
|
||||
gst_base_transform_update_src
|
||||
|
||||
GST_BASE_TRANSFORM_SINK_NAME
|
||||
GST_BASE_TRANSFORM_SRC_NAME
|
||||
|
|
|
@ -2786,3 +2786,33 @@ gst_base_transform_get_allocator (GstBaseTransform * trans,
|
|||
if (params)
|
||||
*params = trans->priv->params;
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_base_transform_update_src_caps:
|
||||
* @trans: a #GstBaseTransform
|
||||
* @updated_caps: An updated version of the srcpad caps to be pushed
|
||||
* downstream
|
||||
*
|
||||
* Updates the srcpad caps and send the caps downstream. This function
|
||||
* can be used by subclasses when they have already negotiated their caps
|
||||
* but found a change in them (or computed new informations). This way,
|
||||
* they can notify downstream about that change without loosing any
|
||||
* buffer.
|
||||
*
|
||||
* Returns: %TRUE if the caps could be send downstream %FALSE otherwise
|
||||
*/
|
||||
gboolean
|
||||
gst_base_transform_update_src_caps (GstBaseTransform * trans,
|
||||
GstCaps * updated_caps)
|
||||
{
|
||||
g_return_val_if_fail (GST_IS_BASE_TRANSFORM (trans), FALSE);
|
||||
|
||||
if (gst_pad_push_event (GST_BASE_TRANSFORM_SRC_PAD (trans),
|
||||
gst_event_new_caps (updated_caps))) {
|
||||
gst_pad_mark_reconfigure (trans->srcpad);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
|
|
@ -293,6 +293,8 @@ void gst_base_transform_get_allocator (GstBaseTransform *trans,
|
|||
|
||||
void gst_base_transform_reconfigure_sink (GstBaseTransform *trans);
|
||||
void gst_base_transform_reconfigure_src (GstBaseTransform *trans);
|
||||
gboolean gst_base_transform_update_src_caps (GstBaseTransform *trans,
|
||||
GstCaps *updated_caps);
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GST_BASE_TRANSFORM_H__ */
|
||||
|
|
Loading…
Reference in a new issue