wu@webrtc.org | 9dba525 | 2013-08-05 20:36:57 +0000 | [diff] [blame^] | 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 | #include "webrtc/system_wrappers/interface/trace.h" |
| 16 | |
| 17 | #define NOTREACHED() \ |
| 18 | do { \ |
| 19 | WEBRTC_TRACE(kTraceError, kTraceVideoRenderer, -1, "Not reached"); \ |
| 20 | assert(false); \ |
| 21 | } while (0) |
| 22 | |
| 23 | namespace webrtc { |
| 24 | |
| 25 | TextureVideoFrame::TextureVideoFrame(NativeHandle* handle, |
| 26 | int width, |
| 27 | int height, |
| 28 | uint32_t timestamp, |
| 29 | int64_t render_time_ms) |
| 30 | : handle_(handle) { |
| 31 | set_width(width); |
| 32 | set_height(height); |
| 33 | set_timestamp(timestamp); |
| 34 | set_render_time_ms(render_time_ms); |
| 35 | } |
| 36 | |
| 37 | TextureVideoFrame::~TextureVideoFrame() {} |
| 38 | |
| 39 | int TextureVideoFrame::CreateEmptyFrame(int width, |
| 40 | int height, |
| 41 | int stride_y, |
| 42 | int stride_u, |
| 43 | int stride_v) { |
| 44 | NOTREACHED(); |
| 45 | return -1; |
| 46 | } |
| 47 | |
| 48 | int TextureVideoFrame::CreateFrame(int size_y, |
| 49 | const uint8_t* buffer_y, |
| 50 | int size_u, |
| 51 | const uint8_t* buffer_u, |
| 52 | int size_v, |
| 53 | const uint8_t* buffer_v, |
| 54 | int width, |
| 55 | int height, |
| 56 | int stride_y, |
| 57 | int stride_u, |
| 58 | int stride_v) { |
| 59 | NOTREACHED(); |
| 60 | return -1; |
| 61 | } |
| 62 | |
| 63 | int TextureVideoFrame::CopyFrame(const I420VideoFrame& videoFrame) { |
| 64 | NOTREACHED(); |
| 65 | return -1; |
| 66 | } |
| 67 | |
| 68 | void TextureVideoFrame::SwapFrame(I420VideoFrame* videoFrame) { |
| 69 | NOTREACHED(); |
| 70 | } |
| 71 | |
| 72 | uint8_t* TextureVideoFrame::buffer(PlaneType type) { |
| 73 | NOTREACHED(); |
| 74 | return NULL; |
| 75 | } |
| 76 | |
| 77 | const uint8_t* TextureVideoFrame::buffer(PlaneType type) const { |
| 78 | NOTREACHED(); |
| 79 | return NULL; |
| 80 | } |
| 81 | |
| 82 | int TextureVideoFrame::allocated_size(PlaneType type) const { |
| 83 | NOTREACHED(); |
| 84 | return -1; |
| 85 | } |
| 86 | |
| 87 | int TextureVideoFrame::stride(PlaneType type) const { |
| 88 | NOTREACHED(); |
| 89 | return -1; |
| 90 | } |
| 91 | |
| 92 | bool TextureVideoFrame::IsZeroSize() const { |
| 93 | NOTREACHED(); |
| 94 | return true; |
| 95 | } |
| 96 | |
| 97 | void TextureVideoFrame::ResetSize() { |
| 98 | NOTREACHED(); |
| 99 | } |
| 100 | |
| 101 | void* TextureVideoFrame::native_handle() const { return handle_.get(); } |
| 102 | |
| 103 | int TextureVideoFrame::CheckDimensions( |
| 104 | int width, int height, int stride_y, int stride_u, int stride_v) { |
| 105 | return 0; |
| 106 | } |
| 107 | |
| 108 | } // namespace webrtc |