| 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 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 | 450 |
| 451 // |type| didn't match any of the supported types. | 451 // |type| didn't match any of the supported types. |
| 452 return false; | 452 return false; |
| 453 } | 453 } |
| 454 | 454 |
| 455 bool StreamParserFactory::IsTypeSupported( | 455 bool StreamParserFactory::IsTypeSupported( |
| 456 const std::string& type, const std::vector<std::string>& codecs) { | 456 const std::string& type, const std::vector<std::string>& codecs) { |
| 457 return CheckTypeAndCodecs(type, codecs, new MediaLog(), NULL, NULL, NULL); | 457 return CheckTypeAndCodecs(type, codecs, new MediaLog(), NULL, NULL, NULL); |
| 458 } | 458 } |
| 459 | 459 |
| 460 scoped_ptr<StreamParser> StreamParserFactory::Create( | 460 std::unique_ptr<StreamParser> StreamParserFactory::Create( |
| 461 const std::string& type, | 461 const std::string& type, |
| 462 const std::vector<std::string>& codecs, | 462 const std::vector<std::string>& codecs, |
| 463 const scoped_refptr<MediaLog>& media_log, | 463 const scoped_refptr<MediaLog>& media_log, |
| 464 bool* has_audio, | 464 bool* has_audio, |
| 465 bool* has_video) { | 465 bool* has_video) { |
| 466 scoped_ptr<StreamParser> stream_parser; | 466 std::unique_ptr<StreamParser> stream_parser; |
| 467 ParserFactoryFunction factory_function; | 467 ParserFactoryFunction factory_function; |
| 468 std::vector<CodecInfo::HistogramTag> audio_codecs; | 468 std::vector<CodecInfo::HistogramTag> audio_codecs; |
| 469 std::vector<CodecInfo::HistogramTag> video_codecs; | 469 std::vector<CodecInfo::HistogramTag> video_codecs; |
| 470 *has_audio = false; | 470 *has_audio = false; |
| 471 *has_video = false; | 471 *has_video = false; |
| 472 | 472 |
| 473 if (CheckTypeAndCodecs(type, codecs, media_log, &factory_function, | 473 if (CheckTypeAndCodecs(type, codecs, media_log, &factory_function, |
| 474 &audio_codecs, &video_codecs)) { | 474 &audio_codecs, &video_codecs)) { |
| 475 *has_audio = !audio_codecs.empty(); | 475 *has_audio = !audio_codecs.empty(); |
| 476 *has_video = !video_codecs.empty(); | 476 *has_video = !video_codecs.empty(); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 488 CodecInfo::HISTOGRAM_MAX + 1); | 488 CodecInfo::HISTOGRAM_MAX + 1); |
| 489 } | 489 } |
| 490 | 490 |
| 491 stream_parser.reset(factory_function(codecs, media_log)); | 491 stream_parser.reset(factory_function(codecs, media_log)); |
| 492 } | 492 } |
| 493 | 493 |
| 494 return stream_parser; | 494 return stream_parser; |
| 495 } | 495 } |
| 496 | 496 |
| 497 } // namespace media | 497 } // namespace media |
| OLD | NEW |