Minor updates

Original commit message from CVS:
Minor updates
This commit is contained in:
Ronald S. Bultje 2001-12-24 21:43:31 +00:00
parent 0574040487
commit d728b4a2fe
8 changed files with 48 additions and 30 deletions

View file

@ -1,8 +1,7 @@
filterdir = $(libdir)/gst filterdir = $(libdir)/gst
filter_LTLIBRARIES = libv4lelement.la libv4lsrc.la \ filter_LTLIBRARIES = libv4lelement.la libv4lsrc.la \
libv4lmjpegsrc.la libv4lmjpegsrc.la libv4lmjpegsink.la
#libv4lmjpegsink.la
libv4lelement_la_SOURCES = \ libv4lelement_la_SOURCES = \
gstv4lelement.c \ gstv4lelement.c \
@ -26,15 +25,15 @@ libv4lmjpegsrc_la_LIBADD = \
libv4lmjpegsrc_la_CFLAGS = \ libv4lmjpegsrc_la_CFLAGS = \
$(GST_CFLAGS) $(GST_CFLAGS)
#libv4lmjpegsink_la_SOURCED = \ libv4lmjpegsink_la_SOURCES = \
# gstv4lmjpegsink.c \ gstv4lmjpegsink.c \
# v4lmjpegsikn_calls.c v4lmjpegsink_calls.c
#libv4lmjpegsink_la_LIBADD = \ libv4lmjpegsink_la_LIBADD = \
# libv4lelement.la libv4lelement.la
#libv4lmjpegsink_la_CFLAGS = \ libv4lmjpegsink_la_CFLAGS = \
# $(GST_CFLAGS) $(GST_CFLAGS)
noinst_HEADERS = gstv4lelement.h v4l_calls.h \ noinst_HEADERS = gstv4lelement.h v4l_calls.h \
gstv4lsrc.h v4lsrc_calls.h \ gstv4lsrc.h v4lsrc_calls.h \
gstv4lmjpegsrc.h v4lmjpegsrc_calls.h gstv4lmjpegsrc.h v4lmjpegsrc_calls.h \
#gstv4lmjpegsink.h v4lmjpegsink_calls.h gstv4lmjpegsink.h v4lmjpegsink_calls.h

View file

@ -11,8 +11,7 @@ v4l_calls.[ch] \ \ v4lmjpegsrc_calls.[ch]
\ v4lmjpegsink_calls.[ch] \ v4lmjpegsink_calls.[ch]
I.e., all the files on the right are child classes of I.e., all the files on the right are child classes of
the v4lelement 'parent' on the left. mjpegsink is still the v4lelement 'parent' on the left.
todo.
* v4lelement handles generic v4l stuff (picture settings, * v4lelement handles generic v4l stuff (picture settings,
audio, norm/input setting, open()/close()) audio, norm/input setting, open()/close())

View file

@ -2,9 +2,6 @@ TODO list (short term):
======================= =======================
* v4lmjpegsrc: integrate input/norm autodetection * v4lmjpegsrc: integrate input/norm autodetection
* libgstrec: build (a library for video recording) * libgstrec: build (a library for video recording)
* v4lmjpegsink: build (based on liblavplay (mjpegtools) and MJPEG/V4L API)
* v4lsrc: threaded sync() (done?)
* v4lsrc: threaded wait-for-sync()-until-queue() (done?)
TODO list (long term): TODO list (long term):
====================== ======================

View file

@ -187,7 +187,7 @@ gst_v4lmjpegsrc_init (GstV4lMjpegSrc *v4lmjpegsrc)
v4lmjpegsrc->quality = 50; v4lmjpegsrc->quality = 50;
v4lmjpegsrc->numbufs = 64; v4lmjpegsrc->numbufs = 64;
v4lmjpegsrc->bufsize = 256 * 1024; v4lmjpegsrc->bufsize = 256;
v4lmjpegsrc->init = TRUE; v4lmjpegsrc->init = TRUE;
} }

View file

@ -68,7 +68,7 @@ struct _GstV4lMjpegSrc {
gint quality; gint quality;
gint numbufs; gint numbufs;
gint bufsize; gint bufsize; /* in KB */
gboolean init; gboolean init;
}; };

View file

@ -189,14 +189,14 @@ gst_v4lmjpegsrc_set_buffer (GstV4lMjpegSrc *v4lmjpegsrc,
gint bufsize) gint bufsize)
{ {
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "V4LMJPEGSRC: gst_v4lmjpegsrc_set_buffer(), numbufs = %d, bufsize = %d\n", fprintf(stderr, "V4LMJPEGSRC: gst_v4lmjpegsrc_set_buffer(), numbufs = %d, bufsize = %d KB\n",
numbufs, bufsize); numbufs, bufsize);
#endif #endif
GST_V4L_CHECK_OPEN(GST_V4LELEMENT(v4lmjpegsrc)); GST_V4L_CHECK_OPEN(GST_V4LELEMENT(v4lmjpegsrc));
GST_V4L_CHECK_NOT_ACTIVE(GST_V4LELEMENT(v4lmjpegsrc)); GST_V4L_CHECK_NOT_ACTIVE(GST_V4LELEMENT(v4lmjpegsrc));
v4lmjpegsrc->breq.size = bufsize; v4lmjpegsrc->breq.size = bufsize * 1024;
v4lmjpegsrc->breq.count = numbufs; v4lmjpegsrc->breq.count = numbufs;
return TRUE; return TRUE;
@ -515,7 +515,11 @@ gst_v4lmjpegsrc_get_buffer (GstV4lMjpegSrc *v4lmjpegsrc,
num); num);
#endif #endif
if (!GST_V4L_IS_ACTIVE(GST_V4LELEMENT(v4lmjpegsrc))) if (!GST_V4L_IS_ACTIVE(GST_V4LELEMENT(v4lmjpegsrc)) ||
!GST_V4L_IS_OPEN(GST_V4LELEMENT(v4lmjpegsrc)))
return NULL;
if (num < 0 || num >= v4lmjpegsrc->breq.count)
return NULL; return NULL;
return GST_V4LELEMENT(v4lmjpegsrc)->buffer+(v4lmjpegsrc->breq.size*num); return GST_V4LELEMENT(v4lmjpegsrc)->buffer+(v4lmjpegsrc->breq.size*num);

View file

@ -39,19 +39,34 @@ extern char *input_name[];
/* set input/norm (includes autodetection, norm = VIDEO_MODE_{PAL|NTSC|SECAM|AUTO}) */ /* set input/norm (includes autodetection, norm = VIDEO_MODE_{PAL|NTSC|SECAM|AUTO}) */
gboolean gst_v4lmjpegsrc_set_input_norm (GstV4lMjpegSrc *v4lmjpegsrc, GstV4lMjpegInputType input, gint norm); gboolean gst_v4lmjpegsrc_set_input_norm (GstV4lMjpegSrc *v4lmjpegsrc,
GstV4lMjpegInputType input,
gint norm);
/* frame grabbing/capture */ /* frame grabbing/capture */
gboolean gst_v4lmjpegsrc_set_buffer (GstV4lMjpegSrc *v4lmjpegsrc, gint numbufs, gint bufsize); gboolean gst_v4lmjpegsrc_set_buffer (GstV4lMjpegSrc *v4lmjpegsrc,
gboolean gst_v4lmjpegsrc_set_capture (GstV4lMjpegSrc *v4lmjpegsrc, gint decimation, gint quality); gint numbufs,
gint bufsize);
gboolean gst_v4lmjpegsrc_set_capture (GstV4lMjpegSrc *v4lmjpegsrc,
gint decimation,
gint quality);
gboolean gst_v4lmjpegsrc_set_capture_m (GstV4lMjpegSrc *v4lmjpegsrc, gboolean gst_v4lmjpegsrc_set_capture_m (GstV4lMjpegSrc *v4lmjpegsrc,
gint x_offset, gint y_offset, gint width, gint height, gint x_offset,
gint h_decimation, gint v_decimation, gint quality); gint y_offset,
gint width,
gint height,
gint h_decimation,
gint v_decimation,
gint quality);
gboolean gst_v4lmjpegsrc_capture_init (GstV4lMjpegSrc *v4lmjpegsrc); gboolean gst_v4lmjpegsrc_capture_init (GstV4lMjpegSrc *v4lmjpegsrc);
gboolean gst_v4lmjpegsrc_capture_start (GstV4lMjpegSrc *v4lmjpegsrc); gboolean gst_v4lmjpegsrc_capture_start (GstV4lMjpegSrc *v4lmjpegsrc);
gboolean gst_v4lmjpegsrc_grab_frame (GstV4lMjpegSrc *v4lmjpegsrc, gint *num, gint *size); gboolean gst_v4lmjpegsrc_grab_frame (GstV4lMjpegSrc *v4lmjpegsrc,
guint8 * gst_v4lmjpegsrc_get_buffer (GstV4lMjpegSrc *v4lmjpegsrc, gint num); gint *num,
gboolean gst_v4lmjpegsrc_requeue_frame (GstV4lMjpegSrc *v4lmjpegsrc, gint num); gint *size);
guint8 * gst_v4lmjpegsrc_get_buffer (GstV4lMjpegSrc *v4lmjpegsrc,
gint num);
gboolean gst_v4lmjpegsrc_requeue_frame (GstV4lMjpegSrc *v4lmjpegsrc,
gint num);
gboolean gst_v4lmjpegsrc_capture_stop (GstV4lMjpegSrc *v4lmjpegsrc); gboolean gst_v4lmjpegsrc_capture_stop (GstV4lMjpegSrc *v4lmjpegsrc);
gboolean gst_v4lmjpegsrc_capture_deinit (GstV4lMjpegSrc *v4lmjpegsrc); gboolean gst_v4lmjpegsrc_capture_deinit (GstV4lMjpegSrc *v4lmjpegsrc);

View file

@ -386,7 +386,11 @@ gst_v4lsrc_get_buffer (GstV4lSrc *v4lsrc, gint num)
num); num);
#endif #endif
if (!GST_V4L_IS_ACTIVE(GST_V4LELEMENT(v4lsrc))) if (!GST_V4L_IS_ACTIVE(GST_V4LELEMENT(v4lsrc)) ||
!GST_V4L_IS_OPEN(GST_V4LELEMENT(v4lsrc)))
return NULL;
if (num < 0 || num >= v4lsrc->mbuf.frames)
return NULL; return NULL;
return GST_V4LELEMENT(v4lsrc)->buffer+v4lsrc->mbuf.offsets[num]; return GST_V4LELEMENT(v4lsrc)->buffer+v4lsrc->mbuf.offsets[num];