mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-30 12:49:40 +00:00
rtpstreamdepay: Only allow activation in push mode
We need a proper caps event from upstream with the full RTP caps as we can't create caps ourselves from thin air. Fixes usage of rtpstreamdepay after e.g. a filesrc or any other element that supports pull mode. https://bugzilla.gnome.org/show_bug.cgi?id=753066
This commit is contained in:
parent
e1143041ed
commit
c9ea95481c
1 changed files with 14 additions and 0 deletions
|
@ -64,6 +64,9 @@ static GstCaps *gst_rtp_stream_depay_get_sink_caps (GstBaseParse * parse,
|
|||
static GstFlowReturn gst_rtp_stream_depay_handle_frame (GstBaseParse * parse,
|
||||
GstBaseParseFrame * frame, gint * skipsize);
|
||||
|
||||
static gboolean gst_rtp_stream_depay_sink_activate (GstPad * pad,
|
||||
GstObject * parent);
|
||||
|
||||
static void
|
||||
gst_rtp_stream_depay_class_init (GstRtpStreamDepayClass * klass)
|
||||
{
|
||||
|
@ -95,6 +98,11 @@ static void
|
|||
gst_rtp_stream_depay_init (GstRtpStreamDepay * self)
|
||||
{
|
||||
gst_base_parse_set_min_frame_size (GST_BASE_PARSE (self), 2);
|
||||
|
||||
/* Force activation in push mode. We need to get a caps event from upstream
|
||||
* to know the full RTP caps. */
|
||||
gst_pad_set_activate_function (GST_BASE_PARSE_SINK_PAD (self),
|
||||
gst_rtp_stream_depay_sink_activate);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
@ -211,6 +219,12 @@ gst_rtp_stream_depay_handle_frame (GstBaseParse * parse,
|
|||
return gst_base_parse_finish_frame (parse, frame, size + 2);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gst_rtp_stream_depay_sink_activate (GstPad * pad, GstObject * parent)
|
||||
{
|
||||
return gst_pad_activate_mode (pad, GST_PAD_MODE_PUSH, TRUE);
|
||||
}
|
||||
|
||||
gboolean
|
||||
gst_rtp_stream_depay_plugin_init (GstPlugin * plugin)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue