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

Unified Diff: content/renderer/media/gpu/rtc_video_encoder.cc

Issue 2939493002: RTCVideoEncoder.SupportsNativeHandle() should return true (Closed)
Patch Set: Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/media/gpu/rtc_video_encoder.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/gpu/rtc_video_encoder.cc
diff --git a/content/renderer/media/gpu/rtc_video_encoder.cc b/content/renderer/media/gpu/rtc_video_encoder.cc
index d9433d7c09d0c5615f7b12123a6fda603cb70d7e..aed18e1c09fd475d0bc33edf95b1582fdb765eb9 100644
--- a/content/renderer/media/gpu/rtc_video_encoder.cc
+++ b/content/renderer/media/gpu/rtc_video_encoder.cc
@@ -637,12 +637,11 @@ void RTCVideoEncoder::Impl::EncodeOneFrame() {
// the input requirements for the encoder.
// TODO(sheu): Support zero-copy from WebRTC. http://crbug.com/269312
// TODO(magjed): Downscale with kFilterBox in an image pyramid instead.
- if (libyuv::I420Scale(next_frame->video_frame_buffer()->DataY(),
- next_frame->video_frame_buffer()->StrideY(),
- next_frame->video_frame_buffer()->DataU(),
- next_frame->video_frame_buffer()->StrideU(),
- next_frame->video_frame_buffer()->DataV(),
- next_frame->video_frame_buffer()->StrideV(),
+ rtc::scoped_refptr<webrtc::I420BufferInterface> i420_buffer =
nisse-chromium (ooo August 14) 2017/06/13 08:06:44 Do we intend to change ToI420 to a const method? I
+ next_frame->video_frame_buffer()->ToI420();
+ if (libyuv::I420Scale(i420_buffer->DataY(), i420_buffer->StrideY(),
+ i420_buffer->DataU(), i420_buffer->StrideU(),
+ i420_buffer->DataV(), i420_buffer->StrideV(),
next_frame->width(), next_frame->height(),
frame->visible_data(media::VideoFrame::kYPlane),
frame->stride(media::VideoFrame::kYPlane),
@@ -651,8 +650,7 @@ void RTCVideoEncoder::Impl::EncodeOneFrame() {
frame->visible_data(media::VideoFrame::kVPlane),
frame->stride(media::VideoFrame::kVPlane),
frame->visible_rect().width(),
- frame->visible_rect().height(),
- libyuv::kFilterBox)) {
+ frame->visible_rect().height(), libyuv::kFilterBox)) {
LogAndNotifyError(FROM_HERE, "Failed to copy buffer",
media::VideoEncodeAccelerator::kPlatformFailureError);
return;
@@ -933,6 +931,10 @@ int32_t RTCVideoEncoder::SetRates(uint32_t new_bit_rate, uint32_t frame_rate) {
return WEBRTC_VIDEO_CODEC_OK;
}
+bool RTCVideoEncoder::SupportsNativeHandle() const {
+ return true;
+}
+
void RTCVideoEncoder::RecordInitEncodeUMA(
int32_t init_retval, media::VideoCodecProfile profile) {
UMA_HISTOGRAM_BOOLEAN("Media.RTCVideoEncoderInitEncodeSuccess",
« no previous file with comments | « content/renderer/media/gpu/rtc_video_encoder.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698