Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(363)

Side by Side Diff: media/filters/chunk_demuxer.cc

Issue 11416367: Add Opus decode wrapper to media. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased (changed machines) Address most comments. Added TODO for Opus buffering question. Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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,
scherkus (not reviewing) 2012/12/14 21:13:34 does this add support for opus to chunk demuxer /
Tom Finegan 2012/12/14 23:19:52 It does not work; removed changes in this file.
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 1177 matching lines...) Expand 10 before | Expand all | Expand 10 after
1240 1243
1241 Ranges<TimeDelta> ChunkDemuxer::GetBufferedRanges() const { 1244 Ranges<TimeDelta> ChunkDemuxer::GetBufferedRanges() const {
1242 if (audio_ && !video_) 1245 if (audio_ && !video_)
1243 return audio_->GetBufferedRanges(duration_); 1246 return audio_->GetBufferedRanges(duration_);
1244 else if (!audio_ && video_) 1247 else if (!audio_ && video_)
1245 return video_->GetBufferedRanges(duration_); 1248 return video_->GetBufferedRanges(duration_);
1246 return ComputeIntersection(); 1249 return ComputeIntersection();
1247 } 1250 }
1248 1251
1249 } // namespace media 1252 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698