niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 1 | /* |
phoglund@webrtc.org | 4aa57b4 | 2012-03-22 12:56:54 +0000 | [diff] [blame] | 2 | * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license |
| 5 | * that can be found in the LICENSE file in the root of the source |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
| 10 | |
Henrik Kjellander | 5dda80a | 2015-11-12 12:46:09 +0100 | [diff] [blame] | 11 | #ifndef WEBRTC_MODULES_VIDEO_CAPTURE_VIDEO_CAPTURE_DEFINES_H_ |
| 12 | #define WEBRTC_MODULES_VIDEO_CAPTURE_VIDEO_CAPTURE_DEFINES_H_ |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 13 | |
nisse | af91689 | 2017-01-10 07:44:26 -0800 | [diff] [blame] | 14 | #include "webrtc/api/video/video_frame.h" |
Henrik Kjellander | ff761fb | 2015-11-04 08:31:52 +0100 | [diff] [blame] | 15 | #include "webrtc/modules/include/module_common_types.h" |
pbos@webrtc.org | a9b74ad | 2013-07-12 10:03:52 +0000 | [diff] [blame] | 16 | #include "webrtc/typedefs.h" |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 17 | |
| 18 | namespace webrtc |
| 19 | { |
| 20 | // Defines |
| 21 | #ifndef NULL |
| 22 | #define NULL 0 |
| 23 | #endif |
| 24 | |
| 25 | enum {kVideoCaptureUniqueNameLength =1024}; //Max unique capture device name lenght |
| 26 | enum {kVideoCaptureDeviceNameLength =256}; //Max capture device name lenght |
| 27 | enum {kVideoCaptureProductIdLength =128}; //Max product id length |
| 28 | |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 29 | struct VideoCaptureCapability |
| 30 | { |
pbos@webrtc.org | dfc5bb9 | 2013-04-10 08:23:13 +0000 | [diff] [blame] | 31 | int32_t width; |
| 32 | int32_t height; |
| 33 | int32_t maxFPS; |
nisse | eb44b39 | 2017-04-28 07:18:05 -0700 | [diff] [blame] | 34 | VideoType videoType; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 35 | bool interlaced; |
| 36 | |
| 37 | VideoCaptureCapability() |
| 38 | { |
| 39 | width = 0; |
| 40 | height = 0; |
| 41 | maxFPS = 0; |
nisse | eb44b39 | 2017-04-28 07:18:05 -0700 | [diff] [blame] | 42 | videoType = VideoType::kUnknown; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 43 | interlaced = false; |
| 44 | } |
| 45 | ; |
| 46 | bool operator!=(const VideoCaptureCapability &other) const |
| 47 | { |
| 48 | if (width != other.width) |
| 49 | return true; |
| 50 | if (height != other.height) |
| 51 | return true; |
| 52 | if (maxFPS != other.maxFPS) |
| 53 | return true; |
nisse | eb44b39 | 2017-04-28 07:18:05 -0700 | [diff] [blame] | 54 | if (videoType != other.videoType) |
| 55 | return true; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 56 | if (interlaced != other.interlaced) |
| 57 | return true; |
| 58 | return false; |
| 59 | } |
| 60 | bool operator==(const VideoCaptureCapability &other) const |
| 61 | { |
| 62 | return !operator!=(other); |
| 63 | } |
| 64 | }; |
| 65 | |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 66 | /* External Capture interface. Returned by Create |
| 67 | and implemented by the capture module. |
| 68 | */ |
| 69 | class VideoCaptureExternal |
| 70 | { |
| 71 | public: |
stefan@webrtc.org | b8e7f4c | 2013-04-12 11:56:23 +0000 | [diff] [blame] | 72 | // |capture_time| must be specified in the NTP time format in milliseconds. |
pbos@webrtc.org | dfc5bb9 | 2013-04-10 08:23:13 +0000 | [diff] [blame] | 73 | virtual int32_t IncomingFrame(uint8_t* videoFrame, |
pkasting@chromium.org | 4591fbd | 2014-11-20 22:28:14 +0000 | [diff] [blame] | 74 | size_t videoFrameLength, |
pbos@webrtc.org | dfc5bb9 | 2013-04-10 08:23:13 +0000 | [diff] [blame] | 75 | const VideoCaptureCapability& frameInfo, |
| 76 | int64_t captureTime = 0) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 77 | protected: |
| 78 | ~VideoCaptureExternal() {} |
| 79 | }; |
| 80 | |
andrew@webrtc.org | 94caca7 | 2012-10-30 21:58:00 +0000 | [diff] [blame] | 81 | } // namespace webrtc |
| 82 | |
Henrik Kjellander | 5dda80a | 2015-11-12 12:46:09 +0100 | [diff] [blame] | 83 | #endif // WEBRTC_MODULES_VIDEO_CAPTURE_VIDEO_CAPTURE_DEFINES_H_ |