From 851ddec4d5fc85b7bfaaf3b318c0d3e088794f7a Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Wed, 13 Nov 2002 12:35:56 +0000 Subject: v4l plugins: add open/close signals v4l2 plugins: add open/close signals move source format enumeration from v4l2elem... Original commit message from CVS: v4l plugins: * add open/close signals v4l2 plugins: * add open/close signals * move source format enumeration from v4l2element to v4l2src * adapt to the final v4l2 API in kernel 2.5 (patches for 2.4 on http://bytesex.org/patches) * small tweaks --- sys/v4l2/v4l2_calls.h | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'sys/v4l2/v4l2_calls.h') diff --git a/sys/v4l2/v4l2_calls.h b/sys/v4l2/v4l2_calls.h index de0bbc9e..db9adc08 100644 --- a/sys/v4l2/v4l2_calls.h +++ b/sys/v4l2/v4l2_calls.h @@ -32,11 +32,11 @@ (v4l2element->buffer != NULL) #define GST_V4L2_IS_OVERLAY(v4l2element) \ - (v4l2element->vcap.flags & V4L2_FLAG_PREVIEW) + (v4l2element->vcap.capabilities & V4L2_CAP_VIDEO_OVERLAY) /* checks whether the current v4lelement has already been open()'ed or not */ #define GST_V4L2_CHECK_OPEN(v4l2element) \ - if (v4l2element->video_fd <= 0) \ + if (!GST_V4L2_IS_OPEN(v4l2element)) \ { \ gst_element_error(GST_ELEMENT(v4l2element), \ "Device is not open"); \ @@ -45,7 +45,7 @@ /* checks whether the current v4lelement is close()'ed or whether it is still open */ #define GST_V4L2_CHECK_NOT_OPEN(v4l2element) \ - if (v4l2element->video_fd != -1) \ + if (GST_V4L2_IS_OPEN(v4l2element)) \ { \ gst_element_error(GST_ELEMENT(v4l2element), \ "Device is open"); \ @@ -54,16 +54,16 @@ /* checks whether the current v4lelement does video overlay */ #define GST_V4L2_CHECK_OVERLAY(v4l2element) \ - if (!(v4l2element->vcap.flags & V4L2_FLAG_PREVIEW)) \ - { \ - gst_element_error(GST_ELEMENT(v4l2element), \ - "Device doesn't do overlay"); \ - return FALSE; \ + if (!GST_V4L2_IS_OVERLAY(v4l2element)) \ + { \ + gst_element_error(GST_ELEMENT(v4l2element), \ + "Device doesn't do overlay"); \ + return FALSE; \ } /* checks whether we're in capture mode or not */ #define GST_V4L2_CHECK_ACTIVE(v4l2element) \ - if (v4l2element->buffer == NULL) \ + if (!GST_V4L2_IS_ACTIVE(v4l2element)) \ { \ gst_element_error(GST_ELEMENT(v4l2element), \ "Device is not in streaming mode"); \ @@ -72,7 +72,7 @@ /* checks whether we're out of capture mode or not */ #define GST_V4L2_CHECK_NOT_ACTIVE(v4l2element) \ - if (v4l2element->buffer != NULL) \ + if (GST_V4L2_IS_ACTIVE(v4l2element)) \ { \ gst_element_error(GST_ELEMENT(v4l2element), \ "Device is in streaming mode"); \ @@ -102,7 +102,8 @@ gboolean gst_v4l2_set_output (GstV4l2Element *v4l2element, GList * gst_v4l2_get_output_names (GstV4l2Element *v4l2element); /* frequency control */ -gboolean gst_v4l2_has_tuner (GstV4l2Element *v4l2element); +gboolean gst_v4l2_has_tuner (GstV4l2Element *v4l2element, + gint *tuner_num); gboolean gst_v4l2_get_frequency (GstV4l2Element *v4l2element, gulong *frequency); gboolean gst_v4l2_set_frequency (GstV4l2Element *v4l2element, -- cgit v1.2.1