Home | History | Annotate | Download | only in video_processing
      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_MODULES_VIDEO_PROCESSING_VIDEO_PROCESSING_IMPL_H_
     12 #define WEBRTC_MODULES_VIDEO_PROCESSING_VIDEO_PROCESSING_IMPL_H_
     13 
     14 #include "webrtc/base/criticalsection.h"
     15 #include "webrtc/modules/video_processing/include/video_processing.h"
     16 #include "webrtc/modules/video_processing/brightness_detection.h"
     17 #include "webrtc/modules/video_processing/deflickering.h"
     18 #include "webrtc/modules/video_processing/frame_preprocessor.h"
     19 
     20 namespace webrtc {
     21 class CriticalSectionWrapper;
     22 
     23 class VideoProcessingImpl : public VideoProcessing {
     24  public:
     25   VideoProcessingImpl();
     26   ~VideoProcessingImpl() override;
     27 
     28   // Implements VideoProcessing.
     29   int32_t Deflickering(VideoFrame* frame, FrameStats* stats) override;
     30   int32_t BrightnessDetection(const VideoFrame& frame,
     31                               const FrameStats& stats) override;
     32   void EnableTemporalDecimation(bool enable) override;
     33   void SetInputFrameResampleMode(VideoFrameResampling resampling_mode) override;
     34   void EnableContentAnalysis(bool enable) override;
     35   int32_t SetTargetResolution(uint32_t width,
     36                               uint32_t height,
     37                               uint32_t frame_rate) override;
     38   void SetTargetFramerate(int frame_rate) override;
     39   uint32_t GetDecimatedFrameRate() override;
     40   uint32_t GetDecimatedWidth() const override;
     41   uint32_t GetDecimatedHeight() const override;
     42   void EnableDenosing(bool enable) override;
     43   const VideoFrame* PreprocessFrame(const VideoFrame& frame) override;
     44   VideoContentMetrics* GetContentMetrics() const override;
     45 
     46  private:
     47   mutable rtc::CriticalSection mutex_;
     48   VPMDeflickering deflickering_ GUARDED_BY(mutex_);
     49   VPMBrightnessDetection brightness_detection_;
     50   VPMFramePreprocessor frame_pre_processor_;
     51 };
     52 
     53 }  // namespace webrtc
     54 
     55 #endif  // WEBRTC_MODULES_VIDEO_PROCESSING_VIDEO_PROCESSING_IMPL_H_
     56