1 /*
2 * libjingle
3 * Copyright 2013 Google Inc.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice,
11 * this list of conditions and the following disclaimer in the documentation
12 * and/or other materials provided with the distribution.
13 * 3. The name of the author may not be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
19 * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
20 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
21 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
22 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
23 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
24 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
25 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28 #include "talk/media/webrtc/webrtctexturevideoframe.h"
29
30 #include "webrtc/base/common.h"
31 #include "webrtc/base/logging.h"
32 #include "webrtc/base/stream.h"
33
34 #define UNIMPLEMENTED \
35 LOG(LS_ERROR) << "Call to unimplemented function "<< __FUNCTION__; \
36 ASSERT(false)
37
38 namespace cricket {
39
WebRtcTextureVideoFrame(webrtc::NativeHandle * handle,int width,int height,int64 elapsed_time,int64 time_stamp)40 WebRtcTextureVideoFrame::WebRtcTextureVideoFrame(
41 webrtc::NativeHandle* handle, int width, int height, int64 elapsed_time,
42 int64 time_stamp)
43 : handle_(handle), width_(width), height_(height),
44 elapsed_time_(elapsed_time), time_stamp_(time_stamp) {}
45
~WebRtcTextureVideoFrame()46 WebRtcTextureVideoFrame::~WebRtcTextureVideoFrame() {}
47
InitToBlack(int w,int h,size_t pixel_width,size_t pixel_height,int64 elapsed_time,int64 time_stamp)48 bool WebRtcTextureVideoFrame::InitToBlack(
49 int w, int h, size_t pixel_width, size_t pixel_height, int64 elapsed_time,
50 int64 time_stamp) {
51 UNIMPLEMENTED;
52 return false;
53 }
54
Reset(uint32 fourcc,int w,int h,int dw,int dh,uint8 * sample,size_t sample_size,size_t pixel_width,size_t pixel_height,int64 elapsed_time,int64 time_stamp,int rotation)55 bool WebRtcTextureVideoFrame::Reset(
56 uint32 fourcc, int w, int h, int dw, int dh, uint8* sample,
57 size_t sample_size, size_t pixel_width, size_t pixel_height,
58 int64 elapsed_time, int64 time_stamp, int rotation) {
59 UNIMPLEMENTED;
60 return false;
61 }
62
GetYPlane() const63 const uint8* WebRtcTextureVideoFrame::GetYPlane() const {
64 UNIMPLEMENTED;
65 return NULL;
66 }
67
GetUPlane() const68 const uint8* WebRtcTextureVideoFrame::GetUPlane() const {
69 UNIMPLEMENTED;
70 return NULL;
71 }
72
GetVPlane() const73 const uint8* WebRtcTextureVideoFrame::GetVPlane() const {
74 UNIMPLEMENTED;
75 return NULL;
76 }
77
GetYPlane()78 uint8* WebRtcTextureVideoFrame::GetYPlane() {
79 UNIMPLEMENTED;
80 return NULL;
81 }
82
GetUPlane()83 uint8* WebRtcTextureVideoFrame::GetUPlane() {
84 UNIMPLEMENTED;
85 return NULL;
86 }
87
GetVPlane()88 uint8* WebRtcTextureVideoFrame::GetVPlane() {
89 UNIMPLEMENTED;
90 return NULL;
91 }
92
GetYPitch() const93 int32 WebRtcTextureVideoFrame::GetYPitch() const {
94 UNIMPLEMENTED;
95 return width_;
96 }
97
GetUPitch() const98 int32 WebRtcTextureVideoFrame::GetUPitch() const {
99 UNIMPLEMENTED;
100 return (width_ + 1) / 2;
101 }
102
GetVPitch() const103 int32 WebRtcTextureVideoFrame::GetVPitch() const {
104 UNIMPLEMENTED;
105 return (width_ + 1) / 2;
106 }
107
Copy() const108 VideoFrame* WebRtcTextureVideoFrame::Copy() const {
109 return new WebRtcTextureVideoFrame(
110 handle_, width_, height_, elapsed_time_, time_stamp_);
111 }
112
MakeExclusive()113 bool WebRtcTextureVideoFrame::MakeExclusive() {
114 UNIMPLEMENTED;
115 return false;
116 }
117
CopyToBuffer(uint8 * buffer,size_t size) const118 size_t WebRtcTextureVideoFrame::CopyToBuffer(uint8* buffer, size_t size) const {
119 UNIMPLEMENTED;
120 return 0;
121 }
122
ConvertToRgbBuffer(uint32 to_fourcc,uint8 * buffer,size_t size,int stride_rgb) const123 size_t WebRtcTextureVideoFrame::ConvertToRgbBuffer(
124 uint32 to_fourcc, uint8* buffer, size_t size, int stride_rgb) const {
125 UNIMPLEMENTED;
126 return 0;
127 }
128
CopyToPlanes(uint8 * dst_y,uint8 * dst_u,uint8 * dst_v,int32 dst_pitch_y,int32 dst_pitch_u,int32 dst_pitch_v) const129 bool WebRtcTextureVideoFrame::CopyToPlanes(
130 uint8* dst_y, uint8* dst_u, uint8* dst_v, int32 dst_pitch_y,
131 int32 dst_pitch_u, int32 dst_pitch_v) const {
132 UNIMPLEMENTED;
133 return false;
134 }
135
CopyToFrame(VideoFrame * dst) const136 void WebRtcTextureVideoFrame::CopyToFrame(VideoFrame* dst) const {
137 UNIMPLEMENTED;
138 }
139
Write(rtc::StreamInterface * stream,int * error)140 rtc::StreamResult WebRtcTextureVideoFrame::Write(
141 rtc::StreamInterface* stream, int* error) {
142 UNIMPLEMENTED;
143 return rtc::SR_ERROR;
144 }
StretchToPlanes(uint8 * dst_y,uint8 * dst_u,uint8 * dst_v,int32 dst_pitch_y,int32 dst_pitch_u,int32 dst_pitch_v,size_t width,size_t height,bool interpolate,bool vert_crop) const145 void WebRtcTextureVideoFrame::StretchToPlanes(
146 uint8* dst_y, uint8* dst_u, uint8* dst_v, int32 dst_pitch_y,
147 int32 dst_pitch_u, int32 dst_pitch_v, size_t width, size_t height,
148 bool interpolate, bool vert_crop) const {
149 UNIMPLEMENTED;
150 }
151
StretchToBuffer(size_t dst_width,size_t dst_height,uint8 * dst_buffer,size_t size,bool interpolate,bool vert_crop) const152 size_t WebRtcTextureVideoFrame::StretchToBuffer(
153 size_t dst_width, size_t dst_height, uint8* dst_buffer, size_t size,
154 bool interpolate, bool vert_crop) const {
155 UNIMPLEMENTED;
156 return 0;
157 }
158
StretchToFrame(VideoFrame * dst,bool interpolate,bool vert_crop) const159 void WebRtcTextureVideoFrame::StretchToFrame(
160 VideoFrame* dst, bool interpolate, bool vert_crop) const {
161 UNIMPLEMENTED;
162 }
163
Stretch(size_t dst_width,size_t dst_height,bool interpolate,bool vert_crop) const164 VideoFrame* WebRtcTextureVideoFrame::Stretch(
165 size_t dst_width, size_t dst_height, bool interpolate,
166 bool vert_crop) const {
167 UNIMPLEMENTED;
168 return NULL;
169 }
170
SetToBlack()171 bool WebRtcTextureVideoFrame::SetToBlack() {
172 UNIMPLEMENTED;
173 return false;
174 }
175
CreateEmptyFrame(int w,int h,size_t pixel_width,size_t pixel_height,int64 elapsed_time,int64 time_stamp) const176 VideoFrame* WebRtcTextureVideoFrame::CreateEmptyFrame(
177 int w, int h, size_t pixel_width, size_t pixel_height, int64 elapsed_time,
178 int64 time_stamp) const {
179 UNIMPLEMENTED;
180 return NULL;
181 }
182
183 } // namespace cricket
184