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>
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_setcaps),
......
common @ 54886902
Subproject commit 8ff526a316f9b576e727b8e32cba0a53cdec07a6
Subproject commit 54886902497be267fe1f1a3f9c4dc0245bc46175
......@@ -102,7 +102,8 @@ static GstPadLinkReturn
gst_ffmpegcsp_pad_link (GstPad * pad, const GstCaps * caps);
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 GstElementClass *parent_class = NULL;
......@@ -384,15 +385,15 @@ gst_ffmpegcsp_chain (GstPad * pad, GstData * data)
gst_pad_push (space->srcpad, GST_DATA (outbuf));
}
static GstElementStateReturn
gst_ffmpegcsp_change_state (GstElement * element)
static GstStateChangeReturn
gst_ffmpegcsp_change_state (GstElement * element, GstStateChange transition)
{
GstFFMpegCsp *space;
space = GST_FFMPEGCSP (element);
switch (GST_STATE_TRANSITION (element)) {
case GST_STATE_PAUSED_TO_READY:
switch (transition) {
case GST_STATE_CHANGE_PAUSED_TO_READY:
if (space->palette)
av_free (space->palette);
space->palette = NULL;
......@@ -400,9 +401,9 @@ gst_ffmpegcsp_change_state (GstElement * element)
}
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
......
......@@ -125,7 +125,8 @@ static gboolean gst_ffmpegdec_setcaps (GstPad * pad, GstCaps * caps);
static gboolean gst_ffmpegdec_sink_event (GstPad * pad, GstEvent * event);
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,
guint prop_id, const GValue * value, GParamSpec * pspec);
......@@ -1071,17 +1072,16 @@ not_negotiated:
}
}
static GstElementStateReturn
gst_ffmpegdec_change_state (GstElement * element)
static GstStateChangeReturn
gst_ffmpegdec_change_state (GstElement * element, GstStateChange transition)
{
GstFFMpegDec *ffmpegdec = (GstFFMpegDec *) element;
gint transition = GST_STATE_TRANSITION (element);
GstElementStateReturn ret;
GstStateChangeReturn ret;
ret = GST_ELEMENT_CLASS (parent_class)->change_state (element);
ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
switch (transition) {
case GST_STATE_PAUSED_TO_READY:
case GST_STATE_CHANGE_PAUSED_TO_READY:
gst_ffmpegdec_close (ffmpegdec);
if (ffmpegdec->last_buffer != NULL) {
gst_buffer_unref (ffmpegdec->last_buffer);
......
......@@ -119,7 +119,8 @@ static GstPadLinkReturn
gst_ffmpegdeinterlace_pad_link (GstPad * pad, const GstCaps * caps);
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;
......@@ -306,22 +307,22 @@ 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)
{
GstFFMpegDeinterlace *deinterlace;
deinterlace = GST_FFMPEGDEINTERLACE (element);
switch (GST_STATE_TRANSITION (element)) {
case GST_STATE_READY_TO_NULL:
switch (transition) {
case GST_STATE_CHANGE_READY_TO_NULL:
break;
}
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
......
......@@ -103,8 +103,8 @@ static void gst_ffmpegdemux_init (GstFFMpegDemux * demux);
static void gst_ffmpegdemux_loop (GstElement * element);
static GstElementStateReturn
gst_ffmpegdemux_change_state (GstElement * element);
static GstStateChangeReturn
gst_ffmpegdemux_change_state (GstElement * element, GstStateChange transition);
static GstElementClass *parent_class = NULL;
......@@ -672,22 +672,21 @@ gst_ffmpegdemux_loop (GstElement * element)
pkt.destruct (&pkt);
}
static GstElementStateReturn
gst_ffmpegdemux_change_state (GstElement * element)
static GstStateChangeReturn
gst_ffmpegdemux_change_state (GstElement * element, GstStateChange transition)
{
GstFFMpegDemux *demux = (GstFFMpegDemux *) (element);
gint transition = GST_STATE_TRANSITION (element);
switch (transition) {
case GST_STATE_PAUSED_TO_READY:
case GST_STATE_CHANGE_PAUSED_TO_READY:
gst_ffmpegdemux_close (demux);
break;
}
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
......
......@@ -142,7 +142,8 @@ static void gst_ffmpegenc_set_property (GObject * object,
static void gst_ffmpegenc_get_property (GObject * object,
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;
......@@ -655,22 +656,21 @@ gst_ffmpegenc_get_property (GObject * object,
}
}
static GstElementStateReturn
gst_ffmpegenc_change_state (GstElement * element)
static GstStateChangeReturn
gst_ffmpegenc_change_state (GstElement * element, GstStateChange transition)
{
GstFFMpegEnc *ffmpegenc = (GstFFMpegEnc *) element;
gint transition = GST_STATE_TRANSITION (element);
GstElementStateReturn result;
GstStateChangeReturn result;
switch (transition) {
default:
break;
}
result = GST_ELEMENT_CLASS (parent_class)->change_state (element);
result = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
switch (transition) {
case GST_STATE_PAUSED_TO_READY:
case GST_STATE_CHANGE_PAUSED_TO_READY:
if (ffmpegenc->opened) {
avcodec_close (ffmpegenc->context);
ffmpegenc->opened = FALSE;
......
......@@ -105,7 +105,8 @@ static GstPad *gst_ffmpegmux_request_new_pad (GstElement * element,
GstPadTemplate * templ, const gchar * name);
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;
......@@ -507,14 +508,13 @@ gst_ffmpegmux_loop (GstElement * element)
}
}
static GstElementStateReturn
gst_ffmpegmux_change_state (GstElement * element)
static GstStateChangeReturn
gst_ffmpegmux_change_state (GstElement * element, GstStateChange transition)
{
GstFFMpegMux *ffmpegmux = (GstFFMpegMux *) (element);
gint transition = GST_STATE_TRANSITION (element);
switch (transition) {
case GST_STATE_PAUSED_TO_READY:
case GST_STATE_CHANGE_PAUSED_TO_READY:
if (ffmpegmux->tags) {
gst_tag_list_free (ffmpegmux->tags);
ffmpegmux->tags = NULL;
......@@ -527,9 +527,9 @@ gst_ffmpegmux_change_state (GstElement * element)
}
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 *
......
......@@ -123,7 +123,8 @@ static GstPadLinkReturn
gst_ffmpegscale_pad_link (GstPad * pad, const GstCaps * caps);
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;
......@@ -387,24 +388,24 @@ 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)
{
GstFFMpegScale *scale;
scale = GST_FFMPEGSCALE (element);
switch (GST_STATE_TRANSITION (element)) {
case GST_STATE_READY_TO_NULL:
switch (transition) {
case GST_STATE_CHANGE_READY_TO_NULL:
if (scale->res != NULL)
img_resample_close (scale->res);
break;
}
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
......
......@@ -122,7 +122,8 @@ static GstPadLinkReturn gst_postproc_link (GstPad * pad, const GstCaps * caps);
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,
const GValue * value,
......@@ -392,22 +393,22 @@ 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)
{
GstPostProc *postproc = (GstPostProc *) element;
/* don't go to play if we don't have mode and context */
switch (GST_STATE_TRANSITION (element)) {
case GST_STATE_PAUSED_TO_PLAYING:
switch (transition) {
case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
if ((!postproc->mode) && (!postproc->context))
return GST_STATE_FAILURE;
return GST_STATE_CHANGE_FAILURE;
}
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
......
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