Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(611)

Unified Diff: media/video/capture/video_capture_device.h

Issue 967793002: Linux Video Capture: Add V4L2VideoCaptureDelegate{Single,Multi}Plane. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: magjed@ comments Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: media/video/capture/video_capture_device.h
diff --git a/media/video/capture/video_capture_device.h b/media/video/capture/video_capture_device.h
index 747f1b00d3a6a98e74ab4d3091e84d9cf13e792c..874b926c3fbdf69f6ca1969c05e9239e8b13075e 100644
--- a/media/video/capture/video_capture_device.h
+++ b/media/video/capture/video_capture_device.h
@@ -41,7 +41,14 @@ class MEDIA_EXPORT VideoCaptureDevice {
Name();
Name(const std::string& name, const std::string& id);
-#if defined(OS_WIN)
+#if defined(OS_LINUX)
+ // Linux/CrOS targets Capture Api type: it can only be set on construction.
+ enum CaptureApiType {
+ V4L2_SINGLE_PLANE,
+ V4L2_MULTI_PLANE,
+ API_TYPE_UNKNOWN
+ };
+#elif defined(OS_WIN)
// Windows targets Capture Api type: it can only be set on construction.
enum CaptureApiType {
MEDIA_FOUNDATION,
@@ -49,8 +56,7 @@ class MEDIA_EXPORT VideoCaptureDevice {
DIRECT_SHOW_WDM_CROSSBAR,
API_TYPE_UNKNOWN
};
-#endif
-#if defined(OS_MACOSX)
+#elif defined(OS_MACOSX)
// Mac targets Capture Api type: it can only be set on construction.
enum CaptureApiType {
AVFOUNDATION,
@@ -64,7 +70,7 @@ class MEDIA_EXPORT VideoCaptureDevice {
OTHER_TRANSPORT
};
#endif
-#if defined(OS_WIN) || defined(OS_MACOSX)
+#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX)
Name(const std::string& name,
const std::string& id,
const CaptureApiType api_type);
@@ -102,7 +108,7 @@ class MEDIA_EXPORT VideoCaptureDevice {
return unique_id_ < other.id();
}
-#if defined(OS_WIN) || defined(OS_MACOSX)
+#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX)
CaptureApiType capture_api_type() const {
return capture_api_class_.capture_api_type();
}
@@ -133,7 +139,7 @@ class MEDIA_EXPORT VideoCaptureDevice {
private:
std::string device_name_;
std::string unique_id_;
-#if defined(OS_WIN) || defined(OS_MACOSX)
+#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX)
// This class wraps the CaptureApiType to give it a by default value if not
// initialized.
class CaptureApiClass {
@@ -195,9 +201,22 @@ class MEDIA_EXPORT VideoCaptureDevice {
virtual void OnIncomingCapturedData(const uint8* data,
int length,
const VideoCaptureFormat& frame_format,
- int rotation, // Clockwise.
+ int clockwise_rotation,
const base::TimeTicks& timestamp) = 0;
+ // Captured a 3 planar YUV frame. Planes are possibly disjoint.
+ // |frame_format| must indicate I420.
+ virtual void OnIncomingCapturedYuvData(
+ const uint8* y_data,
+ const uint8* u_data,
+ const uint8* v_data,
+ size_t y_stride,
+ size_t u_stride,
+ size_t v_stride,
+ const VideoCaptureFormat& frame_format,
+ int clockwise_rotation,
+ const base::TimeTicks& timestamp) = 0;
+
// Reserve an output buffer into which contents can be captured directly.
// The returned Buffer will always be allocated with a memory size suitable
// for holding a packed video frame with pixels of |format| format, of
« no previous file with comments | « media/video/capture/linux/video_capture_device_linux.cc ('k') | media/video/capture/video_capture_device.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698