2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
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.
11 #ifndef WEBRTC_MODULE_VIDEO_PROCESSING_IMPL_H
12 #define WEBRTC_MODULE_VIDEO_PROCESSING_IMPL_H
14 #include "webrtc/modules/video_processing/main/interface/video_processing.h"
15 #include "webrtc/modules/video_processing/main/source/brighten.h"
16 #include "webrtc/modules/video_processing/main/source/brightness_detection.h"
17 #include "webrtc/modules/video_processing/main/source/color_enhancement.h"
18 #include "webrtc/modules/video_processing/main/source/deflickering.h"
19 #include "webrtc/modules/video_processing/main/source/frame_preprocessor.h"
22 class CriticalSectionWrapper;
24 class VideoProcessingModuleImpl : public VideoProcessingModule {
26 VideoProcessingModuleImpl(int32_t id);
28 virtual ~VideoProcessingModuleImpl();
32 virtual int32_t ChangeUniqueId(const int32_t id) OVERRIDE;
34 virtual void Reset() OVERRIDE;
36 virtual int32_t Deflickering(I420VideoFrame* frame,
37 FrameStats* stats) OVERRIDE;
39 virtual int32_t BrightnessDetection(const I420VideoFrame& frame,
40 const FrameStats& stats) OVERRIDE;
42 // Frame pre-processor functions
44 // Enable temporal decimation
45 virtual void EnableTemporalDecimation(bool enable) OVERRIDE;
47 virtual void SetInputFrameResampleMode(
48 VideoFrameResampling resampling_mode) OVERRIDE;
50 // Enable content analysis
51 virtual void EnableContentAnalysis(bool enable) OVERRIDE;
53 // Set Target Resolution: frame rate and dimension
54 virtual int32_t SetTargetResolution(uint32_t width,
56 uint32_t frame_rate) OVERRIDE;
59 // Get decimated values: frame rate/dimension
60 virtual uint32_t Decimatedframe_rate() OVERRIDE;
61 virtual uint32_t DecimatedWidth() const OVERRIDE;
62 virtual uint32_t DecimatedHeight() const OVERRIDE;
65 // Pre-process incoming frame: Sample when needed and compute content
66 // metrics when enabled.
67 // If no resampling takes place - processed_frame is set to NULL.
68 virtual int32_t PreprocessFrame(const I420VideoFrame& frame,
69 I420VideoFrame** processed_frame) OVERRIDE;
70 virtual VideoContentMetrics* ContentMetrics() const OVERRIDE;
74 CriticalSectionWrapper& mutex_;
75 VPMDeflickering deflickering_;
76 VPMBrightnessDetection brightness_detection_;
77 VPMFramePreprocessor frame_pre_processor_;