Commit b0055313 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 d4d75746
......@@ -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
......
This diff is collapsed.
......@@ -60,9 +60,7 @@ GST_PAD_TEMPLATE_FACTORY (cdparanoia_src_factory,
GST_PAD_ALWAYS,
GST_CAPS_NEW (
"cdparanoia_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_BOOLEAN (TRUE),
"width", GST_PROPS_INT (16),
......
......@@ -36,7 +36,7 @@ vorbis_caps_factory (void)
return
gst_caps_new (
"vorbis_vorbis",
"application/x-ogg",
"application/ogg",
NULL);
}
......@@ -46,10 +46,8 @@ raw_caps_factory (void)
return
gst_caps_new (
"vorbis_raw",
"audio/raw",
"audio/x-raw-int",
gst_props_new (
"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),
......@@ -65,10 +63,12 @@ raw_caps2_factory (void)
return
gst_caps_new (
"vorbis_raw_float",
"audio/raw",
"audio/x-raw-float",
gst_props_new (
"format", GST_PROPS_STRING ("float"),
"layout", GST_PROPS_STRING ("IEEE"),
"depth", GST_PROPS_INT (32),
"endianness", GST_PROPS_INT (G_BYTE_ORDER),
"slope", GST_PROPS_FLOAT (1.),
"intercept", GST_PROPS_FLOAT (0.),
"rate", GST_PROPS_INT_RANGE (11025, 48000),
"channels", GST_PROPS_INT (2),
NULL));
......@@ -76,7 +76,7 @@ raw_caps2_factory (void)
static GstTypeDefinition vorbisdefinition = {
"vorbis_audio/x-ogg",
"application/x-ogg",
"application/ogg",
".ogg",
vorbis_type_find,
};
......@@ -98,7 +98,7 @@ vorbis_type_find (GstBuffer *buf, gpointer private)
head = GUINT32_FROM_BE (*((guint32 *)data));
if (head == 0x4F676753) {
return gst_caps_new ("vorbis_type_find", "application/x-ogg", NULL);
return gst_caps_new ("vorbis_type_find", "application/ogg", NULL);
} else {
/* checks for existance of vorbis identification header in case
* there's an ID3 tag */
......@@ -110,7 +110,7 @@ vorbis_type_find (GstBuffer *buf, gpointer private)
data[offset+4] == 'b' &&
data[offset+5] == 'i' &&
data[offset+6] == 's' ) {
return gst_caps_new ("vorbis_type_find", "application/x-ogg", NULL);
return gst_caps_new ("vorbis_type_find", "application/ogg", NULL);
}
}
}
......
......@@ -148,7 +148,7 @@ gst_vorbisenc_class_init (VorbisEncClass * klass)
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_QUALITY,
g_param_spec_float ("quality", "Quality",
"Specify quality instead of specifying a particular bitrate.",
-1.0, 10.0, QUALITY_DEFAULT, G_PARAM_READWRITE));
0.0, 1.0, QUALITY_DEFAULT, G_PARAM_READWRITE));
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_SERIAL,
g_param_spec_int ("serial", "Serial", "Specify a serial number for the stream. (-1 is random)",
-1, G_MAXINT, -1, G_PARAM_READWRITE));
......
......@@ -467,9 +467,7 @@ gst_vorbisfile_new_link (VorbisFile *vorbisfile, gint link)
gst_vorbisfile_update_streaminfo (vorbisfile, link);
caps = GST_CAPS_NEW ("vorbisdec_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_BOOLEAN (TRUE),
"width", GST_PROPS_INT (16),
......
......@@ -52,8 +52,6 @@
#define GST_AUDIO_INT_PAD_TEMPLATE_PROPS \
gst_props_new (\
"format", GST_PROPS_STRING ("int"),\
"law", GST_PROPS_INT (0),\
"endianness", GST_PROPS_INT (G_BYTE_ORDER),\
"signed", GST_PROPS_LIST (\
GST_PROPS_BOOLEAN (TRUE),\
......@@ -70,8 +68,6 @@
#define GST_AUDIO_INT_MONO_PAD_TEMPLATE_PROPS \
gst_props_new (\
"format", GST_PROPS_STRING ("int"),\
"law", GST_PROPS_INT (0),\
"endianness", GST_PROPS_INT (G_BYTE_ORDER),\
"signed", GST_PROPS_LIST (\
GST_PROPS_BOOLEAN (TRUE),\
......@@ -88,8 +84,8 @@
#define GST_AUDIO_FLOAT_MONO_PAD_TEMPLATE_PROPS \
gst_props_new (\
"format", GST_PROPS_STRING ("float"),\
"layout", GST_PROPS_STRING ("gfloat"),\
"depth", GST_PROPS_INT (32),\
"endianness", GST_PROPS_INT (G_BYTE_ORDER),\
"intercept", GST_PROPS_FLOAT (0.0),\
"slope", GST_PROPS_FLOAT (1.0),\
"rate", GST_PROPS_INT_RANGE (GST_AUDIO_MIN_RATE, \
......
......@@ -20,31 +20,36 @@
#include "video.h"
#define NUM_UNITS 1000000000
/* This is simply a convenience function, nothing more or less */
gdouble
gfloat
gst_video_frame_rate (GstPad *pad)
{
GstFormat dest_format = GST_FORMAT_DEFAULT;
gint64 dest_value = 0;
gdouble fps;
/* do a convert request on the source pad */
if (!gst_pad_convert(pad,
GST_FORMAT_TIME, GST_SECOND * NUM_UNITS,
&dest_format, &dest_value))
{
g_warning("gstvideo: pad %s:%s failed to convert time to unit!\n",
GST_ELEMENT_NAME(gst_pad_get_parent (pad)), GST_PAD_NAME(pad));
gfloat fps = 0.;
GstCaps *caps;
/* get pad caps */
caps = GST_PAD_CAPS (pad);
if (caps == NULL) {
g_warning ("gstvideo: failed to get caps of pad %s:%s",
GST_ELEMENT_NAME (gst_pad_get_parent (pad)),
GST_PAD_NAME(pad));
return 0.;
}
if (!gst_caps_has_property_typed (caps, "framerate",
GST_PROPS_FLOAT_TYPE)) {
g_warning ("gstvideo: failed to get framerate property of pad %s:%s",
GST_ELEMENT_NAME (gst_pad_get_parent (pad)),
GST_PAD_NAME (pad));
return 0.;
}
fps = ((gdouble) dest_value) / NUM_UNITS;
gst_caps_get_float (caps, "framerate", &fps);
GST_DEBUG ("Framerate request on pad %s:%s - %f fps",
GST_ELEMENT_NAME(gst_pad_get_parent (pad)), GST_PAD_NAME(pad), fps);
GST_DEBUG ("Framerate request on pad %s:%s: %f",
GST_ELEMENT_NAME (gst_pad_get_parent (pad)),
GST_PAD_NAME(pad), fps);
return fps;
}
......@@ -56,28 +61,37 @@ gst_video_get_size (GstPad *pad,
{
GstCaps *caps;
g_return_val_if_fail(pad != NULL, FALSE);
g_return_val_if_fail (pad != NULL, FALSE);
caps = GST_PAD_CAPS(pad);
if (!caps) {
g_warning("gstvideo: failed to get caps of pad %s:%s",
GST_ELEMENT_NAME(gst_pad_get_parent (pad)), GST_PAD_NAME(pad));
caps = GST_PAD_CAPS (pad);
if (caps == NULL) {
g_warning ("gstvideo: failed to get caps of pad %s:%s",
GST_ELEMENT_NAME (gst_pad_get_parent (pad)),
GST_PAD_NAME(pad));
return FALSE;
}
if (!gst_caps_has_property(caps, "width") ||
!gst_caps_has_property(caps, "height")) {
g_warning("gstvideo: resulting caps doesn't have width/height properties");
if (!gst_caps_has_property_typed (caps, "width",
GST_PROPS_INT_TYPE) ||
!gst_caps_has_property_typed (caps, "height",
GST_PROPS_FLOAT_TYPE)) {
g_warning ("gstvideo: failed to get size properties on pad %s:%s",
GST_ELEMENT_NAME (gst_pad_get_parent (pad)),
GST_PAD_NAME(pad));
return FALSE;
}
if (width)
gst_caps_get_int(caps, "width", width);
gst_caps_get_int (caps, "width", width);
if (height)
gst_caps_get_int(caps, "height", height);
gst_caps_get_int (caps, "height", height);
GST_DEBUG ("size request on pad %s:%s: %dx%d",
GST_ELEMENT_NAME(gst_pad_get_parent (pad)), GST_PAD_NAME(pad),
width?*width:0, height?*height:0);
GST_ELEMENT_NAME (gst_pad_get_parent (pad)),
GST_PAD_NAME (pad),
width ? *width : -1,
height ? *height : -1);
return TRUE;
}
......
......@@ -23,7 +23,155 @@
#include <gst/gst.h>
gdouble gst_video_frame_rate (GstPad *pad);
#if (G_BYTE_ORDER == G_BIG_ENDIAN)
#define R_MASK_32 0xff000000
#define G_MASK_32 0x00ff0000
#define B_MASK_32 0x0000ff00
#define R_MASK_24 0xff0000
#define G_MASK_24 0x00ff00
#define B_MASK_24 0x0000ff
#else
#define R_MASK_32 0x000000ff
#define G_MASK_32 0x0000ff00
#define B_MASK_32 0x00ff0000
#define R_MASK_24 0x0000ff
#define G_MASK_24 0x00ff00
#define B_MASK_24 0xff0000
#endif
#define R_MASK_16 0xf800
#define G_MASK_16 0x07e0
#define B_MASK_16 0x001f
#define R_MASK_15 0x8c00
#define G_MASK_15 0x03e0
#define B_MASK_15 0x001f
#define SIZE_RANGE GST_PROPS_INT_RANGE (16, 4096)
#define FPS_RANGE GST_PROPS_FLOAT_RANGE (0, G_MAXFLOAT)
/* properties for pad templates */
#define GST_VIDEO_RGB_PAD_TEMPLATE_PROPS_24_32 \
gst_props_new ( \
"bpp", GST_PROPS_LIST ( \
GST_PROPS_INT (24), \
GST_PROPS_INT (32) \
), \
"depth", GST_PROPS_LIST ( \
GST_PROPS_INT (24), \
GST_PROPS_INT (32) \
), \
"endianness", GST_PROPS_INT (G_BIG_ENDIAN), \
"red_mask", GST_PROPS_LIST ( \
GST_PROPS_INT (R_MASK_32), \
GST_PROPS_INT (R_MASK_24) \
), \
"green_mask", GST_PROPS_LIST ( \
GST_PROPS_INT (G_MASK_32), \
GST_PROPS_INT (G_MASK_24) \
), \
"blue_mask", GST_PROPS_LIST ( \
GST_PROPS_INT (B_MASK_32), \
GST_PROPS_INT (B_MASK_24) \
), \
"width", SIZE_RANGE, \
"height", SIZE_RANGE, \
"framerate", FPS_RANGE, \
NULL)
#define GST_VIDEO_RGB_PAD_TEMPLATE_PROPS_32 \
gst_props_new ( \
"bpp", GST_PROPS_INT (32), \
"depth", GST_PROPS_INT (32), \
"endianness", GST_PROPS_INT (G_BIG_ENDIAN), \
"red_mask", GST_PROPS_INT (R_MASK_32), \
"green_mask", GST_PROPS_INT (G_MASK_32), \
"blue_mask", GST_PROPS_INT (B_MASK_32), \
"width", SIZE_RANGE, \
"height", SIZE_RANGE, \
"framerate", FPS_RANGE, \
NULL)
#define GST_VIDEO_RGB_PAD_TEMPLATE_PROPS_24 \
gst_props_new ( \
"bpp", GST_PROPS_INT (24), \
"depth", GST_PROPS_INT (24), \
"endianness", GST_PROPS_INT (G_BIG_ENDIAN), \
"red_mask", GST_PROPS_INT (R_MASK_24), \
"green_mask", GST_PROPS_INT (G_MASK_24), \
"blue_mask", GST_PROPS_INT (B_MASK_24), \
"width", SIZE_RANGE, \
"height", SIZE_RANGE, \
"framerate", FPS_RANGE, \
NULL)
#define GST_VIDEO_RGB_PAD_TEMPLATE_PROPS_15_16 \
gst_props_new ( \
"bpp", GST_PROPS_INT (16), \
"depth", GST_PROPS_LIST ( \
GST_PROPS_INT (15), \
GST_PROPS_INT (16) \
), \
"endianness", GST_PROPS_INT (G_BYTE_ORDER), \
"red_mask", GST_PROPS_LIST ( \
GST_PROPS_INT (R_MASK_15), \
GST_PROPS_INT (R_MASK_16) \
), \
"green_mask", GST_PROPS_LIST ( \
GST_PROPS_INT (G_MASK_15), \
GST_PROPS_INT (G_MASK_16) \
), \
"blue_mask", GST_PROPS_LIST ( \
GST_PROPS_INT (B_MASK_15), \
GST_PROPS_INT (B_MASK_16) \
), \
"width", SIZE_RANGE, \
"height", SIZE_RANGE, \
"framerate", FPS_RANGE, \
NULL)
#define GST_VIDEO_RGB_PAD_TEMPLATE_PROPS_16 \
gst_props_new ( \
"bpp", GST_PROPS_INT (16), \
"depth", GST_PROPS_INT (16), \
"endianness", GST_PROPS_INT (G_BYTE_ORDER), \
"red_mask", GST_PROPS_INT (R_MASK_16), \
"green_mask", GST_PROPS_INT (G_MASK_16), \
"blue_mask", GST_PROPS_INT (B_MASK_16), \
"width", SIZE_RANGE, \
"height", SIZE_RANGE, \
"framerate", FPS_RANGE, \
NULL)
#define GST_VIDEO_RGB_PAD_TEMPLATE_PROPS_15 \
gst_props_new ( \
"bpp", GST_PROPS_INT (15), \
"depth", GST_PROPS_INT (15), \
"endianness", GST_PROPS_INT (G_BYTE_ORDER), \
"red_mask", GST_PROPS_INT (R_MASK_15), \
"green_mask", GST_PROPS_INT (G_MASK_15), \
"blue_mask", GST_PROPS_INT (B_MASK_15), \
"width", SIZE_RANGE, \
"height", SIZE_RANGE, \
"framerate", FPS_RANGE, \
NULL)
#define GST_VIDEO_YUV_PAD_TEMPLATE_PROPS(fourcc) \
gst_props_new (\
"format", fourcc, \
"width", SIZE_RANGE, \
"height", SIZE_RANGE, \
"framerate", FPS_RANGE, \
NULL)
/* functions */
gfloat gst_video_frame_rate (GstPad *pad);
gboolean gst_video_get_size (GstPad *pad,
gint *width,
gint *height);
......
......@@ -58,9 +58,9 @@ GST_PAD_TEMPLATE_FACTORY (gst_adder_src_template_factory,
"src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
gst_caps_new ("int_src", "audio/raw",
gst_caps_new ("int_src", "audio/x-raw-int",
GST_AUDIO_INT_PAD_TEMPLATE_PROPS),
gst_caps_new ("float_src", "audio/raw",
gst_caps_new ("float_src", "audio/x-raw-float",
GST_AUDIO_FLOAT_MONO_PAD_TEMPLATE_PROPS)
);
......@@ -68,9 +68,9 @@ GST_PAD_TEMPLATE_FACTORY (gst_adder_sink_template_factory,
"sink%d",
GST_PAD_SINK,
GST_PAD_REQUEST,
gst_caps_new ("int_sink", "audio/raw",
gst_caps_new ("int_sink", "audio/x-raw-int",
GST_AUDIO_INT_PAD_TEMPLATE_PROPS),
gst_caps_new ("float_sink", "audio/raw",
gst_caps_new ("float_sink", "audio/x-raw-float",
GST_AUDIO_FLOAT_MONO_PAD_TEMPLATE_PROPS)
);
......@@ -111,29 +111,27 @@ gst_adder_get_type (void) {
static gboolean
gst_adder_parse_caps (GstAdder *adder, GstCaps *caps)
{
const gchar *format;
const gchar *mimetype;
GstElement *el = GST_ELEMENT (adder);
gst_caps_get_string (caps, "format", &format);
mimetype = gst_caps_get_mime (caps);
if (adder->format == GST_ADDER_FORMAT_UNSET) {
/* the caps haven't been set yet at all,
* so we need to go ahead and set all
the relevant values. */
if (strcmp (format, "int") == 0) {
if (strcmp (mimetype, "audio/x-raw-int") == 0) {
GST_DEBUG ("parse_caps sets adder to format int");
adder->format = GST_ADDER_FORMAT_INT;
gst_caps_get_int (caps, "width", &adder->width);
gst_caps_get_int (caps, "depth", &adder->depth);
gst_caps_get_int (caps, "law", &adder->law);
gst_caps_get_int (caps, "endianness", &adder->endianness);
gst_caps_get_boolean (caps, "signed", &adder->is_signed);
gst_caps_get_int (caps, "channels", &adder->channels);
gst_caps_get_int (caps, "rate", &adder->rate);
} else if (strcmp (format, "float") == 0) {
} else if (strcmp (mimetype, "audio/x-raw-float") == 0) {
GST_DEBUG ("parse_caps sets adder to format float");
adder->format = GST_ADDER_FORMAT_FLOAT;
gst_caps_get_string (caps, "layout", &adder->layout);
gst_caps_get_float (caps, "intercept", &adder->intercept);
gst_caps_get_float (caps, "slope", &adder->slope);
gst_caps_get_int (caps, "channels", &adder->channels);
......@@ -142,7 +140,7 @@ gst_adder_parse_caps (GstAdder *adder, GstCaps *caps)
} else {
/* otherwise, a previously-linked pad has set all the values. we should
barf if some of the attempted new values don't match. */
if (strcmp (format, "int") == 0) {
if (strcmp (mimetype, "audio/x-raw-int") == 0) {
gint width, channels, rate;
gboolean is_signed;
......@@ -179,7 +177,7 @@ gst_adder_parse_caps (GstAdder *adder, GstCaps *caps)
is_signed ? "" : "un");
return FALSE;
}
} else if (strcmp (format, "float") == 0) {
} else if (strcmp (mimetype, "audio/x-raw-float") == 0) {
gint channels, rate;
gst_caps_get_int (caps, "channels", &channels);
......@@ -200,9 +198,6 @@ gst_adder_parse_caps (GstAdder *adder, GstCaps *caps)
gst_element_error (el, "can't link %d Hz pad with %d Hz adder",
rate, adder->rate);
return FALSE;
} else {
/* whoa, we don't know what's trying to link with us ! barf ! */
return FALSE;
}
}
}
......@@ -526,13 +521,11 @@ gst_adder_loop (GstElement *element)
GstCaps *caps =
gst_caps_new ("default_adder_caps",
"audio/raw",
gst_props_new ("format", GST_PROPS_STRING ("int"),
"width", GST_PROPS_INT (16),
"audio/x-raw-int",
gst_props_new ("width", GST_PROPS_INT (16),
"depth", GST_PROPS_INT (16),
"rate", GST_PROPS_INT (44100),
"channels", GST_PROPS_INT (2),
"law", GST_PROPS_INT (0),
"endianness", GST_PROPS_INT (G_BYTE_ORDER),
"signed", GST_PROPS_BOOLEAN (TRUE),
NULL));
......@@ -623,4 +616,3 @@ GstPluginDesc plugin_desc = {
"adder",
plugin_init
};
......@@ -127,9 +127,7 @@ GST_PAD_TEMPLATE_FACTORY (audio_convert_src_template_factory,
GST_PAD_ALWAYS,
GST_CAPS_NEW (
"audio_convert_src",
"audio/raw",
"format", GST_PROPS_STRING ("int"),
"law", GST_PROPS_INT (0),
"audio/x-raw-int",
"endianness", GST_PROPS_LIST (
GST_PROPS_INT (G_LITTLE_ENDIAN),
GST_PROPS_INT (G_BIG_ENDIAN)
......@@ -155,9 +153,7 @@ GST_PAD_TEMPLATE_FACTORY (audio_convert_sink_template_factory,
GST_PAD_ALWAYS,
GST_CAPS_NEW (
"audio_convert_sink",
"audio/raw",
"format", GST_PROPS_STRING ("int"),
"law", GST_PROPS_INT (0),
"audio/x-raw-int",
"endianness", GST_PROPS_LIST (
GST_PROPS_INT (G_LITTLE_ENDIAN),
GST_PROPS_INT (G_BIG_ENDIAN)
......@@ -403,9 +399,7 @@ make_caps (gint endianness, gboolean sign, gint depth, gint width, gint rate, gi
if (width == 1) {
return GST_CAPS_NEW (
"audio_convert_caps",
"audio/raw",
"format", GST_PROPS_STRING ("int"),
"law", GST_PROPS_INT (0),
"audio/x-raw-int",
"signed", GST_PROPS_BOOLEAN (sign),
"depth", GST_PROPS_INT (depth),
"width", GST_PROPS_INT (width * 8),
......@@ -415,9 +409,7 @@ make_caps (gint endianness, gboolean sign, gint depth, gint width, gint rate, gi
} else {
return GST_CAPS_NEW (
"audio_convert_caps",
"audio/raw",
"format", GST_PROPS_STRING ("int"),
"law", GST_PROPS_INT (0),
"audio/x-raw-int",
"endianness", GST_PROPS_INT (endianness),
"signed", GST_PROPS_BOOLEAN (sign),
"depth", GST_PROPS_INT (depth),
......
......@@ -54,37 +54,23 @@ enum {
/* FILL ME */
};
static GstPadTemplate *
sink_template (void)
{
static GstPadTemplate *template = NULL;
if (!template) {
template = gst_pad_template_new ("sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
gst_caps_new
("audioscale_sink",
"audio/raw", GST_AUDIO_INT_PAD_TEMPLATE_PROPS), NULL);
}
return template;
}
static GstPadTemplate *
src_template (void)
{
static GstPadTemplate *template = NULL;
if (!template) {
template = gst_pad_template_new ("src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
gst_caps_new
("audioscale_src",
"audio/raw", GST_AUDIO_INT_PAD_TEMPLATE_PROPS), NULL);
}
return template;
}
GST_PAD_TEMPLATE_FACTORY (sink_factory,
"sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
gst_caps_new ("audioscale_sink",
"audio/x-raw-int",
GST_AUDIO_INT_PAD_TEMPLATE_PROPS)
);
GST_PAD_TEMPLATE_FACTORY (src_factory,
"src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
gst_caps_new ("audioscale_src",
"audio/x-raw-int",
GST_AUDIO_INT_PAD_TEMPLATE_PROPS)
);
#define GST_TYPE_AUDIOSCALE_METHOD (gst_audioscale_method_get_type())
static GType
......@@ -211,12 +197,14 @@ gst_audioscale_init (Audioscale *audioscale)
{
resample_t *r;
audioscale->sinkpad = gst_pad_new_from_template (GST_PAD_TEMPLATE_GET (sink_template), "sink");
audioscale->sinkpad = gst_pad_new_from_template (
GST_PAD_TEMPLATE_GET (sink_factory), "sink");
gst_element_add_pad(GST_ELEMENT(audioscale),audioscale->sinkpad);
gst_pad_set_chain_function(audioscale->sinkpad,gst_audioscale_chain);
gst_pad_set_link_function (audioscale->sinkpad, gst_audioscale_sinkconnect);
audioscale->srcpad = gst_pad_new_from_template (GST_PAD_TEMPLATE_GET (src_template), "src");
audioscale->srcpad = gst_pad_new_from_template (