blob: cec5bfeef7e8261b0322744b5fa9a5bf7a858378 [file] [log] [blame]
niklase@google.com470e71d2011-07-07 08:21:25 +00001/*
mflodman@webrtc.org1f992802012-01-27 13:42:53 +00002 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
niklase@google.com470e71d2011-07-07 08:21:25 +00003 *
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.org1f992802012-01-27 13:42:53 +000012
niklase@google.com470e71d2011-07-07 08:21:25 +000013#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
pbos@webrtc.org8b062002013-07-12 08:28:10 +000018#include "webrtc/common_video/interface/i420_video_frame.h"
19#include "webrtc/engine_configurations.h"
20#include "webrtc/modules/interface/module_common_types.h"
21#include "webrtc/system_wrappers/interface/scoped_ptr.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000022
mflodman@webrtc.org1f992802012-01-27 13:42:53 +000023namespace webrtc {
24
mikhal@webrtc.org2ab104e2011-12-09 02:46:22 +000025class Scaler;
niklase@google.com470e71d2011-07-07 08:21:25 +000026class VideoFrame;
mflodman@webrtc.org1f992802012-01-27 13:42:53 +000027
28class FrameScaler {
29 public:
niklase@google.com470e71d2011-07-07 08:21:25 +000030 FrameScaler();
31 ~FrameScaler();
32
mflodman@webrtc.org1f992802012-01-27 13:42:53 +000033 // Re-sizes |video_frame| so that it has the width |out_width| and height
34 // |out_height|.
mikhal@webrtc.org9fedff72012-10-24 18:33:04 +000035 int ResizeFrameIfNeeded(I420VideoFrame* video_frame,
36 int out_width,
37 int out_height);
niklase@google.com470e71d2011-07-07 08:21:25 +000038
mflodman@webrtc.org1f992802012-01-27 13:42:53 +000039 private:
40 scoped_ptr<Scaler> scaler_;
mikhal@webrtc.org9fedff72012-10-24 18:33:04 +000041 I420VideoFrame scaled_frame_;
niklase@google.com470e71d2011-07-07 08:21:25 +000042};
mflodman@webrtc.org1f992802012-01-27 13:42:53 +000043
44} // namespace webrtc
45
46#endif // WEBRTC_MODULE_UTILITY_VIDEO
47
48#endif // WEBRTC_MODULES_UTILITY_SOURCE_FRAME_SCALER_H_