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 | |
mikhal@webrtc.org | 9fedff7 | 2012-10-24 18:33:04 +0000 | [diff] [blame] | 18 | #include "common_video/interface/i420_video_frame.h" |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 19 | #include "engine_configurations.h" |
mflodman@webrtc.org | 1f99280 | 2012-01-27 13:42:53 +0000 | [diff] [blame] | 20 | #include "modules/interface/module_common_types.h" |
mikhal@webrtc.org | 2ab104e | 2011-12-09 02:46:22 +0000 | [diff] [blame] | 21 | #include "system_wrappers/interface/scoped_ptr.h" |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 22 | |
mflodman@webrtc.org | 1f99280 | 2012-01-27 13:42:53 +0000 | [diff] [blame] | 23 | namespace webrtc { |
| 24 | |
mikhal@webrtc.org | 2ab104e | 2011-12-09 02:46:22 +0000 | [diff] [blame] | 25 | class Scaler; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 26 | class VideoFrame; |
mflodman@webrtc.org | 1f99280 | 2012-01-27 13:42:53 +0000 | [diff] [blame] | 27 | |
| 28 | class FrameScaler { |
| 29 | public: |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 30 | FrameScaler(); |
| 31 | ~FrameScaler(); |
| 32 | |
mflodman@webrtc.org | 1f99280 | 2012-01-27 13:42:53 +0000 | [diff] [blame] | 33 | // Re-sizes |video_frame| so that it has the width |out_width| and height |
| 34 | // |out_height|. |
mikhal@webrtc.org | 9fedff7 | 2012-10-24 18:33:04 +0000 | [diff] [blame] | 35 | int ResizeFrameIfNeeded(I420VideoFrame* video_frame, |
| 36 | int out_width, |
| 37 | int out_height); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 38 | |
mflodman@webrtc.org | 1f99280 | 2012-01-27 13:42:53 +0000 | [diff] [blame] | 39 | private: |
| 40 | scoped_ptr<Scaler> scaler_; |
mikhal@webrtc.org | 9fedff7 | 2012-10-24 18:33:04 +0000 | [diff] [blame] | 41 | I420VideoFrame scaled_frame_; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 42 | }; |
mflodman@webrtc.org | 1f99280 | 2012-01-27 13:42:53 +0000 | [diff] [blame] | 43 | |
| 44 | } // namespace webrtc |
| 45 | |
| 46 | #endif // WEBRTC_MODULE_UTILITY_VIDEO |
| 47 | |
| 48 | #endif // WEBRTC_MODULES_UTILITY_SOURCE_FRAME_SCALER_H_ |