Upstream version 9.38.198.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);
33
34   virtual void Reset();
35
36   virtual int32_t Deflickering(I420VideoFrame* frame, FrameStats* stats);
37
38   virtual int32_t BrightnessDetection(const I420VideoFrame& frame,
39                                       const FrameStats& stats);
40
41   // Frame pre-processor functions
42
43   // Enable temporal decimation
44   virtual void EnableTemporalDecimation(bool enable);
45
46   virtual void SetInputFrameResampleMode(VideoFrameResampling resampling_mode);
47
48   // Enable content analysis
49   virtual void EnableContentAnalysis(bool enable);
50
51   // Set Target Resolution: frame rate and dimension
52   virtual int32_t SetTargetResolution(uint32_t width,
53                                       uint32_t height,
54                                       uint32_t frame_rate);
55
56
57   // Get decimated values: frame rate/dimension
58   virtual uint32_t Decimatedframe_rate();
59   virtual uint32_t DecimatedWidth() const;
60   virtual uint32_t DecimatedHeight() const;
61
62   // Preprocess:
63   // Pre-process incoming frame: Sample when needed and compute content
64   // metrics when enabled.
65   // If no resampling takes place - processed_frame is set to NULL.
66   virtual int32_t PreprocessFrame(const I420VideoFrame& frame,
67                                   I420VideoFrame** processed_frame);
68   virtual VideoContentMetrics* ContentMetrics() const;
69
70  private:
71   int32_t  id_;
72   CriticalSectionWrapper& mutex_;
73   VPMDeflickering deflickering_;
74   VPMBrightnessDetection brightness_detection_;
75   VPMFramePreprocessor  frame_pre_processor_;
76 };
77
78 }  // namespace
79
80 #endif