OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "media/filters/stream_parser_factory.h" | 5 #include "media/filters/stream_parser_factory.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 std::vector<CodecInfo::HistogramTag>* video_codecs) { | 336 std::vector<CodecInfo::HistogramTag>* video_codecs) { |
337 switch (codec_info->type) { | 337 switch (codec_info->type) { |
338 case CodecInfo::AUDIO: | 338 case CodecInfo::AUDIO: |
339 if (audio_codecs) | 339 if (audio_codecs) |
340 audio_codecs->push_back(codec_info->tag); | 340 audio_codecs->push_back(codec_info->tag); |
341 return true; | 341 return true; |
342 case CodecInfo::VIDEO: | 342 case CodecInfo::VIDEO: |
343 #if defined(OS_ANDROID) | 343 #if defined(OS_ANDROID) |
344 // TODO(wolenetz, dalecurtis): This should instead use MimeUtil() to avoid | 344 // TODO(wolenetz, dalecurtis): This should instead use MimeUtil() to avoid |
345 // duplication of subtle Android behavior. http://crbug.com/587303. | 345 // duplication of subtle Android behavior. http://crbug.com/587303. |
346 if (codec_info->tag == CodecInfo::HISTOGRAM_H264) { | 346 if (codec_info->tag == CodecInfo::HISTOGRAM_H264 && |
347 if (media::IsUnifiedMediaPipelineEnabled() && | 347 !media::HasPlatformDecoderSupport()) { |
348 !media::HasPlatformDecoderSupport()) { | |
349 return false; | |
350 } | |
351 | |
352 if (!MediaCodecUtil::IsMediaCodecAvailable()) | |
353 return false; | |
354 } | |
355 if (codec_info->tag == CodecInfo::HISTOGRAM_VP8 && | |
356 !media::MediaCodecUtil::IsVp8DecoderAvailable() && | |
357 !media::IsUnifiedMediaPipelineEnabled()) { | |
358 return false; | |
359 } | |
360 if (codec_info->tag == CodecInfo::HISTOGRAM_VP9 && | |
361 !media::MediaCodecUtil::IsVp9DecoderAvailable() && | |
362 !media::IsUnifiedMediaPipelineEnabled()) { | |
363 return false; | |
364 } | |
365 if (codec_info->tag == CodecInfo::HISTOGRAM_OPUS && | |
366 !media::PlatformHasOpusSupport() && | |
367 !media::IsUnifiedMediaPipelineEnabled()) { | |
368 return false; | 348 return false; |
369 } | 349 } |
370 #endif | 350 #endif |
371 if (video_codecs) | 351 if (video_codecs) |
372 video_codecs->push_back(codec_info->tag); | 352 video_codecs->push_back(codec_info->tag); |
373 return true; | 353 return true; |
374 default: | 354 default: |
375 // Not audio or video, so skip it. | 355 // Not audio or video, so skip it. |
376 DVLOG(1) << "CodecInfo type of " << codec_info->type | 356 DVLOG(1) << "CodecInfo type of " << codec_info->type |
377 << " should not be specified in a SupportedTypes list"; | 357 << " should not be specified in a SupportedTypes list"; |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
484 CodecInfo::HISTOGRAM_MAX + 1); | 464 CodecInfo::HISTOGRAM_MAX + 1); |
485 } | 465 } |
486 | 466 |
487 stream_parser.reset(factory_function(codecs, media_log)); | 467 stream_parser.reset(factory_function(codecs, media_log)); |
488 } | 468 } |
489 | 469 |
490 return stream_parser; | 470 return stream_parser; |
491 } | 471 } |
492 | 472 |
493 } // namespace media | 473 } // namespace media |
OLD | NEW |