blob: f86a933824424f5c89106178af2ab6de26a48a66 [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
18#include "engine_configurations.h"
mflodman@webrtc.org1f992802012-01-27 13:42:53 +000019#include "modules/interface/module_common_types.h"
mikhal@webrtc.org2ab104e2011-12-09 02:46:22 +000020#include "system_wrappers/interface/scoped_ptr.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000021
mflodman@webrtc.org1f992802012-01-27 13:42:53 +000022namespace webrtc {
23
mikhal@webrtc.org2ab104e2011-12-09 02:46:22 +000024class Scaler;
niklase@google.com470e71d2011-07-07 08:21:25 +000025class VideoFrame;
mflodman@webrtc.org1f992802012-01-27 13:42:53 +000026
27class FrameScaler {
28 public:
niklase@google.com470e71d2011-07-07 08:21:25 +000029 FrameScaler();
30 ~FrameScaler();
31
mflodman@webrtc.org1f992802012-01-27 13:42:53 +000032 // 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.com470e71d2011-07-07 08:21:25 +000037
mflodman@webrtc.org1f992802012-01-27 13:42:53 +000038 private:
39 scoped_ptr<Scaler> scaler_;
40 VideoFrame scaled_frame_;
niklase@google.com470e71d2011-07-07 08:21:25 +000041};
mflodman@webrtc.org1f992802012-01-27 13:42:53 +000042
43} // namespace webrtc
44
45#endif // WEBRTC_MODULE_UTILITY_VIDEO
46
47#endif // WEBRTC_MODULES_UTILITY_SOURCE_FRAME_SCALER_H_