diff --git a/sys/v4l2/gstv4l2src.c b/sys/v4l2/gstv4l2src.c index 6660ff49f1..486a3b9168 100644 --- a/sys/v4l2/gstv4l2src.c +++ b/sys/v4l2/gstv4l2src.c @@ -35,7 +35,7 @@ * * * - * gst-launch v4l2src use-undef-fps=true ! xvimagesink + * gst-launch v4l2src ! xvimagesink * * This example should be used to capture from web-cams * @@ -67,13 +67,10 @@ GST_ELEMENT_DETAILS ("Video (video4linux2/raw) Source", GST_DEBUG_CATEGORY (v4l2src_debug); #define GST_CAT_DEFAULT v4l2src_debug -#define DEFAULT_PROP_USE_UNDEF_FPS FALSE - enum { PROP_0, V4L2_STD_OBJECT_PROPS, - PROP_USE_UNDEF_FPS }; static const guint32 gst_v4l2_formats[] = { @@ -283,13 +280,6 @@ gst_v4l2src_class_init (GstV4l2SrcClass * klass) gst_v4l2_object_install_properties_helper (gobject_class); - g_object_class_install_property (gobject_class, PROP_USE_UNDEF_FPS, - g_param_spec_boolean ("use-undef-fps", "Use undefined FPS", - "Set this property to TRUE for devices that cannot properly " - "determine a framerate. The 'caps' will have their " - "'framerate' set to '0/1'.", - DEFAULT_PROP_USE_UNDEF_FPS, G_PARAM_READWRITE)); - basesrc_class->get_caps = gst_v4l2src_get_caps; basesrc_class->set_caps = gst_v4l2src_set_caps; basesrc_class->start = gst_v4l2src_start; @@ -311,7 +301,6 @@ gst_v4l2src_init (GstV4l2Src * v4l2src, GstV4l2SrcClass * klass) /* fps */ v4l2src->fps_n = 0; v4l2src->fps_d = 1; - v4l2src->use_undef_fps = DEFAULT_PROP_USE_UNDEF_FPS; v4l2src->is_capturing = FALSE; @@ -348,11 +337,6 @@ gst_v4l2src_set_property (GObject * object, if (!gst_v4l2_object_set_property_helper (v4l2src->v4l2object, prop_id, value, pspec)) { switch (prop_id) { - case PROP_USE_UNDEF_FPS: - if (!GST_V4L2_IS_ACTIVE (v4l2src->v4l2object)) { - v4l2src->use_undef_fps = g_value_get_boolean (value); - } - break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -373,9 +357,6 @@ gst_v4l2src_get_property (GObject * object, if (!gst_v4l2_object_get_property_helper (v4l2src->v4l2object, prop_id, value, pspec)) { switch (prop_id) { - case PROP_USE_UNDEF_FPS: - g_value_set_boolean (value, v4l2src->use_undef_fps); - break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -806,7 +787,6 @@ gst_v4l2src_set_caps (GstBaseSrc * src, GstCaps * caps) return FALSE; } - /* it's undef, one struct */ structure = gst_caps_get_structure (caps, 0); /* we want our own v4l2 type of fourcc codes */ @@ -1003,22 +983,10 @@ gst_v4l2src_create (GstPushSrc * src, GstBuffer ** buf) GstV4l2Src *v4l2src = GST_V4L2SRC (src); GstFlowReturn ret; - if ((!v4l2src->use_undef_fps) && v4l2src->fps_n == 0) - goto no_framerate; - if (v4l2src->breq.memory == V4L2_MEMORY_MMAP) { ret = gst_v4l2src_get_mmap (v4l2src, buf); } else { ret = gst_v4l2src_get_read (v4l2src, buf); } return ret; - - /* ERRORS */ -no_framerate: - { - GST_ELEMENT_ERROR (v4l2src, RESOURCE, SETTINGS, - (_("Could not get frame rate for %s, try to set the use-undef-fps " - "property to true."), v4l2src->v4l2object->videodev), (NULL)); - return GST_FLOW_ERROR; - } } diff --git a/sys/v4l2/gstv4l2src.h b/sys/v4l2/gstv4l2src.h index 874fddf78b..87923e4ee9 100644 --- a/sys/v4l2/gstv4l2src.h +++ b/sys/v4l2/gstv4l2src.h @@ -101,7 +101,6 @@ struct _GstV4l2Src /* how are we going to push buffers? */ guint fps_n, fps_d; - gboolean use_undef_fps; }; struct _GstV4l2SrcClass diff --git a/tests/icles/v4l2src-test.c b/tests/icles/v4l2src-test.c index a81c357d45..431f00c215 100644 --- a/tests/icles/v4l2src-test.c +++ b/tests/icles/v4l2src-test.c @@ -358,7 +358,6 @@ main (int argc, char *argv[]) gchar device[128] = { '\0' }; gchar input[128] = { '\0' }; gulong frequency = 0; - gboolean undeffps = FALSE; GstBus *bus; /* see for input option */ @@ -371,7 +370,6 @@ main (int argc, char *argv[]) {"Device location. Common in /dev/video0"}, {"input/output (channel) to switch to"}, {"frequency to tune to (in Hz)"}, - {"set use-undef-fps to TRUE"}, {0, 0, 0, 0} }; static struct option long_options[] = { @@ -379,13 +377,12 @@ main (int argc, char *argv[]) {"device", 1, 0, 'd'}, {"input", 1, 0, 'i'}, {"frequency", 1, 0, 'f'}, - {"undeffps", 0, 0, 's'}, {0, 0, 0, 0} }; /* getopt_long stores the option index here. */ int option_index = 0; - c = getopt_long (argc, argv, "n:d:i:f:sh", long_options, &option_index); + c = getopt_long (argc, argv, "n:d:i:f:h", long_options, &option_index); /* Detect the end of the options. */ if (c == -1) { @@ -420,10 +417,6 @@ main (int argc, char *argv[]) frequency = atol (optarg); break; - case 's': - undeffps = TRUE; - break; - case 'h': printf ("Usage: v4l2src-test [OPTION]...\n"); for (c = 0; long_options[c].name; ++c) { @@ -484,9 +477,6 @@ main (int argc, char *argv[]) if (frequency) { g_object_set (source, "frequency", frequency, NULL); } - if (undeffps) { - g_object_set (source, "use-undef-fps", undeffps, NULL); - } /* you would normally check that the elements were created properly */ bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline));