OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 /* | 11 /* |
pbos-webrtc
2015/12/07 18:45:48
nit: remove comment
mflodman
2015/12/08 05:59:06
Done.
| |
12 * video_processing.h | 12 * video_processing.h |
13 * This header file contains the API required for the video | 13 * This header file contains the API required for the video |
14 * processing module class. | 14 * processing module class. |
15 */ | 15 */ |
16 | 16 |
17 | |
18 #ifndef WEBRTC_MODULES_VIDEO_PROCESSING_INCLUDE_VIDEO_PROCESSING_H_ | 17 #ifndef WEBRTC_MODULES_VIDEO_PROCESSING_INCLUDE_VIDEO_PROCESSING_H_ |
19 #define WEBRTC_MODULES_VIDEO_PROCESSING_INCLUDE_VIDEO_PROCESSING_H_ | 18 #define WEBRTC_MODULES_VIDEO_PROCESSING_INCLUDE_VIDEO_PROCESSING_H_ |
20 | 19 |
21 #include "webrtc/modules/include/module_common_types.h" | 20 #include "webrtc/modules/include/module_common_types.h" |
22 #include "webrtc/modules/video_processing/include/video_processing_defines.h" | 21 #include "webrtc/modules/video_processing/include/video_processing_defines.h" |
23 #include "webrtc/video_frame.h" | 22 #include "webrtc/video_frame.h" |
24 | 23 |
25 // The module is largely intended to process video streams, except functionality | 24 // The module is largely intended to process video streams, except functionality |
26 // provided by static functions which operate independent of previous frames. It | 25 // provided by static functions which operate independent of previous frames. It |
27 // is recommended, but not required that a unique instance be used for each | 26 // is recommended, but not required that a unique instance be used for each |
28 // concurrently processed stream. Similarly, it is recommended to call Reset() | 27 // concurrently processed stream. Similarly, it is recommended to call Reset() |
29 // before switching to a new stream, but this is not absolutely required. | 28 // before switching to a new stream, but this is not absolutely required. |
30 // | 29 // |
31 // The module provides basic thread safety by permitting only a single function | 30 // The module provides basic thread safety by permitting only a single function |
32 // to execute concurrently. | 31 // to execute concurrently. |
33 | 32 |
34 namespace webrtc { | 33 namespace webrtc { |
35 | 34 |
36 class VideoProcessing { | 35 class VideoProcessing { |
37 public: | 36 public: |
38 struct FrameStats { | 37 struct FrameStats { |
39 uint32_t hist[256]; // Frame histogram. | 38 uint32_t hist[256]; // Frame histogram. |
40 uint32_t mean; | 39 uint32_t mean; |
41 uint32_t sum; | 40 uint32_t sum; |
42 uint32_t num_pixels; | 41 uint32_t num_pixels; |
43 uint32_t sub_sampling_factor; // Sub-sampling factor, in powers of 2. | 42 uint32_t sub_sampling_factor; // Sub-sampling factor, in powers of 2. |
44 }; | 43 }; |
45 | 44 |
46 enum BrightnessWarning { | 45 enum BrightnessWarning { kNoWarning, kDarkWarning, kBrightWarning }; |
47 kNoWarning, | |
48 kDarkWarning, | |
49 kBrightWarning | |
50 }; | |
51 | 46 |
52 static VideoProcessing* Create(); | 47 static VideoProcessing* Create(); |
53 virtual ~VideoProcessing() {} | 48 virtual ~VideoProcessing() {} |
54 | 49 |
55 // Retrieves statistics for the input frame. This function must be used to | 50 // Retrieves statistics for the input frame. This function must be used to |
56 // prepare a FrameStats struct for use in certain VPM functions. | 51 // prepare a FrameStats struct for use in certain VPM functions. |
57 static void GetFrameStats(const VideoFrame& frame, FrameStats* stats); | 52 static void GetFrameStats(const VideoFrame& frame, FrameStats* stats); |
58 | 53 |
59 // Checks the validity of a FrameStats struct. Currently, valid implies only | 54 // Checks the validity of a FrameStats struct. Currently, valid implies only |
60 // that is had changed from its initialized state. | 55 // that is had changed from its initialized state. |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
104 virtual void EnableDenosing(bool enable) = 0; | 99 virtual void EnableDenosing(bool enable) = 0; |
105 virtual const VideoFrame* PreprocessFrame(const VideoFrame& frame) = 0; | 100 virtual const VideoFrame* PreprocessFrame(const VideoFrame& frame) = 0; |
106 | 101 |
107 virtual VideoContentMetrics* GetContentMetrics() const = 0; | 102 virtual VideoContentMetrics* GetContentMetrics() const = 0; |
108 virtual void EnableContentAnalysis(bool enable) = 0; | 103 virtual void EnableContentAnalysis(bool enable) = 0; |
109 }; | 104 }; |
110 | 105 |
111 } // namespace webrtc | 106 } // namespace webrtc |
112 | 107 |
113 #endif // WEBRTC_MODULES_VIDEO_PROCESSING_INCLUDE_VIDEO_PROCESSING_H_ | 108 #endif // WEBRTC_MODULES_VIDEO_PROCESSING_INCLUDE_VIDEO_PROCESSING_H_ |
OLD | NEW |