niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 1 | /* |
mflodman@webrtc.org | 1f99280 | 2012-01-27 13:42:53 +0000 | [diff] [blame] | 2 | * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 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 | // This file implements a class that can be used for scaling frames. |
mflodman@webrtc.org | 1f99280 | 2012-01-27 13:42:53 +0000 | [diff] [blame] | 12 | |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 13 | #ifndef WEBRTC_MODULES_UTILITY_SOURCE_FRAME_SCALER_H_ |
| 14 | #define WEBRTC_MODULES_UTILITY_SOURCE_FRAME_SCALER_H_ |
| 15 | |
| 16 | #ifdef WEBRTC_MODULE_UTILITY_VIDEO |
| 17 | |
| 18 | #include "engine_configurations.h" |
mflodman@webrtc.org | 1f99280 | 2012-01-27 13:42:53 +0000 | [diff] [blame] | 19 | #include "modules/interface/module_common_types.h" |
mikhal@webrtc.org | 2ab104e | 2011-12-09 02:46:22 +0000 | [diff] [blame] | 20 | #include "system_wrappers/interface/scoped_ptr.h" |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 21 | |
mflodman@webrtc.org | 1f99280 | 2012-01-27 13:42:53 +0000 | [diff] [blame] | 22 | namespace webrtc { |
| 23 | |
mikhal@webrtc.org | 2ab104e | 2011-12-09 02:46:22 +0000 | [diff] [blame] | 24 | class Scaler; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 25 | class VideoFrame; |
mflodman@webrtc.org | 1f99280 | 2012-01-27 13:42:53 +0000 | [diff] [blame] | 26 | |
| 27 | class FrameScaler { |
| 28 | public: |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 29 | FrameScaler(); |
| 30 | ~FrameScaler(); |
| 31 | |
mflodman@webrtc.org | 1f99280 | 2012-01-27 13:42:53 +0000 | [diff] [blame] | 32 | // Re-sizes |video_frame| so that it has the width |out_width| and height |
| 33 | // |out_height|. |
| 34 | int ResizeFrameIfNeeded(VideoFrame* video_frame, |
| 35 | WebRtc_UWord32 out_width, |
| 36 | WebRtc_UWord32 out_height); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 37 | |
mflodman@webrtc.org | 1f99280 | 2012-01-27 13:42:53 +0000 | [diff] [blame] | 38 | private: |
| 39 | scoped_ptr<Scaler> scaler_; |
| 40 | VideoFrame scaled_frame_; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 41 | }; |
mflodman@webrtc.org | 1f99280 | 2012-01-27 13:42:53 +0000 | [diff] [blame] | 42 | |
| 43 | } // namespace webrtc |
| 44 | |
| 45 | #endif // WEBRTC_MODULE_UTILITY_VIDEO |
| 46 | |
| 47 | #endif // WEBRTC_MODULES_UTILITY_SOURCE_FRAME_SCALER_H_ |