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

Side by Side Diff: webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_encoder.cc

Issue 1900673002: Delete webrtc::VideoFrame methods buffer and stride. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebase. Created 4 years, 7 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
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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 return false; 161 return false;
162 } 162 }
163 uint8_t* dst_y = reinterpret_cast<uint8_t*>( 163 uint8_t* dst_y = reinterpret_cast<uint8_t*>(
164 CVPixelBufferGetBaseAddressOfPlane(pixel_buffer, 0)); 164 CVPixelBufferGetBaseAddressOfPlane(pixel_buffer, 0));
165 int dst_stride_y = CVPixelBufferGetBytesPerRowOfPlane(pixel_buffer, 0); 165 int dst_stride_y = CVPixelBufferGetBytesPerRowOfPlane(pixel_buffer, 0);
166 uint8_t* dst_uv = reinterpret_cast<uint8_t*>( 166 uint8_t* dst_uv = reinterpret_cast<uint8_t*>(
167 CVPixelBufferGetBaseAddressOfPlane(pixel_buffer, 1)); 167 CVPixelBufferGetBaseAddressOfPlane(pixel_buffer, 1));
168 int dst_stride_uv = CVPixelBufferGetBytesPerRowOfPlane(pixel_buffer, 1); 168 int dst_stride_uv = CVPixelBufferGetBytesPerRowOfPlane(pixel_buffer, 1);
169 // Convert I420 to NV12. 169 // Convert I420 to NV12.
170 int ret = libyuv::I420ToNV12( 170 int ret = libyuv::I420ToNV12(
171 frame.buffer(webrtc::kYPlane), frame.stride(webrtc::kYPlane), 171 frame.video_frame_buffer()->DataY(),
172 frame.buffer(webrtc::kUPlane), frame.stride(webrtc::kUPlane), 172 frame.video_frame_buffer()->StrideY(),
173 frame.buffer(webrtc::kVPlane), frame.stride(webrtc::kVPlane), dst_y, 173 frame.video_frame_buffer()->DataU(),
174 dst_stride_y, dst_uv, dst_stride_uv, frame.width(), frame.height()); 174 frame.video_frame_buffer()->StrideU(),
175 frame.video_frame_buffer()->DataV(),
176 frame.video_frame_buffer()->StrideV(),
177 dst_y, dst_stride_y, dst_uv, dst_stride_uv,
178 frame.width(), frame.height());
175 CVPixelBufferUnlockBaseAddress(pixel_buffer, 0); 179 CVPixelBufferUnlockBaseAddress(pixel_buffer, 0);
176 if (ret) { 180 if (ret) {
177 LOG(LS_ERROR) << "Error converting I420 VideoFrame to NV12 :" << ret; 181 LOG(LS_ERROR) << "Error converting I420 VideoFrame to NV12 :" << ret;
178 return false; 182 return false;
179 } 183 }
180 return true; 184 return true;
181 } 185 }
182 186
183 // This is the callback function that VideoToolbox calls when encode is 187 // This is the callback function that VideoToolbox calls when encode is
184 // complete. From inspection this happens on its own queue. 188 // complete. From inspection this happens on its own queue.
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
526 if (result != 0) { 530 if (result != 0) {
527 LOG(LS_ERROR) << "Encode callback failed: " << result; 531 LOG(LS_ERROR) << "Encode callback failed: " << result;
528 return; 532 return;
529 } 533 }
530 bitrate_adjuster_.Update(frame._size); 534 bitrate_adjuster_.Update(frame._size);
531 } 535 }
532 536
533 } // namespace webrtc 537 } // namespace webrtc
534 538
535 #endif // defined(WEBRTC_VIDEO_TOOLBOX_SUPPORTED) 539 #endif // defined(WEBRTC_VIDEO_TOOLBOX_SUPPORTED)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698