2003-04-22 14:55:12 +00:00
|
|
|
/* GStreamer xvid decoder plugin
|
|
|
|
* Copyright (C) 2003 Ronald Bultje <rbultje@ronald.bitfreak.net>
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <string.h>
|
Update xvid plugin to latest xvid (1.0.0-beta3) API.
Original commit message from CVS:
2004-01-03 Ronald Bultje <rbultje@ronald.bitfreak.net>
reviewed by: <delete if not using a buddy>
* configure.ac:
* ext/xvid/gstxvid.c: (gst_xvid_init), (gst_xvid_error),
(gst_xvid_structure_to_csp), (gst_xvid_csp_to_caps):
* ext/xvid/gstxvid.h:
* ext/xvid/gstxviddec.c: (gst_xviddec_class_init),
(gst_xviddec_init), (gst_xviddec_setup), (gst_xviddec_chain),
(gst_xviddec_src_link), (gst_xviddec_sink_link),
(gst_xviddec_change_state):
* ext/xvid/gstxviddec.h:
* ext/xvid/gstxvidenc.c: (gst_xvidenc_profile_get_type),
(gst_xvidenc_base_init), (gst_xvidenc_class_init),
(gst_xvidenc_init), (gst_xvidenc_setup), (gst_xvidenc_chain),
(gst_xvidenc_link), (gst_xvidenc_set_property),
(gst_xvidenc_get_property), (gst_xvidenc_change_state):
* ext/xvid/gstxvidenc.h:
Update xvid plugin to latest xvid (1.0.0-beta3) API.
2004-01-03 19:38:40 +00:00
|
|
|
#include <xvid.h>
|
|
|
|
|
2003-04-22 14:55:12 +00:00
|
|
|
#include <gst/video/video.h>
|
Update xvid plugin to latest xvid (1.0.0-beta3) API.
Original commit message from CVS:
2004-01-03 Ronald Bultje <rbultje@ronald.bitfreak.net>
reviewed by: <delete if not using a buddy>
* configure.ac:
* ext/xvid/gstxvid.c: (gst_xvid_init), (gst_xvid_error),
(gst_xvid_structure_to_csp), (gst_xvid_csp_to_caps):
* ext/xvid/gstxvid.h:
* ext/xvid/gstxviddec.c: (gst_xviddec_class_init),
(gst_xviddec_init), (gst_xviddec_setup), (gst_xviddec_chain),
(gst_xviddec_src_link), (gst_xviddec_sink_link),
(gst_xviddec_change_state):
* ext/xvid/gstxviddec.h:
* ext/xvid/gstxvidenc.c: (gst_xvidenc_profile_get_type),
(gst_xvidenc_base_init), (gst_xvidenc_class_init),
(gst_xvidenc_init), (gst_xvidenc_setup), (gst_xvidenc_chain),
(gst_xvidenc_link), (gst_xvidenc_set_property),
(gst_xvidenc_get_property), (gst_xvidenc_change_state):
* ext/xvid/gstxvidenc.h:
Update xvid plugin to latest xvid (1.0.0-beta3) API.
2004-01-03 19:38:40 +00:00
|
|
|
#include "gstxviddec.h"
|
2003-04-22 14:55:12 +00:00
|
|
|
|
|
|
|
/* elementfactory information */
|
2006-04-06 11:35:26 +00:00
|
|
|
GstElementDetails gst_xviddec_details =
|
|
|
|
GST_ELEMENT_DETAILS ("XviD video decoder",
|
|
|
|
"Codec/Decoder/Video",
|
|
|
|
"XviD decoder based on xvidcore",
|
|
|
|
"Ronald Bultje <rbultje@ronald.bitfreak.net>");
|
2003-04-22 14:55:12 +00:00
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink",
|
|
|
|
GST_PAD_SINK,
|
|
|
|
GST_PAD_ALWAYS,
|
|
|
|
GST_STATIC_CAPS ("video/x-xvid, "
|
2004-03-15 19:32:27 +00:00
|
|
|
"width = (int) [ 0, MAX ], "
|
2005-12-14 22:41:47 +00:00
|
|
|
"height = (int) [ 0, MAX ], " "framerate = (fraction) [0/1, MAX]")
|
2004-03-14 22:34:33 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src",
|
|
|
|
GST_PAD_SRC,
|
|
|
|
GST_PAD_ALWAYS,
|
|
|
|
GST_STATIC_CAPS (GST_VIDEO_CAPS_YUV ("{ I420, YUY2, YV12, YVYU, UYVY }")
|
2004-03-15 19:32:27 +00:00
|
|
|
"; " RGB_24_32_STATIC_CAPS (32, 0x00ff0000, 0x0000ff00,
|
|
|
|
0x000000ff) "; " RGB_24_32_STATIC_CAPS (32, 0xff000000, 0x00ff0000,
|
|
|
|
0x0000ff00) "; " RGB_24_32_STATIC_CAPS (32, 0x0000ff00, 0x00ff0000,
|
|
|
|
0xff000000) "; " RGB_24_32_STATIC_CAPS (32, 0x000000ff, 0x0000ff00,
|
|
|
|
0x00ff0000) "; " RGB_24_32_STATIC_CAPS (24, 0x0000ff, 0x00ff00,
|
|
|
|
0xff0000) "; " GST_VIDEO_CAPS_RGB_15 "; " GST_VIDEO_CAPS_RGB_16)
|
2004-03-14 22:34:33 +00:00
|
|
|
);
|
2003-04-22 14:55:12 +00:00
|
|
|
|
|
|
|
|
|
|
|
/* XvidDec signals and args */
|
2004-03-14 22:34:33 +00:00
|
|
|
enum
|
|
|
|
{
|
2003-04-22 14:55:12 +00:00
|
|
|
/* FILL ME */
|
|
|
|
LAST_SIGNAL
|
|
|
|
};
|
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
enum
|
|
|
|
{
|
2003-04-22 14:55:12 +00:00
|
|
|
ARG_0
|
2004-03-14 22:34:33 +00:00
|
|
|
/* FILL ME */
|
2003-04-22 14:55:12 +00:00
|
|
|
};
|
|
|
|
|
2005-12-14 22:41:47 +00:00
|
|
|
static void gst_xviddec_base_init (GstXvidDecClass * klass);
|
2004-03-14 22:34:33 +00:00
|
|
|
static void gst_xviddec_class_init (GstXvidDecClass * klass);
|
|
|
|
static void gst_xviddec_init (GstXvidDec * xviddec);
|
2005-12-14 22:41:47 +00:00
|
|
|
static GstFlowReturn gst_xviddec_chain (GstPad * pad, GstBuffer * buf);
|
|
|
|
static gboolean gst_xviddec_setcaps (GstPad * pad, GstCaps * caps);
|
|
|
|
static gboolean gst_xviddec_negotiate (GstXvidDec * xviddec);
|
2005-09-05 17:20:29 +00:00
|
|
|
static GstStateChangeReturn gst_xviddec_change_state (GstElement * element,
|
|
|
|
GstStateChange transition);
|
Update xvid plugin to latest xvid (1.0.0-beta3) API.
Original commit message from CVS:
2004-01-03 Ronald Bultje <rbultje@ronald.bitfreak.net>
reviewed by: <delete if not using a buddy>
* configure.ac:
* ext/xvid/gstxvid.c: (gst_xvid_init), (gst_xvid_error),
(gst_xvid_structure_to_csp), (gst_xvid_csp_to_caps):
* ext/xvid/gstxvid.h:
* ext/xvid/gstxviddec.c: (gst_xviddec_class_init),
(gst_xviddec_init), (gst_xviddec_setup), (gst_xviddec_chain),
(gst_xviddec_src_link), (gst_xviddec_sink_link),
(gst_xviddec_change_state):
* ext/xvid/gstxviddec.h:
* ext/xvid/gstxvidenc.c: (gst_xvidenc_profile_get_type),
(gst_xvidenc_base_init), (gst_xvidenc_class_init),
(gst_xvidenc_init), (gst_xvidenc_setup), (gst_xvidenc_chain),
(gst_xvidenc_link), (gst_xvidenc_set_property),
(gst_xvidenc_get_property), (gst_xvidenc_change_state):
* ext/xvid/gstxvidenc.h:
Update xvid plugin to latest xvid (1.0.0-beta3) API.
2004-01-03 19:38:40 +00:00
|
|
|
|
2003-04-22 14:55:12 +00:00
|
|
|
static GstElementClass *parent_class = NULL;
|
2004-03-14 22:34:33 +00:00
|
|
|
|
2003-04-22 14:55:12 +00:00
|
|
|
/* static guint gst_xviddec_signals[LAST_SIGNAL] = { 0 }; */
|
|
|
|
|
|
|
|
GType
|
2004-03-14 22:34:33 +00:00
|
|
|
gst_xviddec_get_type (void)
|
2003-04-22 14:55:12 +00:00
|
|
|
{
|
|
|
|
static GType xviddec_type = 0;
|
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
if (!xviddec_type) {
|
2003-04-22 14:55:12 +00:00
|
|
|
static const GTypeInfo xviddec_info = {
|
2004-03-14 22:34:33 +00:00
|
|
|
sizeof (GstXvidDecClass),
|
2005-12-14 22:41:47 +00:00
|
|
|
(GBaseInitFunc) gst_xviddec_base_init,
|
2003-04-22 14:55:12 +00:00
|
|
|
NULL,
|
|
|
|
(GClassInitFunc) gst_xviddec_class_init,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
2004-03-14 22:34:33 +00:00
|
|
|
sizeof (GstXvidDec),
|
2003-04-22 14:55:12 +00:00
|
|
|
0,
|
|
|
|
(GInstanceInitFunc) gst_xviddec_init,
|
|
|
|
};
|
2004-03-15 19:32:27 +00:00
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
xviddec_type = g_type_register_static (GST_TYPE_ELEMENT,
|
2004-03-15 19:32:27 +00:00
|
|
|
"GstXvidDec", &xviddec_info, 0);
|
2003-04-22 14:55:12 +00:00
|
|
|
}
|
|
|
|
return xviddec_type;
|
|
|
|
}
|
|
|
|
|
2003-11-02 02:31:04 +00:00
|
|
|
static void
|
2005-12-14 22:41:47 +00:00
|
|
|
gst_xviddec_base_init (GstXvidDecClass * klass)
|
2003-11-02 02:31:04 +00:00
|
|
|
{
|
2005-12-14 22:41:47 +00:00
|
|
|
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
|
2003-11-02 02:31:04 +00:00
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
gst_element_class_add_pad_template (element_class,
|
|
|
|
gst_static_pad_template_get (&sink_template));
|
|
|
|
gst_element_class_add_pad_template (element_class,
|
|
|
|
gst_static_pad_template_get (&src_template));
|
2003-11-02 02:31:04 +00:00
|
|
|
|
|
|
|
gst_element_class_set_details (element_class, &gst_xviddec_details);
|
|
|
|
}
|
2003-04-22 14:55:12 +00:00
|
|
|
|
|
|
|
static void
|
2004-03-14 22:34:33 +00:00
|
|
|
gst_xviddec_class_init (GstXvidDecClass * klass)
|
2003-04-22 14:55:12 +00:00
|
|
|
{
|
2005-12-14 22:41:47 +00:00
|
|
|
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (klass);
|
2003-04-22 14:55:12 +00:00
|
|
|
|
2005-12-14 22:41:47 +00:00
|
|
|
parent_class = g_type_class_peek_parent (klass);
|
2003-04-22 14:55:12 +00:00
|
|
|
|
Update xvid plugin to latest xvid (1.0.0-beta3) API.
Original commit message from CVS:
2004-01-03 Ronald Bultje <rbultje@ronald.bitfreak.net>
reviewed by: <delete if not using a buddy>
* configure.ac:
* ext/xvid/gstxvid.c: (gst_xvid_init), (gst_xvid_error),
(gst_xvid_structure_to_csp), (gst_xvid_csp_to_caps):
* ext/xvid/gstxvid.h:
* ext/xvid/gstxviddec.c: (gst_xviddec_class_init),
(gst_xviddec_init), (gst_xviddec_setup), (gst_xviddec_chain),
(gst_xviddec_src_link), (gst_xviddec_sink_link),
(gst_xviddec_change_state):
* ext/xvid/gstxviddec.h:
* ext/xvid/gstxvidenc.c: (gst_xvidenc_profile_get_type),
(gst_xvidenc_base_init), (gst_xvidenc_class_init),
(gst_xvidenc_init), (gst_xvidenc_setup), (gst_xvidenc_chain),
(gst_xvidenc_link), (gst_xvidenc_set_property),
(gst_xvidenc_get_property), (gst_xvidenc_change_state):
* ext/xvid/gstxvidenc.h:
Update xvid plugin to latest xvid (1.0.0-beta3) API.
2004-01-03 19:38:40 +00:00
|
|
|
gstelement_class->change_state = gst_xviddec_change_state;
|
2003-04-22 14:55:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-03-14 22:34:33 +00:00
|
|
|
gst_xviddec_init (GstXvidDec * xviddec)
|
2003-04-22 14:55:12 +00:00
|
|
|
{
|
2004-03-14 22:34:33 +00:00
|
|
|
gst_xvid_init ();
|
Update xvid plugin to latest xvid (1.0.0-beta3) API.
Original commit message from CVS:
2004-01-03 Ronald Bultje <rbultje@ronald.bitfreak.net>
reviewed by: <delete if not using a buddy>
* configure.ac:
* ext/xvid/gstxvid.c: (gst_xvid_init), (gst_xvid_error),
(gst_xvid_structure_to_csp), (gst_xvid_csp_to_caps):
* ext/xvid/gstxvid.h:
* ext/xvid/gstxviddec.c: (gst_xviddec_class_init),
(gst_xviddec_init), (gst_xviddec_setup), (gst_xviddec_chain),
(gst_xviddec_src_link), (gst_xviddec_sink_link),
(gst_xviddec_change_state):
* ext/xvid/gstxviddec.h:
* ext/xvid/gstxvidenc.c: (gst_xvidenc_profile_get_type),
(gst_xvidenc_base_init), (gst_xvidenc_class_init),
(gst_xvidenc_init), (gst_xvidenc_setup), (gst_xvidenc_chain),
(gst_xvidenc_link), (gst_xvidenc_set_property),
(gst_xvidenc_get_property), (gst_xvidenc_change_state):
* ext/xvid/gstxvidenc.h:
Update xvid plugin to latest xvid (1.0.0-beta3) API.
2004-01-03 19:38:40 +00:00
|
|
|
|
2003-04-22 14:55:12 +00:00
|
|
|
/* create the sink pad */
|
2004-03-14 22:34:33 +00:00
|
|
|
xviddec->sinkpad =
|
|
|
|
gst_pad_new_from_template (gst_static_pad_template_get (&sink_template),
|
|
|
|
"sink");
|
|
|
|
gst_element_add_pad (GST_ELEMENT (xviddec), xviddec->sinkpad);
|
|
|
|
gst_pad_set_chain_function (xviddec->sinkpad, gst_xviddec_chain);
|
2005-12-14 22:41:47 +00:00
|
|
|
gst_pad_set_setcaps_function (xviddec->sinkpad, gst_xviddec_setcaps);
|
2003-04-22 14:55:12 +00:00
|
|
|
|
|
|
|
/* create the src pad */
|
2004-03-14 22:34:33 +00:00
|
|
|
xviddec->srcpad =
|
|
|
|
gst_pad_new_from_template (gst_static_pad_template_get (&src_template),
|
|
|
|
"src");
|
|
|
|
gst_element_add_pad (GST_ELEMENT (xviddec), xviddec->srcpad);
|
2005-12-14 22:41:47 +00:00
|
|
|
gst_pad_use_fixed_caps (xviddec->srcpad);
|
Update xvid plugin to latest xvid (1.0.0-beta3) API.
Original commit message from CVS:
2004-01-03 Ronald Bultje <rbultje@ronald.bitfreak.net>
reviewed by: <delete if not using a buddy>
* configure.ac:
* ext/xvid/gstxvid.c: (gst_xvid_init), (gst_xvid_error),
(gst_xvid_structure_to_csp), (gst_xvid_csp_to_caps):
* ext/xvid/gstxvid.h:
* ext/xvid/gstxviddec.c: (gst_xviddec_class_init),
(gst_xviddec_init), (gst_xviddec_setup), (gst_xviddec_chain),
(gst_xviddec_src_link), (gst_xviddec_sink_link),
(gst_xviddec_change_state):
* ext/xvid/gstxviddec.h:
* ext/xvid/gstxvidenc.c: (gst_xvidenc_profile_get_type),
(gst_xvidenc_base_init), (gst_xvidenc_class_init),
(gst_xvidenc_init), (gst_xvidenc_setup), (gst_xvidenc_chain),
(gst_xvidenc_link), (gst_xvidenc_set_property),
(gst_xvidenc_get_property), (gst_xvidenc_change_state):
* ext/xvid/gstxvidenc.h:
Update xvid plugin to latest xvid (1.0.0-beta3) API.
2004-01-03 19:38:40 +00:00
|
|
|
|
|
|
|
/* size, etc. */
|
2003-04-22 14:55:12 +00:00
|
|
|
xviddec->width = xviddec->height = xviddec->csp = -1;
|
|
|
|
|
|
|
|
/* set xvid handle to NULL */
|
|
|
|
xviddec->handle = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
2004-03-14 22:34:33 +00:00
|
|
|
gst_xviddec_unset (GstXvidDec * xviddec)
|
2003-04-22 14:55:12 +00:00
|
|
|
{
|
|
|
|
/* unref this instance */
|
2004-03-14 22:34:33 +00:00
|
|
|
xvid_decore (xviddec->handle, XVID_DEC_DESTROY, NULL, NULL);
|
2003-04-22 14:55:12 +00:00
|
|
|
xviddec->handle = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static gboolean
|
2004-03-14 22:34:33 +00:00
|
|
|
gst_xviddec_setup (GstXvidDec * xviddec)
|
2003-04-22 14:55:12 +00:00
|
|
|
{
|
Update xvid plugin to latest xvid (1.0.0-beta3) API.
Original commit message from CVS:
2004-01-03 Ronald Bultje <rbultje@ronald.bitfreak.net>
reviewed by: <delete if not using a buddy>
* configure.ac:
* ext/xvid/gstxvid.c: (gst_xvid_init), (gst_xvid_error),
(gst_xvid_structure_to_csp), (gst_xvid_csp_to_caps):
* ext/xvid/gstxvid.h:
* ext/xvid/gstxviddec.c: (gst_xviddec_class_init),
(gst_xviddec_init), (gst_xviddec_setup), (gst_xviddec_chain),
(gst_xviddec_src_link), (gst_xviddec_sink_link),
(gst_xviddec_change_state):
* ext/xvid/gstxviddec.h:
* ext/xvid/gstxvidenc.c: (gst_xvidenc_profile_get_type),
(gst_xvidenc_base_init), (gst_xvidenc_class_init),
(gst_xvidenc_init), (gst_xvidenc_setup), (gst_xvidenc_chain),
(gst_xvidenc_link), (gst_xvidenc_set_property),
(gst_xvidenc_get_property), (gst_xvidenc_change_state):
* ext/xvid/gstxvidenc.h:
Update xvid plugin to latest xvid (1.0.0-beta3) API.
2004-01-03 19:38:40 +00:00
|
|
|
xvid_dec_create_t xdec;
|
2003-04-22 14:55:12 +00:00
|
|
|
int ret;
|
|
|
|
|
|
|
|
/* initialise parameters, see xvid documentation */
|
Update xvid plugin to latest xvid (1.0.0-beta3) API.
Original commit message from CVS:
2004-01-03 Ronald Bultje <rbultje@ronald.bitfreak.net>
reviewed by: <delete if not using a buddy>
* configure.ac:
* ext/xvid/gstxvid.c: (gst_xvid_init), (gst_xvid_error),
(gst_xvid_structure_to_csp), (gst_xvid_csp_to_caps):
* ext/xvid/gstxvid.h:
* ext/xvid/gstxviddec.c: (gst_xviddec_class_init),
(gst_xviddec_init), (gst_xviddec_setup), (gst_xviddec_chain),
(gst_xviddec_src_link), (gst_xviddec_sink_link),
(gst_xviddec_change_state):
* ext/xvid/gstxviddec.h:
* ext/xvid/gstxvidenc.c: (gst_xvidenc_profile_get_type),
(gst_xvidenc_base_init), (gst_xvidenc_class_init),
(gst_xvidenc_init), (gst_xvidenc_setup), (gst_xvidenc_chain),
(gst_xvidenc_link), (gst_xvidenc_set_property),
(gst_xvidenc_get_property), (gst_xvidenc_change_state):
* ext/xvid/gstxvidenc.h:
Update xvid plugin to latest xvid (1.0.0-beta3) API.
2004-01-03 19:38:40 +00:00
|
|
|
gst_xvid_init_struct (xdec);
|
2003-04-22 14:55:12 +00:00
|
|
|
xdec.width = xviddec->width;
|
|
|
|
xdec.height = xviddec->height;
|
Update xvid plugin to latest xvid (1.0.0-beta3) API.
Original commit message from CVS:
2004-01-03 Ronald Bultje <rbultje@ronald.bitfreak.net>
reviewed by: <delete if not using a buddy>
* configure.ac:
* ext/xvid/gstxvid.c: (gst_xvid_init), (gst_xvid_error),
(gst_xvid_structure_to_csp), (gst_xvid_csp_to_caps):
* ext/xvid/gstxvid.h:
* ext/xvid/gstxviddec.c: (gst_xviddec_class_init),
(gst_xviddec_init), (gst_xviddec_setup), (gst_xviddec_chain),
(gst_xviddec_src_link), (gst_xviddec_sink_link),
(gst_xviddec_change_state):
* ext/xvid/gstxviddec.h:
* ext/xvid/gstxvidenc.c: (gst_xvidenc_profile_get_type),
(gst_xvidenc_base_init), (gst_xvidenc_class_init),
(gst_xvidenc_init), (gst_xvidenc_setup), (gst_xvidenc_chain),
(gst_xvidenc_link), (gst_xvidenc_set_property),
(gst_xvidenc_get_property), (gst_xvidenc_change_state):
* ext/xvid/gstxvidenc.h:
Update xvid plugin to latest xvid (1.0.0-beta3) API.
2004-01-03 19:38:40 +00:00
|
|
|
xdec.handle = NULL;
|
2003-04-22 14:55:12 +00:00
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
if ((ret = xvid_decore (NULL, XVID_DEC_CREATE, &xdec, NULL)) < 0) {
|
2004-02-02 17:23:33 +00:00
|
|
|
GST_ELEMENT_ERROR (xviddec, LIBRARY, SETTINGS, (NULL),
|
2004-03-15 19:32:27 +00:00
|
|
|
("Setting parameters %dx%d@%d failed: %s (%d)",
|
|
|
|
xviddec->width, xviddec->height, xviddec->csp,
|
|
|
|
gst_xvid_error (ret), ret));
|
2003-04-22 14:55:12 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
xviddec->handle = xdec.handle;
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2005-12-14 22:41:47 +00:00
|
|
|
static GstFlowReturn
|
|
|
|
gst_xviddec_chain (GstPad * pad, GstBuffer * buf)
|
2003-04-22 14:55:12 +00:00
|
|
|
{
|
2005-12-14 22:41:47 +00:00
|
|
|
GstXvidDec *xviddec = GST_XVIDDEC (gst_pad_get_parent (pad));
|
|
|
|
GstBuffer *outbuf = NULL;
|
Update xvid plugin to latest xvid (1.0.0-beta3) API.
Original commit message from CVS:
2004-01-03 Ronald Bultje <rbultje@ronald.bitfreak.net>
reviewed by: <delete if not using a buddy>
* configure.ac:
* ext/xvid/gstxvid.c: (gst_xvid_init), (gst_xvid_error),
(gst_xvid_structure_to_csp), (gst_xvid_csp_to_caps):
* ext/xvid/gstxvid.h:
* ext/xvid/gstxviddec.c: (gst_xviddec_class_init),
(gst_xviddec_init), (gst_xviddec_setup), (gst_xviddec_chain),
(gst_xviddec_src_link), (gst_xviddec_sink_link),
(gst_xviddec_change_state):
* ext/xvid/gstxviddec.h:
* ext/xvid/gstxvidenc.c: (gst_xvidenc_profile_get_type),
(gst_xvidenc_base_init), (gst_xvidenc_class_init),
(gst_xvidenc_init), (gst_xvidenc_setup), (gst_xvidenc_chain),
(gst_xvidenc_link), (gst_xvidenc_set_property),
(gst_xvidenc_get_property), (gst_xvidenc_change_state):
* ext/xvid/gstxvidenc.h:
Update xvid plugin to latest xvid (1.0.0-beta3) API.
2004-01-03 19:38:40 +00:00
|
|
|
xvid_dec_frame_t xframe;
|
2005-12-14 22:41:47 +00:00
|
|
|
GstFlowReturn ret = GST_FLOW_OK;
|
2006-03-03 18:10:12 +00:00
|
|
|
guint bufsize;
|
2005-12-14 22:41:47 +00:00
|
|
|
int error = 0;
|
2003-04-22 14:55:12 +00:00
|
|
|
|
2005-12-14 22:41:47 +00:00
|
|
|
if (xviddec->handle == NULL) {
|
|
|
|
if (!gst_xviddec_negotiate (xviddec))
|
|
|
|
goto not_negotiated;
|
2003-04-22 14:55:12 +00:00
|
|
|
}
|
|
|
|
|
2006-03-03 18:10:12 +00:00
|
|
|
bufsize = (xviddec->width * xviddec->height * xviddec->bpp / 8);
|
2005-12-14 22:41:47 +00:00
|
|
|
|
|
|
|
outbuf = gst_buffer_new_and_alloc (bufsize);
|
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
GST_BUFFER_TIMESTAMP (outbuf) = GST_BUFFER_TIMESTAMP (buf);
|
|
|
|
GST_BUFFER_DURATION (outbuf) = GST_BUFFER_DURATION (buf);
|
2005-12-14 22:41:47 +00:00
|
|
|
GST_BUFFER_SIZE (outbuf) = bufsize;
|
2003-04-22 14:55:12 +00:00
|
|
|
|
Update xvid plugin to latest xvid (1.0.0-beta3) API.
Original commit message from CVS:
2004-01-03 Ronald Bultje <rbultje@ronald.bitfreak.net>
reviewed by: <delete if not using a buddy>
* configure.ac:
* ext/xvid/gstxvid.c: (gst_xvid_init), (gst_xvid_error),
(gst_xvid_structure_to_csp), (gst_xvid_csp_to_caps):
* ext/xvid/gstxvid.h:
* ext/xvid/gstxviddec.c: (gst_xviddec_class_init),
(gst_xviddec_init), (gst_xviddec_setup), (gst_xviddec_chain),
(gst_xviddec_src_link), (gst_xviddec_sink_link),
(gst_xviddec_change_state):
* ext/xvid/gstxviddec.h:
* ext/xvid/gstxvidenc.c: (gst_xvidenc_profile_get_type),
(gst_xvidenc_base_init), (gst_xvidenc_class_init),
(gst_xvidenc_init), (gst_xvidenc_setup), (gst_xvidenc_chain),
(gst_xvidenc_link), (gst_xvidenc_set_property),
(gst_xvidenc_get_property), (gst_xvidenc_change_state):
* ext/xvid/gstxvidenc.h:
Update xvid plugin to latest xvid (1.0.0-beta3) API.
2004-01-03 19:38:40 +00:00
|
|
|
/* decode and so ... */
|
|
|
|
gst_xvid_init_struct (xframe);
|
2004-08-25 17:12:57 +00:00
|
|
|
xframe.general = XVID_LOWDELAY;
|
2004-03-14 22:34:33 +00:00
|
|
|
xframe.bitstream = (void *) GST_BUFFER_DATA (buf);
|
|
|
|
xframe.length = GST_BUFFER_SIZE (buf);
|
Update xvid plugin to latest xvid (1.0.0-beta3) API.
Original commit message from CVS:
2004-01-03 Ronald Bultje <rbultje@ronald.bitfreak.net>
reviewed by: <delete if not using a buddy>
* configure.ac:
* ext/xvid/gstxvid.c: (gst_xvid_init), (gst_xvid_error),
(gst_xvid_structure_to_csp), (gst_xvid_csp_to_caps):
* ext/xvid/gstxvid.h:
* ext/xvid/gstxviddec.c: (gst_xviddec_class_init),
(gst_xviddec_init), (gst_xviddec_setup), (gst_xviddec_chain),
(gst_xviddec_src_link), (gst_xviddec_sink_link),
(gst_xviddec_change_state):
* ext/xvid/gstxviddec.h:
* ext/xvid/gstxvidenc.c: (gst_xvidenc_profile_get_type),
(gst_xvidenc_base_init), (gst_xvidenc_class_init),
(gst_xvidenc_init), (gst_xvidenc_setup), (gst_xvidenc_chain),
(gst_xvidenc_link), (gst_xvidenc_set_property),
(gst_xvidenc_get_property), (gst_xvidenc_change_state):
* ext/xvid/gstxvidenc.h:
Update xvid plugin to latest xvid (1.0.0-beta3) API.
2004-01-03 19:38:40 +00:00
|
|
|
xframe.output.csp = xviddec->csp;
|
|
|
|
if (xviddec->width == xviddec->stride) {
|
2004-03-14 22:34:33 +00:00
|
|
|
xframe.output.plane[0] = GST_BUFFER_DATA (outbuf);
|
|
|
|
xframe.output.plane[1] =
|
2004-03-15 19:32:27 +00:00
|
|
|
xframe.output.plane[0] + (xviddec->width * xviddec->height);
|
2004-03-14 22:34:33 +00:00
|
|
|
xframe.output.plane[2] =
|
2004-03-15 19:32:27 +00:00
|
|
|
xframe.output.plane[1] + (xviddec->width * xviddec->height / 4);
|
Update xvid plugin to latest xvid (1.0.0-beta3) API.
Original commit message from CVS:
2004-01-03 Ronald Bultje <rbultje@ronald.bitfreak.net>
reviewed by: <delete if not using a buddy>
* configure.ac:
* ext/xvid/gstxvid.c: (gst_xvid_init), (gst_xvid_error),
(gst_xvid_structure_to_csp), (gst_xvid_csp_to_caps):
* ext/xvid/gstxvid.h:
* ext/xvid/gstxviddec.c: (gst_xviddec_class_init),
(gst_xviddec_init), (gst_xviddec_setup), (gst_xviddec_chain),
(gst_xviddec_src_link), (gst_xviddec_sink_link),
(gst_xviddec_change_state):
* ext/xvid/gstxviddec.h:
* ext/xvid/gstxvidenc.c: (gst_xvidenc_profile_get_type),
(gst_xvidenc_base_init), (gst_xvidenc_class_init),
(gst_xvidenc_init), (gst_xvidenc_setup), (gst_xvidenc_chain),
(gst_xvidenc_link), (gst_xvidenc_set_property),
(gst_xvidenc_get_property), (gst_xvidenc_change_state):
* ext/xvid/gstxvidenc.h:
Update xvid plugin to latest xvid (1.0.0-beta3) API.
2004-01-03 19:38:40 +00:00
|
|
|
xframe.output.stride[0] = xviddec->width;
|
|
|
|
xframe.output.stride[1] = xviddec->width / 2;
|
|
|
|
xframe.output.stride[2] = xviddec->width / 2;
|
|
|
|
} else {
|
2004-03-14 22:34:33 +00:00
|
|
|
xframe.output.plane[0] = GST_BUFFER_DATA (outbuf);
|
Update xvid plugin to latest xvid (1.0.0-beta3) API.
Original commit message from CVS:
2004-01-03 Ronald Bultje <rbultje@ronald.bitfreak.net>
reviewed by: <delete if not using a buddy>
* configure.ac:
* ext/xvid/gstxvid.c: (gst_xvid_init), (gst_xvid_error),
(gst_xvid_structure_to_csp), (gst_xvid_csp_to_caps):
* ext/xvid/gstxvid.h:
* ext/xvid/gstxviddec.c: (gst_xviddec_class_init),
(gst_xviddec_init), (gst_xviddec_setup), (gst_xviddec_chain),
(gst_xviddec_src_link), (gst_xviddec_sink_link),
(gst_xviddec_change_state):
* ext/xvid/gstxviddec.h:
* ext/xvid/gstxvidenc.c: (gst_xvidenc_profile_get_type),
(gst_xvidenc_base_init), (gst_xvidenc_class_init),
(gst_xvidenc_init), (gst_xvidenc_setup), (gst_xvidenc_chain),
(gst_xvidenc_link), (gst_xvidenc_set_property),
(gst_xvidenc_get_property), (gst_xvidenc_change_state):
* ext/xvid/gstxvidenc.h:
Update xvid plugin to latest xvid (1.0.0-beta3) API.
2004-01-03 19:38:40 +00:00
|
|
|
xframe.output.stride[0] = xviddec->stride;
|
|
|
|
}
|
2003-04-22 14:55:12 +00:00
|
|
|
|
2005-12-14 22:41:47 +00:00
|
|
|
if ((error =
|
|
|
|
xvid_decore (xviddec->handle, XVID_DEC_DECODE, &xframe, NULL)) < 0) {
|
|
|
|
goto not_decoding;
|
|
|
|
}
|
|
|
|
|
|
|
|
gst_buffer_set_caps (outbuf, GST_PAD_CAPS (xviddec->srcpad));
|
2005-12-15 14:39:00 +00:00
|
|
|
ret = gst_pad_push (xviddec->srcpad, outbuf);
|
|
|
|
|
|
|
|
goto cleanup;
|
2005-12-14 22:41:47 +00:00
|
|
|
|
|
|
|
not_negotiated:
|
|
|
|
{
|
|
|
|
GST_ELEMENT_ERROR (xviddec, CORE, NEGOTIATION, (NULL),
|
|
|
|
("format wasn't negotiated before chain function"));
|
2005-12-15 14:39:00 +00:00
|
|
|
ret = GST_FLOW_NOT_NEGOTIATED;
|
|
|
|
goto cleanup;
|
2005-12-14 22:41:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
not_decoding:
|
|
|
|
{
|
2004-02-02 17:23:33 +00:00
|
|
|
GST_ELEMENT_ERROR (xviddec, STREAM, DECODE, (NULL),
|
2005-12-14 22:41:47 +00:00
|
|
|
("Error decoding xvid frame: %s (%d)\n", gst_xvid_error (error),
|
|
|
|
error));
|
2004-03-14 22:34:33 +00:00
|
|
|
gst_buffer_unref (outbuf);
|
2005-12-15 14:39:00 +00:00
|
|
|
ret = GST_FLOW_ERROR;
|
|
|
|
goto cleanup;
|
2003-04-22 14:55:12 +00:00
|
|
|
}
|
2005-12-15 14:39:00 +00:00
|
|
|
|
|
|
|
cleanup:
|
|
|
|
|
|
|
|
gst_buffer_unref (buf);
|
|
|
|
gst_object_unref (xviddec);
|
|
|
|
return ret;
|
|
|
|
|
2003-04-22 14:55:12 +00:00
|
|
|
}
|
|
|
|
|
2005-12-14 22:41:47 +00:00
|
|
|
static gboolean
|
|
|
|
gst_xviddec_negotiate (GstXvidDec * xviddec)
|
2004-01-04 09:55:16 +00:00
|
|
|
{
|
|
|
|
gint csp[] = {
|
|
|
|
XVID_CSP_I420,
|
|
|
|
XVID_CSP_YV12,
|
|
|
|
XVID_CSP_YUY2,
|
|
|
|
XVID_CSP_UYVY,
|
|
|
|
XVID_CSP_YVYU,
|
|
|
|
XVID_CSP_BGRA,
|
|
|
|
XVID_CSP_ABGR,
|
|
|
|
XVID_CSP_RGBA,
|
2004-01-06 14:34:52 +00:00
|
|
|
#ifdef XVID_CSP_ARGB
|
2004-01-04 09:55:16 +00:00
|
|
|
XVID_CSP_ARGB,
|
2004-01-06 14:34:52 +00:00
|
|
|
#endif
|
2004-01-04 09:55:16 +00:00
|
|
|
XVID_CSP_BGR,
|
|
|
|
XVID_CSP_RGB555,
|
|
|
|
XVID_CSP_RGB565,
|
|
|
|
0
|
|
|
|
}, i;
|
|
|
|
|
|
|
|
for (i = 0; csp[i] != 0; i++) {
|
|
|
|
GstCaps *one = gst_xvid_csp_to_caps (csp[i], xviddec->width,
|
2005-12-14 22:41:47 +00:00
|
|
|
xviddec->height, xviddec->fps_n, xviddec->fps_d);
|
2004-01-04 09:55:16 +00:00
|
|
|
|
2005-12-15 14:39:00 +00:00
|
|
|
if (one) {
|
|
|
|
|
|
|
|
if (gst_pad_set_caps (xviddec->srcpad, one)) {
|
|
|
|
GstStructure *structure = gst_caps_get_structure (one, 0);
|
2003-04-22 14:55:12 +00:00
|
|
|
|
2005-12-15 14:39:00 +00:00
|
|
|
xviddec->csp = gst_xvid_structure_to_csp (structure, xviddec->width,
|
|
|
|
&xviddec->stride, &xviddec->bpp);
|
2003-04-22 14:55:12 +00:00
|
|
|
|
2005-12-15 14:39:00 +00:00
|
|
|
if (xviddec->csp < 0) {
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
2005-12-14 22:41:47 +00:00
|
|
|
}
|
Update xvid plugin to latest xvid (1.0.0-beta3) API.
Original commit message from CVS:
2004-01-03 Ronald Bultje <rbultje@ronald.bitfreak.net>
reviewed by: <delete if not using a buddy>
* configure.ac:
* ext/xvid/gstxvid.c: (gst_xvid_init), (gst_xvid_error),
(gst_xvid_structure_to_csp), (gst_xvid_csp_to_caps):
* ext/xvid/gstxvid.h:
* ext/xvid/gstxviddec.c: (gst_xviddec_class_init),
(gst_xviddec_init), (gst_xviddec_setup), (gst_xviddec_chain),
(gst_xviddec_src_link), (gst_xviddec_sink_link),
(gst_xviddec_change_state):
* ext/xvid/gstxviddec.h:
* ext/xvid/gstxvidenc.c: (gst_xvidenc_profile_get_type),
(gst_xvidenc_base_init), (gst_xvidenc_class_init),
(gst_xvidenc_init), (gst_xvidenc_setup), (gst_xvidenc_chain),
(gst_xvidenc_link), (gst_xvidenc_set_property),
(gst_xvidenc_get_property), (gst_xvidenc_change_state):
* ext/xvid/gstxvidenc.h:
Update xvid plugin to latest xvid (1.0.0-beta3) API.
2004-01-03 19:38:40 +00:00
|
|
|
|
2005-12-15 14:39:00 +00:00
|
|
|
gst_caps_unref (one);
|
|
|
|
|
2005-12-14 22:41:47 +00:00
|
|
|
}
|
2005-12-15 14:39:00 +00:00
|
|
|
|
2003-04-22 14:55:12 +00:00
|
|
|
}
|
|
|
|
|
2005-12-14 22:41:47 +00:00
|
|
|
gst_xviddec_setup (xviddec);
|
|
|
|
return TRUE;
|
Update xvid plugin to latest xvid (1.0.0-beta3) API.
Original commit message from CVS:
2004-01-03 Ronald Bultje <rbultje@ronald.bitfreak.net>
reviewed by: <delete if not using a buddy>
* configure.ac:
* ext/xvid/gstxvid.c: (gst_xvid_init), (gst_xvid_error),
(gst_xvid_structure_to_csp), (gst_xvid_csp_to_caps):
* ext/xvid/gstxvid.h:
* ext/xvid/gstxviddec.c: (gst_xviddec_class_init),
(gst_xviddec_init), (gst_xviddec_setup), (gst_xviddec_chain),
(gst_xviddec_src_link), (gst_xviddec_sink_link),
(gst_xviddec_change_state):
* ext/xvid/gstxviddec.h:
* ext/xvid/gstxvidenc.c: (gst_xvidenc_profile_get_type),
(gst_xvidenc_base_init), (gst_xvidenc_class_init),
(gst_xvidenc_init), (gst_xvidenc_setup), (gst_xvidenc_chain),
(gst_xvidenc_link), (gst_xvidenc_set_property),
(gst_xvidenc_get_property), (gst_xvidenc_change_state):
* ext/xvid/gstxvidenc.h:
Update xvid plugin to latest xvid (1.0.0-beta3) API.
2004-01-03 19:38:40 +00:00
|
|
|
}
|
2003-04-22 14:55:12 +00:00
|
|
|
|
2005-12-14 22:41:47 +00:00
|
|
|
static gboolean
|
|
|
|
gst_xviddec_setcaps (GstPad * pad, GstCaps * caps)
|
2003-07-06 20:49:52 +00:00
|
|
|
{
|
2004-03-14 22:34:33 +00:00
|
|
|
GstXvidDec *xviddec = GST_XVIDDEC (gst_pad_get_parent (pad));
|
2003-12-22 01:47:09 +00:00
|
|
|
GstStructure *structure;
|
2005-12-14 22:41:47 +00:00
|
|
|
const GValue *fps;
|
2005-12-15 14:39:00 +00:00
|
|
|
gboolean ret = FALSE;
|
2003-07-06 20:49:52 +00:00
|
|
|
|
|
|
|
/* if there's something old around, remove it */
|
|
|
|
if (xviddec->handle) {
|
2004-03-14 22:34:33 +00:00
|
|
|
gst_xviddec_unset (xviddec);
|
2003-07-06 20:49:52 +00:00
|
|
|
}
|
|
|
|
|
2005-12-14 22:41:47 +00:00
|
|
|
if (!gst_pad_set_caps (xviddec->srcpad, caps)) {
|
2005-12-15 14:39:00 +00:00
|
|
|
ret = FALSE;
|
|
|
|
goto done;
|
2005-12-14 22:41:47 +00:00
|
|
|
}
|
|
|
|
|
2003-07-06 20:49:52 +00:00
|
|
|
/* if we get here, we know the input is xvid. we
|
Update xvid plugin to latest xvid (1.0.0-beta3) API.
Original commit message from CVS:
2004-01-03 Ronald Bultje <rbultje@ronald.bitfreak.net>
reviewed by: <delete if not using a buddy>
* configure.ac:
* ext/xvid/gstxvid.c: (gst_xvid_init), (gst_xvid_error),
(gst_xvid_structure_to_csp), (gst_xvid_csp_to_caps):
* ext/xvid/gstxvid.h:
* ext/xvid/gstxviddec.c: (gst_xviddec_class_init),
(gst_xviddec_init), (gst_xviddec_setup), (gst_xviddec_chain),
(gst_xviddec_src_link), (gst_xviddec_sink_link),
(gst_xviddec_change_state):
* ext/xvid/gstxviddec.h:
* ext/xvid/gstxvidenc.c: (gst_xvidenc_profile_get_type),
(gst_xvidenc_base_init), (gst_xvidenc_class_init),
(gst_xvidenc_init), (gst_xvidenc_setup), (gst_xvidenc_chain),
(gst_xvidenc_link), (gst_xvidenc_set_property),
(gst_xvidenc_get_property), (gst_xvidenc_change_state):
* ext/xvid/gstxvidenc.h:
Update xvid plugin to latest xvid (1.0.0-beta3) API.
2004-01-03 19:38:40 +00:00
|
|
|
* only need to bother with the output colorspace,
|
|
|
|
* which the src_link function takes care of. */
|
2005-12-14 22:41:47 +00:00
|
|
|
structure = gst_caps_get_structure (caps, 0);
|
2004-03-14 22:34:33 +00:00
|
|
|
gst_structure_get_int (structure, "width", &xviddec->width);
|
|
|
|
gst_structure_get_int (structure, "height", &xviddec->height);
|
Update xvid plugin to latest xvid (1.0.0-beta3) API.
Original commit message from CVS:
2004-01-03 Ronald Bultje <rbultje@ronald.bitfreak.net>
reviewed by: <delete if not using a buddy>
* configure.ac:
* ext/xvid/gstxvid.c: (gst_xvid_init), (gst_xvid_error),
(gst_xvid_structure_to_csp), (gst_xvid_csp_to_caps):
* ext/xvid/gstxvid.h:
* ext/xvid/gstxviddec.c: (gst_xviddec_class_init),
(gst_xviddec_init), (gst_xviddec_setup), (gst_xviddec_chain),
(gst_xviddec_src_link), (gst_xviddec_sink_link),
(gst_xviddec_change_state):
* ext/xvid/gstxviddec.h:
* ext/xvid/gstxvidenc.c: (gst_xvidenc_profile_get_type),
(gst_xvidenc_base_init), (gst_xvidenc_class_init),
(gst_xvidenc_init), (gst_xvidenc_setup), (gst_xvidenc_chain),
(gst_xvidenc_link), (gst_xvidenc_set_property),
(gst_xvidenc_get_property), (gst_xvidenc_change_state):
* ext/xvid/gstxvidenc.h:
Update xvid plugin to latest xvid (1.0.0-beta3) API.
2004-01-03 19:38:40 +00:00
|
|
|
|
2005-12-14 22:41:47 +00:00
|
|
|
fps = gst_structure_get_value (structure, "framerate");
|
2005-12-15 14:39:00 +00:00
|
|
|
if (fps != NULL) {
|
2005-12-14 22:41:47 +00:00
|
|
|
xviddec->fps_n = gst_value_get_fraction_numerator (fps);
|
|
|
|
xviddec->fps_d = gst_value_get_fraction_denominator (fps);
|
|
|
|
} else {
|
|
|
|
xviddec->fps_n = -1;
|
|
|
|
}
|
Update xvid plugin to latest xvid (1.0.0-beta3) API.
Original commit message from CVS:
2004-01-03 Ronald Bultje <rbultje@ronald.bitfreak.net>
reviewed by: <delete if not using a buddy>
* configure.ac:
* ext/xvid/gstxvid.c: (gst_xvid_init), (gst_xvid_error),
(gst_xvid_structure_to_csp), (gst_xvid_csp_to_caps):
* ext/xvid/gstxvid.h:
* ext/xvid/gstxviddec.c: (gst_xviddec_class_init),
(gst_xviddec_init), (gst_xviddec_setup), (gst_xviddec_chain),
(gst_xviddec_src_link), (gst_xviddec_sink_link),
(gst_xviddec_change_state):
* ext/xvid/gstxviddec.h:
* ext/xvid/gstxvidenc.c: (gst_xvidenc_profile_get_type),
(gst_xvidenc_base_init), (gst_xvidenc_class_init),
(gst_xvidenc_init), (gst_xvidenc_setup), (gst_xvidenc_chain),
(gst_xvidenc_link), (gst_xvidenc_set_property),
(gst_xvidenc_get_property), (gst_xvidenc_change_state):
* ext/xvid/gstxvidenc.h:
Update xvid plugin to latest xvid (1.0.0-beta3) API.
2004-01-03 19:38:40 +00:00
|
|
|
|
2005-12-15 14:39:00 +00:00
|
|
|
ret = gst_xviddec_negotiate (xviddec);
|
|
|
|
|
|
|
|
done:
|
|
|
|
gst_object_unref (xviddec);
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
|
Update xvid plugin to latest xvid (1.0.0-beta3) API.
Original commit message from CVS:
2004-01-03 Ronald Bultje <rbultje@ronald.bitfreak.net>
reviewed by: <delete if not using a buddy>
* configure.ac:
* ext/xvid/gstxvid.c: (gst_xvid_init), (gst_xvid_error),
(gst_xvid_structure_to_csp), (gst_xvid_csp_to_caps):
* ext/xvid/gstxvid.h:
* ext/xvid/gstxviddec.c: (gst_xviddec_class_init),
(gst_xviddec_init), (gst_xviddec_setup), (gst_xviddec_chain),
(gst_xviddec_src_link), (gst_xviddec_sink_link),
(gst_xviddec_change_state):
* ext/xvid/gstxviddec.h:
* ext/xvid/gstxvidenc.c: (gst_xvidenc_profile_get_type),
(gst_xvidenc_base_init), (gst_xvidenc_class_init),
(gst_xvidenc_init), (gst_xvidenc_setup), (gst_xvidenc_chain),
(gst_xvidenc_link), (gst_xvidenc_set_property),
(gst_xvidenc_get_property), (gst_xvidenc_change_state):
* ext/xvid/gstxvidenc.h:
Update xvid plugin to latest xvid (1.0.0-beta3) API.
2004-01-03 19:38:40 +00:00
|
|
|
}
|
|
|
|
|
2005-09-05 17:20:29 +00:00
|
|
|
static GstStateChangeReturn
|
|
|
|
gst_xviddec_change_state (GstElement * element, GstStateChange transition)
|
Update xvid plugin to latest xvid (1.0.0-beta3) API.
Original commit message from CVS:
2004-01-03 Ronald Bultje <rbultje@ronald.bitfreak.net>
reviewed by: <delete if not using a buddy>
* configure.ac:
* ext/xvid/gstxvid.c: (gst_xvid_init), (gst_xvid_error),
(gst_xvid_structure_to_csp), (gst_xvid_csp_to_caps):
* ext/xvid/gstxvid.h:
* ext/xvid/gstxviddec.c: (gst_xviddec_class_init),
(gst_xviddec_init), (gst_xviddec_setup), (gst_xviddec_chain),
(gst_xviddec_src_link), (gst_xviddec_sink_link),
(gst_xviddec_change_state):
* ext/xvid/gstxviddec.h:
* ext/xvid/gstxvidenc.c: (gst_xvidenc_profile_get_type),
(gst_xvidenc_base_init), (gst_xvidenc_class_init),
(gst_xvidenc_init), (gst_xvidenc_setup), (gst_xvidenc_chain),
(gst_xvidenc_link), (gst_xvidenc_set_property),
(gst_xvidenc_get_property), (gst_xvidenc_change_state):
* ext/xvid/gstxvidenc.h:
Update xvid plugin to latest xvid (1.0.0-beta3) API.
2004-01-03 19:38:40 +00:00
|
|
|
{
|
|
|
|
GstXvidDec *xviddec = GST_XVIDDEC (element);
|
2005-12-14 22:41:47 +00:00
|
|
|
GstStateChangeReturn ret;
|
|
|
|
|
|
|
|
switch (transition) {
|
|
|
|
case GST_STATE_CHANGE_NULL_TO_READY:
|
|
|
|
break;
|
|
|
|
case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
ret = parent_class->change_state (element, transition);
|
Update xvid plugin to latest xvid (1.0.0-beta3) API.
Original commit message from CVS:
2004-01-03 Ronald Bultje <rbultje@ronald.bitfreak.net>
reviewed by: <delete if not using a buddy>
* configure.ac:
* ext/xvid/gstxvid.c: (gst_xvid_init), (gst_xvid_error),
(gst_xvid_structure_to_csp), (gst_xvid_csp_to_caps):
* ext/xvid/gstxvid.h:
* ext/xvid/gstxviddec.c: (gst_xviddec_class_init),
(gst_xviddec_init), (gst_xviddec_setup), (gst_xviddec_chain),
(gst_xviddec_src_link), (gst_xviddec_sink_link),
(gst_xviddec_change_state):
* ext/xvid/gstxviddec.h:
* ext/xvid/gstxvidenc.c: (gst_xvidenc_profile_get_type),
(gst_xvidenc_base_init), (gst_xvidenc_class_init),
(gst_xvidenc_init), (gst_xvidenc_setup), (gst_xvidenc_chain),
(gst_xvidenc_link), (gst_xvidenc_set_property),
(gst_xvidenc_get_property), (gst_xvidenc_change_state):
* ext/xvid/gstxvidenc.h:
Update xvid plugin to latest xvid (1.0.0-beta3) API.
2004-01-03 19:38:40 +00:00
|
|
|
|
2005-12-14 22:41:47 +00:00
|
|
|
switch (transition) {
|
|
|
|
case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
|
|
|
|
break;
|
2005-09-05 17:20:29 +00:00
|
|
|
case GST_STATE_CHANGE_PAUSED_TO_READY:
|
Update xvid plugin to latest xvid (1.0.0-beta3) API.
Original commit message from CVS:
2004-01-03 Ronald Bultje <rbultje@ronald.bitfreak.net>
reviewed by: <delete if not using a buddy>
* configure.ac:
* ext/xvid/gstxvid.c: (gst_xvid_init), (gst_xvid_error),
(gst_xvid_structure_to_csp), (gst_xvid_csp_to_caps):
* ext/xvid/gstxvid.h:
* ext/xvid/gstxviddec.c: (gst_xviddec_class_init),
(gst_xviddec_init), (gst_xviddec_setup), (gst_xviddec_chain),
(gst_xviddec_src_link), (gst_xviddec_sink_link),
(gst_xviddec_change_state):
* ext/xvid/gstxviddec.h:
* ext/xvid/gstxvidenc.c: (gst_xvidenc_profile_get_type),
(gst_xvidenc_base_init), (gst_xvidenc_class_init),
(gst_xvidenc_init), (gst_xvidenc_setup), (gst_xvidenc_chain),
(gst_xvidenc_link), (gst_xvidenc_set_property),
(gst_xvidenc_get_property), (gst_xvidenc_change_state):
* ext/xvid/gstxvidenc.h:
Update xvid plugin to latest xvid (1.0.0-beta3) API.
2004-01-03 19:38:40 +00:00
|
|
|
if (xviddec->handle) {
|
2004-03-15 19:32:27 +00:00
|
|
|
gst_xviddec_unset (xviddec);
|
Update xvid plugin to latest xvid (1.0.0-beta3) API.
Original commit message from CVS:
2004-01-03 Ronald Bultje <rbultje@ronald.bitfreak.net>
reviewed by: <delete if not using a buddy>
* configure.ac:
* ext/xvid/gstxvid.c: (gst_xvid_init), (gst_xvid_error),
(gst_xvid_structure_to_csp), (gst_xvid_csp_to_caps):
* ext/xvid/gstxvid.h:
* ext/xvid/gstxviddec.c: (gst_xviddec_class_init),
(gst_xviddec_init), (gst_xviddec_setup), (gst_xviddec_chain),
(gst_xviddec_src_link), (gst_xviddec_sink_link),
(gst_xviddec_change_state):
* ext/xvid/gstxviddec.h:
* ext/xvid/gstxvidenc.c: (gst_xvidenc_profile_get_type),
(gst_xvidenc_base_init), (gst_xvidenc_class_init),
(gst_xvidenc_init), (gst_xvidenc_setup), (gst_xvidenc_chain),
(gst_xvidenc_link), (gst_xvidenc_set_property),
(gst_xvidenc_get_property), (gst_xvidenc_change_state):
* ext/xvid/gstxvidenc.h:
Update xvid plugin to latest xvid (1.0.0-beta3) API.
2004-01-03 19:38:40 +00:00
|
|
|
}
|
|
|
|
break;
|
2005-12-14 22:41:47 +00:00
|
|
|
case GST_STATE_CHANGE_READY_TO_NULL:
|
|
|
|
break;
|
Update xvid plugin to latest xvid (1.0.0-beta3) API.
Original commit message from CVS:
2004-01-03 Ronald Bultje <rbultje@ronald.bitfreak.net>
reviewed by: <delete if not using a buddy>
* configure.ac:
* ext/xvid/gstxvid.c: (gst_xvid_init), (gst_xvid_error),
(gst_xvid_structure_to_csp), (gst_xvid_csp_to_caps):
* ext/xvid/gstxvid.h:
* ext/xvid/gstxviddec.c: (gst_xviddec_class_init),
(gst_xviddec_init), (gst_xviddec_setup), (gst_xviddec_chain),
(gst_xviddec_src_link), (gst_xviddec_sink_link),
(gst_xviddec_change_state):
* ext/xvid/gstxviddec.h:
* ext/xvid/gstxvidenc.c: (gst_xvidenc_profile_get_type),
(gst_xvidenc_base_init), (gst_xvidenc_class_init),
(gst_xvidenc_init), (gst_xvidenc_setup), (gst_xvidenc_chain),
(gst_xvidenc_link), (gst_xvidenc_set_property),
(gst_xvidenc_get_property), (gst_xvidenc_change_state):
* ext/xvid/gstxvidenc.h:
Update xvid plugin to latest xvid (1.0.0-beta3) API.
2004-01-03 19:38:40 +00:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2005-12-14 22:41:47 +00:00
|
|
|
return ret;
|
2003-07-06 20:49:52 +00:00
|
|
|
}
|