OLD | NEW |
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 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
495 base::SharedMemory* input_buffer = input_buffers_[index]; | 495 base::SharedMemory* input_buffer = input_buffers_[index]; |
496 scoped_refptr<media::VideoFrame> frame = | 496 scoped_refptr<media::VideoFrame> frame = |
497 media::VideoFrame::WrapExternalPackedMemory( | 497 media::VideoFrame::WrapExternalPackedMemory( |
498 media::VideoFrame::I420, | 498 media::VideoFrame::I420, |
499 input_frame_coded_size_, | 499 input_frame_coded_size_, |
500 gfx::Rect(input_visible_size_), | 500 gfx::Rect(input_visible_size_), |
501 input_visible_size_, | 501 input_visible_size_, |
502 reinterpret_cast<uint8*>(input_buffer->memory()), | 502 reinterpret_cast<uint8*>(input_buffer->memory()), |
503 input_buffer->mapped_size(), | 503 input_buffer->mapped_size(), |
504 input_buffer->handle(), | 504 input_buffer->handle(), |
| 505 0, |
505 base::TimeDelta(), | 506 base::TimeDelta(), |
506 base::Bind(&RTCVideoEncoder::Impl::EncodeFrameFinished, this, index)); | 507 base::Bind(&RTCVideoEncoder::Impl::EncodeFrameFinished, this, index)); |
507 if (!frame.get()) { | 508 if (!frame.get()) { |
508 DLOG(ERROR) << "Impl::EncodeOneFrame(): failed to create frame"; | 509 DLOG(ERROR) << "Impl::EncodeOneFrame(): failed to create frame"; |
509 NOTIFY_ERROR(media::VideoEncodeAccelerator::kPlatformFailureError); | 510 NOTIFY_ERROR(media::VideoEncodeAccelerator::kPlatformFailureError); |
510 return; | 511 return; |
511 } | 512 } |
512 | 513 |
513 // Do a strided copy of the input frame to match the input requirements for | 514 // Do a strided copy of the input frame to match the input requirements for |
514 // the encoder. | 515 // the encoder. |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
772 UMA_HISTOGRAM_BOOLEAN("Media.RTCVideoEncoderInitEncodeSuccess", | 773 UMA_HISTOGRAM_BOOLEAN("Media.RTCVideoEncoderInitEncodeSuccess", |
773 init_retval == WEBRTC_VIDEO_CODEC_OK); | 774 init_retval == WEBRTC_VIDEO_CODEC_OK); |
774 if (init_retval == WEBRTC_VIDEO_CODEC_OK) { | 775 if (init_retval == WEBRTC_VIDEO_CODEC_OK) { |
775 UMA_HISTOGRAM_ENUMERATION("Media.RTCVideoEncoderProfile", | 776 UMA_HISTOGRAM_ENUMERATION("Media.RTCVideoEncoderProfile", |
776 profile, | 777 profile, |
777 media::VIDEO_CODEC_PROFILE_MAX + 1); | 778 media::VIDEO_CODEC_PROFILE_MAX + 1); |
778 } | 779 } |
779 } | 780 } |
780 | 781 |
781 } // namespace content | 782 } // namespace content |
OLD | NEW |