Home | History | Annotate | Download | only in source
      1 /*
      2  *  Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
      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.
     12 
     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 "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"
     22 
     23 namespace webrtc {
     24 
     25 class Scaler;
     26 class VideoFrame;
     27 
     28 class FrameScaler {
     29  public:
     30     FrameScaler();
     31     ~FrameScaler();
     32 
     33     // Re-sizes |video_frame| so that it has the width |out_width| and height
     34     // |out_height|.
     35     int ResizeFrameIfNeeded(I420VideoFrame* video_frame,
     36                             int out_width,
     37                             int out_height);
     38 
     39  private:
     40     scoped_ptr<Scaler> scaler_;
     41     I420VideoFrame scaled_frame_;
     42 };
     43 
     44 }  // namespace webrtc
     45 
     46 #endif  // WEBRTC_MODULE_UTILITY_VIDEO
     47 
     48 #endif  // WEBRTC_MODULES_UTILITY_SOURCE_FRAME_SCALER_H_
     49