Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / third_party / webrtc / modules / video_processing / main / source / video_processing_impl.h
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/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"
20
21 namespace webrtc {
22 class CriticalSectionWrapper;
23
24 class VideoProcessingModuleImpl : public VideoProcessingModule {
25  public:
26   VideoProcessingModuleImpl(int32_t id);
27
28   virtual ~VideoProcessingModuleImpl();
29
30   int32_t Id() const;
31
32   virtual int32_t ChangeUniqueId(const int32_t id) OVERRIDE;
33
34   virtual void Reset() OVERRIDE;
35
36   virtual int32_t Deflickering(I420VideoFrame* frame,
37                                FrameStats* stats) OVERRIDE;
38
39   virtual int32_t BrightnessDetection(const I420VideoFrame& frame,
40                                       const FrameStats& stats) OVERRIDE;
41
42   // Frame pre-processor functions
43
44   // Enable temporal decimation
45   virtual void EnableTemporalDecimation(bool enable) OVERRIDE;
46
47   virtual void SetInputFrameResampleMode(
48       VideoFrameResampling resampling_mode) OVERRIDE;
49
50   // Enable content analysis
51   virtual void EnableContentAnalysis(bool enable) OVERRIDE;
52
53   // Set Target Resolution: frame rate and dimension
54   virtual int32_t SetTargetResolution(uint32_t width,
55                                       uint32_t height,
56                                       uint32_t frame_rate) OVERRIDE;
57
58
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;
63
64   // Preprocess:
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;
71
72  private:
73   int32_t  id_;
74   CriticalSectionWrapper& mutex_;
75   VPMDeflickering deflickering_;
76   VPMBrightnessDetection brightness_detection_;
77   VPMFramePreprocessor  frame_pre_processor_;
78 };
79
80 }  // namespace
81
82 #endif