niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 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 | |
Henrik Kjellander | 0f59a88 | 2015-11-18 22:31:24 +0100 | [diff] [blame] | 11 | #ifndef WEBRTC_MODULES_VIDEO_PROCESSING_INCLUDE_VIDEO_PROCESSING_H_ |
| 12 | #define WEBRTC_MODULES_VIDEO_PROCESSING_INCLUDE_VIDEO_PROCESSING_H_ |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 13 | |
Henrik Kjellander | ff761fb | 2015-11-04 08:31:52 +0100 | [diff] [blame] | 14 | #include "webrtc/modules/include/module_common_types.h" |
Henrik Kjellander | 0f59a88 | 2015-11-18 22:31:24 +0100 | [diff] [blame] | 15 | #include "webrtc/modules/video_processing/include/video_processing_defines.h" |
Thiago Farina | 9bfe3da | 2015-04-10 12:52:13 +0200 | [diff] [blame] | 16 | #include "webrtc/video_frame.h" |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 17 | |
mflodman | a856542 | 2015-12-07 01:09:52 -0800 | [diff] [blame] | 18 | // The module is largely intended to process video streams, except functionality |
| 19 | // provided by static functions which operate independent of previous frames. It |
| 20 | // is recommended, but not required that a unique instance be used for each |
| 21 | // concurrently processed stream. Similarly, it is recommended to call Reset() |
| 22 | // before switching to a new stream, but this is not absolutely required. |
| 23 | // |
| 24 | // The module provides basic thread safety by permitting only a single function |
| 25 | // to execute concurrently. |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 26 | |
| 27 | namespace webrtc { |
| 28 | |
mflodman | a856542 | 2015-12-07 01:09:52 -0800 | [diff] [blame] | 29 | class VideoProcessing { |
mikhal@webrtc.org | b43d807 | 2013-10-03 16:42:41 +0000 | [diff] [blame] | 30 | public: |
mflodman | a856542 | 2015-12-07 01:09:52 -0800 | [diff] [blame] | 31 | static VideoProcessing* Create(); |
| 32 | virtual ~VideoProcessing() {} |
mikhal@webrtc.org | b43d807 | 2013-10-03 16:42:41 +0000 | [diff] [blame] | 33 | |
mflodman | a856542 | 2015-12-07 01:09:52 -0800 | [diff] [blame] | 34 | // The following functions refer to the pre-processor unit within VPM. The |
| 35 | // pre-processor perfoms spatial/temporal decimation and content analysis on |
| 36 | // the frames prior to encoding. |
mikhal@webrtc.org | b43d807 | 2013-10-03 16:42:41 +0000 | [diff] [blame] | 37 | |
mflodman | a856542 | 2015-12-07 01:09:52 -0800 | [diff] [blame] | 38 | // Enable/disable temporal decimation |
mikhal@webrtc.org | b43d807 | 2013-10-03 16:42:41 +0000 | [diff] [blame] | 39 | virtual void EnableTemporalDecimation(bool enable) = 0; |
| 40 | |
mikhal@webrtc.org | b43d807 | 2013-10-03 16:42:41 +0000 | [diff] [blame] | 41 | virtual int32_t SetTargetResolution(uint32_t width, |
| 42 | uint32_t height, |
| 43 | uint32_t frame_rate) = 0; |
| 44 | |
mflodman | a856542 | 2015-12-07 01:09:52 -0800 | [diff] [blame] | 45 | virtual uint32_t GetDecimatedFrameRate() = 0; |
| 46 | virtual uint32_t GetDecimatedWidth() const = 0; |
| 47 | virtual uint32_t GetDecimatedHeight() const = 0; |
mikhal@webrtc.org | b43d807 | 2013-10-03 16:42:41 +0000 | [diff] [blame] | 48 | |
mflodman | a856542 | 2015-12-07 01:09:52 -0800 | [diff] [blame] | 49 | // Set the spatial resampling settings of the VPM according to |
| 50 | // VideoFrameResampling. |
| 51 | virtual void SetInputFrameResampleMode( |
| 52 | VideoFrameResampling resampling_mode) = 0; |
mikhal@webrtc.org | b43d807 | 2013-10-03 16:42:41 +0000 | [diff] [blame] | 53 | |
nisse | 90c335a | 2016-04-27 00:59:22 -0700 | [diff] [blame] | 54 | virtual void EnableDenoising(bool enable) = 0; |
mflodman | a856542 | 2015-12-07 01:09:52 -0800 | [diff] [blame] | 55 | virtual const VideoFrame* PreprocessFrame(const VideoFrame& frame) = 0; |
mikhal@webrtc.org | b43d807 | 2013-10-03 16:42:41 +0000 | [diff] [blame] | 56 | |
mflodman | a856542 | 2015-12-07 01:09:52 -0800 | [diff] [blame] | 57 | virtual VideoContentMetrics* GetContentMetrics() const = 0; |
mikhal@webrtc.org | b43d807 | 2013-10-03 16:42:41 +0000 | [diff] [blame] | 58 | virtual void EnableContentAnalysis(bool enable) = 0; |
| 59 | }; |
| 60 | |
| 61 | } // namespace webrtc |
| 62 | |
Henrik Kjellander | 0f59a88 | 2015-11-18 22:31:24 +0100 | [diff] [blame] | 63 | #endif // WEBRTC_MODULES_VIDEO_PROCESSING_INCLUDE_VIDEO_PROCESSING_H_ |