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 */
|
|
|
|
GstElementDetails gst_xviddec_details = {
|
|
|
|
"Xvid decoder",
|
2004-05-09 14:37:16 +00:00
|
|
|
"Codec/Decoder/Video",
|
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 decoder based on xvidcore",
|
2003-04-22 14:55:12 +00:00
|
|
|
"Ronald Bultje <rbultje@ronald.bitfreak.net>",
|
|
|
|
};
|
|
|
|
|
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 ], "
|
|
|
|
"height = (int) [ 0, MAX ], " "framerate = (double) [ 0, 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
|
|
|
};
|
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
static void gst_xviddec_base_init (gpointer g_class);
|
|
|
|
static void gst_xviddec_class_init (GstXvidDecClass * klass);
|
|
|
|
static void gst_xviddec_init (GstXvidDec * xviddec);
|
|
|
|
static void gst_xviddec_chain (GstPad * pad, GstData * data);
|
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
|
|
|
static GstPadLinkReturn
|
2004-03-14 22:34:33 +00:00
|
|
|
gst_xviddec_sink_link (GstPad * pad, const GstCaps * vscapslist);
|
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
|
|
|
static GstPadLinkReturn
|
2004-03-14 22:34:33 +00:00
|
|
|
gst_xviddec_src_link (GstPad * pad, const GstCaps * vscapslist);
|
|
|
|
static GstCaps *gst_xviddec_src_getcaps (GstPad * pad);
|
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),
|
2003-11-02 02:31:04 +00:00
|
|
|
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
|
|
|
|
gst_xviddec_base_init (gpointer g_class)
|
|
|
|
{
|
|
|
|
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
|
|
|
|
|
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
|
|
|
{
|
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
|
|
|
GstElementClass *gstelement_class = (GstElementClass *) klass;
|
2003-04-22 14:55:12 +00:00
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
parent_class = g_type_class_ref (GST_TYPE_ELEMENT);
|
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);
|
2003-04-22 14:55:12 +00:00
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
gst_pad_set_chain_function (xviddec->sinkpad, gst_xviddec_chain);
|
|
|
|
gst_pad_set_link_function (xviddec->sinkpad, gst_xviddec_sink_link);
|
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);
|
2003-04-22 14:55:12 +00:00
|
|
|
|
2004-01-04 09:55:16 +00:00
|
|
|
gst_pad_set_getcaps_function (xviddec->srcpad, gst_xviddec_src_getcaps);
|
2004-03-14 22:34:33 +00:00
|
|
|
gst_pad_set_link_function (xviddec->srcpad, gst_xviddec_src_link);
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
2004-03-14 22:34:33 +00:00
|
|
|
gst_xviddec_chain (GstPad * pad, GstData * _data)
|
2003-04-22 14:55:12 +00:00
|
|
|
{
|
2003-10-08 16:08:19 +00:00
|
|
|
GstBuffer *buf = GST_BUFFER (_data);
|
2004-03-14 22:34:33 +00:00
|
|
|
GstXvidDec *xviddec = GST_XVIDDEC (GST_OBJECT_PARENT (pad));
|
2003-04-22 14:55:12 +00:00
|
|
|
GstBuffer *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
|
|
|
xvid_dec_frame_t xframe;
|
2003-04-22 14:55:12 +00:00
|
|
|
int ret;
|
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
g_return_if_fail (pad != NULL);
|
|
|
|
g_return_if_fail (GST_IS_PAD (pad));
|
2003-04-22 14:55:12 +00:00
|
|
|
|
|
|
|
if (!xviddec->handle) {
|
2004-02-02 17:23:33 +00:00
|
|
|
GST_ELEMENT_ERROR (xviddec, CORE, NEGOTIATION, (NULL),
|
2004-03-15 19:32:27 +00:00
|
|
|
("format wasn't negotiated before chain function"));
|
2004-03-14 22:34:33 +00:00
|
|
|
gst_buffer_unref (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
|
|
|
return;
|
2003-04-22 14:55:12 +00:00
|
|
|
}
|
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
outbuf = gst_buffer_new_and_alloc (xviddec->width *
|
|
|
|
xviddec->height * xviddec->bpp / 8);
|
|
|
|
GST_BUFFER_TIMESTAMP (outbuf) = GST_BUFFER_TIMESTAMP (buf);
|
|
|
|
GST_BUFFER_DURATION (outbuf) = GST_BUFFER_DURATION (buf);
|
|
|
|
GST_BUFFER_SIZE (outbuf) = xviddec->width *
|
|
|
|
xviddec->height * xviddec->bpp / 8;
|
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
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
if ((ret = xvid_decore (xviddec->handle, XVID_DEC_DECODE, &xframe, NULL)) < 0) {
|
2004-02-02 17:23:33 +00:00
|
|
|
GST_ELEMENT_ERROR (xviddec, STREAM, DECODE, (NULL),
|
2004-03-15 19:32:27 +00:00
|
|
|
("Error decoding xvid frame: %s (%d)\n", gst_xvid_error (ret), ret));
|
2004-03-14 22:34:33 +00:00
|
|
|
gst_buffer_unref (buf);
|
|
|
|
gst_buffer_unref (outbuf);
|
2003-04-22 14:55:12 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
gst_pad_push (xviddec->srcpad, GST_DATA (outbuf));
|
|
|
|
gst_buffer_unref (buf);
|
2003-04-22 14:55:12 +00:00
|
|
|
}
|
|
|
|
|
2004-01-04 09:55:16 +00:00
|
|
|
static GstCaps *
|
2004-03-14 22:34:33 +00:00
|
|
|
gst_xviddec_src_getcaps (GstPad * pad)
|
2004-01-04 09:55:16 +00:00
|
|
|
{
|
|
|
|
GstXvidDec *xviddec = GST_XVIDDEC (gst_pad_get_parent (pad));
|
|
|
|
GstCaps *caps;
|
|
|
|
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;
|
|
|
|
|
|
|
|
if (!GST_PAD_CAPS (xviddec->sinkpad)) {
|
|
|
|
GstPadTemplate *templ = gst_static_pad_template_get (&src_template);
|
2004-03-14 22:34:33 +00:00
|
|
|
|
2004-01-04 09:55:16 +00:00
|
|
|
return gst_caps_copy (gst_pad_template_get_caps (templ));
|
|
|
|
}
|
|
|
|
|
|
|
|
caps = gst_caps_new_empty ();
|
|
|
|
for (i = 0; csp[i] != 0; i++) {
|
|
|
|
GstCaps *one = gst_xvid_csp_to_caps (csp[i], xviddec->width,
|
2004-03-15 19:32:27 +00:00
|
|
|
xviddec->height, xviddec->fps);
|
2004-03-14 22:34:33 +00:00
|
|
|
|
2004-01-04 09:55:16 +00:00
|
|
|
gst_caps_append (caps, one);
|
|
|
|
}
|
|
|
|
|
|
|
|
return caps;
|
|
|
|
}
|
2003-04-22 14:55:12 +00:00
|
|
|
|
|
|
|
static GstPadLinkReturn
|
2004-03-14 22:34:33 +00:00
|
|
|
gst_xviddec_src_link (GstPad * pad, const GstCaps * vscaps)
|
2003-04-22 14:55:12 +00:00
|
|
|
{
|
2004-03-14 22:34:33 +00:00
|
|
|
GstXvidDec *xviddec = GST_XVIDDEC (gst_pad_get_parent (pad));
|
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
|
|
|
GstStructure *structure = gst_caps_get_structure (vscaps, 0);
|
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
|
|
|
if (!GST_PAD_CAPS (xviddec->sinkpad))
|
|
|
|
return GST_PAD_LINK_DELAYED;
|
|
|
|
|
|
|
|
/* if there's something old around, remove it */
|
|
|
|
if (xviddec->handle) {
|
2004-03-14 22:34:33 +00:00
|
|
|
gst_xviddec_unset (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
|
|
|
xviddec->csp = gst_xvid_structure_to_csp (structure, xviddec->width,
|
2004-03-14 22:34:33 +00:00
|
|
|
&xviddec->stride, &xviddec->bpp);
|
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->csp < 0)
|
|
|
|
return GST_PAD_LINK_REFUSED;
|
2003-04-22 14:55:12 +00:00
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
if (!gst_xviddec_setup (xviddec))
|
2004-02-02 20:09:09 +00:00
|
|
|
return GST_PAD_LINK_REFUSED;
|
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
|
|
|
|
|
|
|
return GST_PAD_LINK_OK;
|
|
|
|
}
|
2003-04-22 14:55:12 +00:00
|
|
|
|
2003-07-06 20:49:52 +00:00
|
|
|
static GstPadLinkReturn
|
2004-03-14 22:34:33 +00:00
|
|
|
gst_xviddec_sink_link (GstPad * pad, const GstCaps * vscaps)
|
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;
|
2004-04-28 03:13:48 +00:00
|
|
|
GstPadLinkReturn ret;
|
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
|
|
|
}
|
|
|
|
|
|
|
|
/* 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. */
|
2003-12-22 01:47:09 +00:00
|
|
|
structure = gst_caps_get_structure (vscaps, 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);
|
|
|
|
gst_structure_get_double (structure, "framerate", &xviddec->fps);
|
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
|
|
|
|
2004-04-28 03:13:48 +00:00
|
|
|
ret = gst_pad_renegotiate (xviddec->srcpad);
|
|
|
|
if (ret == GST_PAD_LINK_DELAYED)
|
|
|
|
ret = GST_PAD_LINK_OK;
|
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
|
|
|
|
2004-04-28 03:13:48 +00:00
|
|
|
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);
|
|
|
|
|
|
|
|
switch (GST_STATE_PENDING (element)) {
|
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;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (parent_class->change_state)
|
2005-09-05 17:20:29 +00:00
|
|
|
return 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-09-05 17:20:29 +00:00
|
|
|
return GST_STATE_CHANGE_SUCCESS;
|
2003-07-06 20:49:52 +00:00
|
|
|
}
|