| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "media/cast/video_sender/external_video_encoder.h" | 5 #include "media/cast/video_sender/external_video_encoder.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
| 10 #include "base/memory/shared_memory.h" | 10 #include "base/memory/shared_memory.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 | 24 |
| 25 namespace { | 25 namespace { |
| 26 static const size_t kOutputBufferCount = 3; | 26 static const size_t kOutputBufferCount = 3; |
| 27 | 27 |
| 28 void LogFrameEncodedEvent( | 28 void LogFrameEncodedEvent( |
| 29 const scoped_refptr<media::cast::CastEnvironment>& cast_environment, | 29 const scoped_refptr<media::cast::CastEnvironment>& cast_environment, |
| 30 base::TimeTicks event_time, | 30 base::TimeTicks event_time, |
| 31 media::cast::RtpTimestamp rtp_timestamp, | 31 media::cast::RtpTimestamp rtp_timestamp, |
| 32 uint32 frame_id) { | 32 uint32 frame_id) { |
| 33 cast_environment->Logging()->InsertFrameEvent( | 33 cast_environment->Logging()->InsertFrameEvent( |
| 34 event_time, media::cast::kVideoFrameEncoded, rtp_timestamp, frame_id); | 34 event_time, media::cast::FRAME_ENCODED, media::cast::VIDEO_EVENT, |
| 35 rtp_timestamp, frame_id); |
| 35 } | 36 } |
| 36 | 37 |
| 37 // Proxy this call to ExternalVideoEncoder on the cast main thread. | 38 // Proxy this call to ExternalVideoEncoder on the cast main thread. |
| 38 void ProxyCreateVideoEncodeAccelerator( | 39 void ProxyCreateVideoEncodeAccelerator( |
| 39 const scoped_refptr<media::cast::CastEnvironment>& cast_environment, | 40 const scoped_refptr<media::cast::CastEnvironment>& cast_environment, |
| 40 const base::WeakPtr<media::cast::ExternalVideoEncoder>& weak_ptr, | 41 const base::WeakPtr<media::cast::ExternalVideoEncoder>& weak_ptr, |
| 41 const media::cast::CreateVideoEncodeMemoryCallback& | 42 const media::cast::CreateVideoEncodeMemoryCallback& |
| 42 create_video_encode_mem_cb, | 43 create_video_encode_mem_cb, |
| 43 scoped_refptr<base::SingleThreadTaskRunner> encoder_task_runner, | 44 scoped_refptr<base::SingleThreadTaskRunner> encoder_task_runner, |
| 44 scoped_ptr<media::VideoEncodeAccelerator> vea) { | 45 scoped_ptr<media::VideoEncodeAccelerator> vea) { |
| (...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 // Do nothing not supported. | 442 // Do nothing not supported. |
| 442 } | 443 } |
| 443 | 444 |
| 444 int ExternalVideoEncoder::NumberOfSkippedFrames() const { | 445 int ExternalVideoEncoder::NumberOfSkippedFrames() const { |
| 445 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); | 446 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); |
| 446 return skip_count_; | 447 return skip_count_; |
| 447 } | 448 } |
| 448 | 449 |
| 449 } // namespace cast | 450 } // namespace cast |
| 450 } // namespace media | 451 } // namespace media |
| OLD | NEW |