From aa94247770732a40e46ab3d539dd9987062abef4 Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Fri, 10 Oct 2003 12:47:42 +0000 Subject: 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! --- sys/v4l2/gstv4l2src.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'sys/v4l2/gstv4l2src.c') 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 #include #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.; } -- cgit v1.2.1