| 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 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 486 input_next_frame_keyframe_ = false; | 486 input_next_frame_keyframe_ = false; |
| 487 | 487 |
| 488 if (!video_encoder_) { | 488 if (!video_encoder_) { |
| 489 SignalAsyncWaiter(WEBRTC_VIDEO_CODEC_ERROR); | 489 SignalAsyncWaiter(WEBRTC_VIDEO_CODEC_ERROR); |
| 490 return; | 490 return; |
| 491 } | 491 } |
| 492 | 492 |
| 493 const int index = input_buffers_free_.back(); | 493 const int index = input_buffers_free_.back(); |
| 494 base::SharedMemory* input_buffer = input_buffers_[index]; | 494 base::SharedMemory* input_buffer = input_buffers_[index]; |
| 495 scoped_refptr<media::VideoFrame> frame = | 495 scoped_refptr<media::VideoFrame> frame = |
| 496 media::VideoFrame::WrapExternalPackedMemory( | 496 media::VideoFrame::WrapExternalSharedMemory( |
| 497 media::VideoFrame::I420, | 497 media::VideoFrame::I420, |
| 498 input_frame_coded_size_, | 498 input_frame_coded_size_, |
| 499 gfx::Rect(input_visible_size_), | 499 gfx::Rect(input_visible_size_), |
| 500 input_visible_size_, | 500 input_visible_size_, |
| 501 reinterpret_cast<uint8*>(input_buffer->memory()), | 501 reinterpret_cast<uint8*>(input_buffer->memory()), |
| 502 input_buffer->mapped_size(), | 502 input_buffer->mapped_size(), |
| 503 input_buffer->handle(), | 503 input_buffer->handle(), |
| 504 0, | 504 0, |
| 505 base::TimeDelta()); | 505 base::TimeDelta()); |
| 506 frame->AddDestructionObserver( | 506 frame->AddDestructionObserver( |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 779 UMA_HISTOGRAM_BOOLEAN("Media.RTCVideoEncoderInitEncodeSuccess", | 779 UMA_HISTOGRAM_BOOLEAN("Media.RTCVideoEncoderInitEncodeSuccess", |
| 780 init_retval == WEBRTC_VIDEO_CODEC_OK); | 780 init_retval == WEBRTC_VIDEO_CODEC_OK); |
| 781 if (init_retval == WEBRTC_VIDEO_CODEC_OK) { | 781 if (init_retval == WEBRTC_VIDEO_CODEC_OK) { |
| 782 UMA_HISTOGRAM_ENUMERATION("Media.RTCVideoEncoderProfile", | 782 UMA_HISTOGRAM_ENUMERATION("Media.RTCVideoEncoderProfile", |
| 783 profile, | 783 profile, |
| 784 media::VIDEO_CODEC_PROFILE_MAX + 1); | 784 media::VIDEO_CODEC_PROFILE_MAX + 1); |
| 785 } | 785 } |
| 786 } | 786 } |
| 787 | 787 |
| 788 } // namespace content | 788 } // namespace content |
| OLD | NEW |