Chromium Code Reviews| 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..c3a4abd99cc238a4fe1ffd9b0f1df0e2a0f128e5 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_length, |
|
Pawel Osciak
2015/03/20 00:56:07
This is stride?
mcasas
2015/03/20 03:01:20
Done.
Gosh this signature is repeated in 7 places
|
| + size_t u_length, |
| + size_t v_length, |
| + 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 |