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 /* | |
12 * video_processing.h | |
13 * This header file contains the API required for the video | |
14 * processing module class. | |
15 */ | |
16 | |
17 | |
18 #ifndef WEBRTC_MODULES_VIDEO_PROCESSING_INCLUDE_VIDEO_PROCESSING_H_ | 11 #ifndef WEBRTC_MODULES_VIDEO_PROCESSING_INCLUDE_VIDEO_PROCESSING_H_ |
19 #define WEBRTC_MODULES_VIDEO_PROCESSING_INCLUDE_VIDEO_PROCESSING_H_ | 12 #define WEBRTC_MODULES_VIDEO_PROCESSING_INCLUDE_VIDEO_PROCESSING_H_ |
20 | 13 |
21 #include "webrtc/modules/include/module_common_types.h" | 14 #include "webrtc/modules/include/module_common_types.h" |
22 #include "webrtc/modules/video_processing/include/video_processing_defines.h" | 15 #include "webrtc/modules/video_processing/include/video_processing_defines.h" |
23 #include "webrtc/video_frame.h" | 16 #include "webrtc/video_frame.h" |
24 | 17 |
25 // The module is largely intended to process video streams, except functionality | 18 // The module is largely intended to process video streams, except functionality |
26 // provided by static functions which operate independent of previous frames. It | 19 // 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 | 20 // is recommended, but not required that a unique instance be used for each |
28 // concurrently processed stream. Similarly, it is recommended to call Reset() | 21 // concurrently processed stream. Similarly, it is recommended to call Reset() |
29 // before switching to a new stream, but this is not absolutely required. | 22 // before switching to a new stream, but this is not absolutely required. |
30 // | 23 // |
31 // The module provides basic thread safety by permitting only a single function | 24 // The module provides basic thread safety by permitting only a single function |
32 // to execute concurrently. | 25 // to execute concurrently. |
33 | 26 |
34 namespace webrtc { | 27 namespace webrtc { |
35 | 28 |
36 class VideoProcessing { | 29 class VideoProcessing { |
37 public: | 30 public: |
38 struct FrameStats { | 31 struct FrameStats { |
39 uint32_t hist[256]; // Frame histogram. | 32 uint32_t hist[256]; // Frame histogram. |
40 uint32_t mean; | 33 uint32_t mean; |
41 uint32_t sum; | 34 uint32_t sum; |
42 uint32_t num_pixels; | 35 uint32_t num_pixels; |
43 uint32_t sub_sampling_factor; // Sub-sampling factor, in powers of 2. | 36 uint32_t sub_sampling_factor; // Sub-sampling factor, in powers of 2. |
44 }; | 37 }; |
45 | 38 |
46 enum BrightnessWarning { | 39 enum BrightnessWarning { kNoWarning, kDarkWarning, kBrightWarning }; |
47 kNoWarning, | |
48 kDarkWarning, | |
49 kBrightWarning | |
50 }; | |
51 | 40 |
52 static VideoProcessing* Create(); | 41 static VideoProcessing* Create(); |
53 virtual ~VideoProcessing() {} | 42 virtual ~VideoProcessing() {} |
54 | 43 |
55 // Retrieves statistics for the input frame. This function must be used to | 44 // Retrieves statistics for the input frame. This function must be used to |
56 // prepare a FrameStats struct for use in certain VPM functions. | 45 // prepare a FrameStats struct for use in certain VPM functions. |
57 static void GetFrameStats(const VideoFrame& frame, FrameStats* stats); | 46 static void GetFrameStats(const VideoFrame& frame, FrameStats* stats); |
58 | 47 |
59 // Checks the validity of a FrameStats struct. Currently, valid implies only | 48 // Checks the validity of a FrameStats struct. Currently, valid implies only |
60 // that is had changed from its initialized state. | 49 // 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; | 93 virtual void EnableDenosing(bool enable) = 0; |
105 virtual const VideoFrame* PreprocessFrame(const VideoFrame& frame) = 0; | 94 virtual const VideoFrame* PreprocessFrame(const VideoFrame& frame) = 0; |
106 | 95 |
107 virtual VideoContentMetrics* GetContentMetrics() const = 0; | 96 virtual VideoContentMetrics* GetContentMetrics() const = 0; |
108 virtual void EnableContentAnalysis(bool enable) = 0; | 97 virtual void EnableContentAnalysis(bool enable) = 0; |
109 }; | 98 }; |
110 | 99 |
111 } // namespace webrtc | 100 } // namespace webrtc |
112 | 101 |
113 #endif // WEBRTC_MODULES_VIDEO_PROCESSING_INCLUDE_VIDEO_PROCESSING_H_ | 102 #endif // WEBRTC_MODULES_VIDEO_PROCESSING_INCLUDE_VIDEO_PROCESSING_H_ |
OLD | NEW |