OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/chunk_demuxer.h" | 5 #include "media/filters/chunk_demuxer.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <deque> | 8 #include <deque> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 const std::vector<std::string>& codecs); | 34 const std::vector<std::string>& codecs); |
35 | 35 |
36 struct SupportedTypeInfo { | 36 struct SupportedTypeInfo { |
37 const char* type; | 37 const char* type; |
38 const ParserFactoryFunction factory_function; | 38 const ParserFactoryFunction factory_function; |
39 const CodecInfo** codecs; | 39 const CodecInfo** codecs; |
40 }; | 40 }; |
41 | 41 |
42 static const CodecInfo kVP8CodecInfo = { "vp8", DemuxerStream::VIDEO }; | 42 static const CodecInfo kVP8CodecInfo = { "vp8", DemuxerStream::VIDEO }; |
43 static const CodecInfo kVorbisCodecInfo = { "vorbis", DemuxerStream::AUDIO }; | 43 static const CodecInfo kVorbisCodecInfo = { "vorbis", DemuxerStream::AUDIO }; |
| 44 static const CodecInfo kOpusCodecInfo = { "opus", DemuxerStream::AUDIO }; |
44 | 45 |
45 static const CodecInfo* kVideoWebMCodecs[] = { | 46 static const CodecInfo* kVideoWebMCodecs[] = { |
46 &kVP8CodecInfo, | 47 &kVP8CodecInfo, |
47 &kVorbisCodecInfo, | 48 &kVorbisCodecInfo, |
| 49 &kOpusCodecInfo, |
48 NULL | 50 NULL |
49 }; | 51 }; |
50 | 52 |
51 static const CodecInfo* kAudioWebMCodecs[] = { | 53 static const CodecInfo* kAudioWebMCodecs[] = { |
52 &kVorbisCodecInfo, | 54 &kVorbisCodecInfo, |
| 55 &kOpusCodecInfo, |
53 NULL | 56 NULL |
54 }; | 57 }; |
55 | 58 |
56 static StreamParser* BuildWebMParser(const std::vector<std::string>& codecs) { | 59 static StreamParser* BuildWebMParser(const std::vector<std::string>& codecs) { |
57 return new WebMStreamParser(); | 60 return new WebMStreamParser(); |
58 } | 61 } |
59 | 62 |
60 #if defined(GOOGLE_CHROME_BUILD) || defined(USE_PROPRIETARY_CODECS) | 63 #if defined(GOOGLE_CHROME_BUILD) || defined(USE_PROPRIETARY_CODECS) |
61 static const CodecInfo kH264CodecInfo = { "avc1.*", DemuxerStream::VIDEO }; | 64 static const CodecInfo kH264CodecInfo = { "avc1.*", DemuxerStream::VIDEO }; |
62 static const CodecInfo kAACCodecInfo = { "mp4a.40.*", DemuxerStream::AUDIO }; | 65 static const CodecInfo kAACCodecInfo = { "mp4a.40.*", DemuxerStream::AUDIO }; |
(...skipping 1182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1245 | 1248 |
1246 Ranges<TimeDelta> ChunkDemuxer::GetBufferedRanges() const { | 1249 Ranges<TimeDelta> ChunkDemuxer::GetBufferedRanges() const { |
1247 if (audio_ && !video_) | 1250 if (audio_ && !video_) |
1248 return audio_->GetBufferedRanges(duration_); | 1251 return audio_->GetBufferedRanges(duration_); |
1249 else if (!audio_ && video_) | 1252 else if (!audio_ && video_) |
1250 return video_->GetBufferedRanges(duration_); | 1253 return video_->GetBufferedRanges(duration_); |
1251 return ComputeIntersection(); | 1254 return ComputeIntersection(); |
1252 } | 1255 } |
1253 | 1256 |
1254 } // namespace media | 1257 } // namespace media |
OLD | NEW |