Home | History | Annotate | Download | only in common_video
      1 /*
      2  *  Copyright (c) 2013 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 #include "webrtc/common_video/interface/texture_video_frame.h"
     12 
     13 #include <assert.h>
     14 
     15 namespace webrtc {
     16 
     17 TextureVideoFrame::TextureVideoFrame(NativeHandle* handle,
     18                                      int width,
     19                                      int height,
     20                                      uint32_t timestamp,
     21                                      int64_t render_time_ms)
     22     : handle_(handle) {
     23   set_width(width);
     24   set_height(height);
     25   set_timestamp(timestamp);
     26   set_render_time_ms(render_time_ms);
     27 }
     28 
     29 TextureVideoFrame::~TextureVideoFrame() {}
     30 
     31 int TextureVideoFrame::CreateEmptyFrame(int width,
     32                                         int height,
     33                                         int stride_y,
     34                                         int stride_u,
     35                                         int stride_v) {
     36   assert(false);  // Should not be called.
     37   return -1;
     38 }
     39 
     40 int TextureVideoFrame::CreateFrame(int size_y,
     41                                    const uint8_t* buffer_y,
     42                                    int size_u,
     43                                    const uint8_t* buffer_u,
     44                                    int size_v,
     45                                    const uint8_t* buffer_v,
     46                                    int width,
     47                                    int height,
     48                                    int stride_y,
     49                                    int stride_u,
     50                                    int stride_v) {
     51   assert(false);  // Should not be called.
     52   return -1;
     53 }
     54 
     55 int TextureVideoFrame::CopyFrame(const I420VideoFrame& videoFrame) {
     56   assert(false);  // Should not be called.
     57   return -1;
     58 }
     59 
     60 I420VideoFrame* TextureVideoFrame::CloneFrame() const {
     61   return new TextureVideoFrame(
     62       handle_, width(), height(), timestamp(), render_time_ms());
     63 }
     64 
     65 void TextureVideoFrame::SwapFrame(I420VideoFrame* videoFrame) {
     66   assert(false);  // Should not be called.
     67 }
     68 
     69 uint8_t* TextureVideoFrame::buffer(PlaneType type) {
     70   assert(false);  // Should not be called.
     71   return NULL;
     72 }
     73 
     74 const uint8_t* TextureVideoFrame::buffer(PlaneType type) const {
     75   assert(false);  // Should not be called.
     76   return NULL;
     77 }
     78 
     79 int TextureVideoFrame::allocated_size(PlaneType type) const {
     80   assert(false);  // Should not be called.
     81   return -1;
     82 }
     83 
     84 int TextureVideoFrame::stride(PlaneType type) const {
     85   assert(false);  // Should not be called.
     86   return -1;
     87 }
     88 
     89 bool TextureVideoFrame::IsZeroSize() const {
     90   assert(false);  // Should not be called.
     91   return true;
     92 }
     93 
     94 void TextureVideoFrame::ResetSize() {
     95   assert(false);  // Should not be called.
     96 }
     97 
     98 void* TextureVideoFrame::native_handle() const { return handle_.get(); }
     99 
    100 int TextureVideoFrame::CheckDimensions(
    101     int width, int height, int stride_y, int stride_u, int stride_v) {
    102   return 0;
    103 }
    104 
    105 }  // namespace webrtc
    106