Commit 75dc9634 authored by Wim Taymans's avatar Wim Taymans

change getcaps to query

Chain up event function in payloaders.
parent 8548b2c7
......@@ -95,6 +95,7 @@ static void gst_jpeg_dec_get_property (GObject * object, guint prop_id,
static GstFlowReturn gst_jpeg_dec_chain (GstPad * pad, GstBuffer * buffer);
static GstCaps *gst_jpeg_dec_getcaps (GstPad * pad, GstCaps * filter);
static gboolean gst_jpeg_dec_sink_query (GstPad * pad, GstQuery * query);
static gboolean gst_jpeg_dec_sink_event (GstPad * pad, GstEvent * event);
static gboolean gst_jpeg_dec_src_event (GstPad * pad, GstEvent * event);
static GstStateChangeReturn gst_jpeg_dec_change_state (GstElement * element,
......@@ -359,12 +360,12 @@ gst_jpeg_dec_init (GstJpegDec * dec)
gst_pad_new_from_static_template (&gst_jpeg_dec_sink_pad_template,
"sink");
gst_element_add_pad (GST_ELEMENT (dec), dec->sinkpad);
gst_pad_set_getcaps_function (dec->sinkpad,
GST_DEBUG_FUNCPTR (gst_jpeg_dec_getcaps));
gst_pad_set_chain_function (dec->sinkpad,
GST_DEBUG_FUNCPTR (gst_jpeg_dec_chain));
gst_pad_set_event_function (dec->sinkpad,
GST_DEBUG_FUNCPTR (gst_jpeg_dec_sink_event));
gst_pad_set_query_function (dec->sinkpad,
GST_DEBUG_FUNCPTR (gst_jpeg_dec_sink_query));
dec->srcpad =
gst_pad_new_from_static_template (&gst_jpeg_dec_src_pad_template, "src");
......@@ -1775,6 +1776,30 @@ gst_jpeg_dec_sink_event (GstPad * pad, GstEvent * event)
return ret;
}
static gboolean
gst_jpeg_dec_sink_query (GstPad * pad, GstQuery * query)
{
gboolean res = FALSE;
switch (GST_QUERY_TYPE (query)) {
case GST_QUERY_CAPS:
{
GstCaps *filter, *caps;
gst_query_parse_caps (query, &filter);
caps = gst_jpeg_dec_getcaps (pad, filter);
gst_query_set_caps_result (query, caps);
gst_caps_unref (caps);
res = TRUE;
break;
}
default:
res = gst_pad_query_default (pad, query);
break;
}
return res;
}
static void
gst_jpeg_dec_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec)
......
......@@ -72,6 +72,7 @@ static void gst_jpegenc_finalize (GObject * object);
static GstFlowReturn gst_jpegenc_chain (GstPad * pad, GstBuffer * buf);
static gboolean gst_jpegenc_sink_event (GstPad * pad, GstEvent * event);
static GstCaps *gst_jpegenc_getcaps (GstPad * pad, GstCaps * filter);
static gboolean gst_jpegenc_sink_query (GstPad * pad, GstQuery * query);
static void gst_jpegenc_resync (GstJpegEnc * jpegenc);
static void gst_jpegenc_set_property (GObject * object, guint prop_id,
......@@ -227,8 +228,8 @@ gst_jpegenc_init (GstJpegEnc * jpegenc)
gst_pad_new_from_static_template (&gst_jpegenc_sink_pad_template, "sink");
gst_pad_set_chain_function (jpegenc->sinkpad,
GST_DEBUG_FUNCPTR (gst_jpegenc_chain));
gst_pad_set_getcaps_function (jpegenc->sinkpad,
GST_DEBUG_FUNCPTR (gst_jpegenc_getcaps));
gst_pad_set_query_function (jpegenc->sinkpad,
GST_DEBUG_FUNCPTR (gst_jpegenc_sink_query));
gst_pad_set_event_function (jpegenc->sinkpad,
GST_DEBUG_FUNCPTR (gst_jpegenc_sink_event));
gst_element_add_pad (GST_ELEMENT (jpegenc), jpegenc->sinkpad);
......@@ -340,6 +341,34 @@ done:
return caps;
}
static gboolean
gst_jpegenc_sink_query (GstPad * pad, GstQuery * query)
{
gboolean res;
GstJpegEnc *enc = GST_JPEGENC (gst_pad_get_parent (pad));
switch (GST_QUERY_TYPE (query)) {
case GST_QUERY_CAPS:
{
GstCaps *filter, *caps;
gst_query_parse_caps (query, &filter);
caps = gst_jpegenc_getcaps (pad, filter);
gst_query_set_caps_result (query, caps);
gst_caps_unref (caps);
res = TRUE;
break;
}
default:
res = gst_pad_query_default (pad, query);
break;
}
gst_object_unref (enc);
return res;
}
static gboolean
gst_jpegenc_setcaps (GstJpegEnc * enc, GstCaps * caps)
{
......
......@@ -207,6 +207,31 @@ gst_alaw_dec_getcaps (GstPad * pad, GstCaps * filter)
return result;
}
static gboolean
gst_alaw_dec_query (GstPad * pad, GstQuery * query)
{
gboolean res;
switch (GST_QUERY_TYPE (query)) {
case GST_QUERY_CAPS:
{
GstCaps *filter, *caps;
gst_query_parse_caps (query, &filter);
caps = gst_alaw_dec_getcaps (pad, filter);
gst_query_set_caps_result (query, caps);
gst_caps_unref (caps);
res = TRUE;
break;
}
default:
res = gst_pad_query_default (pad, query);
break;
}
return res;
}
static void
gst_alaw_dec_class_init (GstALawDecClass * klass)
{
......@@ -231,8 +256,8 @@ gst_alaw_dec_init (GstALawDec * alawdec)
{
alawdec->sinkpad =
gst_pad_new_from_static_template (&alaw_dec_sink_factory, "sink");
gst_pad_set_getcaps_function (alawdec->sinkpad,
GST_DEBUG_FUNCPTR (gst_alaw_dec_getcaps));
gst_pad_set_query_function (alawdec->sinkpad,
GST_DEBUG_FUNCPTR (gst_alaw_dec_query));
gst_pad_set_event_function (alawdec->sinkpad,
GST_DEBUG_FUNCPTR (gst_alaw_dec_event));
gst_pad_set_chain_function (alawdec->sinkpad,
......@@ -242,8 +267,8 @@ gst_alaw_dec_init (GstALawDec * alawdec)
alawdec->srcpad =
gst_pad_new_from_static_template (&alaw_dec_src_factory, "src");
gst_pad_use_fixed_caps (alawdec->srcpad);
gst_pad_set_getcaps_function (alawdec->srcpad,
GST_DEBUG_FUNCPTR (gst_alaw_dec_getcaps));
gst_pad_set_query_function (alawdec->srcpad,
GST_DEBUG_FUNCPTR (gst_alaw_dec_query));
gst_element_add_pad (GST_ELEMENT (alawdec), alawdec->srcpad);
}
......
......@@ -359,6 +359,31 @@ gst_alaw_enc_getcaps (GstPad * pad, GstCaps * filter)
return result;
}
static gboolean
gst_alaw_enc_query (GstPad * pad, GstQuery * query)
{
gboolean res;
switch (GST_QUERY_TYPE (query)) {
case GST_QUERY_CAPS:
{
GstCaps *filter, *caps;
gst_query_parse_caps (query, &filter);
caps = gst_alaw_enc_getcaps (pad, filter);
gst_query_set_caps_result (query, caps);
gst_caps_unref (caps);
res = TRUE;
break;
}
default:
res = gst_pad_query_default (pad, query);
break;
}
return res;
}
static gboolean
gst_alaw_enc_setcaps (GstALawEnc * alawenc, GstCaps * caps)
{
......@@ -409,8 +434,8 @@ gst_alaw_enc_init (GstALawEnc * alawenc)
{
alawenc->sinkpad =
gst_pad_new_from_static_template (&alaw_enc_sink_factory, "sink");
gst_pad_set_getcaps_function (alawenc->sinkpad,
GST_DEBUG_FUNCPTR (gst_alaw_enc_getcaps));
gst_pad_set_query_function (alawenc->sinkpad,
GST_DEBUG_FUNCPTR (gst_alaw_enc_query));
gst_pad_set_event_function (alawenc->sinkpad,
GST_DEBUG_FUNCPTR (gst_alaw_enc_event));
gst_pad_set_chain_function (alawenc->sinkpad,
......@@ -419,8 +444,8 @@ gst_alaw_enc_init (GstALawEnc * alawenc)
alawenc->srcpad =
gst_pad_new_from_static_template (&alaw_enc_src_factory, "src");
gst_pad_set_getcaps_function (alawenc->srcpad,
GST_DEBUG_FUNCPTR (gst_alaw_enc_getcaps));
gst_pad_set_query_function (alawenc->srcpad,
GST_DEBUG_FUNCPTR (gst_alaw_enc_query));
gst_pad_use_fixed_caps (alawenc->srcpad);
gst_element_add_pad (GST_ELEMENT (alawenc), alawenc->srcpad);
......
......@@ -146,6 +146,31 @@ mulawdec_getcaps (GstPad * pad, GstCaps * filter)
return result;
}
static gboolean
gst_mulawdec_query (GstPad * pad, GstQuery * query)
{
gboolean res;
switch (GST_QUERY_TYPE (query)) {
case GST_QUERY_CAPS:
{
GstCaps *filter, *caps;
gst_query_parse_caps (query, &filter);
caps = mulawdec_getcaps (pad, filter);
gst_query_set_caps_result (query, caps);
gst_caps_unref (caps);
res = TRUE;
break;
}
default:
res = gst_pad_query_default (pad, query);
break;
}
return res;
}
static void
gst_mulawdec_class_init (GstMuLawDecClass * klass)
{
......@@ -169,15 +194,14 @@ gst_mulawdec_init (GstMuLawDec * mulawdec)
{
mulawdec->sinkpad =
gst_pad_new_from_static_template (&mulaw_dec_sink_factory, "sink");
gst_pad_set_getcaps_function (mulawdec->sinkpad, mulawdec_getcaps);
gst_pad_set_query_function (mulawdec->sinkpad, gst_mulawdec_query);
gst_pad_set_event_function (mulawdec->sinkpad, gst_mulawdec_event);
gst_pad_set_chain_function (mulawdec->sinkpad, gst_mulawdec_chain);
gst_element_add_pad (GST_ELEMENT (mulawdec), mulawdec->sinkpad);
mulawdec->srcpad =
gst_pad_new_from_static_template (&mulaw_dec_src_factory, "src");
gst_pad_use_fixed_caps (mulawdec->srcpad);
gst_pad_set_getcaps_function (mulawdec->srcpad, mulawdec_getcaps);
gst_pad_set_query_function (mulawdec->srcpad, gst_mulawdec_query);
gst_element_add_pad (GST_ELEMENT (mulawdec), mulawdec->srcpad);
}
......
......@@ -113,6 +113,32 @@ mulawenc_getcaps (GstPad * pad, GstCaps * filter)
return result;
}
static gboolean
gst_mulawenc_query (GstPad * pad, GstQuery * query)
{
gboolean res;
switch (GST_QUERY_TYPE (query)) {
case GST_QUERY_CAPS:
{
GstCaps *filter, *caps;
gst_query_parse_caps (query, &filter);
caps = mulawenc_getcaps (pad, filter);
gst_query_set_caps_result (query, caps);
gst_caps_unref (caps);
res = TRUE;
break;
}
default:
res = gst_pad_query_default (pad, query);
break;
}
return res;
}
static gboolean
mulawenc_setcaps (GstMuLawEnc * mulawenc, GstCaps * caps)
{
......@@ -158,15 +184,14 @@ gst_mulawenc_init (GstMuLawEnc * mulawenc)
{
mulawenc->sinkpad =
gst_pad_new_from_static_template (&mulaw_enc_sink_factory, "sink");
gst_pad_set_getcaps_function (mulawenc->sinkpad, mulawenc_getcaps);
gst_pad_set_query_function (mulawenc->sinkpad, gst_mulawenc_query);
gst_pad_set_event_function (mulawenc->sinkpad, gst_mulawenc_event);
gst_pad_set_chain_function (mulawenc->sinkpad, gst_mulawenc_chain);
gst_element_add_pad (GST_ELEMENT (mulawenc), mulawenc->sinkpad);
mulawenc->srcpad =
gst_pad_new_from_static_template (&mulaw_enc_src_factory, "src");
gst_pad_set_getcaps_function (mulawenc->srcpad, mulawenc_getcaps);
gst_pad_use_fixed_caps (mulawenc->srcpad);
gst_pad_set_query_function (mulawenc->srcpad, gst_mulawenc_query);
gst_element_add_pad (GST_ELEMENT (mulawenc), mulawenc->srcpad);
/* init rest */
......
......@@ -55,7 +55,7 @@ static GstStateChangeReturn gst_rtp_ac3_pay_change_state (GstElement * element,
static gboolean gst_rtp_ac3_pay_setcaps (GstRTPBasePayload * payload,
GstCaps * caps);
static gboolean gst_rtp_ac3_pay_handle_event (GstRTPBasePayload * payload,
static gboolean gst_rtp_ac3_pay_sink_event (GstRTPBasePayload * payload,
GstEvent * event);
static GstFlowReturn gst_rtp_ac3_pay_flush (GstRtpAC3Pay * rtpac3pay);
static GstFlowReturn gst_rtp_ac3_pay_handle_buffer (GstRTPBasePayload * payload,
......@@ -93,7 +93,7 @@ gst_rtp_ac3_pay_class_init (GstRtpAC3PayClass * klass)
"Wim Taymans <wim.taymans@gmail.com>");
gstrtpbasepayload_class->set_caps = gst_rtp_ac3_pay_setcaps;
gstrtpbasepayload_class->handle_event = gst_rtp_ac3_pay_handle_event;
gstrtpbasepayload_class->sink_event = gst_rtp_ac3_pay_sink_event;
gstrtpbasepayload_class->handle_buffer = gst_rtp_ac3_pay_handle_buffer;
}
......@@ -143,7 +143,7 @@ gst_rtp_ac3_pay_setcaps (GstRTPBasePayload * payload, GstCaps * caps)
}
static gboolean
gst_rtp_ac3_pay_handle_event (GstRTPBasePayload * payload, GstEvent * event)
gst_rtp_ac3_pay_sink_event (GstRTPBasePayload * payload, GstEvent * event)
{
gboolean res;
GstRtpAC3Pay *rtpac3pay;
......@@ -162,8 +162,7 @@ gst_rtp_ac3_pay_handle_event (GstRTPBasePayload * payload, GstEvent * event)
break;
}
res =
GST_RTP_BASE_PAYLOAD_CLASS (parent_class)->handle_event (payload, event);
res = GST_RTP_BASE_PAYLOAD_CLASS (parent_class)->sink_event (payload, event);
return res;
}
......
......@@ -116,7 +116,7 @@ static gboolean gst_rtp_h264_pay_setcaps (GstRTPBasePayload * basepayload,
GstCaps * caps);
static GstFlowReturn gst_rtp_h264_pay_handle_buffer (GstRTPBasePayload * pad,
GstBuffer * buffer);
static gboolean gst_rtp_h264_pay_handle_event (GstRTPBasePayload * payload,
static gboolean gst_rtp_h264_pay_sink_event (GstRTPBasePayload * payload,
GstEvent * event);
static GstStateChangeReturn gst_rtp_h264_pay_change_state (GstElement *
element, GstStateChange transition);
......@@ -193,7 +193,7 @@ gst_rtp_h264_pay_class_init (GstRtpH264PayClass * klass)
gstrtpbasepayload_class->get_caps = gst_rtp_h264_pay_getcaps;
gstrtpbasepayload_class->set_caps = gst_rtp_h264_pay_setcaps;
gstrtpbasepayload_class->handle_buffer = gst_rtp_h264_pay_handle_buffer;
gstrtpbasepayload_class->handle_event = gst_rtp_h264_pay_handle_event;
gstrtpbasepayload_class->sink_event = gst_rtp_h264_pay_sink_event;
GST_DEBUG_CATEGORY_INIT (rtph264pay_debug, "rtph264pay", 0,
"H264 RTP Payloader");
......@@ -1322,7 +1322,7 @@ caps_rejected:
}
static gboolean
gst_rtp_h264_pay_handle_event (GstRTPBasePayload * payload, GstEvent * event)
gst_rtp_h264_pay_sink_event (GstRTPBasePayload * payload, GstEvent * event)
{
gboolean res;
const GstStructure *s;
......@@ -1346,8 +1346,7 @@ gst_rtp_h264_pay_handle_event (GstRTPBasePayload * payload, GstEvent * event)
break;
}
res =
GST_RTP_BASE_PAYLOAD_CLASS (parent_class)->handle_event (payload, event);
res = GST_RTP_BASE_PAYLOAD_CLASS (parent_class)->sink_event (payload, event);
return res;
}
......
......@@ -82,7 +82,7 @@ static gboolean gst_rtp_mp4g_pay_setcaps (GstRTPBasePayload * payload,
GstCaps * caps);
static GstFlowReturn gst_rtp_mp4g_pay_handle_buffer (GstRTPBasePayload *
payload, GstBuffer * buffer);
static gboolean gst_rtp_mp4g_pay_handle_event (GstRTPBasePayload * payload,
static gboolean gst_rtp_mp4g_pay_sink_event (GstRTPBasePayload * payload,
GstEvent * event);
#define gst_rtp_mp4g_pay_parent_class parent_class
......@@ -104,7 +104,7 @@ G_DEFINE_TYPE (GstRtpMP4GPay, gst_rtp_mp4g_pay, GST_TYPE_RTP_BASE_PAYLOAD)
gstrtpbasepayload_class->set_caps = gst_rtp_mp4g_pay_setcaps;
gstrtpbasepayload_class->handle_buffer = gst_rtp_mp4g_pay_handle_buffer;
gstrtpbasepayload_class->handle_event = gst_rtp_mp4g_pay_handle_event;
gstrtpbasepayload_class->sink_event = gst_rtp_mp4g_pay_sink_event;
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&gst_rtp_mp4g_pay_src_template));
......@@ -573,7 +573,7 @@ gst_rtp_mp4g_pay_handle_buffer (GstRTPBasePayload * basepayload,
}
static gboolean
gst_rtp_mp4g_pay_handle_event (GstRTPBasePayload * payload, GstEvent * event)
gst_rtp_mp4g_pay_sink_event (GstRTPBasePayload * payload, GstEvent * event)
{
GstRtpMP4GPay *rtpmp4gpay;
......@@ -596,7 +596,7 @@ gst_rtp_mp4g_pay_handle_event (GstRTPBasePayload * payload, GstEvent * event)
}
/* let parent handle event too */
return FALSE;
return GST_RTP_BASE_PAYLOAD_CLASS (parent_class)->sink_event (payload, event);
}
static GstStateChangeReturn
......
......@@ -78,7 +78,7 @@ static gboolean gst_rtp_mp4v_pay_setcaps (GstRTPBasePayload * payload,
GstCaps * caps);
static GstFlowReturn gst_rtp_mp4v_pay_handle_buffer (GstRTPBasePayload *
payload, GstBuffer * buffer);
static gboolean gst_rtp_mp4v_pay_handle_event (GstRTPBasePayload * pay,
static gboolean gst_rtp_mp4v_pay_sink_event (GstRTPBasePayload * pay,
GstEvent * event);
#define gst_rtp_mp4v_pay_parent_class parent_class
......@@ -130,7 +130,7 @@ G_DEFINE_TYPE (GstRtpMP4VPay, gst_rtp_mp4v_pay, GST_TYPE_RTP_BASE_PAYLOAD)
gstrtpbasepayload_class->set_caps = gst_rtp_mp4v_pay_setcaps;
gstrtpbasepayload_class->handle_buffer = gst_rtp_mp4v_pay_handle_buffer;
gstrtpbasepayload_class->handle_event = gst_rtp_mp4v_pay_handle_event;
gstrtpbasepayload_class->sink_event = gst_rtp_mp4v_pay_sink_event;
GST_DEBUG_CATEGORY_INIT (rtpmp4vpay_debug, "rtpmp4vpay", 0,
"MP4 video RTP Payloader");
......@@ -579,7 +579,7 @@ gst_rtp_mp4v_pay_handle_buffer (GstRTPBasePayload * basepayload,
}
static gboolean
gst_rtp_mp4v_pay_handle_event (GstRTPBasePayload * pay, GstEvent * event)
gst_rtp_mp4v_pay_sink_event (GstRTPBasePayload * pay, GstEvent * event)
{
GstRtpMP4VPay *rtpmp4vpay;
......@@ -602,7 +602,7 @@ gst_rtp_mp4v_pay_handle_event (GstRTPBasePayload * pay, GstEvent * event)
}
/* let parent handle event too */
return FALSE;
return GST_RTP_BASE_PAYLOAD_CLASS (parent_class)->sink_event (pay, event);
}
static void
......
......@@ -58,7 +58,7 @@ static GstStateChangeReturn gst_rtp_mpa_pay_change_state (GstElement * element,
static gboolean gst_rtp_mpa_pay_setcaps (GstRTPBasePayload * payload,
GstCaps * caps);
static gboolean gst_rtp_mpa_pay_handle_event (GstRTPBasePayload * payload,
static gboolean gst_rtp_mpa_pay_sink_event (GstRTPBasePayload * payload,
GstEvent * event);
static GstFlowReturn gst_rtp_mpa_pay_flush (GstRtpMPAPay * rtpmpapay);
static GstFlowReturn gst_rtp_mpa_pay_handle_buffer (GstRTPBasePayload * payload,
......@@ -96,7 +96,7 @@ gst_rtp_mpa_pay_class_init (GstRtpMPAPayClass * klass)
"Wim Taymans <wim.taymans@gmail.com>");
gstrtpbasepayload_class->set_caps = gst_rtp_mpa_pay_setcaps;
gstrtpbasepayload_class->handle_event = gst_rtp_mpa_pay_handle_event;
gstrtpbasepayload_class->sink_event = gst_rtp_mpa_pay_sink_event;
gstrtpbasepayload_class->handle_buffer = gst_rtp_mpa_pay_handle_buffer;
}
......@@ -140,7 +140,7 @@ gst_rtp_mpa_pay_setcaps (GstRTPBasePayload * payload, GstCaps * caps)
}
static gboolean
gst_rtp_mpa_pay_handle_event (GstRTPBasePayload * payload, GstEvent * event)
gst_rtp_mpa_pay_sink_event (GstRTPBasePayload * payload, GstEvent * event)
{
gboolean ret;
GstRtpMPAPay *rtpmpapay;
......@@ -159,8 +159,7 @@ gst_rtp_mpa_pay_handle_event (GstRTPBasePayload * payload, GstEvent * event)
break;
}
ret =
GST_RTP_BASE_PAYLOAD_CLASS (parent_class)->handle_event (payload, event);
ret = GST_RTP_BASE_PAYLOAD_CLASS (parent_class)->sink_event (payload, event);
return ret;
}
......
......@@ -58,7 +58,7 @@ static gboolean gst_rtp_mpv_pay_setcaps (GstRTPBasePayload * payload,
GstCaps * caps);
static GstFlowReturn gst_rtp_mpv_pay_handle_buffer (GstRTPBasePayload *
payload, GstBuffer * buffer);
static gboolean gst_rtp_mpv_pay_handle_event (GstRTPBasePayload * payload,
static gboolean gst_rtp_mpv_pay_sink_event (GstRTPBasePayload * payload,
GstEvent * event);
#define gst_rtp_mpv_pay_parent_class parent_class
......@@ -91,7 +91,7 @@ gst_rtp_mpv_pay_class_init (GstRTPMPVPayClass * klass)
gstrtpbasepayload_class->set_caps = gst_rtp_mpv_pay_setcaps;
gstrtpbasepayload_class->handle_buffer = gst_rtp_mpv_pay_handle_buffer;
gstrtpbasepayload_class->handle_event = gst_rtp_mpv_pay_handle_event;
gstrtpbasepayload_class->sink_event = gst_rtp_mpv_pay_sink_event;
GST_DEBUG_CATEGORY_INIT (rtpmpvpay_debug, "rtpmpvpay", 0,
"MPEG2 ES Video RTP Payloader");
......@@ -136,7 +136,7 @@ gst_rtp_mpv_pay_setcaps (GstRTPBasePayload * payload, GstCaps * caps)
}
static gboolean
gst_rtp_mpv_pay_handle_event (GstRTPBasePayload * payload, GstEvent * event)
gst_rtp_mpv_pay_sink_event (GstRTPBasePayload * payload, GstEvent * event)
{
gboolean ret;
GstRTPMPVPay *rtpmpvpay;
......@@ -155,8 +155,7 @@ gst_rtp_mpv_pay_handle_event (GstRTPBasePayload * payload, GstEvent * event)
break;
}
ret =
GST_RTP_BASE_PAYLOAD_CLASS (parent_class)->handle_event (payload, event);
ret = GST_RTP_BASE_PAYLOAD_CLASS (parent_class)->sink_event (payload, event);
return ret;
}
......
......@@ -84,7 +84,7 @@ static GstStateChangeReturn gst_rtp_theora_pay_change_state (GstElement *
element, GstStateChange transition);
static GstFlowReturn gst_rtp_theora_pay_handle_buffer (GstRTPBasePayload * pad,
GstBuffer * buffer);
static gboolean gst_rtp_theora_pay_handle_event (GstRTPBasePayload * payload,
static gboolean gst_rtp_theora_pay_sink_event (GstRTPBasePayload * payload,
GstEvent * event);
......@@ -108,7 +108,7 @@ gst_rtp_theora_pay_class_init (GstRtpTheoraPayClass * klass)
gstrtpbasepayload_class->set_caps = gst_rtp_theora_pay_setcaps;
gstrtpbasepayload_class->handle_buffer = gst_rtp_theora_pay_handle_buffer;
gstrtpbasepayload_class->handle_event = gst_rtp_theora_pay_handle_event;
gstrtpbasepayload_class->sink_event = gst_rtp_theora_pay_sink_event;
gobject_class->set_property = gst_rtp_theora_pay_set_property;
gobject_class->get_property = gst_rtp_theora_pay_get_property;
......@@ -793,7 +793,7 @@ header_error:
}
static gboolean
gst_rtp_theora_pay_handle_event (GstRTPBasePayload * payload, GstEvent * event)
gst_rtp_theora_pay_sink_event (GstRTPBasePayload * payload, GstEvent * event)
{
GstRtpTheoraPay *rtptheorapay = GST_RTP_THEORA_PAY (payload);
......@@ -805,7 +805,7 @@ gst_rtp_theora_pay_handle_event (GstRTPBasePayload * payload, GstEvent * event)
break;
}
/* false to let parent handle event as well */
return FALSE;
return GST_RTP_BASE_PAYLOAD_CLASS (parent_class)->sink_event (payload, event);
}
static GstStateChangeReturn
......
......@@ -67,7 +67,7 @@ static GstStateChangeReturn gst_rtp_vorbis_pay_change_state (GstElement *
element, GstStateChange transition);
static GstFlowReturn gst_rtp_vorbis_pay_handle_buffer (GstRTPBasePayload * pad,
GstBuffer * buffer);
static gboolean gst_rtp_vorbis_pay_handle_event (GstRTPBasePayload * payload,
static gboolean gst_rtp_vorbis_pay_sink_event (GstRTPBasePayload * payload,
GstEvent * event);
static void
......@@ -83,7 +83,7 @@ gst_rtp_vorbis_pay_class_init (GstRtpVorbisPayClass * klass)
gstrtpbasepayload_class->set_caps = gst_rtp_vorbis_pay_setcaps;
gstrtpbasepayload_class->handle_buffer = gst_rtp_vorbis_pay_handle_buffer;
gstrtpbasepayload_class->handle_event = gst_rtp_vorbis_pay_handle_event;
gstrtpbasepayload_class->sink_event = gst_rtp_vorbis_pay_sink_event;
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&gst_rtp_vorbis_pay_src_template));
......@@ -663,7 +663,7 @@ header_error:
}
static gboolean
gst_rtp_vorbis_pay_handle_event (GstRTPBasePayload * payload, GstEvent * event)
gst_rtp_vorbis_pay_sink_event (GstRTPBasePayload * payload, GstEvent * event)
{
GstRtpVorbisPay *rtpvorbispay = GST_RTP_VORBIS_PAY (payload);
......@@ -675,7 +675,7 @@ gst_rtp_vorbis_pay_handle_event (GstRTPBasePayload * payload, GstEvent * event)
break;
}
/* false to let parent handle event as well */
return FALSE;
return GST_RTP_BASE_PAYLOAD_CLASS (parent_class)->sink_event (payload, event);
}
static GstStateChangeReturn
......
......@@ -252,13 +252,17 @@ static gboolean gst_rtp_jitter_buffer_sink_rtcp_event (GstPad * pad,
static GstFlowReturn gst_rtp_jitter_buffer_chain_rtcp (GstPad * pad,
GstBuffer * buffer);
static gboolean gst_rtp_jitter_buffer_sink_query (GstPad * pad,
GstQuery * query);
/* srcpad overrides */
static gboolean gst_rtp_jitter_buffer_src_event (GstPad * pad,
GstEvent * event);
static gboolean
gst_rtp_jitter_buffer_src_activate_push (GstPad * pad, gboolean active);
static void gst_rtp_jitter_buffer_loop (GstRtpJitterBuffer * jitterbuffer);
static gboolean gst_rtp_jitter_buffer_query (GstPad * pad, GstQuery * query);
static gboolean gst_rtp_jitter_buffer_src_query (GstPad * pad,
GstQuery * query);
static void
gst_rtp_jitter_buffer_clear_pt_map (GstRtpJitterBuffer * jitterbuffer);
......@@ -473,9 +477,7 @@ gst_rtp_jitter_buffer_init (GstRtpJitterBuffer * jitterbuffer)
gst_pad_set_activatepush_function (priv->srcpad,
GST_DEBUG_FUNCPTR (gst_rtp_jitter_buffer_src_activate_push));
gst_pad_set_query_function (priv->srcpad,
GST_DEBUG_FUNCPTR (gst_rtp_jitter_buffer_query));
gst_pad_set_getcaps_function (priv->srcpad,
GST_DEBUG_FUNCPTR (gst_rtp_jitter_buffer_getcaps));
GST_DEBUG_FUNCPTR (gst_rtp_jitter_buffer_src_query));
gst_pad_set_event_function (priv->srcpad,
GST_DEBUG_FUNCPTR (gst_rtp_jitter_buffer_src_event));
......@@ -487,8 +489,8 @@ gst_rtp_jitter_buffer_init (GstRtpJitterBuffer * jitterbuffer)
GST_DEBUG_FUNCPTR (gst_rtp_jitter_buffer_chain));
gst_pad_set_event_function (priv->sinkpad,
GST_DEBUG_FUNCPTR (gst_rtp_jitter_buffer_sink_event));
gst_pad_set_getcaps_function (priv->sinkpad,
GST_DEBUG_FUNCPTR (gst_rtp_jitter_buffer_getcaps));
gst_pad_set_query_function (priv->sinkpad,
GST_DEBUG_FUNCPTR (gst_rtp_jitter_buffer_sink_query));
gst_element_add_pad (GST_ELEMENT (jitterbuffer), priv->srcpad);
gst_element_add_pad (GST_ELEMENT (jitterbuffer), priv->sinkpad);
......@@ -2085,7 +2087,39 @@ ignore_buffer:
}
static gboolean
gst_rtp_jitter_buffer_query (GstPad * pad, GstQuery * query)
gst_rtp_jitter_buffer_sink_query (GstPad * pad, GstQuery * query)
{
GstRtpJitterBuffer *jitterbuffer;
gboolean res = FALSE;
jitterbuffer = GST_RTP_JITTER_BUFFER (gst_pad_get_parent (pad));
if (G_UNLIKELY (jitterbuffer == NULL))
return FALSE;
switch (GST_QUERY_TYPE (query)) {
case GST_QUERY_CAPS:
{
GstCaps *filter, *caps;
gst_query_parse_caps (query, &filter);
caps = gst_rtp_jitter_buffer_getcaps (pad, filter);
gst_query_set_caps_result (query, caps);
gst_caps_unref (caps);
res = TRUE;
break;
}
default:
res = gst_pad_query_default (pad, query);
break;
}
gst_object_unref (jitterbuffer);
return res;
}
static gboolean
gst_rtp_jitter_buffer_src_query (GstPad * pad, GstQuery * query)
{
GstRtpJitterBuffer *jitterbuffer;
GstRtpJitterBufferPrivate *priv;
......@@ -2162,6 +2196,17 @@ gst_rtp_jitter_buffer_query (GstPad * pad, GstQuery * query)
}
break;
}
case GST_QUERY_CAPS:
{
GstCaps *filter, *caps;
gst_query_parse_caps (query, &filter);
caps = gst_rtp_jitter_buffer_getcaps (pad, filter);
gst_query_set_caps_result (query, caps);
gst_caps_unref (caps);
res = TRUE;
break;
}
default:
res = gst_pad_query_default (pad, query);
break;
......
......@@ -1768,6 +1768,31 @@ gst_rtp_session_getcaps_send_rtp (GstPad * pad, GstCaps * filter)
return result;
}
static gboolean
gst_rtp_session_query_send_rtp (GstPad * pad, GstQuery * query)
{
gboolean res = FALSE;
switch (GST_QUERY_TYPE (query)) {
case GST_QUERY_CAPS:
{
GstCaps *filter, *caps;
gst_query_parse_caps (query, &filter);
caps = gst_rtp_session_getcaps_send_rtp (pad, filter);
gst_query_set_caps_result (query, caps);
gst_caps_unref (caps);
res = TRUE;
break;
}
default:
res = gst_pad_query_default (pad, query);
break;
}