mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 05:06:17 +00:00
gst-libs/gst/rtp/gstbasertppayload.*: Add getcaps vfunc to basertppayload. See #465146.
Original commit message from CVS: Patch by: Olivier Crete <tester at tester ca> * gst-libs/gst/rtp/gstbasertppayload.c: (gst_basertppayload_init), (gst_basertppayload_getcaps): * gst-libs/gst/rtp/gstbasertppayload.h: Add getcaps vfunc to basertppayload. See #465146.
This commit is contained in:
parent
5c59b5a2aa
commit
b78030f77d
3 changed files with 43 additions and 1 deletions
|
@ -1,3 +1,12 @@
|
||||||
|
2007-08-16 Wim Taymans <wim.taymans@gmail.com>
|
||||||
|
|
||||||
|
Patch by: Olivier Crete <tester at tester ca>
|
||||||
|
|
||||||
|
* gst-libs/gst/rtp/gstbasertppayload.c: (gst_basertppayload_init),
|
||||||
|
(gst_basertppayload_getcaps):
|
||||||
|
* gst-libs/gst/rtp/gstbasertppayload.h:
|
||||||
|
Add getcaps vfunc to basertppayload. See #465146.
|
||||||
|
|
||||||
2007-08-16 Wim Taymans <wim.taymans@gmail.com>
|
2007-08-16 Wim Taymans <wim.taymans@gmail.com>
|
||||||
|
|
||||||
* gst/playback/gstplaybasebin.c: (queue_threshold_reached):
|
* gst/playback/gstplaybasebin.c: (queue_threshold_reached):
|
||||||
|
|
|
@ -89,6 +89,7 @@ static void gst_basertppayload_init (GstBaseRTPPayload * basertppayload,
|
||||||
static void gst_basertppayload_finalize (GObject * object);
|
static void gst_basertppayload_finalize (GObject * object);
|
||||||
|
|
||||||
static gboolean gst_basertppayload_setcaps (GstPad * pad, GstCaps * caps);
|
static gboolean gst_basertppayload_setcaps (GstPad * pad, GstCaps * caps);
|
||||||
|
static GstCaps *gst_basertppayload_getcaps (GstPad * pad);
|
||||||
static gboolean gst_basertppayload_event (GstPad * pad, GstEvent * event);
|
static gboolean gst_basertppayload_event (GstPad * pad, GstEvent * event);
|
||||||
static GstFlowReturn gst_basertppayload_chain (GstPad * pad,
|
static GstFlowReturn gst_basertppayload_chain (GstPad * pad,
|
||||||
GstBuffer * buffer);
|
GstBuffer * buffer);
|
||||||
|
@ -228,6 +229,8 @@ gst_basertppayload_init (GstBaseRTPPayload * basertppayload, gpointer g_class)
|
||||||
basertppayload->sinkpad = gst_pad_new_from_template (templ, "sink");
|
basertppayload->sinkpad = gst_pad_new_from_template (templ, "sink");
|
||||||
gst_pad_set_setcaps_function (basertppayload->sinkpad,
|
gst_pad_set_setcaps_function (basertppayload->sinkpad,
|
||||||
gst_basertppayload_setcaps);
|
gst_basertppayload_setcaps);
|
||||||
|
gst_pad_set_getcaps_function (basertppayload->sinkpad,
|
||||||
|
gst_basertppayload_getcaps);
|
||||||
gst_pad_set_event_function (basertppayload->sinkpad,
|
gst_pad_set_event_function (basertppayload->sinkpad,
|
||||||
gst_basertppayload_event);
|
gst_basertppayload_event);
|
||||||
gst_pad_set_chain_function (basertppayload->sinkpad,
|
gst_pad_set_chain_function (basertppayload->sinkpad,
|
||||||
|
@ -297,6 +300,35 @@ gst_basertppayload_setcaps (GstPad * pad, GstCaps * caps)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static GstCaps *
|
||||||
|
gst_basertppayload_getcaps (GstPad * pad)
|
||||||
|
{
|
||||||
|
GstBaseRTPPayload *basertppayload;
|
||||||
|
GstBaseRTPPayloadClass *basertppayload_class;
|
||||||
|
GstCaps *caps = NULL;
|
||||||
|
|
||||||
|
GST_DEBUG_OBJECT (pad, "getting caps");
|
||||||
|
|
||||||
|
basertppayload = GST_BASE_RTP_PAYLOAD (gst_pad_get_parent (pad));
|
||||||
|
basertppayload_class = GST_BASE_RTP_PAYLOAD_GET_CLASS (basertppayload);
|
||||||
|
|
||||||
|
if (basertppayload_class->get_caps)
|
||||||
|
caps = basertppayload_class->get_caps (basertppayload, pad);
|
||||||
|
|
||||||
|
if (!caps) {
|
||||||
|
caps = GST_PAD_TEMPLATE_CAPS (GST_PAD_PAD_TEMPLATE (pad));
|
||||||
|
GST_DEBUG_OBJECT (pad,
|
||||||
|
"using pad template %p with caps %p %" GST_PTR_FORMAT,
|
||||||
|
GST_PAD_PAD_TEMPLATE (pad), caps, caps);
|
||||||
|
|
||||||
|
caps = gst_caps_ref (caps);
|
||||||
|
}
|
||||||
|
|
||||||
|
gst_object_unref (basertppayload);
|
||||||
|
|
||||||
|
return caps;
|
||||||
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_basertppayload_event (GstPad * pad, GstEvent * event)
|
gst_basertppayload_event (GstPad * pad, GstEvent * event)
|
||||||
{
|
{
|
||||||
|
|
|
@ -122,9 +122,10 @@ struct _GstBaseRTPPayloadClass
|
||||||
GstFlowReturn (*handle_buffer) (GstBaseRTPPayload *payload,
|
GstFlowReturn (*handle_buffer) (GstBaseRTPPayload *payload,
|
||||||
GstBuffer *buffer);
|
GstBuffer *buffer);
|
||||||
gboolean (*handle_event) (GstPad * pad, GstEvent * event);
|
gboolean (*handle_event) (GstPad * pad, GstEvent * event);
|
||||||
|
GstCaps * (*get_caps) (GstBaseRTPPayload *payload, GstPad * pad);
|
||||||
|
|
||||||
/*< private >*/
|
/*< private >*/
|
||||||
gpointer _gst_reserved[GST_PADDING-1];
|
gpointer _gst_reserved[GST_PADDING-2];
|
||||||
};
|
};
|
||||||
|
|
||||||
GType gst_basertppayload_get_type (void);
|
GType gst_basertppayload_get_type (void);
|
||||||
|
|
Loading…
Reference in a new issue