diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/v4l2/gstv4l2src.c | 2 | ||||
-rw-r--r-- | sys/v4l2/gstv4l2tuner.c | 2 | ||||
-rw-r--r-- | sys/v4l2/v4l2src_calls.c | 34 | ||||
-rw-r--r-- | sys/v4l2/v4l2src_calls.h | 2 |
4 files changed, 24 insertions, 16 deletions
diff --git a/sys/v4l2/gstv4l2src.c b/sys/v4l2/gstv4l2src.c index a974791c..9291a9ed 100644 --- a/sys/v4l2/gstv4l2src.c +++ b/sys/v4l2/gstv4l2src.c @@ -298,7 +298,7 @@ gst_v4l2src_init (GstV4l2Src * v4l2src, GstV4l2SrcClass * klass) gst_v4l2_get_input, gst_v4l2_set_input, NULL); /* number of buffers requested */ - v4l2src->num_buffers = 2; + v4l2src->num_buffers = GST_V4L2_MIN_BUFFERS; v4l2src->formats = NULL; diff --git a/sys/v4l2/gstv4l2tuner.c b/sys/v4l2/gstv4l2tuner.c index 1dc893ab..94bf9085 100644 --- a/sys/v4l2/gstv4l2tuner.c +++ b/sys/v4l2/gstv4l2tuner.c @@ -256,7 +256,9 @@ gst_v4l2_tuner_set_frequency_and_notify (GstV4l2Object * v4l2object, GstTunerChannel * channel, gulong frequency) { if (gst_v4l2_tuner_set_frequency (v4l2object, channel, frequency)) { +#if 0 g_object_notify (G_OBJECT (v4l2object->element), "frequency"); +#endif } } diff --git a/sys/v4l2/v4l2src_calls.c b/sys/v4l2/v4l2src_calls.c index f90167e7..87f2234f 100644 --- a/sys/v4l2/v4l2src_calls.c +++ b/sys/v4l2/v4l2src_calls.c @@ -642,17 +642,24 @@ unknown_type: } default_frame_sizes: #endif /* defined VIDIOC_ENUM_FRAMESIZES */ + { + gint min_w, max_w, min_h, max_h; - /* This code is for Linux < 2.6.19 */ - - ret = gst_caps_new_empty (); - tmp = gst_structure_copy (template); - gst_structure_set (tmp, "width", GST_TYPE_INT_RANGE, (gint) 1, - (gint) GST_V4L2_MAX_SIZE, "height", GST_TYPE_INT_RANGE, - (gint) 1, (gint) GST_V4L2_MAX_SIZE, - "framerate", GST_TYPE_FRACTION_RANGE, (gint) 0, - (gint) 1, (gint) 100, (gint) 1, NULL); - gst_caps_append_structure (ret, tmp); + /* This code is for Linux < 2.6.19 */ + if (!gst_v4l2src_get_size_limits (v4l2src, pixelformat, &min_w, &max_w, + &min_h, &max_h)) { + min_w = min_h = 1; + max_w = max_h = GST_V4L2_MAX_SIZE; + } + ret = gst_caps_new_empty (); + tmp = gst_structure_copy (template); + gst_structure_set (tmp, + "width", GST_TYPE_INT_RANGE, min_w, max_w, + "height", GST_TYPE_INT_RANGE, min_h, max_h, + "framerate", GST_TYPE_FRACTION_RANGE, (gint) 0, (gint) 1, (gint) 100, + (gint) 1, NULL); + gst_caps_append_structure (ret, tmp); + } return ret; } @@ -1181,22 +1188,21 @@ gst_v4l2src_capture_deinit (GstV4l2Src * v4l2src) */ gboolean gst_v4l2src_get_size_limits (GstV4l2Src * v4l2src, - struct v4l2_fmtdesc * format, - gint * min_w, gint * max_w, gint * min_h, gint * max_h) + guint32 pixelformat, gint * min_w, gint * max_w, gint * min_h, gint * max_h) { struct v4l2_format fmt; GST_LOG_OBJECT (v4l2src, "getting size limits with format %" GST_FOURCC_FORMAT, - GST_FOURCC_ARGS (format->pixelformat)); + GST_FOURCC_ARGS (pixelformat)); /* get size delimiters */ memset (&fmt, 0, sizeof (fmt)); fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; fmt.fmt.pix.width = 0; fmt.fmt.pix.height = 0; - fmt.fmt.pix.pixelformat = format->pixelformat; + fmt.fmt.pix.pixelformat = pixelformat; fmt.fmt.pix.field = V4L2_FIELD_INTERLACED; if (ioctl (v4l2src->v4l2object->video_fd, VIDIOC_TRY_FMT, &fmt) < 0) { GST_DEBUG_OBJECT (v4l2src, "failed to get min size: %s", diff --git a/sys/v4l2/v4l2src_calls.h b/sys/v4l2/v4l2src_calls.h index 450ea1af..139d1f03 100644 --- a/sys/v4l2/v4l2src_calls.h +++ b/sys/v4l2/v4l2src_calls.h @@ -48,7 +48,7 @@ GstCaps* gst_v4l2src_probe_caps_for_format (GstV4l2Src * v4l2src, guint32 pixe const GstStructure *template); gboolean gst_v4l2src_get_size_limits (GstV4l2Src * v4l2src, - struct v4l2_fmtdesc *fmt, + guint32 pixelformat, gint * min_w, gint * max_w, gint * min_h, gint * max_h); |