Commit a02a444d authored by Andy Wingo Wingo's avatar Andy Wingo Wingo

Update for state change type and macro changes.

Original commit message from CVS:
2005-09-05  Andy Wingo  <wingo@pobox.com>

* Update for state change type and macro changes.
parent 0c539256
2005-09-05 Andy Wingo <wingo@pobox.com>
* Update for state change type and macro changes.
2005-08-19 Wim Taymans <wim@fluendo.com> 2005-08-19 Wim Taymans <wim@fluendo.com>
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_setcaps), * ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_setcaps),
......
common @ 54886902
Subproject commit 8ff526a316f9b576e727b8e32cba0a53cdec07a6 Subproject commit 54886902497be267fe1f1a3f9c4dc0245bc46175
...@@ -102,7 +102,8 @@ static GstPadLinkReturn ...@@ -102,7 +102,8 @@ static GstPadLinkReturn
gst_ffmpegcsp_pad_link (GstPad * pad, const GstCaps * caps); gst_ffmpegcsp_pad_link (GstPad * pad, const GstCaps * caps);
static void gst_ffmpegcsp_chain (GstPad * pad, GstData * data); static void gst_ffmpegcsp_chain (GstPad * pad, GstData * data);
static GstElementStateReturn gst_ffmpegcsp_change_state (GstElement * element); static GstStateChangeReturn gst_ffmpegcsp_change_state (GstElement * element,
GstStateChange transition);
static GstPadTemplate *srctempl, *sinktempl; static GstPadTemplate *srctempl, *sinktempl;
static GstElementClass *parent_class = NULL; static GstElementClass *parent_class = NULL;
...@@ -384,15 +385,15 @@ gst_ffmpegcsp_chain (GstPad * pad, GstData * data) ...@@ -384,15 +385,15 @@ gst_ffmpegcsp_chain (GstPad * pad, GstData * data)
gst_pad_push (space->srcpad, GST_DATA (outbuf)); gst_pad_push (space->srcpad, GST_DATA (outbuf));
} }
static GstElementStateReturn static GstStateChangeReturn
gst_ffmpegcsp_change_state (GstElement * element) gst_ffmpegcsp_change_state (GstElement * element, GstStateChange transition)
{ {
GstFFMpegCsp *space; GstFFMpegCsp *space;
space = GST_FFMPEGCSP (element); space = GST_FFMPEGCSP (element);
switch (GST_STATE_TRANSITION (element)) { switch (transition) {
case GST_STATE_PAUSED_TO_READY: case GST_STATE_CHANGE_PAUSED_TO_READY:
if (space->palette) if (space->palette)
av_free (space->palette); av_free (space->palette);
space->palette = NULL; space->palette = NULL;
...@@ -400,9 +401,9 @@ gst_ffmpegcsp_change_state (GstElement * element) ...@@ -400,9 +401,9 @@ gst_ffmpegcsp_change_state (GstElement * element)
} }
if (parent_class->change_state) if (parent_class->change_state)
return parent_class->change_state (element); return parent_class->change_state (element, transition);
return GST_STATE_SUCCESS; return GST_STATE_CHANGE_SUCCESS;
} }
static void static void
......
...@@ -125,7 +125,8 @@ static gboolean gst_ffmpegdec_setcaps (GstPad * pad, GstCaps * caps); ...@@ -125,7 +125,8 @@ static gboolean gst_ffmpegdec_setcaps (GstPad * pad, GstCaps * caps);
static gboolean gst_ffmpegdec_sink_event (GstPad * pad, GstEvent * event); static gboolean gst_ffmpegdec_sink_event (GstPad * pad, GstEvent * event);
static GstFlowReturn gst_ffmpegdec_chain (GstPad * pad, GstBuffer * buf); static GstFlowReturn gst_ffmpegdec_chain (GstPad * pad, GstBuffer * buf);
static GstElementStateReturn gst_ffmpegdec_change_state (GstElement * element); static GstStateChangeReturn gst_ffmpegdec_change_state (GstElement * element,
GstStateChange transition);
static void gst_ffmpegdec_set_property (GObject * object, static void gst_ffmpegdec_set_property (GObject * object,
guint prop_id, const GValue * value, GParamSpec * pspec); guint prop_id, const GValue * value, GParamSpec * pspec);
...@@ -1071,17 +1072,16 @@ not_negotiated: ...@@ -1071,17 +1072,16 @@ not_negotiated:
} }
} }
static GstElementStateReturn static GstStateChangeReturn
gst_ffmpegdec_change_state (GstElement * element) gst_ffmpegdec_change_state (GstElement * element, GstStateChange transition)
{ {
GstFFMpegDec *ffmpegdec = (GstFFMpegDec *) element; GstFFMpegDec *ffmpegdec = (GstFFMpegDec *) element;
gint transition = GST_STATE_TRANSITION (element); GstStateChangeReturn ret;
GstElementStateReturn ret;
ret = GST_ELEMENT_CLASS (parent_class)->change_state (element); ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
switch (transition) { switch (transition) {
case GST_STATE_PAUSED_TO_READY: case GST_STATE_CHANGE_PAUSED_TO_READY:
gst_ffmpegdec_close (ffmpegdec); gst_ffmpegdec_close (ffmpegdec);
if (ffmpegdec->last_buffer != NULL) { if (ffmpegdec->last_buffer != NULL) {
gst_buffer_unref (ffmpegdec->last_buffer); gst_buffer_unref (ffmpegdec->last_buffer);
......
...@@ -119,7 +119,8 @@ static GstPadLinkReturn ...@@ -119,7 +119,8 @@ static GstPadLinkReturn
gst_ffmpegdeinterlace_pad_link (GstPad * pad, const GstCaps * caps); gst_ffmpegdeinterlace_pad_link (GstPad * pad, const GstCaps * caps);
static void gst_ffmpegdeinterlace_chain (GstPad * pad, GstData * data); static void gst_ffmpegdeinterlace_chain (GstPad * pad, GstData * data);
static GstElementStateReturn gst_ffmpegdeinterlace_change_state (GstElement * element); static GstStateChangeReturn gst_ffmpegdeinterlace_change_state (GstElement * element,
GstStateChange transition);
static GstElementClass *parent_class = NULL; static GstElementClass *parent_class = NULL;
...@@ -306,22 +307,22 @@ gst_ffmpegdeinterlace_chain (GstPad * pad, GstData * data) ...@@ -306,22 +307,22 @@ gst_ffmpegdeinterlace_chain (GstPad * pad, GstData * data)
} }
static GstElementStateReturn static GstStateChangeReturn
gst_ffmpegdeinterlace_change_state (GstElement * element) gst_ffmpegdeinterlace_change_state (GstElement * element, GstStateChange transition)
{ {
GstFFMpegDeinterlace *deinterlace; GstFFMpegDeinterlace *deinterlace;
deinterlace = GST_FFMPEGDEINTERLACE (element); deinterlace = GST_FFMPEGDEINTERLACE (element);
switch (GST_STATE_TRANSITION (element)) { switch (transition) {
case GST_STATE_READY_TO_NULL: case GST_STATE_CHANGE_READY_TO_NULL:
break; break;
} }
if (parent_class->change_state) if (parent_class->change_state)
return parent_class->change_state (element); return parent_class->change_state (element, transition);
return GST_STATE_SUCCESS; return GST_STATE_CHANGE_SUCCESS;
} }
static void static void
......
...@@ -103,8 +103,8 @@ static void gst_ffmpegdemux_init (GstFFMpegDemux * demux); ...@@ -103,8 +103,8 @@ static void gst_ffmpegdemux_init (GstFFMpegDemux * demux);
static void gst_ffmpegdemux_loop (GstElement * element); static void gst_ffmpegdemux_loop (GstElement * element);
static GstElementStateReturn static GstStateChangeReturn
gst_ffmpegdemux_change_state (GstElement * element); gst_ffmpegdemux_change_state (GstElement * element, GstStateChange transition);
static GstElementClass *parent_class = NULL; static GstElementClass *parent_class = NULL;
...@@ -672,22 +672,21 @@ gst_ffmpegdemux_loop (GstElement * element) ...@@ -672,22 +672,21 @@ gst_ffmpegdemux_loop (GstElement * element)
pkt.destruct (&pkt); pkt.destruct (&pkt);
} }
static GstElementStateReturn static GstStateChangeReturn
gst_ffmpegdemux_change_state (GstElement * element) gst_ffmpegdemux_change_state (GstElement * element, GstStateChange transition)
{ {
GstFFMpegDemux *demux = (GstFFMpegDemux *) (element); GstFFMpegDemux *demux = (GstFFMpegDemux *) (element);
gint transition = GST_STATE_TRANSITION (element);
switch (transition) { switch (transition) {
case GST_STATE_PAUSED_TO_READY: case GST_STATE_CHANGE_PAUSED_TO_READY:
gst_ffmpegdemux_close (demux); gst_ffmpegdemux_close (demux);
break; break;
} }
if (GST_ELEMENT_CLASS (parent_class)->change_state) if (GST_ELEMENT_CLASS (parent_class)->change_state)
return GST_ELEMENT_CLASS (parent_class)->change_state (element); return GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
return GST_STATE_SUCCESS; return GST_STATE_CHANGE_SUCCESS;
} }
gboolean gboolean
......
...@@ -142,7 +142,8 @@ static void gst_ffmpegenc_set_property (GObject * object, ...@@ -142,7 +142,8 @@ static void gst_ffmpegenc_set_property (GObject * object,
static void gst_ffmpegenc_get_property (GObject * object, static void gst_ffmpegenc_get_property (GObject * object,
guint prop_id, GValue * value, GParamSpec * pspec); guint prop_id, GValue * value, GParamSpec * pspec);
static GstElementStateReturn gst_ffmpegenc_change_state (GstElement * element); static GstStateChangeReturn gst_ffmpegenc_change_state (GstElement * element,
GstStateChange transition);
static GstElementClass *parent_class = NULL; static GstElementClass *parent_class = NULL;
...@@ -655,22 +656,21 @@ gst_ffmpegenc_get_property (GObject * object, ...@@ -655,22 +656,21 @@ gst_ffmpegenc_get_property (GObject * object,
} }
} }
static GstElementStateReturn static GstStateChangeReturn
gst_ffmpegenc_change_state (GstElement * element) gst_ffmpegenc_change_state (GstElement * element, GstStateChange transition)
{ {
GstFFMpegEnc *ffmpegenc = (GstFFMpegEnc *) element; GstFFMpegEnc *ffmpegenc = (GstFFMpegEnc *) element;
gint transition = GST_STATE_TRANSITION (element); GstStateChangeReturn result;
GstElementStateReturn result;
switch (transition) { switch (transition) {
default: default:
break; break;
} }
result = GST_ELEMENT_CLASS (parent_class)->change_state (element); result = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
switch (transition) { switch (transition) {
case GST_STATE_PAUSED_TO_READY: case GST_STATE_CHANGE_PAUSED_TO_READY:
if (ffmpegenc->opened) { if (ffmpegenc->opened) {
avcodec_close (ffmpegenc->context); avcodec_close (ffmpegenc->context);
ffmpegenc->opened = FALSE; ffmpegenc->opened = FALSE;
......
...@@ -105,7 +105,8 @@ static GstPad *gst_ffmpegmux_request_new_pad (GstElement * element, ...@@ -105,7 +105,8 @@ static GstPad *gst_ffmpegmux_request_new_pad (GstElement * element,
GstPadTemplate * templ, const gchar * name); GstPadTemplate * templ, const gchar * name);
static void gst_ffmpegmux_loop (GstElement * element); static void gst_ffmpegmux_loop (GstElement * element);
static GstElementStateReturn gst_ffmpegmux_change_state (GstElement * element); static GstStateChangeReturn gst_ffmpegmux_change_state (GstElement * element,
GstStateChange transition);
static GstElementClass *parent_class = NULL; static GstElementClass *parent_class = NULL;
...@@ -507,14 +508,13 @@ gst_ffmpegmux_loop (GstElement * element) ...@@ -507,14 +508,13 @@ gst_ffmpegmux_loop (GstElement * element)
} }
} }
static GstElementStateReturn static GstStateChangeReturn
gst_ffmpegmux_change_state (GstElement * element) gst_ffmpegmux_change_state (GstElement * element, GstStateChange transition)
{ {
GstFFMpegMux *ffmpegmux = (GstFFMpegMux *) (element); GstFFMpegMux *ffmpegmux = (GstFFMpegMux *) (element);
gint transition = GST_STATE_TRANSITION (element);
switch (transition) { switch (transition) {
case GST_STATE_PAUSED_TO_READY: case GST_STATE_CHANGE_PAUSED_TO_READY:
if (ffmpegmux->tags) { if (ffmpegmux->tags) {
gst_tag_list_free (ffmpegmux->tags); gst_tag_list_free (ffmpegmux->tags);
ffmpegmux->tags = NULL; ffmpegmux->tags = NULL;
...@@ -527,9 +527,9 @@ gst_ffmpegmux_change_state (GstElement * element) ...@@ -527,9 +527,9 @@ gst_ffmpegmux_change_state (GstElement * element)
} }
if (GST_ELEMENT_CLASS (parent_class)->change_state) if (GST_ELEMENT_CLASS (parent_class)->change_state)
return GST_ELEMENT_CLASS (parent_class)->change_state (element); return GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
return GST_STATE_SUCCESS; return GST_STATE_CHANGE_SUCCESS;
} }
GstCaps * GstCaps *
......
...@@ -123,7 +123,8 @@ static GstPadLinkReturn ...@@ -123,7 +123,8 @@ static GstPadLinkReturn
gst_ffmpegscale_pad_link (GstPad * pad, const GstCaps * caps); gst_ffmpegscale_pad_link (GstPad * pad, const GstCaps * caps);
static void gst_ffmpegscale_chain (GstPad * pad, GstData * data); static void gst_ffmpegscale_chain (GstPad * pad, GstData * data);
static GstElementStateReturn gst_ffmpegscale_change_state (GstElement * element); static GstStateChangeReturn gst_ffmpegscale_change_state (GstElement * element,
GstStateChange transition);
static GstElementClass *parent_class = NULL; static GstElementClass *parent_class = NULL;
...@@ -387,24 +388,24 @@ gst_ffmpegscale_chain (GstPad * pad, GstData * data) ...@@ -387,24 +388,24 @@ gst_ffmpegscale_chain (GstPad * pad, GstData * data)
} }
static GstElementStateReturn static GstStateChangeReturn
gst_ffmpegscale_change_state (GstElement * element) gst_ffmpegscale_change_state (GstElement * element, GstStateChange transition)
{ {
GstFFMpegScale *scale; GstFFMpegScale *scale;
scale = GST_FFMPEGSCALE (element); scale = GST_FFMPEGSCALE (element);
switch (GST_STATE_TRANSITION (element)) { switch (transition) {
case GST_STATE_READY_TO_NULL: case GST_STATE_CHANGE_READY_TO_NULL:
if (scale->res != NULL) if (scale->res != NULL)
img_resample_close (scale->res); img_resample_close (scale->res);
break; break;
} }
if (parent_class->change_state) if (parent_class->change_state)
return parent_class->change_state (element); return parent_class->change_state (element, transition);
return GST_STATE_SUCCESS; return GST_STATE_CHANGE_SUCCESS;
} }
static void static void
......
...@@ -122,7 +122,8 @@ static GstPadLinkReturn gst_postproc_link (GstPad * pad, const GstCaps * caps); ...@@ -122,7 +122,8 @@ static GstPadLinkReturn gst_postproc_link (GstPad * pad, const GstCaps * caps);
static void gst_postproc_chain (GstPad * pad, GstData * data); static void gst_postproc_chain (GstPad * pad, GstData * data);
static GstElementStateReturn gst_postproc_change_state (GstElement * element); static GstStateChangeReturn gst_postproc_change_state (GstElement * element,
GstStateChange transition);
static void gst_postproc_set_property ( GObject * object, guint prop_id, static void gst_postproc_set_property ( GObject * object, guint prop_id,
const GValue * value, const GValue * value,
...@@ -392,22 +393,22 @@ gst_postproc_chain (GstPad * pad, GstData * data) ...@@ -392,22 +393,22 @@ gst_postproc_chain (GstPad * pad, GstData * data)
} }
static GstElementStateReturn static GstStateChangeReturn
gst_postproc_change_state (GstElement * element) gst_postproc_change_state (GstElement * element, GstStateChange transition)
{ {
GstPostProc *postproc = (GstPostProc *) element; GstPostProc *postproc = (GstPostProc *) element;
/* don't go to play if we don't have mode and context */ /* don't go to play if we don't have mode and context */
switch (GST_STATE_TRANSITION (element)) { switch (transition) {
case GST_STATE_PAUSED_TO_PLAYING: case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
if ((!postproc->mode) && (!postproc->context)) if ((!postproc->mode) && (!postproc->context))
return GST_STATE_FAILURE; return GST_STATE_CHANGE_FAILURE;
} }
if (parent_class->change_state) if (parent_class->change_state)
return parent_class->change_state (element); return parent_class->change_state (element, transition);
return GST_STATE_SUCCESS; return GST_STATE_CHANGE_SUCCESS;
} }
static void static void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment