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/common/gpu/media/android_video_encode_accelerator.h" | 5 #include "content/common/gpu/media/android_video_encode_accelerator.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 } | 80 } |
81 | 81 |
82 // static | 82 // static |
83 std::vector<media::VideoEncodeAccelerator::SupportedProfile> | 83 std::vector<media::VideoEncodeAccelerator::SupportedProfile> |
84 AndroidVideoEncodeAccelerator::GetSupportedProfiles() { | 84 AndroidVideoEncodeAccelerator::GetSupportedProfiles() { |
85 std::vector<MediaCodecBridge::CodecsInfo> codecs_info = | 85 std::vector<MediaCodecBridge::CodecsInfo> codecs_info = |
86 MediaCodecBridge::GetCodecsInfo(); | 86 MediaCodecBridge::GetCodecsInfo(); |
87 | 87 |
88 std::vector<SupportedProfile> profiles; | 88 std::vector<SupportedProfile> profiles; |
89 | 89 |
| 90 #if defined(ENABLE_WEBRTC) |
90 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); | 91 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); |
91 if (cmd_line->HasSwitch(switches::kDisableWebRtcHWEncoding)) | 92 if (cmd_line->HasSwitch(switches::kDisableWebRtcHWEncoding)) |
92 return profiles; | 93 return profiles; |
| 94 #endif |
93 | 95 |
94 for (size_t i = 0; i < codecs_info.size(); ++i) { | 96 for (size_t i = 0; i < codecs_info.size(); ++i) { |
95 const MediaCodecBridge::CodecsInfo& info = codecs_info[i]; | 97 const MediaCodecBridge::CodecsInfo& info = codecs_info[i]; |
96 if (info.direction != media::MEDIA_CODEC_ENCODER || info.codecs != "vp8" || | 98 if (info.direction != media::MEDIA_CODEC_ENCODER || info.codecs != "vp8" || |
97 VideoCodecBridge::IsKnownUnaccelerated(media::kCodecVP8, | 99 VideoCodecBridge::IsKnownUnaccelerated(media::kCodecVP8, |
98 media::MEDIA_CODEC_ENCODER)) { | 100 media::MEDIA_CODEC_ENCODER)) { |
99 // We're only looking for a HW VP8 encoder. | 101 // We're only looking for a HW VP8 encoder. |
100 continue; | 102 continue; |
101 } | 103 } |
102 SupportedProfile profile; | 104 SupportedProfile profile; |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
403 base::MessageLoop::current()->PostTask( | 405 base::MessageLoop::current()->PostTask( |
404 FROM_HERE, | 406 FROM_HERE, |
405 base::Bind(&VideoEncodeAccelerator::Client::BitstreamBufferReady, | 407 base::Bind(&VideoEncodeAccelerator::Client::BitstreamBufferReady, |
406 client_ptr_factory_.GetWeakPtr(), | 408 client_ptr_factory_.GetWeakPtr(), |
407 bitstream_buffer.id(), | 409 bitstream_buffer.id(), |
408 size, | 410 size, |
409 key_frame)); | 411 key_frame)); |
410 } | 412 } |
411 | 413 |
412 } // namespace content | 414 } // namespace content |
OLD | NEW |