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/video_encoder.h" | 5 #include "media/cast/sender/video_encoder.h" |
6 | 6 |
7 #include "media/cast/sender/external_video_encoder.h" | 7 #include "media/cast/sender/external_video_encoder.h" |
8 #include "media/cast/sender/video_encoder_impl.h" | 8 #include "media/cast/sender/video_encoder_impl.h" |
9 | 9 |
10 #if defined(OS_MACOSX) | 10 #if defined(OS_MACOSX) |
(...skipping 16 matching lines...) Expand all Loading... |
27 if (!video_config.use_external_encoder && | 27 if (!video_config.use_external_encoder && |
28 H264VideoToolboxEncoder::IsSupported(video_config)) { | 28 H264VideoToolboxEncoder::IsSupported(video_config)) { |
29 return scoped_ptr<VideoEncoder>( | 29 return scoped_ptr<VideoEncoder>( |
30 new SizeAdaptableH264VideoToolboxVideoEncoder( | 30 new SizeAdaptableH264VideoToolboxVideoEncoder( |
31 cast_environment, | 31 cast_environment, |
32 video_config, | 32 video_config, |
33 status_change_cb)); | 33 status_change_cb)); |
34 } | 34 } |
35 #endif // defined(OS_MACOSX) | 35 #endif // defined(OS_MACOSX) |
36 | 36 |
| 37 #if !defined(OS_IOS) |
37 // If the system provides a hardware-accelerated encoder, use it. | 38 // If the system provides a hardware-accelerated encoder, use it. |
38 #if !defined(OS_IOS) | |
39 if (ExternalVideoEncoder::IsSupported(video_config)) { | 39 if (ExternalVideoEncoder::IsSupported(video_config)) { |
40 return scoped_ptr<VideoEncoder>(new SizeAdaptableExternalVideoEncoder( | 40 return scoped_ptr<VideoEncoder>(new SizeAdaptableExternalVideoEncoder( |
41 cast_environment, | 41 cast_environment, |
42 video_config, | 42 video_config, |
43 status_change_cb, | 43 status_change_cb, |
44 create_vea_cb, | 44 create_vea_cb, |
45 create_video_encode_memory_cb)); | 45 create_video_encode_memory_cb)); |
46 } | 46 } |
47 #endif // !defined(OS_IOS) | |
48 | 47 |
49 // Attempt to use the software encoder implementation. | 48 // Attempt to use the software encoder implementation. |
50 if (VideoEncoderImpl::IsSupported(video_config)) { | 49 if (VideoEncoderImpl::IsSupported(video_config)) { |
51 return scoped_ptr<VideoEncoder>(new VideoEncoderImpl( | 50 return scoped_ptr<VideoEncoder>(new VideoEncoderImpl( |
52 cast_environment, | 51 cast_environment, |
53 video_config, | 52 video_config, |
54 status_change_cb)); | 53 status_change_cb)); |
55 } | 54 } |
| 55 #endif // !defined(OS_IOS) |
56 | 56 |
57 // No encoder implementation will suffice. | 57 // No encoder implementation will suffice. |
58 return nullptr; | 58 return nullptr; |
59 } | 59 } |
60 | 60 |
61 scoped_ptr<VideoFrameFactory> VideoEncoder::CreateVideoFrameFactory() { | 61 scoped_ptr<VideoFrameFactory> VideoEncoder::CreateVideoFrameFactory() { |
62 return nullptr; | 62 return nullptr; |
63 } | 63 } |
64 | 64 |
65 void VideoEncoder::EmitFrames() { | 65 void VideoEncoder::EmitFrames() { |
66 } | 66 } |
67 | 67 |
68 } // namespace cast | 68 } // namespace cast |
69 } // namespace media | 69 } // namespace media |
OLD | NEW |