| OLD | NEW |
| (Empty) |
| 1 /* | |
| 2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. | |
| 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 | |
| 11 #ifndef WEBRTC_MODULE_VIDEO_PROCESSING_IMPL_H | |
| 12 #define WEBRTC_MODULE_VIDEO_PROCESSING_IMPL_H | |
| 13 | |
| 14 #include "webrtc/base/criticalsection.h" | |
| 15 #include "webrtc/modules/video_processing/main/interface/video_processing.h" | |
| 16 #include "webrtc/modules/video_processing/main/source/brighten.h" | |
| 17 #include "webrtc/modules/video_processing/main/source/brightness_detection.h" | |
| 18 #include "webrtc/modules/video_processing/main/source/deflickering.h" | |
| 19 #include "webrtc/modules/video_processing/main/source/frame_preprocessor.h" | |
| 20 | |
| 21 namespace webrtc { | |
| 22 class CriticalSectionWrapper; | |
| 23 | |
| 24 class VideoProcessingModuleImpl : public VideoProcessingModule { | |
| 25 public: | |
| 26 VideoProcessingModuleImpl(); | |
| 27 ~VideoProcessingModuleImpl() override; | |
| 28 | |
| 29 void Reset() override; | |
| 30 | |
| 31 int32_t Deflickering(VideoFrame* frame, FrameStats* stats) override; | |
| 32 | |
| 33 int32_t BrightnessDetection(const VideoFrame& frame, | |
| 34 const FrameStats& stats) override; | |
| 35 | |
| 36 // Frame pre-processor functions | |
| 37 | |
| 38 // Enable temporal decimation | |
| 39 void EnableTemporalDecimation(bool enable) override; | |
| 40 | |
| 41 void SetInputFrameResampleMode(VideoFrameResampling resampling_mode) override; | |
| 42 | |
| 43 // Enable content analysis | |
| 44 void EnableContentAnalysis(bool enable) override; | |
| 45 | |
| 46 // Set Target Resolution: frame rate and dimension | |
| 47 int32_t SetTargetResolution(uint32_t width, | |
| 48 uint32_t height, | |
| 49 uint32_t frame_rate) override; | |
| 50 | |
| 51 void SetTargetFramerate(int frame_rate) override; | |
| 52 | |
| 53 // Get decimated values: frame rate/dimension | |
| 54 uint32_t Decimatedframe_rate() override; | |
| 55 uint32_t DecimatedWidth() const override; | |
| 56 uint32_t DecimatedHeight() const override; | |
| 57 | |
| 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 | |
| 66 private: | |
| 67 mutable rtc::CriticalSection mutex_; | |
| 68 VPMDeflickering deflickering_ GUARDED_BY(mutex_); | |
| 69 VPMBrightnessDetection brightness_detection_; | |
| 70 VPMFramePreprocessor frame_pre_processor_; | |
| 71 }; | |
| 72 | |
| 73 } // namespace | |
| 74 | |
| 75 #endif | |
| OLD | NEW |