AC_SUBST(GST_HTTPSRC_GET_TYPE)
])
+dnl *** Jack ***
+translit(dnm, m, l) AM_CONDITIONAL(USE_LCS, true)
+GST_CHECK_FEATURE(LCS, Lcs, lcs, [
+ PKG_CHECK_MODULES(LCS, lcs, HAVE_LCS="yes", HAVE_LCS="no")
+ AC_SUBST(LCS_CFLAGS)
+ AC_SUBST(LCS_LIBS)
+])
+
dnl *** Jack ***
translit(dnm, m, l) AM_CONDITIONAL(USE_JACK, true)
GST_CHECK_FEATURE(JACK, Jack, jack, [
ext/http/Makefile
ext/jack/Makefile
ext/jpeg/Makefile
+ext/lcs/Makefile
ext/ladspa/Makefile
ext/lame/Makefile
ext/mad/Makefile
GList *l;
GstAlsaPad *pad;
- g_return_val_if_fail (this = GST_ALSA(element), NULL);
+ g_return_val_if_fail ((this = GST_ALSA(element)), NULL);
/* you can't request a pad if the non-request pad is connected */
g_return_val_if_fail (this->data_interleaved == FALSE ||
static gboolean
gst_alsa_parse_caps (GstAlsa *this, GstCaps *caps)
{
- gint law, endianness, width, depth;
+ gint law, endianness, width, depth, channels;
gboolean sign;
gint format = -1;
const gchar* format_name;
- format_name = gst_caps_get_string(caps, "format");
+ gst_caps_get_string(caps, "format", &format_name);
if (format_name == NULL) {
return FALSE;
} else if (strcmp(format_name, "int")==0) {
- width = gst_caps_get_int (caps, "width");
- depth = gst_caps_get_int (caps, "depth");
+ gst_caps_get_int (caps, "width", &width);
+ gst_caps_get_int (caps, "depth", &depth);
- law = gst_caps_get_int (caps, "law");
- endianness = gst_caps_get_int (caps, "endianness");
- sign = gst_caps_get_boolean (caps, "signed");
+ gst_caps_get_int (caps, "law", &law);
+ gst_caps_get_int (caps, "endianness", &endianness);
+ gst_caps_get_boolean (caps, "signed", &sign);
if (law == 0) {
if (width == 8) {
return FALSE;
}
} else if (strcmp(format_name, "float")==0) {
- if (strcmp(gst_caps_get_string(caps, "layout"), "gfloat")==0) {
+ const gchar *layout;
+
+ gst_caps_get_string(caps, "layout", &layout);
+
+ if (strcmp(layout, "gfloat")==0) {
format = SND_PCM_FORMAT_FLOAT;
} else {
return FALSE;
}
this->format = format;
- this->rate = gst_caps_get_int(caps, "rate");
+ gst_caps_get_int(caps, "rate", &this->rate);
+ gst_caps_get_int(caps, "channels", &channels);
+
if (this->data_interleaved)
- this->channels = gst_caps_get_int(caps, "channels");
- else if (gst_caps_get_int(caps, "channels") != 1)
+ this->channels = channels;
+ else if (channels != 1)
return FALSE;
return TRUE;
if (!GST_CAPS_IS_FIXED (caps))
return GST_PAD_CONNECT_DELAYED;
- vorbisenc->channels = gst_caps_get_int (caps, "channels");
- vorbisenc->frequency = gst_caps_get_int (caps, "rate");
+ gst_caps_get_int (caps, "channels", &vorbisenc->channels);
+ gst_caps_get_int (caps, "rate", &vorbisenc->frequency);
gst_vorbisenc_setup (vorbisenc);
/* add a comment */
vorbis_comment_init (&vorbisenc->vc);
vorbis_comment_add (&vorbisenc->vc, (gchar *)comment);
+ /*
gst_element_send_event (GST_ELEMENT (vorbisenc),
gst_event_new_info ("comment", GST_PROPS_STRING (comment), NULL));
+ */
/* set up the analysis state and auxiliary encoding storage */
vorbis_analysis_init (&vorbisenc->vd, &vorbisenc->vi);
/* ERROR: could not get caps of pad */
return 0;
- width = gst_caps_get_int (caps, "width");
- channels = gst_caps_get_int (caps, "channels");
+ gst_caps_get_int (caps, "width", &width);
+ gst_caps_get_int (caps, "channels", &channels);
return (width / 8) * channels;
}
*/
{
GstCaps *caps = NULL;
+ gint rate;
/* get caps of pad */
caps = GST_PAD_CAPS (pad);
if (caps == NULL)
/* ERROR: could not get caps of pad */
return 0;
- else
- return gst_caps_get_int (caps, "rate");
+ else {
+ gst_caps_get_int (caps, "rate", &rate);
+ return rate;
+ }
}
double
long bytes = 0;
int width = 0;
int channels = 0;
- long rate = 0L;
+ int rate = 0;
double length;
else
{
bytes = GST_BUFFER_SIZE (buf);
- width = gst_caps_get_int (caps, "width");
- channels = gst_caps_get_int (caps, "channels");
- rate = gst_caps_get_int (caps, "rate");
+ gst_caps_get_int (caps, "width", &width);
+ gst_caps_get_int (caps, "channels", &channels);
+ gst_caps_get_int (caps, "rate", &rate);
length = (bytes * 8.0) / (double) (rate * channels * width);
}
/* FIXME : Please change this to a better warning method ! */
if (caps == NULL)
printf ("WARNING: gstaudio: could not get caps of pad !\n");
- width = gst_caps_get_int (caps, "width");
- is_signed = gst_caps_get_boolean (caps, "signed");
+
+ gst_caps_get_int (caps, "width", &width);
+ gst_caps_get_boolean (caps, "signed", &is_signed);
+
if (is_signed) --width;
/* example : 16 bit, signed : samples between -32768 and 32767 */
return ((long) (1 << width));
static gboolean
gst_adder_parse_caps (GstAdder *adder, GstCaps *caps)
{
- const gchar *format = gst_caps_get_string (caps, "format");
+ const gchar *format;
+
+ gst_caps_get_string (caps, "format", &format);
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) {
adder->format = GST_ADDER_FORMAT_INT;
- adder->width = gst_caps_get_int (caps, "width");
- adder->depth = gst_caps_get_int (caps, "depth");
- adder->law = gst_caps_get_int (caps, "law");
- adder->endianness = gst_caps_get_int (caps, "endianness");
- adder->is_signed = gst_caps_get_int (caps, "signed");
- adder->channels = gst_caps_get_int (caps, "channels");
+ 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);
} else if (strcmp (format, "float") == 0) {
adder->format = GST_ADDER_FORMAT_FLOAT;
- adder->layout = gst_caps_get_string (caps, "layout");
- adder->intercept = gst_caps_get_float (caps, "intercept");
- adder->slope = gst_caps_get_float (caps, "slope");
- adder->channels = gst_caps_get_int (caps, "channels");
+ 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);
}
} else {
/* otherwise, a previously-connected pad has set all the values. we should
barf if some of the attempted new values don't match. */
if (strcmp (format, "int") == 0) {
+ gint width, channels;
+ gboolean is_signed;
+
+ gst_caps_get_int (caps, "width", &width);
+ gst_caps_get_int (caps, "channels", &channels);
+ gst_caps_get_boolean (caps, "signed", &is_signed);
+
if ((adder->format != GST_ADDER_FORMAT_INT) ||
- (adder->width != gst_caps_get_int (caps, "width")) ||
- (adder->channels != gst_caps_get_int (caps, "channels")) ||
- (adder->is_signed != gst_caps_get_int (caps, "signed"))) {
+ (adder->width != width) ||
+ (adder->channels != channels) ||
+ (adder->is_signed != is_signed)) {
return FALSE;
}
} else if (strcmp (format, "float") == 0) {
+ gint channels;
+
+ gst_caps_get_int (caps, "channels", &channels);
+
if ((adder->format != GST_ADDER_FORMAT_FLOAT) ||
- (adder->channels != gst_caps_get_int (caps, "channels"))) {
+ (adder->channels != channels)) {
return FALSE;
}
} else {
{
Audioscale *audioscale;
resample_t *r;
+ gint rate;
audioscale = GST_AUDIOSCALE (gst_pad_get_parent (pad));
r = audioscale->resample;
- r->i_rate = gst_caps_get_int (caps, "rate");
- r->channels = gst_caps_get_int (caps, "channels");
+ gst_caps_get_int (caps, "rate", &rate);
+ gst_caps_get_int (caps, "channels", &r->channels);
+
+ r->i_rate = rate;
resample_reinit(r);
/*g_print("audioscale: unsupported scaling method %d\n", audioscale->method); */
noinst_HEADERS = gstsinesrc.h
if HAVE_GTK
-noinst_PROGRAMS = demo-dparams
+noinst_PROGRAMS = demo_dparams
endif
demo_dparams_SOURCES = demo-dparams.c
return GST_PAD_CONNECT_DELAYED;
}
- videoscale->width = gst_caps_get_int (caps, "width");
- videoscale->height = gst_caps_get_int (caps, "height");
- videoscale->format = gst_caps_get_int (caps, "format");
+ gst_caps_get_int (caps, "width", &videoscale->width);
+ gst_caps_get_int (caps, "height", &videoscale->height);
+ gst_caps_get_int (caps, "format", &videoscale->format);
gst_videoscale_setup(videoscale);
size = GST_BUFFER_SIZE(buf);
if(!videoscale->scale_cc){
- videoscale->format = gst_caps_get_int (gst_pad_get_caps(pad), "format");
+ gst_caps_get_int (gst_pad_get_caps(pad), "format", &videoscale->format);
gst_videoscale_setup(videoscale);
}
GST_DEBUG (0,"gst_videoscale_chain: got buffer of %ld bytes in '%s'",size,
g_return_val_if_fail(filter!=NULL,-1);
g_return_val_if_fail(caps!=NULL,-1);
- format = gst_caps_get_string(caps, "format");
+ gst_caps_get_string (caps, "format", &format);
- filter->rate = gst_caps_get_int (caps, "rate");
- filter->channels = gst_caps_get_int (caps, "channels");
+ gst_caps_get_int (caps, "rate", &filter->rate);
+ gst_caps_get_int (caps, "channels", &filter->channels);
if (strcmp(format, "int")==0) {
filter->format = GST_VOLUME_FORMAT_INT;
- filter->width = gst_caps_get_int (caps, "width");
- filter->depth = gst_caps_get_int (caps, "depth");
- filter->law = gst_caps_get_int (caps, "law");
- filter->endianness = gst_caps_get_int (caps, "endianness");
- filter->is_signed = gst_caps_get_int (caps, "signed");
+ gst_caps_get_int (caps, "width", &filter->width);
+ gst_caps_get_int (caps, "depth", &filter->depth);
+ gst_caps_get_int (caps, "law", &filter->law);
+ gst_caps_get_int (caps, "endianness", &filter->endianness);
+ gst_caps_get_int (caps, "signed", &filter->is_signed);
+
if (!filter->silent) {
g_print ("Volume : channels %d, rate %d\n",
filter->channels, filter->rate);
}
} else if (strcmp(format, "float")==0) {
filter->format = GST_VOLUME_FORMAT_FLOAT;
- filter->layout = gst_caps_get_string(caps, "layout");
- filter->intercept = gst_caps_get_float(caps, "intercept");
- filter->slope = gst_caps_get_float(caps, "slope");
+ gst_caps_get_string (caps, "layout", &filter->layout);
+ gst_caps_get_float (caps, "intercept", &filter->intercept);
+ gst_caps_get_float (caps, "slope", &filter->slope);
+
if (!filter->silent) {
g_print ("Volume : channels %d, rate %d\n",
filter->channels, filter->rate);
for (caps = vscapslist; caps != NULL; caps = vscapslist = vscapslist->next)
{
- v4lmjpegsink->width = gst_caps_get_int (caps, "width");
- v4lmjpegsink->height = gst_caps_get_int (caps, "height");
+ gst_caps_get_int (caps, "width", &v4lmjpegsink->width);
+ gst_caps_get_int (caps, "height", &v4lmjpegsink->height);
if (!gst_v4lmjpegsink_set_playback(v4lmjpegsink,
v4lmjpegsink->width, v4lmjpegsink->height,
/* TODO: caps = gst_caps_normalize(capslist); */
for (caps = vscapslist ; caps != NULL ; caps = vscapslist = vscapslist->next)
{
+ guint32 fourcc;
+ gint depth;
+
+ gst_caps_get_fourcc_int (caps, "format", &fourcc);
+
if (v4lsrc->palette > 0)
{
switch (v4lsrc->palette)
{
case VIDEO_PALETTE_YUV420P:
- if (gst_caps_get_fourcc_int (caps, "format") != GST_MAKE_FOURCC('I','4','2','0') &&
- gst_caps_get_fourcc_int (caps, "format") != GST_MAKE_FOURCC('I','Y','U','V'))
+ if (fourcc != GST_MAKE_FOURCC('I','4','2','0') &&
+ fourcc != GST_MAKE_FOURCC('I','Y','U','V'))
goto try_next;
v4lsrc->buffer_size = v4lsrc->width * v4lsrc->height * 1.5;
goto try_caps;
case VIDEO_PALETTE_YUV422:
case VIDEO_PALETTE_YUYV:
- if (gst_caps_get_fourcc_int (caps, "format") != GST_MAKE_FOURCC('Y','U','Y','2'))
+ if (fourcc != GST_MAKE_FOURCC('Y','U','Y','2'))
goto try_next;
v4lsrc->buffer_size = v4lsrc->width * v4lsrc->height * 2;
goto try_caps;
case VIDEO_PALETTE_UYVY:
- if (gst_caps_get_fourcc_int (caps, "format") != GST_MAKE_FOURCC('U','Y','V','Y'))
+ if (fourcc != GST_MAKE_FOURCC('U','Y','V','Y'))
goto try_next;
v4lsrc->buffer_size = v4lsrc->width * v4lsrc->height * 2;
goto try_caps;
case VIDEO_PALETTE_YUV411:
- if (gst_caps_get_fourcc_int (caps, "format") != GST_MAKE_FOURCC('Y','4','1','P'))
+ if (fourcc != GST_MAKE_FOURCC('Y','4','1','P'))
goto try_next;
v4lsrc->buffer_size = v4lsrc->width * v4lsrc->height * 1.5;
goto try_caps;
case VIDEO_PALETTE_RGB555:
- if (gst_caps_get_fourcc_int (caps, "format") != GST_MAKE_FOURCC('R','G','B',' ') ||
- gst_caps_get_int(caps, "depth") != 15)
+ depth = gst_caps_get_int (caps, "depth", &depth);
+ if (fourcc != GST_MAKE_FOURCC('R','G','B',' ') ||
+ depth != 15)
goto try_next;
v4lsrc->buffer_size = v4lsrc->width * v4lsrc->height * 2;
goto try_caps;
case VIDEO_PALETTE_RGB565:
- if (gst_caps_get_fourcc_int (caps, "format") != GST_MAKE_FOURCC('R','G','B',' ') ||
- gst_caps_get_int(caps, "depth") != 16)
+ depth = gst_caps_get_int (caps, "depth", &depth);
+ if (fourcc != GST_MAKE_FOURCC('R','G','B',' ') ||
+ depth != 16)
goto try_next;
v4lsrc->buffer_size = v4lsrc->width * v4lsrc->height * 2;
goto try_caps;
case VIDEO_PALETTE_RGB24:
- if (gst_caps_get_fourcc_int (caps, "format") != GST_MAKE_FOURCC('R','G','B',' ') ||
- gst_caps_get_int(caps, "depth") != 24)
+ depth = gst_caps_get_int (caps, "depth", &depth);
+ if (fourcc != GST_MAKE_FOURCC('R','G','B',' ') ||
+ depth != 24)
goto try_next;
v4lsrc->buffer_size = v4lsrc->width * v4lsrc->height * 3;
goto try_caps;
case VIDEO_PALETTE_RGB32:
- if (gst_caps_get_fourcc_int (caps, "format") != GST_MAKE_FOURCC('R','G','B',' ') ||
- gst_caps_get_int(caps, "depth") != 32)
+ depth = gst_caps_get_int (caps, "depth", &depth);
+ if (fourcc != GST_MAKE_FOURCC('R','G','B',' ') ||
+ depth != 32)
goto try_next;
v4lsrc->buffer_size = v4lsrc->width * v4lsrc->height * 4;
goto try_caps;
}
else
{
- switch (gst_caps_get_fourcc_int(caps, "format"))
+ switch (fourcc)
{
case GST_MAKE_FOURCC('I','4','2','0'):
case GST_MAKE_FOURCC('I','Y','U','V'):
v4lsrc->buffer_size = v4lsrc->width * v4lsrc->height * 1.5;
goto try_caps;
case GST_MAKE_FOURCC('R','G','B',' '):
- switch (gst_caps_get_int(caps, "depth"))
+ depth = gst_caps_get_int (caps, "depth", &depth);
+ switch (depth)
{
case 15:
palette = VIDEO_PALETTE_RGB555;
continue;
/* try to connect the pad/caps with the actual width/height */
- if (palette >= VIDEO_PALETTE_RGB565 && palette <= VIDEO_PALETTE_RGB555)
+ if (palette >= VIDEO_PALETTE_RGB565 && palette <= VIDEO_PALETTE_RGB555) {
+ gint depth;
+ gint bpp;
+
+ gst_caps_get_int(caps, "bpp", &bpp),
+ gst_caps_get_int(caps, "depth", &depth),
+
newcaps = gst_caps_new("v4lsrc_caps",
"video/raw",
gst_props_new(
- "format", GST_PROPS_FOURCC(gst_caps_get_fourcc_int(caps, "format")),
+ "format", GST_PROPS_FOURCC(fourcc),
"width", GST_PROPS_INT(v4lsrc->width),
"height", GST_PROPS_INT(v4lsrc->height),
- "bpp", GST_PROPS_INT(gst_caps_get_int(caps, "bpp")),
- "depth", GST_PROPS_INT(gst_caps_get_int(caps, "depth")),
+ "bpp", GST_PROPS_INT(bpp),
+ "depth", GST_PROPS_INT(depth),
NULL ) );
- else
+ }
+ else {
newcaps = gst_caps_new("v4lsrc_caps",
"video/raw",
gst_props_new(
- "format", GST_PROPS_FOURCC(gst_caps_get_fourcc_int(caps, "format")),
+ "format", GST_PROPS_FOURCC(fourcc),
"width", GST_PROPS_INT(v4lsrc->width),
"height", GST_PROPS_INT(v4lsrc->height),
NULL ) );
+ }
gst_caps_debug (newcaps, "new caps to set on v4lsrc's src pad");
gst_v4lsrc_change_state (GstElement *element)
{
GstV4lSrc *v4lsrc;
- GstElementStateReturn parent_value;
gint transition = GST_STATE_TRANSITION (element);
guint32 fourcc;
gint depth=0, bpp=0;
case VIDEO_PALETTE_UYVY:
fourcc = GST_MAKE_FOURCC('U','Y','V','Y');
break;
+ default:
+ return GST_STATE_FAILURE;
}
if (bpp && depth)
caps = gst_caps_new("v4lsrc_caps",