| 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/sender/external_video_encoder.h" | 5 #include "media/cast/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" |
| 11 #include "base/message_loop/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
| 12 #include "base/metrics/histogram.h" | 12 #include "base/metrics/histogram.h" |
| 13 #include "media/base/video_frame.h" | 13 #include "media/base/video_frame.h" |
| 14 #include "media/base/video_util.h" | 14 #include "media/base/video_util.h" |
| 15 #include "media/cast/cast_defines.h" | 15 #include "media/cast/cast_defines.h" |
| 16 #include "media/cast/logging/logging_defines.h" | 16 #include "media/cast/logging/logging_defines.h" |
| 17 #include "media/cast/net/cast_transport_config.h" | 17 #include "media/cast/net/cast_transport_config.h" |
| 18 #include "media/cast/sender/video_frame_factory.h" |
| 18 #include "media/video/video_encode_accelerator.h" | 19 #include "media/video/video_encode_accelerator.h" |
| 19 | 20 |
| 20 namespace media { | 21 namespace media { |
| 21 namespace cast { | 22 namespace cast { |
| 22 class LocalVideoEncodeAcceleratorClient; | 23 class LocalVideoEncodeAcceleratorClient; |
| 23 } // namespace cast | 24 } // namespace cast |
| 24 } // namespace media | 25 } // namespace media |
| 25 | 26 |
| 26 namespace { | 27 namespace { |
| 27 static const size_t kOutputBufferCount = 3; | 28 static const size_t kOutputBufferCount = 3; |
| (...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 479 // Inform the encoder to encode the next frame as a key frame. | 480 // Inform the encoder to encode the next frame as a key frame. |
| 480 void ExternalVideoEncoder::GenerateKeyFrame() { | 481 void ExternalVideoEncoder::GenerateKeyFrame() { |
| 481 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); | 482 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); |
| 482 key_frame_requested_ = true; | 483 key_frame_requested_ = true; |
| 483 } | 484 } |
| 484 | 485 |
| 485 // Inform the encoder to only reference frames older or equal to frame_id; | 486 // Inform the encoder to only reference frames older or equal to frame_id; |
| 486 void ExternalVideoEncoder::LatestFrameIdToReference(uint32 /*frame_id*/) { | 487 void ExternalVideoEncoder::LatestFrameIdToReference(uint32 /*frame_id*/) { |
| 487 // Do nothing not supported. | 488 // Do nothing not supported. |
| 488 } | 489 } |
| 490 |
| 491 // Allow the encoder to return a specialized video frame factory. May return |
| 492 // null, in which case a default implementation will be used instead. |
| 493 scoped_refptr<VideoFrameFactory> ExternalVideoEncoder::GetVideoFrameFactory() { |
| 494 return nullptr; |
| 495 } |
| 496 |
| 489 } // namespace cast | 497 } // namespace cast |
| 490 } // namespace media | 498 } // namespace media |
| OLD | NEW |