mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-22 07:08:23 +00:00
add parent to pad functions
This commit is contained in:
parent
ee240c1ac0
commit
2679b9432a
12 changed files with 151 additions and 152 deletions
|
@ -90,9 +90,12 @@ static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src",
|
|||
#define gst_a52dec_parent_class parent_class
|
||||
G_DEFINE_TYPE (GstA52Dec, gst_a52dec, GST_TYPE_ELEMENT);
|
||||
|
||||
static GstFlowReturn gst_a52dec_chain (GstPad * pad, GstBuffer * buffer);
|
||||
static GstFlowReturn gst_a52dec_chain_raw (GstPad * pad, GstBuffer * buf);
|
||||
static gboolean gst_a52dec_sink_event (GstPad * pad, GstEvent * event);
|
||||
static GstFlowReturn gst_a52dec_chain (GstPad * pad, GstObject * parent,
|
||||
GstBuffer * buffer);
|
||||
static GstFlowReturn gst_a52dec_chain_raw (GstPad * pad, GstObject * parent,
|
||||
GstBuffer * buf);
|
||||
static gboolean gst_a52dec_sink_event (GstPad * pad, GstObject * parent,
|
||||
GstEvent * event);
|
||||
static GstStateChangeReturn gst_a52dec_change_state (GstElement * element,
|
||||
GstStateChange transition);
|
||||
|
||||
|
@ -465,9 +468,9 @@ gst_a52dec_sink_setcaps (GstA52Dec * a52dec, GstCaps * caps)
|
|||
}
|
||||
|
||||
static gboolean
|
||||
gst_a52dec_sink_event (GstPad * pad, GstEvent * event)
|
||||
gst_a52dec_sink_event (GstPad * pad, GstObject * parent, GstEvent * event)
|
||||
{
|
||||
GstA52Dec *a52dec = GST_A52DEC (gst_pad_get_parent (pad));
|
||||
GstA52Dec *a52dec = GST_A52DEC (parent);
|
||||
gboolean ret = FALSE;
|
||||
|
||||
GST_LOG ("Handling %s event", GST_EVENT_TYPE_NAME (event));
|
||||
|
@ -536,7 +539,6 @@ gst_a52dec_sink_event (GstPad * pad, GstEvent * event)
|
|||
break;
|
||||
}
|
||||
|
||||
gst_object_unref (a52dec);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -672,9 +674,9 @@ gst_a52dec_handle_frame (GstA52Dec * a52dec, guint8 * data,
|
|||
}
|
||||
|
||||
static GstFlowReturn
|
||||
gst_a52dec_chain (GstPad * pad, GstBuffer * buf)
|
||||
gst_a52dec_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
|
||||
{
|
||||
GstA52Dec *a52dec = GST_A52DEC (GST_PAD_PARENT (pad));
|
||||
GstA52Dec *a52dec = GST_A52DEC (parent);
|
||||
GstFlowReturn ret;
|
||||
gint first_access;
|
||||
|
||||
|
@ -714,7 +716,7 @@ gst_a52dec_chain (GstPad * pad, GstBuffer * buf)
|
|||
|
||||
subbuf = gst_buffer_copy_region (buf, GST_BUFFER_COPY_ALL, offset, len);
|
||||
GST_BUFFER_TIMESTAMP (subbuf) = GST_CLOCK_TIME_NONE;
|
||||
ret = gst_a52dec_chain_raw (pad, subbuf);
|
||||
ret = gst_a52dec_chain_raw (pad, parent, subbuf);
|
||||
if (ret != GST_FLOW_OK)
|
||||
goto done;
|
||||
|
||||
|
@ -725,7 +727,7 @@ gst_a52dec_chain (GstPad * pad, GstBuffer * buf)
|
|||
subbuf = gst_buffer_copy_region (buf, GST_BUFFER_COPY_ALL, offset, len);
|
||||
GST_BUFFER_TIMESTAMP (subbuf) = GST_BUFFER_TIMESTAMP (buf);
|
||||
|
||||
ret = gst_a52dec_chain_raw (pad, subbuf);
|
||||
ret = gst_a52dec_chain_raw (pad, parent, subbuf);
|
||||
}
|
||||
} else {
|
||||
/* first_access = 0 or 1, so if there's a timestamp it applies to the first byte */
|
||||
|
@ -733,11 +735,11 @@ gst_a52dec_chain (GstPad * pad, GstBuffer * buf)
|
|||
gst_buffer_copy_region (buf, GST_BUFFER_COPY_ALL, offset,
|
||||
size - offset);
|
||||
GST_BUFFER_TIMESTAMP (subbuf) = GST_BUFFER_TIMESTAMP (buf);
|
||||
ret = gst_a52dec_chain_raw (pad, subbuf);
|
||||
ret = gst_a52dec_chain_raw (pad, parent, subbuf);
|
||||
}
|
||||
} else {
|
||||
gst_buffer_ref (buf);
|
||||
ret = gst_a52dec_chain_raw (pad, buf);
|
||||
ret = gst_a52dec_chain_raw (pad, parent, buf);
|
||||
}
|
||||
|
||||
done:
|
||||
|
@ -762,7 +764,7 @@ bad_first_access_parameter:
|
|||
}
|
||||
|
||||
static GstFlowReturn
|
||||
gst_a52dec_chain_raw (GstPad * pad, GstBuffer * buf)
|
||||
gst_a52dec_chain_raw (GstPad * pad, GstObject * parent, GstBuffer * buf)
|
||||
{
|
||||
GstA52Dec *a52dec;
|
||||
guint8 *bdata, *data;
|
||||
|
@ -770,7 +772,7 @@ gst_a52dec_chain_raw (GstPad * pad, GstBuffer * buf)
|
|||
gint length = 0, flags, sample_rate, bit_rate;
|
||||
GstFlowReturn result = GST_FLOW_OK;
|
||||
|
||||
a52dec = GST_A52DEC (GST_PAD_PARENT (pad));
|
||||
a52dec = GST_A52DEC (parent);
|
||||
|
||||
if (!a52dec->sent_segment) {
|
||||
GstSegment segment;
|
||||
|
|
|
@ -84,7 +84,8 @@ static void gst_mpeg2dec_reset (GstMpeg2dec * mpeg2dec);
|
|||
static void gst_mpeg2dec_set_index (GstElement * element, GstIndex * index);
|
||||
static GstIndex *gst_mpeg2dec_get_index (GstElement * element);
|
||||
|
||||
static gboolean gst_mpeg2dec_src_event (GstPad * pad, GstEvent * event);
|
||||
static gboolean gst_mpeg2dec_src_event (GstPad * pad, GstObject * parent,
|
||||
GstEvent * event);
|
||||
|
||||
static gboolean gst_mpeg2dec_src_query (GstPad * pad, GstObject * parent,
|
||||
GstQuery * query);
|
||||
|
@ -97,9 +98,11 @@ static gboolean gst_mpeg2dec_src_convert (GstPad * pad, GstFormat src_format,
|
|||
static GstStateChangeReturn gst_mpeg2dec_change_state (GstElement * element,
|
||||
GstStateChange transition);
|
||||
|
||||
static gboolean gst_mpeg2dec_sink_event (GstPad * pad, GstEvent * event);
|
||||
static gboolean gst_mpeg2dec_sink_event (GstPad * pad, GstObject * parent,
|
||||
GstEvent * event);
|
||||
static gboolean gst_mpeg2dec_setcaps (GstPad * pad, GstCaps * caps);
|
||||
static GstFlowReturn gst_mpeg2dec_chain (GstPad * pad, GstBuffer * buf);
|
||||
static GstFlowReturn gst_mpeg2dec_chain (GstPad * pad, GstObject * parent,
|
||||
GstBuffer * buf);
|
||||
|
||||
static void clear_buffers (GstMpeg2dec * mpeg2dec);
|
||||
|
||||
|
@ -1052,7 +1055,7 @@ dropping_qos:
|
|||
}
|
||||
|
||||
static GstFlowReturn
|
||||
gst_mpeg2dec_chain (GstPad * pad, GstBuffer * buf)
|
||||
gst_mpeg2dec_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
|
||||
{
|
||||
GstMpeg2dec *mpeg2dec;
|
||||
gsize size;
|
||||
|
@ -1063,7 +1066,7 @@ gst_mpeg2dec_chain (GstPad * pad, GstBuffer * buf)
|
|||
gboolean done = FALSE;
|
||||
GstFlowReturn ret = GST_FLOW_OK;
|
||||
|
||||
mpeg2dec = GST_MPEG2DEC (GST_PAD_PARENT (pad));
|
||||
mpeg2dec = GST_MPEG2DEC (parent);
|
||||
|
||||
data = gst_buffer_map (buf, &size, NULL, GST_MAP_READ);
|
||||
pts = GST_BUFFER_TIMESTAMP (buf);
|
||||
|
@ -1223,12 +1226,12 @@ exit:
|
|||
}
|
||||
|
||||
static gboolean
|
||||
gst_mpeg2dec_sink_event (GstPad * pad, GstEvent * event)
|
||||
gst_mpeg2dec_sink_event (GstPad * pad, GstObject * parent, GstEvent * event)
|
||||
{
|
||||
GstMpeg2dec *mpeg2dec;
|
||||
gboolean ret = TRUE;
|
||||
|
||||
mpeg2dec = GST_MPEG2DEC (gst_pad_get_parent (pad));
|
||||
mpeg2dec = GST_MPEG2DEC (parent);
|
||||
|
||||
GST_DEBUG_OBJECT (mpeg2dec, "Got %s event on sink pad",
|
||||
GST_EVENT_TYPE_NAME (event));
|
||||
|
@ -1287,7 +1290,6 @@ gst_mpeg2dec_sink_event (GstPad * pad, GstEvent * event)
|
|||
}
|
||||
|
||||
done:
|
||||
gst_object_unref (mpeg2dec);
|
||||
|
||||
return ret;
|
||||
|
||||
|
@ -1689,12 +1691,12 @@ convert_failed:
|
|||
|
||||
|
||||
static gboolean
|
||||
gst_mpeg2dec_src_event (GstPad * pad, GstEvent * event)
|
||||
gst_mpeg2dec_src_event (GstPad * pad, GstObject * parent, GstEvent * event)
|
||||
{
|
||||
gboolean res;
|
||||
GstMpeg2dec *mpeg2dec;
|
||||
|
||||
mpeg2dec = GST_MPEG2DEC (GST_PAD_PARENT (pad));
|
||||
mpeg2dec = GST_MPEG2DEC (parent);
|
||||
|
||||
if (mpeg2dec->decoder == NULL)
|
||||
goto no_decoder;
|
||||
|
|
|
@ -127,12 +127,12 @@ gst_sid_memory_get_type (void)
|
|||
|
||||
static void gst_siddec_finalize (GObject * object);
|
||||
|
||||
static GstFlowReturn gst_siddec_chain (GstPad * pad, GstBuffer * buffer);
|
||||
static gboolean gst_siddec_sink_event (GstPad * pad, GstEvent * event);
|
||||
static GstFlowReturn gst_siddec_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer);
|
||||
static gboolean gst_siddec_sink_event (GstPad * pad, GstObject * parent, GstEvent * event);
|
||||
|
||||
static gboolean gst_siddec_src_convert (GstPad * pad, GstFormat src_format,
|
||||
gint64 src_value, GstFormat * dest_format, gint64 * dest_value);
|
||||
static gboolean gst_siddec_src_event (GstPad * pad, GstEvent * event);
|
||||
static gboolean gst_siddec_src_event (GstPad * pad, GstObject * parent, GstEvent * event);
|
||||
static gboolean gst_siddec_src_query (GstPad * pad, GstObject * parent, GstQuery * query);
|
||||
|
||||
static void gst_siddec_get_property (GObject * object, guint prop_id,
|
||||
|
@ -471,12 +471,12 @@ could_not_init:
|
|||
}
|
||||
|
||||
static gboolean
|
||||
gst_siddec_sink_event (GstPad * pad, GstEvent * event)
|
||||
gst_siddec_sink_event (GstPad * pad, GstObject * parent, GstEvent * event)
|
||||
{
|
||||
GstSidDec *siddec;
|
||||
gboolean res;
|
||||
|
||||
siddec = GST_SIDDEC (gst_pad_get_parent (pad));
|
||||
siddec = GST_SIDDEC (parent);
|
||||
|
||||
switch (GST_EVENT_TYPE (event)) {
|
||||
case GST_EVENT_EOS:
|
||||
|
@ -490,18 +490,17 @@ gst_siddec_sink_event (GstPad * pad, GstEvent * event)
|
|||
break;
|
||||
}
|
||||
gst_event_unref (event);
|
||||
gst_object_unref (siddec);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
static GstFlowReturn
|
||||
gst_siddec_chain (GstPad * pad, GstBuffer * buffer)
|
||||
gst_siddec_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer)
|
||||
{
|
||||
GstSidDec *siddec;
|
||||
guint64 size;
|
||||
|
||||
siddec = GST_SIDDEC (gst_pad_get_parent (pad));
|
||||
siddec = GST_SIDDEC (parent);
|
||||
|
||||
size = gst_buffer_get_size (buffer);
|
||||
if (siddec->tune_len + size > maxSidtuneFileLen)
|
||||
|
@ -513,8 +512,6 @@ gst_siddec_chain (GstPad * pad, GstBuffer * buffer)
|
|||
|
||||
gst_buffer_unref (buffer);
|
||||
|
||||
gst_object_unref (siddec);
|
||||
|
||||
return GST_FLOW_OK;
|
||||
|
||||
/* ERRORS */
|
||||
|
@ -522,7 +519,6 @@ overflow:
|
|||
{
|
||||
GST_ELEMENT_ERROR (siddec, STREAM, DECODE,
|
||||
(NULL), ("Input data bigger than allowed buffer size"));
|
||||
gst_object_unref (siddec);
|
||||
return GST_FLOW_ERROR;
|
||||
}
|
||||
}
|
||||
|
@ -606,12 +602,9 @@ gst_siddec_src_convert (GstPad * pad, GstFormat src_format, gint64 src_value,
|
|||
}
|
||||
|
||||
static gboolean
|
||||
gst_siddec_src_event (GstPad * pad, GstEvent * event)
|
||||
gst_siddec_src_event (GstPad * pad, GstObject * parent, GstEvent * event)
|
||||
{
|
||||
gboolean res = FALSE;
|
||||
GstSidDec *siddec;
|
||||
|
||||
siddec = GST_SIDDEC (gst_pad_get_parent (pad));
|
||||
|
||||
switch (GST_EVENT_TYPE (event)) {
|
||||
default:
|
||||
|
@ -619,8 +612,6 @@ gst_siddec_src_event (GstPad * pad, GstEvent * event)
|
|||
}
|
||||
gst_event_unref (event);
|
||||
|
||||
gst_object_unref (siddec);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
|
|
@ -485,11 +485,14 @@ static void gst_x264_enc_close_encoder (GstX264Enc * encoder);
|
|||
|
||||
static gboolean gst_x264_enc_sink_set_caps (GstPad * pad, GstCaps * caps);
|
||||
static GstCaps *gst_x264_enc_sink_get_caps (GstPad * pad, GstCaps * filter);
|
||||
static gboolean gst_x264_enc_sink_event (GstPad * pad, GstEvent * event);
|
||||
static gboolean gst_x264_enc_sink_event (GstPad * pad, GstObject * parent,
|
||||
GstEvent * event);
|
||||
static gboolean gst_x264_enc_sink_query (GstPad * pad, GstObject * parent,
|
||||
GstQuery * query);
|
||||
static gboolean gst_x264_enc_src_event (GstPad * pad, GstEvent * event);
|
||||
static GstFlowReturn gst_x264_enc_chain (GstPad * pad, GstBuffer * buf);
|
||||
static gboolean gst_x264_enc_src_event (GstPad * pad, GstObject * parent,
|
||||
GstEvent * event);
|
||||
static GstFlowReturn gst_x264_enc_chain (GstPad * pad, GstObject * parent,
|
||||
GstBuffer * buf);
|
||||
static void gst_x264_enc_flush_frames (GstX264Enc * encoder, gboolean send);
|
||||
static GstFlowReturn gst_x264_enc_encode_frame (GstX264Enc * encoder,
|
||||
x264_picture_t * pic_in, int *i_nal, gboolean send);
|
||||
|
@ -1720,13 +1723,13 @@ gst_x264_enc_sink_get_caps (GstPad * pad, GstCaps * filter)
|
|||
}
|
||||
|
||||
static gboolean
|
||||
gst_x264_enc_src_event (GstPad * pad, GstEvent * event)
|
||||
gst_x264_enc_src_event (GstPad * pad, GstObject * parent, GstEvent * event)
|
||||
{
|
||||
gboolean ret = TRUE;
|
||||
GstX264Enc *encoder;
|
||||
gboolean forward = TRUE;
|
||||
|
||||
encoder = GST_X264_ENC (gst_pad_get_parent (pad));
|
||||
encoder = GST_X264_ENC (parent);
|
||||
|
||||
switch (GST_EVENT_TYPE (event)) {
|
||||
case GST_EVENT_CUSTOM_UPSTREAM:{
|
||||
|
@ -1752,17 +1755,16 @@ gst_x264_enc_src_event (GstPad * pad, GstEvent * event)
|
|||
if (forward)
|
||||
ret = gst_pad_push_event (encoder->sinkpad, event);
|
||||
|
||||
gst_object_unref (encoder);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gst_x264_enc_sink_event (GstPad * pad, GstEvent * event)
|
||||
gst_x264_enc_sink_event (GstPad * pad, GstObject * parent, GstEvent * event)
|
||||
{
|
||||
gboolean ret = FALSE, forward = TRUE;
|
||||
GstX264Enc *encoder;
|
||||
|
||||
encoder = GST_X264_ENC (gst_pad_get_parent (pad));
|
||||
encoder = GST_X264_ENC (parent);
|
||||
|
||||
switch (GST_EVENT_TYPE (event)) {
|
||||
case GST_EVENT_CAPS:
|
||||
|
@ -1813,7 +1815,6 @@ gst_x264_enc_sink_event (GstPad * pad, GstEvent * event)
|
|||
else
|
||||
gst_event_unref (event);
|
||||
|
||||
gst_object_unref (encoder);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -1846,9 +1847,9 @@ gst_x264_enc_sink_query (GstPad * pad, GstObject * parent, GstQuery * query)
|
|||
* this function does the actual processing
|
||||
*/
|
||||
static GstFlowReturn
|
||||
gst_x264_enc_chain (GstPad * pad, GstBuffer * buf)
|
||||
gst_x264_enc_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
|
||||
{
|
||||
GstX264Enc *encoder = GST_X264_ENC (GST_OBJECT_PARENT (pad));
|
||||
GstX264Enc *encoder = GST_X264_ENC (parent);
|
||||
GstFlowReturn ret;
|
||||
x264_picture_t pic_in;
|
||||
gint i_nal, i;
|
||||
|
|
|
@ -85,8 +85,10 @@ static gboolean gst_asf_demux_send_event_unlocked (GstASFDemux * demux,
|
|||
GstEvent * event);
|
||||
static gboolean gst_asf_demux_handle_src_query (GstPad * pad,
|
||||
GstObject * parent, GstQuery * query);
|
||||
static GstFlowReturn gst_asf_demux_chain (GstPad * pad, GstBuffer * buf);
|
||||
static gboolean gst_asf_demux_sink_event (GstPad * pad, GstEvent * event);
|
||||
static GstFlowReturn gst_asf_demux_chain (GstPad * pad, GstObject * parent,
|
||||
GstBuffer * buf);
|
||||
static gboolean gst_asf_demux_sink_event (GstPad * pad, GstObject * parent,
|
||||
GstEvent * event);
|
||||
static GstFlowReturn gst_asf_demux_process_object (GstASFDemux * demux,
|
||||
guint8 ** p_data, guint64 * p_size);
|
||||
static gboolean gst_asf_demux_activate (GstPad * sinkpad);
|
||||
|
@ -348,12 +350,12 @@ gst_asf_demux_activate_pull (GstPad * pad, gboolean active)
|
|||
|
||||
|
||||
static gboolean
|
||||
gst_asf_demux_sink_event (GstPad * pad, GstEvent * event)
|
||||
gst_asf_demux_sink_event (GstPad * pad, GstObject * parent, GstEvent * event)
|
||||
{
|
||||
GstASFDemux *demux;
|
||||
gboolean ret = TRUE;
|
||||
|
||||
demux = GST_ASF_DEMUX (gst_pad_get_parent (pad));
|
||||
demux = GST_ASF_DEMUX (parent);
|
||||
|
||||
GST_LOG_OBJECT (demux, "handling %s event", GST_EVENT_TYPE_NAME (event));
|
||||
switch (GST_EVENT_TYPE (event)) {
|
||||
|
@ -428,11 +430,10 @@ gst_asf_demux_sink_event (GstPad * pad, GstEvent * event)
|
|||
break;
|
||||
|
||||
default:
|
||||
ret = gst_pad_event_default (pad, event);
|
||||
ret = gst_pad_event_default (pad, parent, event);
|
||||
break;
|
||||
}
|
||||
|
||||
gst_object_unref (demux);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -736,12 +737,13 @@ gst_asf_demux_handle_seek_event (GstASFDemux * demux, GstEvent * event)
|
|||
}
|
||||
|
||||
static gboolean
|
||||
gst_asf_demux_handle_src_event (GstPad * pad, GstEvent * event)
|
||||
gst_asf_demux_handle_src_event (GstPad * pad, GstObject * parent,
|
||||
GstEvent * event)
|
||||
{
|
||||
GstASFDemux *demux;
|
||||
gboolean ret;
|
||||
|
||||
demux = GST_ASF_DEMUX (gst_pad_get_parent (pad));
|
||||
demux = GST_ASF_DEMUX (parent);
|
||||
|
||||
switch (GST_EVENT_TYPE (event)) {
|
||||
case GST_EVENT_SEEK:
|
||||
|
@ -757,11 +759,10 @@ gst_asf_demux_handle_src_event (GstPad * pad, GstEvent * event)
|
|||
break;
|
||||
default:
|
||||
GST_LOG_OBJECT (pad, "%s event", GST_EVENT_TYPE_NAME (event));
|
||||
ret = gst_pad_event_default (pad, event);
|
||||
ret = gst_pad_event_default (pad, parent, event);
|
||||
break;
|
||||
}
|
||||
|
||||
gst_object_unref (demux);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -1761,12 +1762,12 @@ gst_asf_demux_check_header (GstASFDemux * demux)
|
|||
}
|
||||
|
||||
static GstFlowReturn
|
||||
gst_asf_demux_chain (GstPad * pad, GstBuffer * buf)
|
||||
gst_asf_demux_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
|
||||
{
|
||||
GstFlowReturn ret = GST_FLOW_OK;
|
||||
GstASFDemux *demux;
|
||||
|
||||
demux = GST_ASF_DEMUX (GST_PAD_PARENT (pad));
|
||||
demux = GST_ASF_DEMUX (parent);
|
||||
|
||||
GST_LOG_OBJECT (demux, "buffer: size=%u, offset=%" G_GINT64_FORMAT ", time=%"
|
||||
GST_TIME_FORMAT, gst_buffer_get_size (buf), GST_BUFFER_OFFSET (buf),
|
||||
|
@ -3821,7 +3822,8 @@ gst_asf_demux_element_send_event (GstElement * element, GstEvent * event)
|
|||
|
||||
for (i = 0; i < demux->num_streams; ++i) {
|
||||
gst_event_ref (event);
|
||||
if (gst_asf_demux_handle_src_event (demux->stream[i].pad, event)) {
|
||||
if (gst_asf_demux_handle_src_event (demux->stream[i].pad,
|
||||
GST_OBJECT_CAST (element), event)) {
|
||||
gst_event_unref (event);
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
@ -72,12 +72,13 @@ static void gst_dvdlpcmdec_base_init (gpointer g_class);
|
|||
static void gst_dvdlpcmdec_class_init (GstDvdLpcmDecClass * klass);
|
||||
static void gst_dvdlpcmdec_init (GstDvdLpcmDec * dvdlpcmdec);
|
||||
|
||||
static GstFlowReturn gst_dvdlpcmdec_chain_raw (GstPad * pad,
|
||||
static GstFlowReturn gst_dvdlpcmdec_chain_raw (GstPad * pad, GstObject * parent,
|
||||
GstBuffer * buffer);
|
||||
static GstFlowReturn gst_dvdlpcmdec_chain_dvd (GstPad * pad,
|
||||
static GstFlowReturn gst_dvdlpcmdec_chain_dvd (GstPad * pad, GstObject * parent,
|
||||
GstBuffer * buffer);
|
||||
static gboolean gst_dvdlpcmdec_setcaps (GstPad * pad, GstCaps * caps);
|
||||
static gboolean dvdlpcmdec_sink_event (GstPad * pad, GstEvent * event);
|
||||
static gboolean dvdlpcmdec_sink_event (GstPad * pad, GstObject * parent,
|
||||
GstEvent * event);
|
||||
|
||||
static GstStateChangeReturn gst_dvdlpcmdec_change_state (GstElement * element,
|
||||
GstStateChange transition);
|
||||
|
@ -416,7 +417,7 @@ parse_header (GstDvdLpcmDec * dec, guint32 header)
|
|||
}
|
||||
|
||||
static GstFlowReturn
|
||||
gst_dvdlpcmdec_chain_dvd (GstPad * pad, GstBuffer * buf)
|
||||
gst_dvdlpcmdec_chain_dvd (GstPad * pad, GstObject * parent, GstBuffer * buf)
|
||||
{
|
||||
GstDvdLpcmDec *dvdlpcmdec;
|
||||
guint8 *data;
|
||||
|
@ -428,7 +429,7 @@ gst_dvdlpcmdec_chain_dvd (GstPad * pad, GstBuffer * buf)
|
|||
gint off, len;
|
||||
gint rate, channels;
|
||||
|
||||
dvdlpcmdec = GST_DVDLPCMDEC (gst_pad_get_parent (pad));
|
||||
dvdlpcmdec = GST_DVDLPCMDEC (parent);
|
||||
|
||||
data = gst_buffer_map (buf, &size, NULL, GST_MAP_READ);
|
||||
|
||||
|
@ -518,7 +519,7 @@ gst_dvdlpcmdec_chain_dvd (GstPad * pad, GstBuffer * buf)
|
|||
GST_BUFFER_TIMESTAMP (subbuf) = GST_CLOCK_TIME_NONE;
|
||||
}
|
||||
|
||||
ret = gst_dvdlpcmdec_chain_raw (pad, subbuf);
|
||||
ret = gst_dvdlpcmdec_chain_raw (pad, parent, subbuf);
|
||||
if (ret != GST_FLOW_OK)
|
||||
goto done;
|
||||
|
||||
|
@ -533,20 +534,19 @@ gst_dvdlpcmdec_chain_dvd (GstPad * pad, GstBuffer * buf)
|
|||
subbuf = gst_buffer_copy_region (buf, GST_BUFFER_COPY_ALL, off, len);
|
||||
GST_BUFFER_TIMESTAMP (subbuf) = GST_BUFFER_TIMESTAMP (buf);
|
||||
|
||||
ret = gst_dvdlpcmdec_chain_raw (pad, subbuf);
|
||||
ret = gst_dvdlpcmdec_chain_raw (pad, parent, subbuf);
|
||||
}
|
||||
} else {
|
||||
GST_LOG_OBJECT (dvdlpcmdec, "Creating single sub-buffer off %d, len %d",
|
||||
off, size - off);
|
||||
subbuf = gst_buffer_copy_region (buf, GST_BUFFER_COPY_ALL, off, size - off);
|
||||
GST_BUFFER_TIMESTAMP (subbuf) = GST_BUFFER_TIMESTAMP (buf);
|
||||
ret = gst_dvdlpcmdec_chain_raw (pad, subbuf);
|
||||
ret = gst_dvdlpcmdec_chain_raw (pad, parent, subbuf);
|
||||
}
|
||||
|
||||
done:
|
||||
gst_buffer_unmap (buf, data, size);
|
||||
gst_buffer_unref (buf);
|
||||
gst_object_unref (dvdlpcmdec);
|
||||
|
||||
return ret;
|
||||
|
||||
|
@ -587,7 +587,7 @@ bad_first_access:
|
|||
}
|
||||
|
||||
static GstFlowReturn
|
||||
gst_dvdlpcmdec_chain_raw (GstPad * pad, GstBuffer * buf)
|
||||
gst_dvdlpcmdec_chain_raw (GstPad * pad, GstObject * parent, GstBuffer * buf)
|
||||
{
|
||||
GstDvdLpcmDec *dvdlpcmdec;
|
||||
gsize size;
|
||||
|
@ -595,7 +595,7 @@ gst_dvdlpcmdec_chain_raw (GstPad * pad, GstBuffer * buf)
|
|||
guint samples = 0;
|
||||
gint rate, channels;
|
||||
|
||||
dvdlpcmdec = GST_DVDLPCMDEC (gst_pad_get_parent (pad));
|
||||
dvdlpcmdec = GST_DVDLPCMDEC (parent);
|
||||
|
||||
size = gst_buffer_get_size (buf);
|
||||
|
||||
|
@ -718,8 +718,6 @@ gst_dvdlpcmdec_chain_raw (GstPad * pad, GstBuffer * buf)
|
|||
ret = gst_pad_push (dvdlpcmdec->srcpad, buf);
|
||||
|
||||
done:
|
||||
gst_object_unref (dvdlpcmdec);
|
||||
|
||||
return ret;
|
||||
|
||||
/* ERRORS */
|
||||
|
@ -750,12 +748,12 @@ invalid_width:
|
|||
}
|
||||
|
||||
static gboolean
|
||||
dvdlpcmdec_sink_event (GstPad * pad, GstEvent * event)
|
||||
dvdlpcmdec_sink_event (GstPad * pad, GstObject * parent, GstEvent * event)
|
||||
{
|
||||
GstDvdLpcmDec *dvdlpcmdec;
|
||||
gboolean res;
|
||||
|
||||
dvdlpcmdec = GST_DVDLPCMDEC (GST_PAD_PARENT (pad));
|
||||
dvdlpcmdec = GST_DVDLPCMDEC (parent);
|
||||
|
||||
switch (GST_EVENT_TYPE (event)) {
|
||||
case GST_EVENT_CAPS:
|
||||
|
|
|
@ -31,8 +31,10 @@
|
|||
#define gst_dvd_sub_dec_parent_class parent_class
|
||||
G_DEFINE_TYPE (GstDvdSubDec, gst_dvd_sub_dec, GST_TYPE_ELEMENT);
|
||||
|
||||
static gboolean gst_dvd_sub_dec_src_event (GstPad * srcpad, GstEvent * event);
|
||||
static GstFlowReturn gst_dvd_sub_dec_chain (GstPad * pad, GstBuffer * buf);
|
||||
static gboolean gst_dvd_sub_dec_src_event (GstPad * srcpad, GstObject * parent,
|
||||
GstEvent * event);
|
||||
static GstFlowReturn gst_dvd_sub_dec_chain (GstPad * pad, GstObject * parent,
|
||||
GstBuffer * buf);
|
||||
|
||||
static gboolean gst_dvd_sub_dec_handle_dvd_event (GstDvdSubDec * dec,
|
||||
GstEvent * event);
|
||||
|
@ -41,7 +43,8 @@ static void gst_setup_palette (GstDvdSubDec * dec);
|
|||
static void gst_dvd_sub_dec_merge_title (GstDvdSubDec * dec,
|
||||
GstVideoFrame * frame);
|
||||
static GstClockTime gst_dvd_sub_dec_get_event_delay (GstDvdSubDec * dec);
|
||||
static gboolean gst_dvd_sub_dec_sink_event (GstPad * pad, GstEvent * event);
|
||||
static gboolean gst_dvd_sub_dec_sink_event (GstPad * pad, GstObject * parent,
|
||||
GstEvent * event);
|
||||
static gboolean gst_dvd_sub_dec_sink_setcaps (GstPad * pad, GstCaps * caps);
|
||||
|
||||
static GstFlowReturn gst_send_subtitle_frame (GstDvdSubDec * dec,
|
||||
|
@ -177,18 +180,16 @@ gst_dvd_sub_dec_finalize (GObject * gobject)
|
|||
}
|
||||
|
||||
static gboolean
|
||||
gst_dvd_sub_dec_src_event (GstPad * pad, GstEvent * event)
|
||||
gst_dvd_sub_dec_src_event (GstPad * pad, GstObject * parent, GstEvent * event)
|
||||
{
|
||||
GstDvdSubDec *dec = GST_DVD_SUB_DEC (gst_pad_get_parent (pad));
|
||||
gboolean res = FALSE;
|
||||
|
||||
switch (GST_EVENT_TYPE (event)) {
|
||||
default:
|
||||
res = gst_pad_event_default (pad, event);
|
||||
res = gst_pad_event_default (pad, parent, event);
|
||||
break;
|
||||
}
|
||||
|
||||
gst_object_unref (dec);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
@ -797,14 +798,14 @@ gst_dvd_sub_dec_advance_time (GstDvdSubDec * dec, GstClockTime new_ts)
|
|||
}
|
||||
|
||||
static GstFlowReturn
|
||||
gst_dvd_sub_dec_chain (GstPad * pad, GstBuffer * buf)
|
||||
gst_dvd_sub_dec_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
|
||||
{
|
||||
GstFlowReturn ret = GST_FLOW_OK;
|
||||
GstDvdSubDec *dec;
|
||||
guint8 *data;
|
||||
glong size = 0;
|
||||
|
||||
dec = GST_DVD_SUB_DEC (GST_PAD_PARENT (pad));
|
||||
dec = GST_DVD_SUB_DEC (parent);
|
||||
|
||||
GST_DEBUG_OBJECT (dec, "Have buffer of size %d, ts %"
|
||||
GST_TIME_FORMAT ", dur %" G_GINT64_FORMAT, gst_buffer_get_size (buf),
|
||||
|
@ -938,9 +939,9 @@ beach:
|
|||
}
|
||||
|
||||
static gboolean
|
||||
gst_dvd_sub_dec_sink_event (GstPad * pad, GstEvent * event)
|
||||
gst_dvd_sub_dec_sink_event (GstPad * pad, GstObject * parent, GstEvent * event)
|
||||
{
|
||||
GstDvdSubDec *dec = GST_DVD_SUB_DEC (gst_pad_get_parent (pad));
|
||||
GstDvdSubDec *dec = GST_DVD_SUB_DEC (parent);
|
||||
gboolean ret = FALSE;
|
||||
|
||||
GST_LOG_OBJECT (dec, "%s event", GST_EVENT_TYPE_NAME (event));
|
||||
|
@ -970,7 +971,7 @@ gst_dvd_sub_dec_sink_event (GstPad * pad, GstEvent * event)
|
|||
}
|
||||
}
|
||||
|
||||
ret = gst_pad_event_default (pad, event);
|
||||
ret = gst_pad_event_default (pad, parent, event);
|
||||
break;
|
||||
}
|
||||
case GST_EVENT_SEGMENT:
|
||||
|
@ -1017,7 +1018,7 @@ gst_dvd_sub_dec_sink_event (GstPad * pad, GstEvent * event)
|
|||
GST_DEBUG_OBJECT (dec, "Got newsegment, new time = %"
|
||||
GST_TIME_FORMAT, GST_TIME_ARGS (dec->next_ts));
|
||||
|
||||
ret = gst_pad_event_default (pad, event);
|
||||
ret = gst_pad_event_default (pad, parent, event);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -1033,15 +1034,14 @@ gst_dvd_sub_dec_sink_event (GstPad * pad, GstEvent * event)
|
|||
dec->have_title = FALSE;
|
||||
}
|
||||
|
||||
ret = gst_pad_event_default (pad, event);
|
||||
ret = gst_pad_event_default (pad, parent, event);
|
||||
break;
|
||||
}
|
||||
default:{
|
||||
ret = gst_pad_event_default (pad, event);
|
||||
ret = gst_pad_event_default (pad, parent, event);
|
||||
break;
|
||||
}
|
||||
}
|
||||
gst_object_unref (dec);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
@ -44,8 +44,10 @@ static void gst_dvd_sub_parse_finalize (GObject * object);
|
|||
|
||||
static void gst_dvd_sub_parse_reset (GstDvdSubParse * parse);
|
||||
|
||||
static gboolean gst_dvd_sub_parse_event (GstPad * pad, GstEvent * event);
|
||||
static GstFlowReturn gst_dvd_sub_parse_chain (GstPad * pad, GstBuffer * buf);
|
||||
static gboolean gst_dvd_sub_parse_event (GstPad * pad, GstObject * parent,
|
||||
GstEvent * event);
|
||||
static GstFlowReturn gst_dvd_sub_parse_chain (GstPad * pad, GstObject * parent,
|
||||
GstBuffer * buf);
|
||||
|
||||
static GstStateChangeReturn gst_dvd_sub_parse_change_state (GstElement *
|
||||
element, GstStateChange transition);
|
||||
|
@ -121,12 +123,12 @@ gst_dvd_sub_parse_reset (GstDvdSubParse * parse)
|
|||
}
|
||||
|
||||
static gboolean
|
||||
gst_dvd_sub_parse_event (GstPad * pad, GstEvent * event)
|
||||
gst_dvd_sub_parse_event (GstPad * pad, GstObject * parent, GstEvent * event)
|
||||
{
|
||||
GstDvdSubParse *parse;
|
||||
gboolean ret;
|
||||
|
||||
parse = GST_DVD_SUB_PARSE (gst_pad_get_parent (pad));
|
||||
parse = GST_DVD_SUB_PARSE (parent);
|
||||
|
||||
switch GST_EVENT_TYPE
|
||||
(event) {
|
||||
|
@ -134,19 +136,18 @@ gst_dvd_sub_parse_event (GstPad * pad, GstEvent * event)
|
|||
gst_dvd_sub_parse_reset (parse);
|
||||
/* fall-through */
|
||||
default:
|
||||
ret = gst_pad_event_default (pad, event);
|
||||
ret = gst_pad_event_default (pad, parent, event);
|
||||
break;
|
||||
}
|
||||
|
||||
gst_object_unref (parse);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
static GstFlowReturn
|
||||
gst_dvd_sub_parse_chain (GstPad * pad, GstBuffer * buf)
|
||||
gst_dvd_sub_parse_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
|
||||
{
|
||||
GstDvdSubParse *parse = GST_DVD_SUB_PARSE (GST_PAD_PARENT (pad));
|
||||
GstDvdSubParse *parse = GST_DVD_SUB_PARSE (parent);
|
||||
GstAdapter *adapter;
|
||||
GstBuffer *outbuf = NULL;
|
||||
GstFlowReturn ret = GST_FLOW_OK;
|
||||
|
|
|
@ -66,9 +66,12 @@ G_DEFINE_TYPE (GstRealAudioDemux, gst_real_audio_demux, GST_TYPE_ELEMENT);
|
|||
|
||||
static GstStateChangeReturn gst_real_audio_demux_change_state (GstElement * e,
|
||||
GstStateChange transition);
|
||||
static GstFlowReturn gst_real_audio_demux_chain (GstPad * pad, GstBuffer * buf);
|
||||
static gboolean gst_real_audio_demux_sink_event (GstPad * pad, GstEvent * ev);
|
||||
static gboolean gst_real_audio_demux_src_event (GstPad * pad, GstEvent * ev);
|
||||
static GstFlowReturn gst_real_audio_demux_chain (GstPad * pad,
|
||||
GstObject * parent, GstBuffer * buf);
|
||||
static gboolean gst_real_audio_demux_sink_event (GstPad * pad,
|
||||
GstObject * parent, GstEvent * ev);
|
||||
static gboolean gst_real_audio_demux_src_event (GstPad * pad,
|
||||
GstObject * parent, GstEvent * ev);
|
||||
static gboolean gst_real_audio_demux_src_query (GstPad * pad,
|
||||
GstObject * parent, GstQuery * query);
|
||||
static void gst_real_audio_demux_loop (GstRealAudioDemux * demux);
|
||||
|
@ -581,11 +584,11 @@ gst_real_audio_demux_handle_buffer (GstRealAudioDemux * demux, GstBuffer * buf)
|
|||
}
|
||||
|
||||
static GstFlowReturn
|
||||
gst_real_audio_demux_chain (GstPad * pad, GstBuffer * buf)
|
||||
gst_real_audio_demux_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
|
||||
{
|
||||
GstRealAudioDemux *demux;
|
||||
|
||||
demux = GST_REAL_AUDIO_DEMUX (GST_PAD_PARENT (pad));
|
||||
demux = GST_REAL_AUDIO_DEMUX (parent);
|
||||
|
||||
return gst_real_audio_demux_handle_buffer (demux, buf);
|
||||
}
|
||||
|
@ -709,12 +712,13 @@ pause_task:
|
|||
}
|
||||
|
||||
static gboolean
|
||||
gst_real_audio_demux_sink_event (GstPad * pad, GstEvent * event)
|
||||
gst_real_audio_demux_sink_event (GstPad * pad, GstObject * parent,
|
||||
GstEvent * event)
|
||||
{
|
||||
GstRealAudioDemux *demux;
|
||||
gboolean ret;
|
||||
|
||||
demux = GST_REAL_AUDIO_DEMUX (gst_pad_get_parent (pad));
|
||||
demux = GST_REAL_AUDIO_DEMUX (parent);
|
||||
|
||||
switch (GST_EVENT_TYPE (event)) {
|
||||
case GST_EVENT_SEGMENT:{
|
||||
|
@ -725,11 +729,9 @@ gst_real_audio_demux_sink_event (GstPad * pad, GstEvent * event)
|
|||
break;
|
||||
}
|
||||
default:
|
||||
ret = gst_pad_event_default (pad, event);
|
||||
ret = gst_pad_event_default (pad, parent, event);
|
||||
break;
|
||||
}
|
||||
|
||||
gst_object_unref (demux);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -835,12 +837,13 @@ cannot_do_backwards_playback:
|
|||
}
|
||||
|
||||
static gboolean
|
||||
gst_real_audio_demux_src_event (GstPad * pad, GstEvent * event)
|
||||
gst_real_audio_demux_src_event (GstPad * pad, GstObject * parent,
|
||||
GstEvent * event)
|
||||
{
|
||||
GstRealAudioDemux *demux;
|
||||
gboolean ret = FALSE;
|
||||
|
||||
demux = GST_REAL_AUDIO_DEMUX (gst_pad_get_parent (pad));
|
||||
demux = GST_REAL_AUDIO_DEMUX (parent);
|
||||
|
||||
switch (GST_EVENT_TYPE (event)) {
|
||||
case GST_EVENT_QOS:
|
||||
|
@ -851,11 +854,10 @@ gst_real_audio_demux_src_event (GstPad * pad, GstEvent * event)
|
|||
gst_event_unref (event);
|
||||
break;
|
||||
default:
|
||||
ret = gst_pad_event_default (pad, event);
|
||||
ret = gst_pad_event_default (pad, parent, event);
|
||||
break;
|
||||
}
|
||||
|
||||
gst_object_unref (demux);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
@ -72,8 +72,10 @@ static void gst_rdt_depay_finalize (GObject * object);
|
|||
static GstStateChangeReturn gst_rdt_depay_change_state (GstElement *
|
||||
element, GstStateChange transition);
|
||||
|
||||
static gboolean gst_rdt_depay_sink_event (GstPad * pad, GstEvent * event);
|
||||
static GstFlowReturn gst_rdt_depay_chain (GstPad * pad, GstBuffer * buf);
|
||||
static gboolean gst_rdt_depay_sink_event (GstPad * pad, GstObject * parent,
|
||||
GstEvent * event);
|
||||
static GstFlowReturn gst_rdt_depay_chain (GstPad * pad, GstObject * parent,
|
||||
GstBuffer * buf);
|
||||
|
||||
static void
|
||||
gst_rdt_depay_class_init (GstRDTDepayClass * klass)
|
||||
|
@ -211,12 +213,12 @@ no_header:
|
|||
}
|
||||
|
||||
static gboolean
|
||||
gst_rdt_depay_sink_event (GstPad * pad, GstEvent * event)
|
||||
gst_rdt_depay_sink_event (GstPad * pad, GstObject * parent, GstEvent * event)
|
||||
{
|
||||
GstRDTDepay *depay;
|
||||
gboolean res = TRUE;
|
||||
|
||||
depay = GST_RDT_DEPAY (GST_OBJECT_PARENT (pad));
|
||||
depay = GST_RDT_DEPAY (parent);
|
||||
|
||||
switch (GST_EVENT_TYPE (event)) {
|
||||
case GST_EVENT_CAPS:
|
||||
|
@ -390,7 +392,7 @@ dropping:
|
|||
}
|
||||
|
||||
static GstFlowReturn
|
||||
gst_rdt_depay_chain (GstPad * pad, GstBuffer * buf)
|
||||
gst_rdt_depay_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
|
||||
{
|
||||
GstRDTDepay *rdtdepay;
|
||||
GstFlowReturn ret;
|
||||
|
@ -398,7 +400,7 @@ gst_rdt_depay_chain (GstPad * pad, GstBuffer * buf)
|
|||
gboolean more;
|
||||
GstRDTPacket packet;
|
||||
|
||||
rdtdepay = GST_RDT_DEPAY (GST_PAD_PARENT (pad));
|
||||
rdtdepay = GST_RDT_DEPAY (parent);
|
||||
|
||||
if (GST_BUFFER_IS_DISCONT (buf)) {
|
||||
GST_LOG_OBJECT (rdtdepay, "received discont");
|
||||
|
|
|
@ -134,12 +134,13 @@ static void gst_rdt_manager_release_pad (GstElement * element, GstPad * pad);
|
|||
|
||||
static gboolean gst_rdt_manager_parse_caps (GstRDTManager * rdtmanager,
|
||||
GstRDTManagerSession * session, GstCaps * caps);
|
||||
static gboolean gst_rdt_manager_event_rdt (GstPad * pad, GstEvent * event);
|
||||
static gboolean gst_rdt_manager_event_rdt (GstPad * pad, GstObject * parent,
|
||||
GstEvent * event);
|
||||
|
||||
static GstFlowReturn gst_rdt_manager_chain_rdt (GstPad * pad,
|
||||
GstBuffer * buffer);
|
||||
GstObject * parent, GstBuffer * buffer);
|
||||
static GstFlowReturn gst_rdt_manager_chain_rtcp (GstPad * pad,
|
||||
GstBuffer * buffer);
|
||||
GstObject * parent, GstBuffer * buffer);
|
||||
static void gst_rdt_manager_loop (GstPad * pad);
|
||||
|
||||
static guint gst_rdt_manager_signals[LAST_SIGNAL] = { 0 };
|
||||
|
@ -710,13 +711,13 @@ wrong_rate:
|
|||
}
|
||||
|
||||
static gboolean
|
||||
gst_rdt_manager_event_rdt (GstPad * pad, GstEvent * event)
|
||||
gst_rdt_manager_event_rdt (GstPad * pad, GstObject * parent, GstEvent * event)
|
||||
{
|
||||
GstRDTManager *rdtmanager;
|
||||
GstRDTManagerSession *session;
|
||||
gboolean res;
|
||||
|
||||
rdtmanager = GST_RDT_MANAGER (GST_PAD_PARENT (pad));
|
||||
rdtmanager = GST_RDT_MANAGER (parent);
|
||||
/* find session */
|
||||
session = gst_pad_get_element_private (pad);
|
||||
|
||||
|
@ -731,14 +732,14 @@ gst_rdt_manager_event_rdt (GstPad * pad, GstEvent * event)
|
|||
break;
|
||||
}
|
||||
default:
|
||||
res = gst_pad_event_default (pad, event);
|
||||
res = gst_pad_event_default (pad, parent, event);
|
||||
break;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
static GstFlowReturn
|
||||
gst_rdt_manager_chain_rdt (GstPad * pad, GstBuffer * buffer)
|
||||
gst_rdt_manager_chain_rdt (GstPad * pad, GstObject * parent, GstBuffer * buffer)
|
||||
{
|
||||
GstFlowReturn res;
|
||||
GstRDTManager *rdtmanager;
|
||||
|
@ -749,7 +750,7 @@ gst_rdt_manager_chain_rdt (GstPad * pad, GstBuffer * buffer)
|
|||
guint8 pt;
|
||||
gboolean more;
|
||||
|
||||
rdtmanager = GST_RDT_MANAGER (GST_PAD_PARENT (pad));
|
||||
rdtmanager = GST_RDT_MANAGER (parent);
|
||||
|
||||
GST_DEBUG_OBJECT (rdtmanager, "got RDT packet");
|
||||
|
||||
|
@ -894,7 +895,8 @@ pause:
|
|||
}
|
||||
|
||||
static GstFlowReturn
|
||||
gst_rdt_manager_chain_rtcp (GstPad * pad, GstBuffer * buffer)
|
||||
gst_rdt_manager_chain_rtcp (GstPad * pad, GstObject * parent,
|
||||
GstBuffer * buffer)
|
||||
{
|
||||
GstRDTManager *src;
|
||||
|
||||
|
@ -904,7 +906,7 @@ gst_rdt_manager_chain_rtcp (GstPad * pad, GstBuffer * buffer)
|
|||
gboolean more;
|
||||
#endif
|
||||
|
||||
src = GST_RDT_MANAGER (GST_PAD_PARENT (pad));
|
||||
src = GST_RDT_MANAGER (parent);
|
||||
|
||||
GST_DEBUG_OBJECT (src, "got rtcp packet");
|
||||
|
||||
|
|
|
@ -134,15 +134,18 @@ static void gst_rmdemux_init (GstRMDemux * rmdemux);
|
|||
static void gst_rmdemux_finalize (GObject * object);
|
||||
static GstStateChangeReturn gst_rmdemux_change_state (GstElement * element,
|
||||
GstStateChange transition);
|
||||
static GstFlowReturn gst_rmdemux_chain (GstPad * pad, GstBuffer * buffer);
|
||||
static GstFlowReturn gst_rmdemux_chain (GstPad * pad, GstObject * parent,
|
||||
GstBuffer * buffer);
|
||||
static void gst_rmdemux_loop (GstPad * pad);
|
||||
static gboolean gst_rmdemux_sink_activate (GstPad * sinkpad);
|
||||
static gboolean gst_rmdemux_sink_activate_push (GstPad * sinkpad,
|
||||
gboolean active);
|
||||
static gboolean gst_rmdemux_sink_activate_pull (GstPad * sinkpad,
|
||||
gboolean active);
|
||||
static gboolean gst_rmdemux_sink_event (GstPad * pad, GstEvent * event);
|
||||
static gboolean gst_rmdemux_src_event (GstPad * pad, GstEvent * event);
|
||||
static gboolean gst_rmdemux_sink_event (GstPad * pad, GstObject * parent,
|
||||
GstEvent * event);
|
||||
static gboolean gst_rmdemux_src_event (GstPad * pad, GstObject * parent,
|
||||
GstEvent * event);
|
||||
static void gst_rmdemux_send_event (GstRMDemux * rmdemux, GstEvent * event);
|
||||
static gboolean gst_rmdemux_src_query (GstPad * pad, GstObject * parent,
|
||||
GstQuery * query);
|
||||
|
@ -267,35 +270,28 @@ gst_rmdemux_init (GstRMDemux * rmdemux)
|
|||
}
|
||||
|
||||
static gboolean
|
||||
gst_rmdemux_sink_event (GstPad * pad, GstEvent * event)
|
||||
gst_rmdemux_sink_event (GstPad * pad, GstObject * parent, GstEvent * event)
|
||||
{
|
||||
GstRMDemux *rmdemux;
|
||||
gboolean ret;
|
||||
|
||||
rmdemux = GST_RMDEMUX (gst_pad_get_parent (pad));
|
||||
|
||||
GST_LOG_OBJECT (pad, "%s event", GST_EVENT_TYPE_NAME (event));
|
||||
|
||||
switch (GST_EVENT_TYPE (event)) {
|
||||
case GST_EVENT_SEGMENT:
|
||||
gst_event_unref (event);
|
||||
ret = TRUE;
|
||||
break;
|
||||
default:
|
||||
ret = gst_pad_event_default (pad, event);
|
||||
ret = gst_pad_event_default (pad, parent, event);
|
||||
break;
|
||||
}
|
||||
|
||||
gst_object_unref (rmdemux);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gst_rmdemux_src_event (GstPad * pad, GstEvent * event)
|
||||
gst_rmdemux_src_event (GstPad * pad, GstObject * parent, GstEvent * event)
|
||||
{
|
||||
gboolean ret = TRUE;
|
||||
|
||||
GstRMDemux *rmdemux = GST_RMDEMUX (GST_PAD_PARENT (pad));
|
||||
GstRMDemux *rmdemux = GST_RMDEMUX (parent);
|
||||
|
||||
GST_LOG_OBJECT (rmdemux, "handling src event");
|
||||
|
||||
|
@ -330,7 +326,7 @@ gst_rmdemux_src_event (GstPad * pad, GstEvent * event)
|
|||
}
|
||||
default:
|
||||
GST_LOG_OBJECT (rmdemux, "Event on src: type=%d", GST_EVENT_TYPE (event));
|
||||
ret = gst_pad_event_default (pad, event);
|
||||
ret = gst_pad_event_default (pad, parent, event);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -869,7 +865,7 @@ gst_rmdemux_loop (GstPad * pad)
|
|||
}
|
||||
|
||||
/* Defer to the chain function */
|
||||
ret = gst_rmdemux_chain (pad, buffer);
|
||||
ret = gst_rmdemux_chain (pad, GST_OBJECT_CAST (rmdemux), buffer);
|
||||
if (ret != GST_FLOW_OK) {
|
||||
GST_DEBUG_OBJECT (rmdemux, "Chain flow failed at offset 0x%08x",
|
||||
rmdemux->offset);
|
||||
|
@ -958,14 +954,14 @@ gst_rmdemux_fourcc_isplausible (guint32 fourcc)
|
|||
}
|
||||
|
||||
static GstFlowReturn
|
||||
gst_rmdemux_chain (GstPad * pad, GstBuffer * buffer)
|
||||
gst_rmdemux_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer)
|
||||
{
|
||||
GstFlowReturn ret = GST_FLOW_OK;
|
||||
const guint8 *data;
|
||||
guint16 version;
|
||||
guint avail;
|
||||
|
||||
GstRMDemux *rmdemux = GST_RMDEMUX (GST_PAD_PARENT (pad));
|
||||
GstRMDemux *rmdemux = GST_RMDEMUX (parent);
|
||||
|
||||
if (rmdemux->base_ts == -1) {
|
||||
rmdemux->base_ts = GST_BUFFER_TIMESTAMP (buffer);
|
||||
|
|
Loading…
Reference in a new issue