From: Wim T. <wt...@pd...> - 2004-06-16 15:08:14
|
CVS Root: /cvs/gstreamer Module: gst-plugins Changes by: wtay Date: Wed Jun 16 2004 08:08:10 PDT Log message: * sys/v4l/gstv4lmjpegsrc.c: (gst_v4lmjpegsrc_get): * sys/v4l/gstv4lsrc.c: (gst_v4lsrc_sync_mode_get_type), (gst_v4lsrc_class_init), (gst_v4lsrc_init), (gst_v4lsrc_get_fps), (gst_v4lsrc_get), (gst_v4lsrc_set_property), (gst_v4lsrc_get_property): * sys/v4l/gstv4lsrc.h: Added a copy mode to v4lsrc where it will output a copied version of its internal hardware buffer. Fix the wrong FLAG_SET usage. The flags are integers, not bits, you can't | them. Modified files: . : ChangeLog sys/v4l : gstv4lmjpegsrc.c gstv4lsrc.c gstv4lsrc.h Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/ChangeLog.diff?r1=1.780&r2=1.781 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/sys/v4l/gstv4lmjpegsrc.c.diff?r1=1.55&r2=1.56 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/sys/v4l/gstv4lsrc.c.diff?r1=1.71&r2=1.72 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/sys/v4l/gstv4lsrc.h.diff?r1=1.25&r2=1.26 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gst-plugins/ChangeLog,v retrieving revision 1.780 retrieving revision 1.781 diff -u -d -r1.780 -r1.781 --- ChangeLog 16 Jun 2004 10:48:04 -0000 1.780 +++ ChangeLog 16 Jun 2004 15:07:57 -0000 1.781 @@ -1,5 +1,18 @@ 2004-06-16 Wim Taymans <wi...@fl...> + * sys/v4l/gstv4lmjpegsrc.c: (gst_v4lmjpegsrc_get): + * sys/v4l/gstv4lsrc.c: (gst_v4lsrc_sync_mode_get_type), + (gst_v4lsrc_class_init), (gst_v4lsrc_init), (gst_v4lsrc_get_fps), + (gst_v4lsrc_get), (gst_v4lsrc_set_property), + (gst_v4lsrc_get_property): + * sys/v4l/gstv4lsrc.h: + Added a copy mode to v4lsrc where it will output a copied version + of its internal hardware buffer. + Fix the wrong FLAG_SET usage. The flags are integers, not bits, you + can't | them. + +2004-06-16 Wim Taymans <wi...@fl...> * sys/oss/gstosssrc.c: (gst_osssrc_get): Timestamp fixes. Index: gstv4lmjpegsrc.c RCS file: /cvs/gstreamer/gst-plugins/sys/v4l/gstv4lmjpegsrc.c,v retrieving revision 1.55 retrieving revision 1.56 diff -u -d -r1.55 -r1.56 --- gstv4lmjpegsrc.c 15 Jun 2004 09:11:06 -0000 1.55 +++ gstv4lmjpegsrc.c 16 Jun 2004 15:07:58 -0000 1.56 @@ -574,7 +574,8 @@ GST_BUFFER_DATA (buf) = gst_v4lmjpegsrc_get_buffer (v4lmjpegsrc, num); GST_BUFFER_SIZE (buf) = v4lmjpegsrc->last_size; GST_BUFFER_MAXSIZE (buf) = v4lmjpegsrc->breq.size; - GST_BUFFER_FLAG_SET (buf, GST_BUFFER_READONLY | GST_BUFFER_DONTFREE); + GST_BUFFER_FLAG_SET (buf, GST_BUFFER_READONLY); + GST_BUFFER_FLAG_SET (buf, GST_BUFFER_DONTFREE); if (v4lmjpegsrc->use_fixed_fps) GST_BUFFER_TIMESTAMP (buf) = v4lmjpegsrc->handled * GST_SECOND / fps; else /* calculate time based on our own clock */ Index: gstv4lsrc.c RCS file: /cvs/gstreamer/gst-plugins/sys/v4l/gstv4lsrc.c,v retrieving revision 1.71 retrieving revision 1.72 diff -u -d -r1.71 -r1.72 --- gstv4lsrc.c 16 Jun 2004 10:13:51 -0000 1.71 +++ gstv4lsrc.c 16 Jun 2004 15:07:58 -0000 1.72 @@ -52,13 +52,16 @@ LAST_SIGNAL }; +#define DEFAULT_SYNC_MODE GST_V4LSRC_SYNC_MODE_CLOCK +#define DEFAULT_COPY_MODE FALSE /* arguments */ enum { ARG_0, ARG_NUMBUFS, ARG_BUFSIZE, - ARG_SYNC_MODE + ARG_SYNC_MODE, + ARG_COPY_MODE GST_FORMATS_FUNCTION (GstPad *, gst_v4lsrc_get_formats, @@ -66,8 +69,6 @@ GST_QUERY_TYPE_FUNCTION (GstPad *, gst_v4lsrc_get_query_types, GST_QUERY_POSITION); -#define DEFAULT_SYNC_MODE GST_V4LSRC_SYNC_MODE_CLOCK - #define GST_TYPE_V4LSRC_SYNC_MODE (gst_v4lsrc_sync_mode_get_type()) static GType gst_v4lsrc_sync_mode_get_type (void) @@ -201,6 +202,10 @@ g_param_spec_enum ("sync_mode", "Sync mode", "Method to use for timestamping captured frames", GST_TYPE_V4LSRC_SYNC_MODE, DEFAULT_SYNC_MODE, G_PARAM_READWRITE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_COPY_MODE, + g_param_spec_boolean ("copy_mode", "Copy mode", + "Don't send out HW buffers, send copy instead", DEFAULT_COPY_MODE, + G_PARAM_READWRITE)); /* signals */ gst_v4lsrc_signals[SIGNAL_FRAME_CAPTURE] = @@ -258,8 +263,8 @@ /* no colourspaces */ v4lsrc->colourspaces = NULL; - /* fps */ v4lsrc->syncmode = DEFAULT_SYNC_MODE; + v4lsrc->copy_mode = DEFAULT_COPY_MODE; v4lsrc->is_capturing = FALSE; } @@ -875,11 +880,19 @@ v4lsrc_private->num = num; GST_BUFFER_PRIVATE (buf) = v4lsrc_private; + /* don't | the flags, they are integers, not bits!! */ GST_BUFFER_DATA (buf) = gst_v4lsrc_get_buffer (v4lsrc, num); GST_BUFFER_MAXSIZE (buf) = v4lsrc->mbuf.size / v4lsrc->mbuf.frames; GST_BUFFER_SIZE (buf) = v4lsrc->buffer_size; + if (v4lsrc->copy_mode) { + GstBuffer *copy = gst_buffer_copy (buf); + gst_buffer_unref (buf); + buf = copy; + } switch (v4lsrc->syncmode) { case GST_V4LSRC_SYNC_MODE_FIXED_FPS: @@ -973,6 +986,10 @@ } break; + case ARG_COPY_MODE: + v4lsrc->copy_mode = g_value_get_boolean (value); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); @@ -1006,6 +1023,10 @@ g_value_set_enum (value, v4lsrc->syncmode); + g_value_set_boolean (value, v4lsrc->copy_mode); Index: gstv4lsrc.h RCS file: /cvs/gstreamer/gst-plugins/sys/v4l/gstv4lsrc.h,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- gstv4lsrc.h 16 Jun 2004 10:13:51 -0000 1.25 +++ gstv4lsrc.h 16 Jun 2004 15:07:58 -0000 1.26 @@ -101,6 +101,8 @@ /* how are we going to timestamp buffers? */ GstV4lSrcSyncMode syncmode; + gboolean copy_mode; struct _GstV4lSrcClass |