summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJan Schmidt <thaytan@mad.scientist.com>2005-11-23 10:40:42 +0000
committerJan Schmidt <thaytan@mad.scientist.com>2005-11-23 10:40:42 +0000
commit17e498503cfcb4dc0941b9292f8d40529c282d3d (patch)
tree5806d33f5974aed4642affca6f5e557e80745944 /sys
parent54ec8cf70e476e6de03ff99dc8edd0414feee7af (diff)
po/: Translation string updates
Original commit message from CVS: * po/af.po: * po/az.po: * po/cs.po: * po/en_GB.po: * po/hu.po: * po/it.po: * po/nb.po: * po/nl.po: * po/or.po: * po/sq.po: * po/sr.po: * po/sv.po: * po/uk.po: * po/vi.po: Translation string updates * sys/v4l/gstv4lsrc.c: (gst_v4lsrc_fixate), (gst_v4lsrc_get_caps), (gst_v4lsrc_set_caps): * sys/v4l/v4lsrc_calls.c: (gst_v4lsrc_get_fps), (gst_v4lsrc_get_fps_list), (gst_v4lsrc_buffer_new): * sys/v4l/v4lsrc_calls.h: Improve v4lsrc, by making it work again.
Diffstat (limited to 'sys')
-rw-r--r--sys/v4l/gstv4lsrc.c25
-rw-r--r--sys/v4l/v4lsrc_calls.c34
-rw-r--r--sys/v4l/v4lsrc_calls.h2
3 files changed, 33 insertions, 28 deletions
diff --git a/sys/v4l/gstv4lsrc.c b/sys/v4l/gstv4lsrc.c
index 94e5f0e7..012e1c01 100644
--- a/sys/v4l/gstv4lsrc.c
+++ b/sys/v4l/gstv4lsrc.c
@@ -371,7 +371,7 @@ gst_v4lsrc_get_caps (GstBaseSrc * src)
gint width = GST_V4LELEMENT (src)->vcap.minwidth;
gint height = GST_V4LELEMENT (src)->vcap.minheight;
gint i;
- GValue fps = { 0 };
+ gint fps_n, fps_d;
GList *item;
if (!GST_V4L_IS_OPEN (GST_V4LELEMENT (v4lsrc))) {
@@ -403,8 +403,10 @@ gst_v4lsrc_get_caps (GstBaseSrc * src)
}
- if (!gst_v4lsrc_get_fps (v4lsrc, &fps))
- gst_value_set_fraction (&fps, 0, 1);
+ if (!gst_v4lsrc_get_fps (v4lsrc, &fps_n, &fps_d)) {
+ fps_n = 0;
+ fps_d = 1;
+ }
list = gst_caps_new_empty ();
for (item = v4lsrc->colorspaces; item != NULL; item = item->next) {
@@ -420,9 +422,7 @@ gst_v4lsrc_get_caps (GstBaseSrc * src)
GST_DEBUG_OBJECT (v4lsrc,
"Device reports w: %d-%d, h: %d-%d, fps: %d/%d for palette %d",
vcap->minwidth, vcap->maxwidth, vcap->minheight, vcap->maxheight,
- gst_value_get_fraction_numerator (&fps),
- gst_value_get_fraction_denominator (&fps),
- GPOINTER_TO_INT (item->data));
+ fps_n, fps_d, GPOINTER_TO_INT (item->data));
if (vcap->minwidth < vcap->maxwidth) {
gst_caps_set_simple (one, "width", GST_TYPE_INT_RANGE, vcap->minwidth,
@@ -443,7 +443,8 @@ gst_v4lsrc_get_caps (GstBaseSrc * src)
if (v4lsrc->fps_list) {
gst_structure_set_value (structure, "framerate", v4lsrc->fps_list);
} else {
- gst_structure_set_value (structure, "framerate", &fps);
+ gst_structure_set (structure, "framerate", GST_TYPE_FRACTION,
+ fps_n, fps_d, NULL);
}
} else {
gst_caps_set_simple (one, "framerate", GST_TYPE_FRACTION_RANGE,
@@ -453,7 +454,6 @@ gst_v4lsrc_get_caps (GstBaseSrc * src)
GST_DEBUG_OBJECT (v4lsrc, "caps: %" GST_PTR_FORMAT, one);
gst_caps_append (list, one);
}
- g_value_unset (&fps);
return list;
}
@@ -465,7 +465,7 @@ gst_v4lsrc_set_caps (GstBaseSrc * src, GstCaps * caps)
guint32 fourcc;
gint bpp, depth, w, h, palette = -1;
const GValue *new_fps;
- GValue cur_fps = { 0 };
+ gint cur_fps_n, cur_fps_d;
GstStructure *structure;
struct video_window *vwin;
@@ -501,10 +501,11 @@ gst_v4lsrc_set_caps (GstBaseSrc * src, GstCaps * caps)
gst_value_get_fraction_denominator (new_fps));
/* set framerate if it's not already correct */
- if (!gst_v4lsrc_get_fps (v4lsrc, &cur_fps))
+ if (!gst_v4lsrc_get_fps (v4lsrc, &cur_fps_n, &cur_fps_d))
return FALSE;
- if (gst_value_compare (new_fps, &cur_fps) != GST_VALUE_EQUAL) {
+ if (gst_value_get_fraction_numerator (new_fps) != cur_fps_n ||
+ gst_value_get_fraction_denominator (new_fps) != cur_fps_d) {
int fps_index = (gst_value_get_fraction_numerator (new_fps) * 16) /
(gst_value_get_fraction_denominator (new_fps) * 15);
@@ -514,11 +515,9 @@ gst_v4lsrc_set_caps (GstBaseSrc * src, GstCaps * caps)
/* set bits 16 to 21 to the index */
vwin->flags |= fps_index << 16;
if (!gst_v4l_set_window_properties (GST_V4LELEMENT (v4lsrc))) {
- g_value_unset (&cur_fps);
return FALSE;
}
}
- g_value_unset (&cur_fps);
switch (fourcc) {
case GST_MAKE_FOURCC ('I', '4', '2', '0'):
diff --git a/sys/v4l/v4lsrc_calls.c b/sys/v4l/v4lsrc_calls.c
index babf5364..18f07d7c 100644
--- a/sys/v4l/v4lsrc_calls.c
+++ b/sys/v4l/v4lsrc_calls.c
@@ -501,14 +501,12 @@ gst_v4lsrc_palette_name (int i)
}
gboolean
-gst_v4lsrc_get_fps (GstV4lSrc * v4lsrc, GValue * fps)
+gst_v4lsrc_get_fps (GstV4lSrc * v4lsrc, gint * fps_n, gint * fps_d)
{
gint norm;
gint fps_index;
struct video_window *vwin = &GST_V4LELEMENT (v4lsrc)->vwin;
- g_return_val_if_fail (GST_VALUE_HOLDS_FRACTION (fps), FALSE);
-
/* check if we have vwin window properties giving a framerate,
* as is done for webcams
* See http://www.smcc.demon.nl/webcam/api.html
@@ -521,7 +519,11 @@ gst_v4lsrc_get_fps (GstV4lSrc * v4lsrc, GValue * fps)
GST_DEBUG_OBJECT (v4lsrc, "device reports fps of %d/%d (%.4f)",
fps_index * 15, 16, fps_index * 15.0 / 16);
- gst_value_set_fraction (fps, fps_index * 15, 16);
+ if (fps_n)
+ *fps_n = fps_index * 15;
+ if (fps_d)
+ *fps_d = 16;
+
return TRUE;
}
@@ -535,10 +537,17 @@ gst_v4lsrc_get_fps (GstV4lSrc * v4lsrc, GValue * fps)
if (!gst_v4l_get_chan_norm (GST_V4LELEMENT (v4lsrc), NULL, &norm))
return FALSE;
- if (norm == VIDEO_MODE_NTSC)
- gst_value_set_fraction (fps, 30000, 1001);
- else
- gst_value_set_fraction (fps, 25, 1);
+ if (norm == VIDEO_MODE_NTSC) {
+ if (fps_n)
+ *fps_n = 30000;
+ if (fps_d)
+ *fps_d = 1001;
+ } else {
+ if (fps_n)
+ *fps_n = 25;
+ if (fps_d)
+ *fps_d = 1;
+ }
return TRUE;
}
@@ -685,12 +694,11 @@ GstBuffer *
gst_v4lsrc_buffer_new (GstV4lSrc * v4lsrc, gint num)
{
GstBuffer *buf;
- GValue fps = { 0 };
+ gint fps_n, fps_d;
GST_DEBUG_OBJECT (v4lsrc, "creating buffer for frame %d", num);
- g_value_init (&fps, GST_TYPE_FRACTION);
- g_return_val_if_fail (gst_v4lsrc_get_fps (v4lsrc, &fps), NULL);
+ g_return_val_if_fail (gst_v4lsrc_get_fps (v4lsrc, &fps_n, &fps_d), NULL);
buf = (GstBuffer *) gst_mini_object_new (GST_TYPE_V4LSRC_BUFFER);
@@ -706,12 +714,10 @@ gst_v4lsrc_buffer_new (GstV4lSrc * v4lsrc, gint num)
/* FIXME: this is a most ghetto timestamp/duration */
GST_BUFFER_DURATION (buf) = gst_util_clock_time_scale (GST_SECOND,
- gst_value_get_fraction_numerator (&fps),
- gst_value_get_fraction_denominator (&fps));
+ fps_n, fps_d);
/* the negotiate() method already set caps on the source pad */
gst_buffer_set_caps (buf, GST_PAD_CAPS (GST_BASE_SRC_PAD (v4lsrc)));
- g_value_unset (&fps);
return buf;
}
diff --git a/sys/v4l/v4lsrc_calls.h b/sys/v4l/v4lsrc_calls.h
index 755d3545..b4f14a77 100644
--- a/sys/v4l/v4lsrc_calls.h
+++ b/sys/v4l/v4lsrc_calls.h
@@ -39,7 +39,7 @@ guint8 * gst_v4lsrc_get_buffer (GstV4lSrc *v4lsrc, gint num);
gboolean gst_v4lsrc_requeue_frame (GstV4lSrc *v4lsrc, gint num);
gboolean gst_v4lsrc_capture_stop (GstV4lSrc *v4lsrc);
gboolean gst_v4lsrc_capture_deinit (GstV4lSrc *v4lsrc);
-gboolean gst_v4lsrc_get_fps (GstV4lSrc * v4lsrc, GValue *fps);
+gboolean gst_v4lsrc_get_fps (GstV4lSrc * v4lsrc, gint *fps_n, gint *fps_d);
GValue * gst_v4lsrc_get_fps_list (GstV4lSrc * v4lsrc);
GstBuffer *gst_v4lsrc_buffer_new (GstV4lSrc * v4lsrc, gint num);