blob: e2069ddbe7a7c52758118150af6bb0430577b5da [file] [log] [blame]
niklase@google.com470e71d2011-07-07 08:21:25 +00001/*
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 Kjellander0f59a882015-11-18 22:31:24 +010011#ifndef WEBRTC_MODULES_VIDEO_PROCESSING_INCLUDE_VIDEO_PROCESSING_H_
12#define WEBRTC_MODULES_VIDEO_PROCESSING_INCLUDE_VIDEO_PROCESSING_H_
niklase@google.com470e71d2011-07-07 08:21:25 +000013
Henrik Kjellanderff761fb2015-11-04 08:31:52 +010014#include "webrtc/modules/include/module_common_types.h"
Henrik Kjellander0f59a882015-11-18 22:31:24 +010015#include "webrtc/modules/video_processing/include/video_processing_defines.h"
Thiago Farina9bfe3da2015-04-10 12:52:13 +020016#include "webrtc/video_frame.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000017
mflodmana8565422015-12-07 01:09:52 -080018// 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.com470e71d2011-07-07 08:21:25 +000026
27namespace webrtc {
28
mflodmana8565422015-12-07 01:09:52 -080029class VideoProcessing {
mikhal@webrtc.orgb43d8072013-10-03 16:42:41 +000030 public:
mflodmana8565422015-12-07 01:09:52 -080031 static VideoProcessing* Create();
32 virtual ~VideoProcessing() {}
mikhal@webrtc.orgb43d8072013-10-03 16:42:41 +000033
mflodmana8565422015-12-07 01:09:52 -080034 // 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.orgb43d8072013-10-03 16:42:41 +000037
mflodmana8565422015-12-07 01:09:52 -080038 // Enable/disable temporal decimation
mikhal@webrtc.orgb43d8072013-10-03 16:42:41 +000039 virtual void EnableTemporalDecimation(bool enable) = 0;
40
mikhal@webrtc.orgb43d8072013-10-03 16:42:41 +000041 virtual int32_t SetTargetResolution(uint32_t width,
42 uint32_t height,
43 uint32_t frame_rate) = 0;
44
mflodmana8565422015-12-07 01:09:52 -080045 virtual uint32_t GetDecimatedFrameRate() = 0;
46 virtual uint32_t GetDecimatedWidth() const = 0;
47 virtual uint32_t GetDecimatedHeight() const = 0;
mikhal@webrtc.orgb43d8072013-10-03 16:42:41 +000048
mflodmana8565422015-12-07 01:09:52 -080049 // Set the spatial resampling settings of the VPM according to
50 // VideoFrameResampling.
51 virtual void SetInputFrameResampleMode(
52 VideoFrameResampling resampling_mode) = 0;
mikhal@webrtc.orgb43d8072013-10-03 16:42:41 +000053
nisse90c335a2016-04-27 00:59:22 -070054 virtual void EnableDenoising(bool enable) = 0;
mflodmana8565422015-12-07 01:09:52 -080055 virtual const VideoFrame* PreprocessFrame(const VideoFrame& frame) = 0;
mikhal@webrtc.orgb43d8072013-10-03 16:42:41 +000056};
57
58} // namespace webrtc
59
Henrik Kjellander0f59a882015-11-18 22:31:24 +010060#endif // WEBRTC_MODULES_VIDEO_PROCESSING_INCLUDE_VIDEO_PROCESSING_H_