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

Side by Side Diff: content/renderer/media/rtc_video_encoder.cc

Issue 48113011: Remove media::VideoFrame from media::VideoCaptureDevice::Client interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@git-svn
Patch Set: ffdbaeb83 Trybot failures. Created 7 years, 1 month 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 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/media/rtc_video_encoder.h" 5 #include "content/renderer/media/rtc_video_encoder.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/scoped_vector.h" 10 #include "base/memory/scoped_vector.h"
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 input_next_frame_keyframe_ = false; 389 input_next_frame_keyframe_ = false;
390 390
391 if (!video_encoder_) { 391 if (!video_encoder_) {
392 SignalAsyncWaiter(WEBRTC_VIDEO_CODEC_ERROR); 392 SignalAsyncWaiter(WEBRTC_VIDEO_CODEC_ERROR);
393 return; 393 return;
394 } 394 }
395 395
396 const int index = input_buffers_free_.back(); 396 const int index = input_buffers_free_.back();
397 base::SharedMemory* input_buffer = input_buffers_[index]; 397 base::SharedMemory* input_buffer = input_buffers_[index];
398 scoped_refptr<media::VideoFrame> frame = 398 scoped_refptr<media::VideoFrame> frame =
399 media::VideoFrame::WrapExternalSharedMemory( 399 media::VideoFrame::WrapExternalPackedMemory(
400 media::VideoFrame::I420, 400 media::VideoFrame::I420,
401 input_frame_coded_size_, 401 input_frame_coded_size_,
402 gfx::Rect(input_visible_size_), 402 gfx::Rect(input_visible_size_),
403 input_visible_size_, 403 input_visible_size_,
404 reinterpret_cast<uint8*>(input_buffer->memory()), 404 reinterpret_cast<uint8*>(input_buffer->memory()),
405 input_buffer->mapped_size(), 405 input_buffer->mapped_size(),
406 input_buffer->handle(), 406 input_buffer->handle(),
407 base::TimeDelta(), 407 base::TimeDelta(),
408 base::Bind(&RTCVideoEncoder::Impl::EncodeFrameFinished, this, index)); 408 base::Bind(&RTCVideoEncoder::Impl::EncodeFrameFinished, this, index));
409 if (!frame) { 409 if (!frame) {
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
658 UMA_HISTOGRAM_BOOLEAN("Media.RTCVideoEncoderInitEncodeSuccess", 658 UMA_HISTOGRAM_BOOLEAN("Media.RTCVideoEncoderInitEncodeSuccess",
659 init_retval == WEBRTC_VIDEO_CODEC_OK); 659 init_retval == WEBRTC_VIDEO_CODEC_OK);
660 if (init_retval == WEBRTC_VIDEO_CODEC_OK) { 660 if (init_retval == WEBRTC_VIDEO_CODEC_OK) {
661 UMA_HISTOGRAM_ENUMERATION("Media.RTCVideoEncoderProfile", 661 UMA_HISTOGRAM_ENUMERATION("Media.RTCVideoEncoderProfile",
662 video_codec_profile_, 662 video_codec_profile_,
663 media::VIDEO_CODEC_PROFILE_MAX); 663 media::VIDEO_CODEC_PROFILE_MAX);
664 } 664 }
665 } 665 }
666 666
667 } // namespace content 667 } // namespace content
OLDNEW
« no previous file with comments | « content/common/gpu/media/gpu_video_encode_accelerator.cc ('k') | content/renderer/media/video_capture_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698