blob: f301d19c8e86e579ac9ca537ccb775e16c41be32 [file] [log] [blame]
wu@webrtc.org9dba5252013-08-05 20:36:57 +00001/*
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
wu@webrtc.org9dba5252013-08-05 20:36:57 +000015namespace webrtc {
16
17TextureVideoFrame::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
29TextureVideoFrame::~TextureVideoFrame() {}
30
31int TextureVideoFrame::CreateEmptyFrame(int width,
32 int height,
33 int stride_y,
34 int stride_u,
35 int stride_v) {
pbos@webrtc.org0fefb102014-04-07 07:29:18 +000036 assert(false); // Should not be called.
wu@webrtc.org9dba5252013-08-05 20:36:57 +000037 return -1;
38}
39
40int 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) {
pbos@webrtc.org0fefb102014-04-07 07:29:18 +000051 assert(false); // Should not be called.
wu@webrtc.org9dba5252013-08-05 20:36:57 +000052 return -1;
53}
54
wu@webrtc.org9dba5252013-08-05 20:36:57 +000055int TextureVideoFrame::CopyFrame(const I420VideoFrame& videoFrame) {
pbos@webrtc.org0fefb102014-04-07 07:29:18 +000056 assert(false); // Should not be called.
wu@webrtc.org9dba5252013-08-05 20:36:57 +000057 return -1;
58}
59
wuchengli@chromium.org637c55f2014-05-28 07:00:51 +000060I420VideoFrame* TextureVideoFrame::CloneFrame() const {
61 return new TextureVideoFrame(
62 handle_, width(), height(), timestamp(), render_time_ms());
63}
64
wu@webrtc.org9dba5252013-08-05 20:36:57 +000065void TextureVideoFrame::SwapFrame(I420VideoFrame* videoFrame) {
pbos@webrtc.org0fefb102014-04-07 07:29:18 +000066 assert(false); // Should not be called.
wu@webrtc.org9dba5252013-08-05 20:36:57 +000067}
68
69uint8_t* TextureVideoFrame::buffer(PlaneType type) {
pbos@webrtc.org0fefb102014-04-07 07:29:18 +000070 assert(false); // Should not be called.
wu@webrtc.org9dba5252013-08-05 20:36:57 +000071 return NULL;
72}
73
74const uint8_t* TextureVideoFrame::buffer(PlaneType type) const {
pbos@webrtc.org0fefb102014-04-07 07:29:18 +000075 assert(false); // Should not be called.
wu@webrtc.org9dba5252013-08-05 20:36:57 +000076 return NULL;
77}
78
79int TextureVideoFrame::allocated_size(PlaneType type) const {
pbos@webrtc.org0fefb102014-04-07 07:29:18 +000080 assert(false); // Should not be called.
wu@webrtc.org9dba5252013-08-05 20:36:57 +000081 return -1;
82}
83
84int TextureVideoFrame::stride(PlaneType type) const {
pbos@webrtc.org0fefb102014-04-07 07:29:18 +000085 assert(false); // Should not be called.
wu@webrtc.org9dba5252013-08-05 20:36:57 +000086 return -1;
87}
88
89bool TextureVideoFrame::IsZeroSize() const {
pbos@webrtc.org0fefb102014-04-07 07:29:18 +000090 assert(false); // Should not be called.
wu@webrtc.org9dba5252013-08-05 20:36:57 +000091 return true;
92}
93
94void TextureVideoFrame::ResetSize() {
pbos@webrtc.org0fefb102014-04-07 07:29:18 +000095 assert(false); // Should not be called.
wu@webrtc.org9dba5252013-08-05 20:36:57 +000096}
97
98void* TextureVideoFrame::native_handle() const { return handle_.get(); }
99
100int TextureVideoFrame::CheckDimensions(
101 int width, int height, int stride_y, int stride_u, int stride_v) {
102 return 0;
103}
104
105} // namespace webrtc