summaryrefslogtreecommitdiffstats
path: root/sys/v4l2/gstv4l2src.c
diff options
context:
space:
mode:
authorRonald S. Bultje <rbultje@ronald.bitfreak.net>2003-10-10 12:47:42 +0000
committerRonald S. Bultje <rbultje@ronald.bitfreak.net>2003-10-10 12:47:42 +0000
commit862d28a1b7321cc660a4230a0b19b3bd93279ce9 (patch)
tree6a5d3d3da3c0348cfff839da4a97d121f9be0b7a /sys/v4l2/gstv4l2src.c
parent4506e60ea0aacfba4fc90136fb20e27dd13b2acf (diff)
Some interface implementations for video4linux/video4linux2 plugins: a Tuner interface, with which one can select inp...
Original commit message from CVS: Some interface implementations for video4linux/video4linux2 plugins: * a Tuner interface, with which one can select inputs and stations. Audio work is underway here, but unfinished. * A Xoverlay interface with which one can do simple overlay. Similar to the API of the v4l/Xv XFree86 extension. Widget implementation for GTK-2.0 coming up in the sandbox. * Colorbalance - for adapting colors (brightness, contrast, etc.) - pretty basic and maybe somewhat overdesigned. But it'll do for now. Apart from these interfaces, there's also a loadable library 'xwindowlistener' that listenes to X for the movement of a window and the overlap of other windows. This is partly copied from xawtv (and thus partly GPL :(), but it's needed for the xoverlay interface implementation in the v4l/v4l2 elements. Lastly, some small changes to remove redundant properties from the v4l/v4l2 elements since these can be done much simpler. Comments appreciated!
Diffstat (limited to 'sys/v4l2/gstv4l2src.c')
-rw-r--r--sys/v4l2/gstv4l2src.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/sys/v4l2/gstv4l2src.c b/sys/v4l2/gstv4l2src.c
index 7a0094bd..67b683e7 100644
--- a/sys/v4l2/gstv4l2src.c
+++ b/sys/v4l2/gstv4l2src.c
@@ -24,6 +24,7 @@
#include <string.h>
#include <sys/time.h>
#include "v4l2src_calls.h"
+#include "gstv4l2tuner.h"
/* elementfactory details */
static GstElementDetails gst_v4l2src_details = {
@@ -247,9 +248,8 @@ gst_v4l2src_close (GstElement *element,
static gfloat
gst_v4l2src_get_fps (GstV4l2Src *v4l2src)
{
- gint norm;
- struct v4l2_standard *std;
- gfloat fps;
+ v4l2_std_id norm;
+ const GList *item;
if (!v4l2src->use_fixed_fps &&
v4l2src->clock != NULL &&
@@ -267,11 +267,14 @@ gst_v4l2src_get_fps (GstV4l2Src *v4l2src)
if (!gst_v4l2_get_norm(GST_V4L2ELEMENT(v4l2src), &norm))
return 0.;
+ for (item = GST_V4L2ELEMENT(v4l2src)->norms;
+ item != NULL; item = item->next) {
+ GstV4l2TunerNorm *v4l2norm = item->data;
+ if (v4l2norm->index == norm)
+ return GST_TUNER_NORM(v4l2norm)->fps;
+ }
- std = ((struct v4l2_standard *) g_list_nth_data(GST_V4L2ELEMENT(v4l2src)->norms, norm));
- fps = (1. * std->frameperiod.denominator) / std->frameperiod.numerator;
-
- return fps;
+ return 0.;
}