2011-07-07 08:21:25 +00:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
|
|
|
|
|
*
|
|
|
|
|
* Use of this source code is governed by a BSD-style license
|
|
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
|
|
|
|
* in the file PATENTS. All contributing project authors may
|
|
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
|
|
|
*/
|
|
|
|
|
|
2015-11-18 22:31:24 +01:00
|
|
|
#ifndef WEBRTC_MODULES_VIDEO_PROCESSING_VIDEO_PROCESSING_IMPL_H_
|
|
|
|
|
#define WEBRTC_MODULES_VIDEO_PROCESSING_VIDEO_PROCESSING_IMPL_H_
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2015-09-18 12:24:25 +02:00
|
|
|
#include "webrtc/base/criticalsection.h"
|
2015-11-18 22:31:24 +01:00
|
|
|
#include "webrtc/modules/video_processing/include/video_processing.h"
|
|
|
|
|
#include "webrtc/modules/video_processing/brighten.h"
|
|
|
|
|
#include "webrtc/modules/video_processing/brightness_detection.h"
|
|
|
|
|
#include "webrtc/modules/video_processing/deflickering.h"
|
|
|
|
|
#include "webrtc/modules/video_processing/frame_preprocessor.h"
|
2011-07-07 08:21:25 +00:00
|
|
|
|
|
|
|
|
namespace webrtc {
|
|
|
|
|
class CriticalSectionWrapper;
|
|
|
|
|
|
2013-10-03 16:42:41 +00:00
|
|
|
class VideoProcessingModuleImpl : public VideoProcessingModule {
|
|
|
|
|
public:
|
2015-09-18 12:24:25 +02:00
|
|
|
VideoProcessingModuleImpl();
|
|
|
|
|
~VideoProcessingModuleImpl() override;
|
2011-11-14 15:30:26 +00:00
|
|
|
|
2015-03-04 12:58:35 +00:00
|
|
|
void Reset() override;
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2015-05-29 17:21:40 -07:00
|
|
|
int32_t Deflickering(VideoFrame* frame, FrameStats* stats) override;
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2015-05-29 17:21:40 -07:00
|
|
|
int32_t BrightnessDetection(const VideoFrame& frame,
|
2015-03-04 12:58:35 +00:00
|
|
|
const FrameStats& stats) override;
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2013-10-03 16:42:41 +00:00
|
|
|
// Frame pre-processor functions
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2013-10-03 16:42:41 +00:00
|
|
|
// Enable temporal decimation
|
2015-03-04 12:58:35 +00:00
|
|
|
void EnableTemporalDecimation(bool enable) override;
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2015-03-04 12:58:35 +00:00
|
|
|
void SetInputFrameResampleMode(VideoFrameResampling resampling_mode) override;
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2013-10-03 16:42:41 +00:00
|
|
|
// Enable content analysis
|
2015-03-04 12:58:35 +00:00
|
|
|
void EnableContentAnalysis(bool enable) override;
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2013-10-03 16:42:41 +00:00
|
|
|
// Set Target Resolution: frame rate and dimension
|
2015-03-04 12:58:35 +00:00
|
|
|
int32_t SetTargetResolution(uint32_t width,
|
|
|
|
|
uint32_t height,
|
|
|
|
|
uint32_t frame_rate) override;
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2015-07-13 16:26:33 -07:00
|
|
|
void SetTargetFramerate(int frame_rate) override;
|
|
|
|
|
|
2013-10-03 16:42:41 +00:00
|
|
|
// Get decimated values: frame rate/dimension
|
2015-03-04 12:58:35 +00:00
|
|
|
uint32_t Decimatedframe_rate() override;
|
|
|
|
|
uint32_t DecimatedWidth() const override;
|
|
|
|
|
uint32_t DecimatedHeight() const override;
|
2011-11-14 15:30:26 +00:00
|
|
|
|
2013-10-03 16:42:41 +00:00
|
|
|
// Preprocess:
|
|
|
|
|
// Pre-process incoming frame: Sample when needed and compute content
|
|
|
|
|
// metrics when enabled.
|
|
|
|
|
// If no resampling takes place - processed_frame is set to NULL.
|
2015-05-29 17:21:40 -07:00
|
|
|
int32_t PreprocessFrame(const VideoFrame& frame,
|
|
|
|
|
VideoFrame** processed_frame) override;
|
2015-03-04 12:58:35 +00:00
|
|
|
VideoContentMetrics* ContentMetrics() const override;
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2013-10-03 16:42:41 +00:00
|
|
|
private:
|
2015-09-18 12:24:25 +02:00
|
|
|
mutable rtc::CriticalSection mutex_;
|
|
|
|
|
VPMDeflickering deflickering_ GUARDED_BY(mutex_);
|
2013-10-03 16:42:41 +00:00
|
|
|
VPMBrightnessDetection brightness_detection_;
|
2015-01-29 12:12:49 +00:00
|
|
|
VPMFramePreprocessor frame_pre_processor_;
|
2011-07-07 08:21:25 +00:00
|
|
|
};
|
|
|
|
|
|
2013-07-03 15:12:26 +00:00
|
|
|
} // namespace
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2015-11-18 22:31:24 +01:00
|
|
|
#endif // WEBRTC_MODULES_VIDEO_PROCESSING_VIDEO_PROCESSING_IMPL_H_
|