summaryrefslogtreecommitdiffstats
path: root/sys/v4l2
diff options
context:
space:
mode:
authorThomas Vander Stichele <thomas@apestaart.org>2004-01-19 17:11:28 +0000
committerThomas Vander Stichele <thomas@apestaart.org>2004-01-19 17:11:28 +0000
commit5a2ceb9ba0b534f67c8c2b44b54a4d24bb258ae5 (patch)
tree72837eb5bffbaf392aae1423df2c04be0058e8dd /sys/v4l2
parenta8dc14076efa6db4a0e374eb5623be62d7233b4b (diff)
downloadgst-plugins-bad-5a2ceb9ba0b534f67c8c2b44b54a4d24bb258ae5.tar.gz
gst-plugins-bad-5a2ceb9ba0b534f67c8c2b44b54a4d24bb258ae5.tar.bz2
gst-plugins-bad-5a2ceb9ba0b534f67c8c2b44b54a4d24bb258ae5.zip
further element_error fixes
Original commit message from CVS: further element_error fixes
Diffstat (limited to 'sys/v4l2')
-rw-r--r--sys/v4l2/v4l2_calls.h73
1 files changed, 37 insertions, 36 deletions
diff --git a/sys/v4l2/v4l2_calls.h b/sys/v4l2/v4l2_calls.h
index a999af8e..a7cc8f88 100644
--- a/sys/v4l2/v4l2_calls.h
+++ b/sys/v4l2/v4l2_calls.h
@@ -21,62 +21,63 @@
#define __V4L2_CALLS_H__
#include "gstv4l2element.h"
+#include "gst-libs/gst/gst-i18n-plugin.h"
/* simple check whether the device is open */
-#define GST_V4L2_IS_OPEN(v4l2element) \
- (v4l2element->video_fd > 0)
+#define GST_V4L2_IS_OPEN(element) \
+ (element->video_fd > 0)
/* check whether the device is 'active' */
-#define GST_V4L2_IS_ACTIVE(v4l2element) \
- (v4l2element->buffer != NULL)
+#define GST_V4L2_IS_ACTIVE(element) \
+ (element->buffer != NULL)
-#define GST_V4L2_IS_OVERLAY(v4l2element) \
- (v4l2element->vcap.capabilities & V4L2_CAP_VIDEO_OVERLAY)
+#define GST_V4L2_IS_OVERLAY(element) \
+ (element->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 (!GST_V4L2_IS_OPEN(v4l2element)) \
- { \
- gst_element_error(GST_ELEMENT(v4l2element), \
- "Device is not open"); \
- return FALSE; \
+#define GST_V4L2_CHECK_OPEN(element) \
+ if (!GST_V4L2_IS_OPEN(element)) \
+ { \
+ gst_element_error (element, RESOURCE, TOO_LAZY, \
+ (_("Device is not open")), NULL); \
+ return FALSE; \
}
/* checks whether the current v4lelement is close()'ed or whether it is still open */
-#define GST_V4L2_CHECK_NOT_OPEN(v4l2element) \
- if (GST_V4L2_IS_OPEN(v4l2element)) \
- { \
- gst_element_error(GST_ELEMENT(v4l2element), \
- "Device is open"); \
- return FALSE; \
+#define GST_V4L2_CHECK_NOT_OPEN(element) \
+ if (GST_V4L2_IS_OPEN(element)) \
+ { \
+ gst_element_error (element, RESOURCE, TOO_LAZY, \
+ (_("Device is open")), NULL); \
+ return FALSE; \
}
/* checks whether the current v4lelement does video overlay */
-#define GST_V4L2_CHECK_OVERLAY(v4l2element) \
- if (!GST_V4L2_IS_OVERLAY(v4l2element)) \
- { \
- gst_element_error(GST_ELEMENT(v4l2element), \
- "Device doesn't do overlay"); \
- return FALSE; \
+#define GST_V4L2_CHECK_OVERLAY(element) \
+ if (!GST_V4L2_IS_OVERLAY(element)) \
+ { \
+ gst_element_error (element, RESOURCE, TOO_LAZY, \
+ NULL, ("Device cannot handle overlay")); \
+ return FALSE; \
}
/* checks whether we're in capture mode or not */
-#define GST_V4L2_CHECK_ACTIVE(v4l2element) \
- if (!GST_V4L2_IS_ACTIVE(v4l2element)) \
- { \
- gst_element_error(GST_ELEMENT(v4l2element), \
- "Device is not in streaming mode"); \
- return FALSE; \
+#define GST_V4L2_CHECK_ACTIVE(element) \
+ if (!GST_V4L2_IS_ACTIVE(element)) \
+ { \
+ gst_element_error (element, RESOURCE, SETTINGS, \
+ NULL, ("Device is not in streaming mode")); \
+ return FALSE; \
}
/* checks whether we're out of capture mode or not */
-#define GST_V4L2_CHECK_NOT_ACTIVE(v4l2element) \
- if (GST_V4L2_IS_ACTIVE(v4l2element)) \
- { \
- gst_element_error(GST_ELEMENT(v4l2element), \
- "Device is in streaming mode"); \
- return FALSE; \
+#define GST_V4L2_CHECK_NOT_ACTIVE(element) \
+ if (GST_V4L2_IS_ACTIVE(element)) \
+ { \
+ gst_element_error (element, RESOURCE, SETTINGS, \
+ NULL, ("Device is in streaming mode")); \
+ return FALSE; \
}