| 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 #ifndef WEBRTC_MODULES_VIDEO_PROCESSING_VIDEO_PROCESSING_IMPL_H_ | 11 #ifndef WEBRTC_MODULES_VIDEO_PROCESSING_VIDEO_PROCESSING_IMPL_H_ |
| 12 #define WEBRTC_MODULES_VIDEO_PROCESSING_VIDEO_PROCESSING_IMPL_H_ | 12 #define WEBRTC_MODULES_VIDEO_PROCESSING_VIDEO_PROCESSING_IMPL_H_ |
| 13 | 13 |
| 14 #include "webrtc/base/criticalsection.h" | 14 #include "webrtc/base/criticalsection.h" |
| 15 #include "webrtc/modules/video_processing/include/video_processing.h" | 15 #include "webrtc/modules/video_processing/include/video_processing.h" |
| 16 #include "webrtc/modules/video_processing/brighten.h" | |
| 17 #include "webrtc/modules/video_processing/brightness_detection.h" | 16 #include "webrtc/modules/video_processing/brightness_detection.h" |
| 18 #include "webrtc/modules/video_processing/deflickering.h" | 17 #include "webrtc/modules/video_processing/deflickering.h" |
| 19 #include "webrtc/modules/video_processing/frame_preprocessor.h" | 18 #include "webrtc/modules/video_processing/frame_preprocessor.h" |
| 20 | 19 |
| 21 namespace webrtc { | 20 namespace webrtc { |
| 22 class CriticalSectionWrapper; | 21 class CriticalSectionWrapper; |
| 23 | 22 |
| 24 class VideoProcessingModuleImpl : public VideoProcessingModule { | 23 class VideoProcessingImpl : public VideoProcessing { |
| 25 public: | 24 public: |
| 26 VideoProcessingModuleImpl(); | 25 VideoProcessingImpl(); |
| 27 ~VideoProcessingModuleImpl() override; | 26 ~VideoProcessingImpl() override; |
| 28 | 27 |
| 29 void Reset() override; | 28 // Implements VideoProcessing. |
| 30 | |
| 31 int32_t Deflickering(VideoFrame* frame, FrameStats* stats) override; | 29 int32_t Deflickering(VideoFrame* frame, FrameStats* stats) override; |
| 32 | |
| 33 int32_t BrightnessDetection(const VideoFrame& frame, | 30 int32_t BrightnessDetection(const VideoFrame& frame, |
| 34 const FrameStats& stats) override; | 31 const FrameStats& stats) override; |
| 35 | |
| 36 // Frame pre-processor functions | |
| 37 | |
| 38 // Enable temporal decimation | |
| 39 void EnableTemporalDecimation(bool enable) override; | 32 void EnableTemporalDecimation(bool enable) override; |
| 40 | |
| 41 void SetInputFrameResampleMode(VideoFrameResampling resampling_mode) override; | 33 void SetInputFrameResampleMode(VideoFrameResampling resampling_mode) override; |
| 42 | |
| 43 // Enable content analysis | |
| 44 void EnableContentAnalysis(bool enable) override; | 34 void EnableContentAnalysis(bool enable) override; |
| 45 | |
| 46 // Set Target Resolution: frame rate and dimension | |
| 47 int32_t SetTargetResolution(uint32_t width, | 35 int32_t SetTargetResolution(uint32_t width, |
| 48 uint32_t height, | 36 uint32_t height, |
| 49 uint32_t frame_rate) override; | 37 uint32_t frame_rate) override; |
| 50 | |
| 51 void SetTargetFramerate(int frame_rate) override; | 38 void SetTargetFramerate(int frame_rate) override; |
| 52 | 39 uint32_t GetDecimatedFrameRate() override; |
| 53 // Get decimated values: frame rate/dimension | 40 uint32_t GetDecimatedWidth() const override; |
| 54 uint32_t Decimatedframe_rate() override; | 41 uint32_t GetDecimatedHeight() const override; |
| 55 uint32_t DecimatedWidth() const override; | 42 void EnableDenosing(bool enable) override; |
| 56 uint32_t DecimatedHeight() const override; | 43 const VideoFrame* PreprocessFrame(const VideoFrame& frame) override; |
| 57 | 44 VideoContentMetrics* GetContentMetrics() const override; |
| 58 // Preprocess: | |
| 59 // Pre-process incoming frame: Sample when needed and compute content | |
| 60 // metrics when enabled. | |
| 61 // If no resampling takes place - processed_frame is set to NULL. | |
| 62 int32_t PreprocessFrame(const VideoFrame& frame, | |
| 63 VideoFrame** processed_frame) override; | |
| 64 VideoContentMetrics* ContentMetrics() const override; | |
| 65 | 45 |
| 66 private: | 46 private: |
| 67 mutable rtc::CriticalSection mutex_; | 47 mutable rtc::CriticalSection mutex_; |
| 68 VPMDeflickering deflickering_ GUARDED_BY(mutex_); | 48 VPMDeflickering deflickering_ GUARDED_BY(mutex_); |
| 69 VPMBrightnessDetection brightness_detection_; | 49 VPMBrightnessDetection brightness_detection_; |
| 70 VPMFramePreprocessor frame_pre_processor_; | 50 VPMFramePreprocessor frame_pre_processor_; |
| 71 }; | 51 }; |
| 72 | 52 |
| 73 } // namespace | 53 } // namespace webrtc |
| 74 | 54 |
| 75 #endif // WEBRTC_MODULES_VIDEO_PROCESSING_VIDEO_PROCESSING_IMPL_H_ | 55 #endif // WEBRTC_MODULES_VIDEO_PROCESSING_VIDEO_PROCESSING_IMPL_H_ |
| OLD | NEW |