OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 #ifndef WEBRTC_MODULES_VIDEO_PROCESSING_SPATIAL_RESAMPLER_H_ | 11 #ifndef WEBRTC_MODULES_VIDEO_PROCESSING_SPATIAL_RESAMPLER_H_ |
12 #define WEBRTC_MODULES_VIDEO_PROCESSING_SPATIAL_RESAMPLER_H_ | 12 #define WEBRTC_MODULES_VIDEO_PROCESSING_SPATIAL_RESAMPLER_H_ |
13 | 13 |
14 #include "webrtc/typedefs.h" | 14 #include "webrtc/typedefs.h" |
15 | 15 |
16 #include "webrtc/modules/include/module_common_types.h" | 16 #include "webrtc/modules/include/module_common_types.h" |
17 #include "webrtc/modules/video_processing/include/video_processing_defines.h" | 17 #include "webrtc/modules/video_processing/include/video_processing_defines.h" |
18 | 18 |
19 #include "webrtc/common_video/libyuv/include/scaler.h" | 19 #include "webrtc/common_video/libyuv/include/scaler.h" |
20 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" | 20 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" |
21 | 21 |
22 namespace webrtc { | 22 namespace webrtc { |
23 | 23 |
24 class VPMSpatialResampler { | 24 class VPMSpatialResampler { |
25 public: | 25 public: |
26 virtual ~VPMSpatialResampler() {}; | 26 virtual ~VPMSpatialResampler(){}; |
27 virtual int32_t SetTargetFrameSize(int32_t width, int32_t height) = 0; | 27 virtual int32_t SetTargetFrameSize(int32_t width, int32_t height) = 0; |
28 virtual void SetInputFrameResampleMode(VideoFrameResampling | 28 virtual void SetInputFrameResampleMode( |
29 resampling_mode) = 0; | 29 VideoFrameResampling resampling_mode) = 0; |
30 virtual void Reset() = 0; | 30 virtual void Reset() = 0; |
31 virtual int32_t ResampleFrame(const VideoFrame& inFrame, | 31 virtual int32_t ResampleFrame(const VideoFrame& inFrame, |
32 VideoFrame* outFrame) = 0; | 32 VideoFrame* outFrame) = 0; |
33 virtual int32_t TargetWidth() = 0; | 33 virtual int32_t TargetWidth() = 0; |
34 virtual int32_t TargetHeight() = 0; | 34 virtual int32_t TargetHeight() = 0; |
35 virtual bool ApplyResample(int32_t width, int32_t height) = 0; | 35 virtual bool ApplyResample(int32_t width, int32_t height) = 0; |
36 }; | 36 }; |
37 | 37 |
38 class VPMSimpleSpatialResampler : public VPMSpatialResampler { | 38 class VPMSimpleSpatialResampler : public VPMSpatialResampler { |
39 public: | 39 public: |
40 VPMSimpleSpatialResampler(); | 40 VPMSimpleSpatialResampler(); |
41 ~VPMSimpleSpatialResampler(); | 41 ~VPMSimpleSpatialResampler(); |
42 virtual int32_t SetTargetFrameSize(int32_t width, int32_t height); | 42 virtual int32_t SetTargetFrameSize(int32_t width, int32_t height); |
43 virtual void SetInputFrameResampleMode(VideoFrameResampling resampling_mode); | 43 virtual void SetInputFrameResampleMode(VideoFrameResampling resampling_mode); |
44 virtual void Reset(); | 44 virtual void Reset(); |
45 virtual int32_t ResampleFrame(const VideoFrame& inFrame, | 45 virtual int32_t ResampleFrame(const VideoFrame& inFrame, |
46 VideoFrame* outFrame); | 46 VideoFrame* outFrame); |
47 virtual int32_t TargetWidth(); | 47 virtual int32_t TargetWidth(); |
48 virtual int32_t TargetHeight(); | 48 virtual int32_t TargetHeight(); |
49 virtual bool ApplyResample(int32_t width, int32_t height); | 49 virtual bool ApplyResample(int32_t width, int32_t height); |
50 | 50 |
51 private: | 51 private: |
52 | 52 VideoFrameResampling resampling_mode_; |
53 VideoFrameResampling resampling_mode_; | 53 int32_t target_width_; |
54 int32_t target_width_; | 54 int32_t target_height_; |
55 int32_t target_height_; | 55 Scaler scaler_; |
56 Scaler scaler_; | |
57 }; | 56 }; |
58 | 57 |
59 } // namespace webrtc | 58 } // namespace webrtc |
60 | 59 |
61 #endif // WEBRTC_MODULES_VIDEO_PROCESSING_SPATIAL_RESAMPLER_H_ | 60 #endif // WEBRTC_MODULES_VIDEO_PROCESSING_SPATIAL_RESAMPLER_H_ |
OLD | NEW |