mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-20 07:16:55 +00:00
Merge branch 'master' into 0.11
Conflicts: libs/gst/base/gstbasetransform.c libs/gst/base/gstbasetransform.h
This commit is contained in:
commit
31b70ea701
3 changed files with 40 additions and 10 deletions
|
@ -324,6 +324,8 @@ static gboolean gst_base_transform_acceptcaps_default (GstBaseTransform * trans,
|
|||
static gboolean gst_base_transform_setcaps (GstBaseTransform * trans,
|
||||
GstPad * pad, GstCaps * caps);
|
||||
static gboolean gst_base_transform_query (GstPad * pad, GstQuery * query);
|
||||
static gboolean gst_base_transform_default_query (GstBaseTransform * trans,
|
||||
GstPad * pad, GstQuery * query);
|
||||
static const GstQueryType *gst_base_transform_query_type (GstPad * pad);
|
||||
|
||||
static GstFlowReturn default_prepare_output_buffer (GstBaseTransform * trans,
|
||||
|
@ -378,6 +380,7 @@ gst_base_transform_class_init (GstBaseTransformClass * klass)
|
|||
klass->prepare_output_buffer =
|
||||
GST_DEBUG_FUNCPTR (default_prepare_output_buffer);
|
||||
klass->copy_metadata = GST_DEBUG_FUNCPTR (default_copy_metadata);
|
||||
klass->query = GST_DEBUG_FUNCPTR (gst_base_transform_default_query);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1299,15 +1302,12 @@ failed_configure:
|
|||
}
|
||||
|
||||
static gboolean
|
||||
gst_base_transform_query (GstPad * pad, GstQuery * query)
|
||||
gst_base_transform_default_query (GstBaseTransform * trans,
|
||||
GstPad * pad, GstQuery * query)
|
||||
{
|
||||
gboolean ret = FALSE;
|
||||
GstBaseTransform *trans;
|
||||
GstPad *otherpad;
|
||||
|
||||
trans = GST_BASE_TRANSFORM (gst_pad_get_parent (pad));
|
||||
if (G_UNLIKELY (trans == NULL))
|
||||
return FALSE;
|
||||
otherpad = (pad == trans->srcpad) ? trans->sinkpad : trans->srcpad;
|
||||
|
||||
switch (GST_QUERY_TYPE (query)) {
|
||||
|
@ -1361,7 +1361,29 @@ gst_base_transform_query (GstPad * pad, GstQuery * query)
|
|||
}
|
||||
|
||||
done:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gst_base_transform_query (GstPad * pad, GstQuery * query)
|
||||
{
|
||||
GstBaseTransform *trans;
|
||||
GstBaseTransformClass *bclass;
|
||||
gboolean ret;
|
||||
|
||||
trans = GST_BASE_TRANSFORM (gst_pad_get_parent (pad));
|
||||
if (G_UNLIKELY (trans == NULL))
|
||||
return FALSE;
|
||||
|
||||
bclass = GST_BASE_TRANSFORM_GET_CLASS (trans);
|
||||
|
||||
if (bclass->query)
|
||||
ret = bclass->query (trans, pad, query);
|
||||
else
|
||||
ret = gst_pad_query_default (pad, query);
|
||||
|
||||
gst_object_unref (trans);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
@ -156,6 +156,10 @@ struct _GstBaseTransform {
|
|||
* handled by the element. The default implementation might not be
|
||||
* the most optimal way to check this in all cases.
|
||||
* @set_caps: allows the subclass to be notified of the actual caps set.
|
||||
* @query: Optional Since 0.10.36
|
||||
* Handle a requested query. Subclasses that implement this
|
||||
* should must chain up to the parent if they didn't handle the
|
||||
* query
|
||||
* @transform_size: Optional. Given the size of a buffer in the given direction
|
||||
* with the given caps, calculate the size in bytes of a buffer
|
||||
* on the other pad with the given other caps.
|
||||
|
@ -221,6 +225,8 @@ struct _GstBaseTransformClass {
|
|||
GstCaps *caps);
|
||||
gboolean (*set_caps) (GstBaseTransform *trans, GstCaps *incaps,
|
||||
GstCaps *outcaps);
|
||||
gboolean (*query) (GstBaseTransform *trans, GstPad *pad,
|
||||
GstQuery *query);
|
||||
|
||||
/* setup allocation query for output buffers */
|
||||
gboolean (*setup_allocation) (GstBaseTransform *trans, GstQuery *query);
|
||||
|
@ -243,9 +249,10 @@ struct _GstBaseTransformClass {
|
|||
gboolean (*src_event) (GstBaseTransform *trans, GstEvent *event);
|
||||
|
||||
GstFlowReturn (*prepare_output_buffer) (GstBaseTransform * trans,
|
||||
GstBuffer *input, GstBuffer **outbuf);
|
||||
GstBuffer *input, GstBuffer **outbuf);
|
||||
|
||||
gboolean (*copy_metadata) (GstBaseTransform * trans, GstBuffer *input, GstBuffer *outbuf);
|
||||
gboolean (*copy_metadata) (GstBaseTransform * trans, GstBuffer *input,
|
||||
GstBuffer *outbuf);
|
||||
|
||||
void (*before_transform) (GstBaseTransform *trans, GstBuffer *buffer);
|
||||
|
||||
|
|
|
@ -200,9 +200,10 @@ gst_capsfilter_set_property (GObject * object, guint prop_id,
|
|||
gst_caps_unref (nego);
|
||||
} else {
|
||||
GST_DEBUG_OBJECT (capsfilter, "no negotiated caps");
|
||||
/* no previous caps, the getcaps function will be used to find suitable
|
||||
* caps */
|
||||
suggest = NULL;
|
||||
/* Suggest the new caps, we can't just rely on _get_caps as this may
|
||||
* already be called at this point even though no buffer has been
|
||||
* pushed yet */
|
||||
suggest = gst_caps_copy (new_caps);
|
||||
}
|
||||
|
||||
GST_DEBUG_OBJECT (capsfilter, "suggesting new caps %" GST_PTR_FORMAT,
|
||||
|
|
Loading…
Reference in a new issue