Commit 95011fd7 authored by Ronald S. Bultje's avatar Ronald S. Bultje

New mimetypes gone into effect today - this commit changes all old mimetypes...

New mimetypes gone into effect today - this commit changes all old mimetypes over to the new mimetypes spec as descri...

Original commit message from CVS:
New mimetypes gone into effect today - this commit changes all old mimetypes over to the new mimetypes spec as described in the previous commit's document. Note: some plugins will break, some pipelines will break, expect HEAD to be broken or at least not 100% working for a few days, but don't forget to report bugs
parent 85a8dd7e
......@@ -409,34 +409,35 @@ dnl FIXME: add check if this platform can support linking to a
dnl non-PIC libXv, if not then don not use Xv.
dnl FIXME: perhaps warn user if they have a shared libXv since
dnl this is an error until XFree86 starts shipping one
translit(dnm, m, l) AM_CONDITIONAL(USE_XVIDEO, true)
GST_CHECK_FEATURE(XVIDEO, [X11 XVideo extensions], xvideosink, [
if test -z $X_DISPLAY_MISSING; then
HAVE_XVIDEO=yes
translit(dnm, m, l) AM_CONDITIONAL(USE_XFREE, true)
GST_CHECK_FEATURE(XFREE, [X11 XFree86], xvideosink-X, [
if test "-DX_DISPLAY_MISSING" = "$X_CFLAGS"; then
HAVE_XFREE=no
else
HAVE_XVIDEO=no
HAVE_XFREE=yes
fi
])
dnl Check for Xv extension
if test x$HAVE_XVIDEO = xyes; then
AC_CHECK_LIB(Xv_pic, XvQueryExtension, HAVE_XV="yes", HAVE_XV="no", $X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS)
if test x$HAVE_XV = xyes; then
AC_DEFINE(HAVE_XV, 1, [Define if Xv extension is available])
translit(dnm, m, l) AM_CONDITIONAL(USE_XVIDEO, true)
GST_CHECK_FEATURE(XVIDEO, [X11 XVideo extensions], xvideosink-Xv, [
if test x$HAVE_XFREE = xyes; then
AC_CHECK_LIB(Xv_pic, XvQueryExtension,
HAVE_XVIDEO="yes", HAVE_XVIDEO="no",
$X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS)
XVIDEO_LIBS="-lXv_pic -lXext"
AC_SUBST(XVIDEO_LIBS)
else
AC_CHECK_LIB(Xv, XvQueryExtension, HAVE_XVIDEO="yes", HAVE_XVIDEO="no", $X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS)
if test x$HAVE_XV = xyes; then
AC_DEFINE(HAVE_XV, 1, [Define if Xv extension is available])
dnl try again using something else if we didn't find it first
if test x$HAVE_XVIDEO = xno; then
AC_CHECK_LIB(Xv, XvQueryExtension,
HAVE_XVIDEO="yes", HAVE_XVIDEO="no",
$X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS)
XVIDEO_LIBS="-lXv -lXext"
AC_SUBST(XVIDEO_LIBS)
fi
AC_SUBST(XVIDEO_LIBS)
fi
fi
])
dnl Next, check for the optional libraries:
dnl These are all libraries used in building plug-ins
......
......@@ -47,9 +47,7 @@ GST_PAD_TEMPLATE_FACTORY ( sink_temp,
GST_PAD_ALWAYS,
GST_CAPS_NEW (
"arts_sample",
"audio/raw",
"format", GST_PROPS_STRING ("int"),
"law", GST_PROPS_INT (0),
"audio/x-raw-int",
"depth", GST_PROPS_INT (16),
"width", GST_PROPS_INT (16),
"signed", GST_PROPS_BOOLEAN (TRUE),
......@@ -64,9 +62,7 @@ GST_PAD_TEMPLATE_FACTORY ( src_temp,
GST_PAD_ALWAYS,
GST_CAPS_NEW (
"arts_sample",
"audio/raw",
"format", GST_PROPS_STRING ("int"),
"law", GST_PROPS_INT (0),
"audio/x-raw-int",
"depth", GST_PROPS_INT (16),
"width", GST_PROPS_INT (16),
"signed", GST_PROPS_BOOLEAN (TRUE),
......
......@@ -45,9 +45,6 @@ enum {
enum {
ARG_0,
ARG_MUTE,
ARG_DEPTH,
ARG_CHANNELS,
ARG_RATE,
ARG_NAME,
};
......@@ -57,27 +54,24 @@ GST_PAD_TEMPLATE_FACTORY (sink_factory,
GST_PAD_ALWAYS, /* ALWAYS/SOMETIMES */
GST_CAPS_NEW (
"artsdsink_sink", /* the name of the caps */
"audio/raw", /* the mime type of the caps */
"audio/x-raw-int", /* the mime type of the caps */
"format", GST_PROPS_STRING ("int"),
"law", GST_PROPS_INT (0),
"endianness", GST_PROPS_INT (G_BYTE_ORDER),
"signed", GST_PROPS_BOOLEAN (FALSE),
"width", GST_PROPS_INT (8),
"depth", GST_PROPS_INT (8),
"width", GST_PROPS_LIST (
GST_PROPS_INT (8),
GST_PROPS_INT (16)
),
"depth", GST_PROPS_LIST (
GST_PROPS_INT (8),
GST_PROPS_INT (16)
),
"rate", GST_PROPS_INT_RANGE (8000, 96000),
"channels", GST_PROPS_LIST (GST_PROPS_INT (1), GST_PROPS_INT (2))
),
GST_CAPS_NEW (
"artsdsink_sink", /* the name of the caps */
"audio/raw", /* the mime type of the caps */
"format", GST_PROPS_STRING ("int"),
"law", GST_PROPS_INT (0),
"endianness", GST_PROPS_INT (G_BYTE_ORDER),
"signed", GST_PROPS_BOOLEAN (TRUE),
"width", GST_PROPS_INT (16),
"depth", GST_PROPS_INT (16),
"rate", GST_PROPS_INT_RANGE (8000, 96000),
"channels", GST_PROPS_LIST (GST_PROPS_INT (1), GST_PROPS_INT (2))
"channels", GST_PROPS_LIST (
GST_PROPS_INT (1),
GST_PROPS_INT (2)
)
)
);
......@@ -88,7 +82,7 @@ static gboolean gst_artsdsink_open_audio (GstArtsdsink *sink);
static void gst_artsdsink_close_audio (GstArtsdsink *sink);
static GstElementStateReturn gst_artsdsink_change_state (GstElement *element);
static gboolean gst_artsdsink_sync_parms (GstArtsdsink *artsdsink);
static GstPadLinkReturn gst_artsdsink_link (GstPad *pad, GstCaps *caps);
static void gst_artsdsink_chain (GstPad *pad, GstBuffer *buf);
static void gst_artsdsink_set_property (GObject *object, guint prop_id,
......@@ -96,39 +90,6 @@ static void gst_artsdsink_set_property (GObject *object, guint prop_id,
static void gst_artsdsink_get_property (GObject *object, guint prop_id,
GValue *value, GParamSpec *pspec);
#define GST_TYPE_ARTSDSINK_DEPTHS (gst_artsdsink_depths_get_type())
static GType
gst_artsdsink_depths_get_type (void)
{
static GType artsdsink_depths_type = 0;
static GEnumValue artsdsink_depths[] = {
{8, "8", "8 Bits"},
{16, "16", "16 Bits"},
{0, NULL, NULL},
};
if (!artsdsink_depths_type) {
artsdsink_depths_type = g_enum_register_static("GstArtsdsinkDepths", artsdsink_depths);
}
return artsdsink_depths_type;
}
#define GST_TYPE_ARTSDSINK_CHANNELS (gst_artsdsink_channels_get_type())
static GType
gst_artsdsink_channels_get_type (void)
{
static GType artsdsink_channels_type = 0;
static GEnumValue artsdsink_channels[] = {
{1, "1", "Mono"},
{2, "2", "Stereo"},
{0, NULL, NULL},
};
if (!artsdsink_channels_type) {
artsdsink_channels_type = g_enum_register_static("GstArtsdsinkChannels", artsdsink_channels);
}
return artsdsink_channels_type;
}
static GstElementClass *parent_class = NULL;
/*static guint gst_artsdsink_signals[LAST_SIGNAL] = { 0 }; */
......@@ -167,15 +128,7 @@ gst_artsdsink_class_init (GstArtsdsinkClass *klass)
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_MUTE,
g_param_spec_boolean("mute","mute","mute",
TRUE,G_PARAM_READWRITE)); /* CHECKME */
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_DEPTH,
g_param_spec_enum("depth","depth","depth",
GST_TYPE_ARTSDSINK_DEPTHS,16,G_PARAM_READWRITE)); /* CHECKME! */
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_CHANNELS,
g_param_spec_enum("channels","channels","channels",
GST_TYPE_ARTSDSINK_CHANNELS,2,G_PARAM_READWRITE)); /* CHECKME! */
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_RATE,
g_param_spec_int("frequency","frequency","frequency",
G_MININT,G_MAXINT,0,G_PARAM_READWRITE)); /* CHECKME */
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_NAME,
g_param_spec_string("name","name","name",
NULL, G_PARAM_READWRITE)); /* CHECKME */
......@@ -193,15 +146,10 @@ gst_artsdsink_init(GstArtsdsink *artsdsink)
GST_PAD_TEMPLATE_GET (sink_factory), "sink");
gst_element_add_pad(GST_ELEMENT(artsdsink), artsdsink->sinkpad);
gst_pad_set_chain_function(artsdsink->sinkpad, gst_artsdsink_chain);
gst_pad_set_link_function(artsdsink->sinkpad, gst_artsdsink_link);
artsdsink->connected = FALSE;
artsdsink->mute = FALSE;
/* FIXME: get default from somewhere better than just putting them inline. */
artsdsink->signd = TRUE;
artsdsink->depth = 16;
artsdsink->channels = 2;
artsdsink->frequency = 44100;
artsdsink->connect_name = NULL;
}
......@@ -218,6 +166,26 @@ gst_artsdsink_sync_parms (GstArtsdsink *artsdsink)
return gst_artsdsink_open_audio (artsdsink);
}
static GstPadLinkReturn
gst_artsdsink_link (GstPad *pad, GstCaps *caps)
{
GstArtsdsink *artsdsink = GST_ARTSDSINK (gst_pad_get_parent (pad));
if (!GST_CAPS_FIXED (caps))
return GST_PAD_LINK_DELAYED;
gst_caps_get (caps,
"rate", &artsdsink->frequency,
"depth", &artsdsink->depth,
"signed", &artsdsink->signd,
"channels", &artsdsink->channels,
NULL);
if (gst_artsdsink_sync_parms (artsdsink))
return GST_PAD_LINK_OK;
return GST_PAD_LINK_REFUSED;
}
static void
gst_artsdsink_chain (GstPad *pad, GstBuffer *buf)
......@@ -267,18 +235,6 @@ gst_artsdsink_set_property (GObject *object, guint prop_id, const GValue *value,
case ARG_MUTE:
artsdsink->mute = g_value_get_boolean (value);
break;
case ARG_DEPTH:
artsdsink->depth = g_value_get_enum (value);
gst_artsdsink_sync_parms (artsdsink);
break;
case ARG_CHANNELS:
artsdsink->channels = g_value_get_enum (value);
gst_artsdsink_sync_parms (artsdsink);
break;
case ARG_RATE:
artsdsink->frequency = g_value_get_int (value);
gst_artsdsink_sync_parms (artsdsink);
break;
case ARG_NAME:
if (artsdsink->connect_name != NULL) g_free(artsdsink->connect_name);
if (g_value_get_string (value) == NULL)
......@@ -304,15 +260,6 @@ gst_artsdsink_get_property (GObject *object, guint prop_id, GValue *value, GPara
case ARG_MUTE:
g_value_set_boolean (value, artsdsink->mute);
break;
case ARG_DEPTH:
g_value_set_enum (value, artsdsink->depth);
break;
case ARG_CHANNELS:
g_value_set_enum (value, artsdsink->channels);
break;
case ARG_RATE:
g_value_set_int (value, artsdsink->frequency);
break;
case ARG_NAME:
g_value_set_string (value, artsdsink->connect_name);
break;
......
......@@ -59,9 +59,7 @@ GST_PAD_TEMPLATE_FACTORY (afparse_src_factory,
GST_PAD_ALWAYS,
GST_CAPS_NEW (
"audiofile_src",
"audio/raw",
"format", GST_PROPS_STRING ("int"),
"law", GST_PROPS_INT (0),
"audio/x-raw-int",
"endianness", GST_PROPS_INT (G_BYTE_ORDER),
"signed", GST_PROPS_LIST (GST_PROPS_BOOLEAN (TRUE), GST_PROPS_BOOLEAN (FALSE)),
"width", GST_PROPS_INT_RANGE (8, 16),
......@@ -87,7 +85,7 @@ GST_PAD_TEMPLATE_FACTORY (afparse_sink_factory,
),
GST_CAPS_NEW (
"afparse_sink_snd",
"audio/basic",
"audio/x-au",
NULL
)
)
......@@ -215,7 +213,7 @@ gst_afparse_loop(GstElement *element)
}
if (bypass_afread){
g_print("will bypass afReadFrames\n");
GST_DEBUG("will bypass afReadFrames\n");
}
frames_to_bytes = afparse->channels * afparse->width / 8;
......@@ -352,7 +350,7 @@ gst_afparse_open_file (GstAFParse *afparse)
/* open the file */
g_print("opening vfile %p\n", afparse->vfile);
GST_DEBUG("opening vfile %p\n", afparse->vfile);
afparse->file = afOpenVirtualFile (afparse->vfile, "r", AF_NULL_FILESETUP);
if (afparse->file == AF_NULL_FILEHANDLE)
{
......@@ -361,7 +359,7 @@ gst_afparse_open_file (GstAFParse *afparse)
return FALSE;
}
g_print("vfile opened\n");
GST_DEBUG("vfile opened\n");
/* get the audiofile audio parameters */
{
int sampleFormat, sampleWidth;
......@@ -393,9 +391,7 @@ gst_afparse_open_file (GstAFParse *afparse)
gst_pad_try_set_caps (afparse->srcpad,
GST_CAPS_NEW (
"af_src",
"audio/raw",
"format", GST_PROPS_STRING ("int"),
"law", GST_PROPS_INT (0), /*FIXME */
"audio/x-raw-int",
"endianness", GST_PROPS_INT (G_BYTE_ORDER), /*FIXME */
"signed", GST_PROPS_BOOLEAN (afparse->is_signed),
"width", GST_PROPS_INT (afparse->width),
......@@ -444,22 +440,19 @@ gst_afparse_vf_read (AFvirtualfile *vfile, void *data, size_t nbytes)
/*g_print("no event found with %u bytes\n", got_bytes);*/
return 0;
}
if (event){
g_print("got event\n");
if (GST_EVENT_TYPE(event) == GST_EVENT_EOS){
switch (GST_EVENT_TYPE(event)) {
case GST_EVENT_EOS:
return 0;
}
else if (GST_EVENT_TYPE(event) == GST_EVENT_FLUSH){
g_print("flush\n");
}
else if (GST_EVENT_TYPE(event) == GST_EVENT_DISCONTINUOUS){
g_print("seek done\n");
case GST_EVENT_FLUSH:
GST_DEBUG("flush");
break;
case GST_EVENT_DISCONTINUOUS:
GST_DEBUG("seek done");
got_bytes = gst_bytestream_peek_bytes(bs, &bytes, nbytes);
}
else {
g_print("unknown event %d", GST_EVENT_TYPE(event));
break;
default:
g_warning("unknown event %d", GST_EVENT_TYPE(event));
got_bytes = gst_bytestream_peek_bytes(bs, &bytes, nbytes);
}
}
}
......@@ -493,7 +486,7 @@ gst_afparse_vf_seek (AFvirtualfile *vfile, long offset, int is_relative)
}
if (gst_bytestream_seek(bs, (gint64)offset, method)){
g_print("doing seek to %d\n", (gint)offset);
GST_DEBUG("doing seek to %d", (gint)offset);
return offset;
}
return 0;
......@@ -502,11 +495,12 @@ gst_afparse_vf_seek (AFvirtualfile *vfile, long offset, int is_relative)
static long
gst_afparse_vf_length (AFvirtualfile *vfile)
{
/*GstByteStream *bs = (GstByteStream*)vfile->closure;*/
/* FIXME there is currently no practical way to do this.
* wait for the events rewrite to drop */
g_warning("cannot get length at the moment");
return G_MAXLONG;
GstByteStream *bs = (GstByteStream*)vfile->closure;
guint64 length;
length = gst_bytestream_length(bs);
GST_DEBUG("doing length: %" G_GUINT64_FORMAT, length);
return length;
}
static ssize_t
......@@ -522,7 +516,7 @@ gst_afparse_vf_destroy(AFvirtualfile *vfile)
{
/* GstByteStream *bs = (GstByteStream*)vfile->closure;*/
g_print("doing destroy\n");
GST_DEBUG("doing destroy");
}
static long
......@@ -532,7 +526,7 @@ gst_afparse_vf_tell (AFvirtualfile *vfile)
guint64 offset;
offset = gst_bytestream_tell(bs);
g_print("doing tell: %" G_GUINT64_FORMAT "\n", offset);
GST_DEBUG("doing tell: %" G_GUINT64_FORMAT, offset);
return offset;
}
......@@ -61,9 +61,7 @@ GST_PAD_TEMPLATE_FACTORY (afsink_sink_factory,
GST_PAD_ALWAYS,
GST_CAPS_NEW (
"audiofile_sink",
"audio/raw",
"format", GST_PROPS_STRING ("int"),
"law", GST_PROPS_INT (0),
"audio/x-raw-int",
"endianness", GST_PROPS_INT (G_BYTE_ORDER),
"signed", GST_PROPS_LIST (
GST_PROPS_BOOLEAN (TRUE),
......
......@@ -60,9 +60,7 @@ GST_PAD_TEMPLATE_FACTORY (afsrc_src_factory,
GST_PAD_ALWAYS,
GST_CAPS_NEW (
"audiofile_src",
"audio/raw",
"format", GST_PROPS_STRING ("int"),
"law", GST_PROPS_INT (0),
"audio/x-raw-int",
"endianness", GST_PROPS_INT (G_BYTE_ORDER),
"signed", GST_PROPS_LIST (
GST_PROPS_BOOLEAN (TRUE),
......@@ -345,9 +343,7 @@ gst_afsrc_open_file (GstAFSrc *src)
gst_pad_try_set_caps (src->srcpad,
GST_CAPS_NEW (
"af_src",
"audio/raw",
"format", GST_PROPS_STRING ("int"),
"law", GST_PROPS_INT (0), /*FIXME */
"audio/x-raw-int",
"endianness", GST_PROPS_INT (G_BYTE_ORDER), /*FIXME */
"signed", GST_PROPS_BOOLEAN (src->is_signed),
"width", GST_PROPS_INT (src->width),
......
......@@ -43,28 +43,42 @@ GST_PAD_TEMPLATE_FACTORY(sink_template,
"sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
GST_CAPS_NEW("divxdec_sink",
"video/divx",
NULL)
GST_CAPS_NEW(
"divxdec_sink",
"video/x-divx",
"divxversion", GST_PROPS_INT_RANGE(3, 5),
"width", GST_PROPS_INT_RANGE(0, G_MAXINT),
"height", GST_PROPS_INT_RANGE(0, G_MAXINT),
"framerate", GST_PROPS_FLOAT_RANGE(0, G_MAXFLOAT)
)
)
GST_PAD_TEMPLATE_FACTORY(src_template,
"src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
GST_CAPS_NEW("divxdec_src",
"video/raw",
"format", GST_PROPS_LIST(
GST_PROPS_FOURCC(GST_MAKE_FOURCC('R','G','B',' ')),
GST_PROPS_FOURCC(GST_MAKE_FOURCC('I','4','2','0')),
GST_PROPS_FOURCC(GST_MAKE_FOURCC('I','Y','U','V')),
GST_PROPS_FOURCC(GST_MAKE_FOURCC('Y','U','Y','2')),
GST_PROPS_FOURCC(GST_MAKE_FOURCC('Y','V','1','2')),
GST_PROPS_FOURCC(GST_MAKE_FOURCC('U','Y','V','Y'))
),
"width", GST_PROPS_INT_RANGE(0, G_MAXINT),
"height", GST_PROPS_INT_RANGE(0, G_MAXINT),
NULL)
gst_caps_new(
"divxdec_src",
"video/x-raw-yuv",
GST_VIDEO_YUV_PAD_TEMPLATE_PROPS(
GST_PROPS_LIST(
GST_PROPS_FOURCC(GST_MAKE_FOURCC('I','4','2','0')),
GST_PROPS_FOURCC(GST_MAKE_FOURCC('Y','U','Y','2')),
GST_PROPS_FOURCC(GST_MAKE_FOURCC('Y','V','1','2')),
GST_PROPS_FOURCC(GST_MAKE_FOURCC('U','Y','V','Y'))
)
)
),
gst_caps_new(
"divxdec_src_rgb1",
"video/x-raw-rgb",
GST_VIDEO_RGB_PAD_TEMPLATE_PROPS_24_32
),
gst_caps_new(
"divxdec_src_rgb2",
"video/x-raw-rgb",
GST_VIDEO_RGB_PAD_TEMPLATE_PROPS_15_16
)
)
......@@ -87,6 +101,7 @@ static void gst_divxdec_chain (GstPad *pad,
GstBuffer *buf);
static GstPadLinkReturn gst_divxdec_connect (GstPad *pad,
GstCaps *vscapslist);
static GstPadLinkReturn gst_divxdec_negotiate (GstDivxDec *divxdec);
static GstElementClass *parent_class = NULL;
/* static guint gst_divxdec_signals[LAST_SIGNAL] = { 0 }; */
......@@ -261,10 +276,12 @@ gst_divxdec_chain (GstPad *pad,
divxdec = GST_DIVXDEC(GST_OBJECT_PARENT(pad));
if (!divxdec->handle) {
gst_element_error(GST_ELEMENT(divxdec),
"No format set - aborting");
gst_buffer_unref(buf);
return;
if (gst_divxdec_negotiate(divxdec) <= 0) {
gst_element_error(GST_ELEMENT(divxdec),
"No format set - aborting");
gst_buffer_unref(buf);
return;
}
}
outbuf = gst_buffer_new_and_alloc(divxdec->width *
......@@ -297,10 +314,9 @@ gst_divxdec_chain (GstPad *pad,
static GstPadLinkReturn
gst_divxdec_connect (GstPad *pad,
GstCaps *vscaps)
gst_divxdec_negotiate (GstDivxDec *divxdec)
{
GstDivxDec *divxdec;
GstPadLinkReturn ret;
GstCaps *caps;
struct {
guint32 fourcc;
......@@ -314,8 +330,6 @@ gst_divxdec_connect (GstPad *pad,
GST_MAKE_FOURCC('U','Y','V','Y'), 0 },
{ GST_MAKE_FOURCC('I','4','2','0'), 12, 12,
GST_MAKE_FOURCC('I','4','2','0'), 0 },
{ GST_MAKE_FOURCC('I','Y','U','V'), 12, 12,
GST_MAKE_FOURCC('I','4','2','0'), 0 },
{ GST_MAKE_FOURCC('Y','V','1','2'), 12, 12,
GST_MAKE_FOURCC('Y','V','1','2'), 0 },
{ GST_MAKE_FOURCC('R','G','B',' '), 32, 32,
......@@ -338,69 +352,59 @@ gst_divxdec_connect (GstPad *pad,
};
gint i;
divxdec = GST_DIVXDEC(gst_pad_get_parent (pad));
/* if there's something old around, remove it */
if (divxdec->handle) {
gst_divxdec_unset(divxdec);
}
/* we are not going to act on variable caps */
if (!GST_CAPS_IS_FIXED(vscaps))
return GST_PAD_LINK_DELAYED;
/* if we get here, we know the input is divx. we
* only need to bother with the output colorspace */
gst_caps_get_int(vscaps, "width", &divxdec->width);
gst_caps_get_int(vscaps, "height", &divxdec->height);
for (i = 0; fmt_list[i].fourcc != 0; i++) {
divxdec->csp = fmt_list[i].csp;
/* try making a caps to set on the other side */
if (fmt_list[i].fourcc == GST_MAKE_FOURCC('R','G','B',' ')) {
guint32 r_mask = 0, b_mask = 0, g_mask = 0;
gint endianness = 0;
switch (fmt_list[i].depth) {
case 15:
endianness = G_BYTE_ORDER;
r_mask = 0xf800; g_mask = 0x07c0; b_mask = 0x003e;
break;
case 16:
endianness = G_BYTE_ORDER;
r_mask = 0xf800; g_mask = 0x07e0; b_mask = 0x001f;
break;
case 24:
r_mask = 0xff0000; g_mask = 0x00ff00; b_mask = 0x0000ff;
endianness = G_BIG_ENDIAN;
r_mask = R_MASK_24; g_mask = G_MASK_24; b_mask = B_MASK_24;
break;
case 32:
r_mask = 0xff000000; g_mask = 0x00ff0000; b_mask = 0x0000ff00;
endianness = G_BIG_ENDIAN;
r_mask = R_MASK_32; g_mask = G_MASK_32; b_mask = B_MASK_32;
break;
}
caps = GST_CAPS_NEW("divxdec_src_pad_rgb",
"video/raw",
"video/x-raw-rgb",
"width", GST_PROPS_INT(divxdec->width),
"height", GST_PROPS_INT(divxdec->height),
"format", GST_PROPS_FOURCC(fmt_list[i].fourcc),
"framerate", GST_PROPS_FLOAT(divxdec->fps),
"depth", GST_PROPS_INT(fmt_list[i].depth),
"bpp", GST_PROPS_INT(fmt_list[i].bpp),
"endianness", GST_PROPS_INT(G_BYTE_ORDER),
"endianness", GST_PROPS_INT(endianness),
"red_mask", GST_PROPS_INT(r_mask),
"green_mask", GST_PROPS_INT(g_mask),
"blue_mask", GST_PROPS_INT(b_mask),
NULL);
"blue_mask", GST_PROPS_INT(b_mask));
} else {
caps = GST_CAPS_NEW("divxdec_src_pad_yuv",
"video/raw",
"video/x-raw-yuv",
"width", GST_PROPS_INT(divxdec->width),
"height", GST_PROPS_INT(divxdec->height),
"format", GST_PROPS_FOURCC(fmt_list[i].fourcc),
NULL);
"framerate", GST_PROPS_FLOAT(divxdec->fps),
"format", GST_PROPS_FOURCC(fmt_list[i].fourcc));
}
if (gst_pad_try_set_caps(divxdec->srcpad, caps) > 0) {
if ((ret = gst_pad_try_set_caps(divxdec->srcpad, caps)) > 0) {
divxdec->csp = fmt_list[i].csp;
divxdec->bpp = fmt_list[i].bpp;
divxdec->bitcnt = fmt_list[i].bitcnt;
if (gst_divxdec_setup(divxdec))
return GST_PAD_LINK_OK;
} else if (ret == GST_PAD_LINK_DELAYED) {
return ret; /* trying more is useless */