Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(269)

Side by Side Diff: webrtc/common_video/video_frame_buffer.cc

Issue 2088753002: Delete deprecated VideoFrameBuffer methods. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/common_video/include/video_frame_buffer.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 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 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 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 12 matching lines...) Expand all
23 namespace webrtc { 23 namespace webrtc {
24 24
25 namespace { 25 namespace {
26 26
27 int I420DataSize(int height, int stride_y, int stride_u, int stride_v) { 27 int I420DataSize(int height, int stride_y, int stride_u, int stride_v) {
28 return stride_y * height + (stride_u + stride_v) * ((height + 1) / 2); 28 return stride_y * height + (stride_u + stride_v) * ((height + 1) / 2);
29 } 29 }
30 30
31 } // namespace 31 } // namespace
32 32
33 const uint8_t* VideoFrameBuffer::data(PlaneType type) const {
34 switch (type) {
35 case kYPlane:
36 return DataY();
37 case kUPlane:
38 return DataU();
39 case kVPlane:
40 return DataV();
41 default:
42 RTC_NOTREACHED();
43 return nullptr;
44 }
45 }
46
47 const uint8_t* VideoFrameBuffer::DataY() const {
48 return data(kYPlane);
49 }
50 const uint8_t* VideoFrameBuffer::DataU() const {
51 return data(kUPlane);
52 }
53 const uint8_t* VideoFrameBuffer::DataV() const {
54 return data(kVPlane);
55 }
56
57 int VideoFrameBuffer::stride(PlaneType type) const {
58 switch (type) {
59 case kYPlane:
60 return StrideY();
61 case kUPlane:
62 return StrideU();
63 case kVPlane:
64 return StrideV();
65 default:
66 RTC_NOTREACHED();
67 return 0;
68 }
69 }
70
71 int VideoFrameBuffer::StrideY() const {
72 return stride(kYPlane);
73 }
74 int VideoFrameBuffer::StrideU() const {
75 return stride(kUPlane);
76 }
77 int VideoFrameBuffer::StrideV() const {
78 return stride(kVPlane);
79 }
80
81 uint8_t* VideoFrameBuffer::MutableDataY() { 33 uint8_t* VideoFrameBuffer::MutableDataY() {
82 RTC_NOTREACHED(); 34 RTC_NOTREACHED();
83 return nullptr; 35 return nullptr;
84 } 36 }
85 uint8_t* VideoFrameBuffer::MutableDataU() { 37 uint8_t* VideoFrameBuffer::MutableDataU() {
86 RTC_NOTREACHED(); 38 RTC_NOTREACHED();
87 return nullptr; 39 return nullptr;
88 } 40 }
89 uint8_t* VideoFrameBuffer::MutableDataV() { 41 uint8_t* VideoFrameBuffer::MutableDataV() {
90 RTC_NOTREACHED(); 42 RTC_NOTREACHED();
91 return nullptr; 43 return nullptr;
92 } 44 }
93 45
94 uint8_t* VideoFrameBuffer::MutableData(PlaneType type) {
95 switch (type) {
96 case kYPlane:
97 return MutableDataY();
98 case kUPlane:
99 return MutableDataU();
100 case kVPlane:
101 return MutableDataV();
102 default:
103 RTC_NOTREACHED();
104 return nullptr;
105 }
106 }
107
108 VideoFrameBuffer::~VideoFrameBuffer() {} 46 VideoFrameBuffer::~VideoFrameBuffer() {}
109 47
110 I420Buffer::I420Buffer(int width, int height) 48 I420Buffer::I420Buffer(int width, int height)
111 : I420Buffer(width, height, width, (width + 1) / 2, (width + 1) / 2) { 49 : I420Buffer(width, height, width, (width + 1) / 2, (width + 1) / 2) {
112 } 50 }
113 51
114 I420Buffer::I420Buffer(int width, 52 I420Buffer::I420Buffer(int width,
115 int height, 53 int height,
116 int stride_y, 54 int stride_y,
117 int stride_u, 55 int stride_u,
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 void* WrappedI420Buffer::native_handle() const { 337 void* WrappedI420Buffer::native_handle() const {
400 return nullptr; 338 return nullptr;
401 } 339 }
402 340
403 rtc::scoped_refptr<VideoFrameBuffer> WrappedI420Buffer::NativeToI420Buffer() { 341 rtc::scoped_refptr<VideoFrameBuffer> WrappedI420Buffer::NativeToI420Buffer() {
404 RTC_NOTREACHED(); 342 RTC_NOTREACHED();
405 return nullptr; 343 return nullptr;
406 } 344 }
407 345
408 } // namespace webrtc 346 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/common_video/include/video_frame_buffer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698