mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-10-06 10:42:22 +00:00
videodecoder: Add GstVideoDecoder::propose_allocation() vfunc
This commit is contained in:
parent
d155b83d03
commit
1e635f682f
2 changed files with 20 additions and 0 deletions
|
@ -287,6 +287,8 @@ static gboolean gst_video_decoder_src_event_default (GstVideoDecoder * decoder,
|
||||||
GstEvent * event);
|
GstEvent * event);
|
||||||
static gboolean gst_video_decoder_decide_allocation_default (GstVideoDecoder *
|
static gboolean gst_video_decoder_decide_allocation_default (GstVideoDecoder *
|
||||||
decoder, GstQuery * query);
|
decoder, GstQuery * query);
|
||||||
|
static gboolean gst_video_decoder_propose_allocation_default (GstVideoDecoder *
|
||||||
|
decoder, GstQuery * query);
|
||||||
|
|
||||||
/* we can't use G_DEFINE_ABSTRACT_TYPE because we need the klass in the _init
|
/* we can't use G_DEFINE_ABSTRACT_TYPE because we need the klass in the _init
|
||||||
* method to get to the padtemplates */
|
* method to get to the padtemplates */
|
||||||
|
@ -339,6 +341,7 @@ gst_video_decoder_class_init (GstVideoDecoderClass * klass)
|
||||||
klass->sink_event = gst_video_decoder_sink_event_default;
|
klass->sink_event = gst_video_decoder_sink_event_default;
|
||||||
klass->src_event = gst_video_decoder_src_event_default;
|
klass->src_event = gst_video_decoder_src_event_default;
|
||||||
klass->decide_allocation = gst_video_decoder_decide_allocation_default;
|
klass->decide_allocation = gst_video_decoder_decide_allocation_default;
|
||||||
|
klass->propose_allocation = gst_video_decoder_propose_allocation_default;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -1230,6 +1233,13 @@ gst_video_decoder_sink_query (GstPad * pad, GstObject * parent,
|
||||||
gst_query_set_convert (query, src_fmt, src_val, dest_fmt, dest_val);
|
gst_query_set_convert (query, src_fmt, src_val, dest_fmt, dest_val);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case GST_QUERY_ALLOCATION:{
|
||||||
|
GstVideoDecoderClass *klass = GST_VIDEO_DECODER_GET_CLASS (decoder);
|
||||||
|
|
||||||
|
if (klass->propose_allocation)
|
||||||
|
res = klass->propose_allocation (decoder, query);
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
res = gst_pad_query_default (pad, parent, query);
|
res = gst_pad_query_default (pad, parent, query);
|
||||||
break;
|
break;
|
||||||
|
@ -2447,6 +2457,13 @@ gst_video_decoder_decide_allocation_default (GstVideoDecoder * decoder,
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
gst_video_decoder_propose_allocation_default (GstVideoDecoder * decoder,
|
||||||
|
GstQuery * query)
|
||||||
|
{
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gst_video_decoder_set_src_caps:
|
* gst_video_decoder_set_src_caps:
|
||||||
* @decoder: a #GstVideoDecoder
|
* @decoder: a #GstVideoDecoder
|
||||||
|
|
|
@ -251,6 +251,8 @@ struct _GstVideoDecoder
|
||||||
* Setup the allocation parameters for allocating output
|
* Setup the allocation parameters for allocating output
|
||||||
* buffers. The passed in query contains the result of the
|
* buffers. The passed in query contains the result of the
|
||||||
* downstream allocation query.
|
* downstream allocation query.
|
||||||
|
* @propose_allocation: Optional.
|
||||||
|
* Propose buffer allocation parameters for upstream elements.
|
||||||
*
|
*
|
||||||
* Subclasses can override any of the available virtual methods or not, as
|
* Subclasses can override any of the available virtual methods or not, as
|
||||||
* needed. At minimum @handle_frame needs to be overridden, and @set_format
|
* needed. At minimum @handle_frame needs to be overridden, and @set_format
|
||||||
|
@ -297,6 +299,7 @@ struct _GstVideoDecoderClass
|
||||||
|
|
||||||
gboolean (*decide_allocation) (GstVideoDecoder *decoder, GstQuery *query);
|
gboolean (*decide_allocation) (GstVideoDecoder *decoder, GstQuery *query);
|
||||||
|
|
||||||
|
gboolean (*propose_allocation) (GstVideoDecoder *decoder, GstQuery * query);
|
||||||
|
|
||||||
/*< private >*/
|
/*< private >*/
|
||||||
/* FIXME before moving to base */
|
/* FIXME before moving to base */
|
||||||
|
|
Loading…
Reference in a new issue