summaryrefslogtreecommitdiffstats
path: root/gst
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@gmail.com>2002-03-30 17:06:26 +0000
committerWim Taymans <wim.taymans@gmail.com>2002-03-30 17:06:26 +0000
commit13d9e8d35227337a04b0cd24a0dda7c0c3961289 (patch)
tree9a4e6fa918604e74a46251b50d2f26d7c0d2d024 /gst
parentc5e4b06ff518ca83a403c175e22a802ee73714f1 (diff)
Changed to the new props API
Original commit message from CVS: Changed to the new props API Other small tuff.
Diffstat (limited to 'gst')
-rw-r--r--gst/avi/gstavidemux.c5
-rw-r--r--gst/avi/gstavimux.c88
-rw-r--r--gst/cutter/gstcutter.c6
-rw-r--r--gst/goom/gstgoom.c2
-rw-r--r--gst/level/gstlevel.c2
-rw-r--r--gst/median/gstmedian.c4
6 files changed, 65 insertions, 42 deletions
diff --git a/gst/avi/gstavidemux.c b/gst/avi/gstavidemux.c
index d659a3f3..8023e971 100644
--- a/gst/avi/gstavidemux.c
+++ b/gst/avi/gstavidemux.c
@@ -583,12 +583,12 @@ gst_avidemux_parse_index (GstAviDemux *avi_demux,
if (GST_BUFFER_OFFSET (buf) != filepos + offset || GST_BUFFER_SIZE (buf) != 8) {
GST_INFO (GST_CAT_PLUGIN_INFO, "avidemux: could not get index");
- return;
+ goto end;
}
if (gst_riff_fourcc_to_id (GST_BUFFER_DATA (buf)) != GST_RIFF_TAG_idx1) {
GST_INFO (GST_CAT_PLUGIN_INFO, "avidemux: no index found");
- return;
+ goto end;
}
index_size = GUINT32_FROM_LE(*(guint32 *)(GST_BUFFER_DATA (buf) + 4));
@@ -604,6 +604,7 @@ gst_avidemux_parse_index (GstAviDemux *avi_demux,
memcpy (avi_demux->index_entries, GST_BUFFER_DATA (buf), GST_BUFFER_SIZE (buf));
gst_buffer_unref (buf);
+end:
if (!gst_bytestream_seek (avi_demux->bs, GST_SEEK_BYTEOFFSET_SET, filepos)) {
GST_INFO (GST_CAT_PLUGIN_INFO, "avidemux: could not seek back to movi");
return;
diff --git a/gst/avi/gstavimux.c b/gst/avi/gstavimux.c
index 4273a40a..eab64bad 100644
--- a/gst/avi/gstavimux.c
+++ b/gst/avi/gstavimux.c
@@ -292,57 +292,68 @@ gst_avimux_sinkconnect (GstPad *pad, GstCaps *vscaps)
if (!strcmp (mimetype, "video/avi"))
{
- const gchar* format = gst_caps_get_string(caps, "format");
+ const gchar* format;
+
+ gst_caps_get_string (caps, "format", &format);
if (!strncmp (format, "strf_vids", 9)) {
avimux->vids.size = sizeof(gst_riff_strf_vids);
- avimux->vids.width = gst_caps_get_int (caps, "width");
- avimux->vids.height = gst_caps_get_int (caps, "height");
- avimux->vids.planes = gst_caps_get_int (caps, "planes");
- avimux->vids.bit_cnt = gst_caps_get_int (caps, "bit_cnt");
- avimux->vids.compression = gst_caps_get_fourcc_int (caps, "compression");
- avimux->vids.image_size = gst_caps_get_int (caps, "image_size");
- avimux->vids.xpels_meter = gst_caps_get_int (caps, "xpels_meter");
- avimux->vids.ypels_meter = gst_caps_get_int (caps, "ypels_meter");
- avimux->vids.num_colors = gst_caps_get_int (caps, "num_colors");
- avimux->vids.imp_colors = gst_caps_get_int (caps, "imp_colors");
+ gst_caps_get (caps,
+ "width", GST_PROPS_INT_TYPE, &avimux->vids.width,
+ "height", GST_PROPS_INT_TYPE, &avimux->vids.height,
+ "planes", GST_PROPS_INT_TYPE, &avimux->vids.planes,
+ "bit_cnt", GST_PROPS_INT_TYPE, &avimux->vids.bit_cnt,
+ "compression", GST_PROPS_FOURCC_TYPE, &avimux->vids.compression,
+ "image_size", GST_PROPS_INT_TYPE, &avimux->vids.image_size,
+ "xpels_meter", GST_PROPS_INT_TYPE, &avimux->vids.xpels_meter,
+ "ypels_meter", GST_PROPS_INT_TYPE, &avimux->vids.ypels_meter,
+ "num_colors", GST_PROPS_INT_TYPE, &avimux->vids.num_colors,
+ "imp_colors", GST_PROPS_INT_TYPE, &avimux->vids.imp_colors,
+ NULL);
}
else if (!strncmp (format, "strf_auds", 9)) {
- avimux->auds.format = gst_caps_get_int (caps, "format");
- avimux->auds.channels = gst_caps_get_int (caps, "channels");
- avimux->auds.rate = gst_caps_get_int (caps, "rate");
- avimux->auds.av_bps = gst_caps_get_int (caps, "av_bps");
- avimux->auds.blockalign = gst_caps_get_int (caps, "blockalign");
- avimux->auds.size = gst_caps_get_int (caps, "size");
+ gst_caps_get (caps,
+ "format", GST_PROPS_INT_TYPE, &avimux->auds.format,
+ "channels", GST_PROPS_INT_TYPE, &avimux->auds.channels,
+ "rate", GST_PROPS_INT_TYPE, &avimux->auds.rate,
+ "av_bps", GST_PROPS_INT_TYPE, &avimux->auds.av_bps,
+ "blockalign", GST_PROPS_INT_TYPE, &avimux->auds.blockalign,
+ "size", GST_PROPS_INT_TYPE, &avimux->auds.size,
+ NULL);
}
goto done;
}
else if (!strcmp (mimetype, "video/raw"))
{
- switch (gst_caps_get_fourcc_int(caps, "format"))
+ guint32 format;
+
+ gst_caps_get_fourcc_int (caps, "format", &format);
+ switch (format)
{
case GST_MAKE_FOURCC('Y','U','Y','2'):
case GST_MAKE_FOURCC('I','4','2','0'):
case GST_MAKE_FOURCC('Y','4','1','P'):
case GST_MAKE_FOURCC('R','G','B',' '):
avimux->vids.size = sizeof(gst_riff_strf_vids);
- avimux->vids.width = gst_caps_get_int (caps, "width");
- avimux->vids.height = gst_caps_get_int (caps, "height");
+ gst_caps_get (caps,
+ "width", GST_PROPS_INT_TYPE, &avimux->vids.width,
+ "height", GST_PROPS_INT_TYPE, &avimux->vids.height,
+ NULL);
avimux->vids.planes = 1;
- switch (gst_caps_get_fourcc_int(caps, "format"))
+ switch (format)
{
case GST_MAKE_FOURCC('Y','U','Y','2'):
avimux->vids.bit_cnt = 16; /* YUY2 */
break;
case GST_MAKE_FOURCC('R','G','B',' '):
- avimux->vids.bit_cnt = gst_caps_get_fourcc_int(caps, "bpp"); /* RGB */
+ gst_caps_get_int (caps, "bpp", &avimux->vids.bit_cnt); /* RGB */
break;
case GST_MAKE_FOURCC('Y','4','1','P'):
case GST_MAKE_FOURCC('I','4','2','0'):
avimux->vids.bit_cnt = 12; /* Y41P or I420 */
break;
}
- avimux->vids.compression = gst_caps_get_fourcc_int(caps, "format");
+ gst_caps_get_fourcc_int(caps, "format", &avimux->vids.compression);
avimux->vids.image_size = avimux->vids.height * avimux->vids.width;
goto done;
default:
@@ -352,8 +363,10 @@ gst_avimux_sinkconnect (GstPad *pad, GstCaps *vscaps)
else if (!strcmp (mimetype, "video/jpeg"))
{
avimux->vids.size = sizeof(gst_riff_strf_vids);
- avimux->vids.width = gst_caps_get_int (caps, "width");
- avimux->vids.height = gst_caps_get_int (caps, "height");
+ gst_caps_get (caps,
+ "width", GST_PROPS_INT_TYPE, &avimux->vids.width,
+ "height", GST_PROPS_INT_TYPE, &avimux->vids.height,
+ NULL);
avimux->vids.planes = 1;
avimux->vids.bit_cnt = 24;
avimux->vids.compression = GST_MAKE_FOURCC('M','J','P','G');
@@ -362,20 +375,29 @@ gst_avimux_sinkconnect (GstPad *pad, GstCaps *vscaps)
}
else if (!strcmp (mimetype, "audio/raw"))
{
+ gint width;
+
avimux->auds.format = GST_RIFF_WAVE_FORMAT_PCM;
- avimux->auds.channels = gst_caps_get_int (caps, "channels");
- avimux->auds.rate = gst_caps_get_int (caps, "rate");
- avimux->auds.av_bps = gst_caps_get_int (caps, "width") * avimux->auds.rate *
- avimux->auds.channels / 8;
- avimux->auds.blockalign = gst_caps_get_int (caps, "width") * avimux->auds.channels/8;
- avimux->auds.size = gst_caps_get_int (caps, "depth");
+ gst_caps_get (caps,
+ "channels", GST_PROPS_INT_TYPE, &avimux->auds.channels,
+ "rate", GST_PROPS_INT_TYPE, &avimux->auds.rate,
+ "width", GST_PROPS_INT_TYPE, &width,
+ "depth", GST_PROPS_INT_TYPE, &avimux->auds.size,
+ NULL);
+ avimux->auds.av_bps = width * avimux->auds.rate * avimux->auds.channels / 8;
+ avimux->auds.blockalign = width * avimux->auds.channels/8;
goto done;
}
else if (!strcmp (mimetype, "audio/mp3"))
{
+ gint layer;
+
+ gst_caps_get_int(caps, "layer", &layer);
+
/* we don't need to do anything here, compressed mp3 contains it all */
- avimux->auds.format = gst_caps_get_int(caps, "layer")==3?
- GST_RIFF_WAVE_FORMAT_MPEGL3:GST_RIFF_WAVE_FORMAT_MPEGL12;
+ avimux->auds.format = (layer == 3?
+ GST_RIFF_WAVE_FORMAT_MPEGL3 :
+ GST_RIFF_WAVE_FORMAT_MPEGL12);
goto done;
}
}
diff --git a/gst/cutter/gstcutter.c b/gst/cutter/gstcutter.c
index a8fd2108..74d582e5 100644
--- a/gst/cutter/gstcutter.c
+++ b/gst/cutter/gstcutter.c
@@ -235,13 +235,13 @@ gst_cutter_chain (GstPad *pad, GstBuffer *buf)
if (filter->silent)
{
/* g_print ("DEBUG: cutter: cut to here, turning off out\n"); */
- gtk_signal_emit (G_OBJECT (filter), gst_cutter_signals[CUT_STOP]);
+ g_signal_emit (G_OBJECT (filter), gst_cutter_signals[CUT_STOP], 0);
}
else
{
/* g_print ("DEBUG: cutter: start from here, turning on out\n"); */
/* first of all, flush current buffer */
- gtk_signal_emit (G_OBJECT (filter), gst_cutter_signals[CUT_START]);
+ g_signal_emit (G_OBJECT (filter), gst_cutter_signals[CUT_START], 0);
g_print ("DEBUG: cutter: flushing buffer ");
while (filter->pre_buffer)
{
@@ -389,7 +389,7 @@ gst_cutter_get_caps (GstPad *pad, GstCutter* filter)
/* FIXME : Please change this to a better warning method ! */
if (caps == NULL)
printf ("WARNING: cutter: get_caps: Could not get caps of pad !\n");
- filter->width = gst_caps_get_int (caps, "width");
+ gst_caps_get_int (caps, "width", &filter->width);
filter->max_sample = gst_audio_highest_sample_value (pad);
filter->have_caps = TRUE;
}
diff --git a/gst/goom/gstgoom.c b/gst/goom/gstgoom.c
index bdbd07fc..fe9d5407 100644
--- a/gst/goom/gstgoom.c
+++ b/gst/goom/gstgoom.c
@@ -114,7 +114,7 @@ GST_PADTEMPLATE_FACTORY (sink_template,
"width", GST_PROPS_INT (16),
"depth", GST_PROPS_INT (16),
"rate", GST_PROPS_INT_RANGE (8000, 96000),
- "channels", GST_PROPS_INT (1)
+ "channels", GST_PROPS_INT (2)
)
)
diff --git a/gst/level/gstlevel.c b/gst/level/gstlevel.c
index 8ceade15..29f1863c 100644
--- a/gst/level/gstlevel.c
+++ b/gst/level/gstlevel.c
@@ -173,7 +173,7 @@ gst_level_chain (GstPad *pad,GstBuffer *buf)
printf ("WARNING : chain : Could not get caps of pad !\n");
}
- width = gst_caps_get_int(caps, "width");
+ gst_caps_get_int(caps, "width", &width);
in_data = (gint16 *)GST_BUFFER_DATA(buf);
outbuf=gst_buffer_new();
diff --git a/gst/median/gstmedian.c b/gst/median/gstmedian.c
index 2c6113dc..79a1311a 100644
--- a/gst/median/gstmedian.c
+++ b/gst/median/gstmedian.c
@@ -134,8 +134,8 @@ gst_median_sinkconnect (GstPad *pad, GstCaps *caps)
if (!GST_CAPS_IS_FIXED (caps))
return GST_PAD_CONNECT_DELAYED;
- filter->width = gst_caps_get_int (caps, "width");
- filter->height = gst_caps_get_int (caps, "height");
+ gst_caps_get_int (caps, "width", &filter->width);
+ gst_caps_get_int (caps, "height", &filter->height);
return GST_PAD_CONNECT_OK;
}