add parent to activate functions

This commit is contained in:
Wim Taymans 2011-11-18 13:59:59 +01:00
parent 152e090891
commit c1b511f5db

View file

@ -126,11 +126,12 @@ static GstFlowReturn gst_ffmpegdemux_chain (GstPad * sinkpad,
GstObject * parent, GstBuffer * buf); GstObject * parent, GstBuffer * buf);
static void gst_ffmpegdemux_loop (GstFFMpegDemux * demux); static void gst_ffmpegdemux_loop (GstFFMpegDemux * demux);
static gboolean gst_ffmpegdemux_sink_activate (GstPad * sinkpad); static gboolean gst_ffmpegdemux_sink_activate (GstPad * sinkpad,
static gboolean GstObject * parent);
gst_ffmpegdemux_sink_activate_pull (GstPad * sinkpad, gboolean active); static gboolean gst_ffmpegdemux_sink_activate_pull (GstPad * sinkpad,
static gboolean GstObject * parent, gboolean active);
gst_ffmpegdemux_sink_activate_push (GstPad * sinkpad, gboolean active); static gboolean gst_ffmpegdemux_sink_activate_push (GstPad * sinkpad,
GstObject * parent, gboolean active);
#if 0 #if 0
static gboolean static gboolean
@ -1690,7 +1691,7 @@ ignore:
} }
static gboolean static gboolean
gst_ffmpegdemux_sink_activate (GstPad * sinkpad) gst_ffmpegdemux_sink_activate (GstPad * sinkpad, GstObject * parent)
{ {
GstQuery *query; GstQuery *query;
gboolean pull_mode; gboolean pull_mode;
@ -1723,12 +1724,13 @@ activate_push:
* - (independently managed) task driving ffmpeg * - (independently managed) task driving ffmpeg
*/ */
static gboolean static gboolean
gst_ffmpegdemux_sink_activate_push (GstPad * sinkpad, gboolean active) gst_ffmpegdemux_sink_activate_push (GstPad * sinkpad, GstObject * parent,
gboolean active)
{ {
GstFFMpegDemux *demux; GstFFMpegDemux *demux;
gboolean res = FALSE; gboolean res = FALSE;
demux = (GstFFMpegDemux *) (gst_pad_get_parent (sinkpad)); demux = (GstFFMpegDemux *) (parent);
if (active) { if (active) {
if (demux->can_push == FALSE) { if (demux->can_push == FALSE) {
@ -1760,8 +1762,6 @@ gst_ffmpegdemux_sink_activate_push (GstPad * sinkpad, gboolean active)
} }
beach: beach:
gst_object_unref (demux);
return res; return res;
} }
@ -1771,12 +1771,13 @@ beach:
* - task driving ffmpeg based on sink pad * - task driving ffmpeg based on sink pad
*/ */
static gboolean static gboolean
gst_ffmpegdemux_sink_activate_pull (GstPad * sinkpad, gboolean active) gst_ffmpegdemux_sink_activate_pull (GstPad * sinkpad, GstObject * parent,
gboolean active)
{ {
GstFFMpegDemux *demux; GstFFMpegDemux *demux;
gboolean res; gboolean res;
demux = (GstFFMpegDemux *) (gst_pad_get_parent (sinkpad)); demux = (GstFFMpegDemux *) parent;
if (active) { if (active) {
demux->seekable = TRUE; demux->seekable = TRUE;
@ -1787,8 +1788,6 @@ gst_ffmpegdemux_sink_activate_pull (GstPad * sinkpad, gboolean active)
demux->seekable = FALSE; demux->seekable = FALSE;
} }
gst_object_unref (demux);
return res; return res;
} }