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

Side by Side Diff: media/base/demuxer_perftest.cc

Issue 2491043003: MediaResource refactoring to support multiple streams (Closed)
Patch Set: Added a TODO about DemuxerStream enabled/set_enabled methods Created 3 years, 10 months 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
« no previous file with comments | « chromecast/media/service/cast_renderer.cc ('k') | media/base/demuxer_stream.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/at_exit.h" 9 #include "base/at_exit.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 Streams streams_; 95 Streams streams_;
96 std::vector<bool> end_of_stream_; 96 std::vector<bool> end_of_stream_;
97 std::vector<base::TimeDelta> last_read_timestamp_; 97 std::vector<base::TimeDelta> last_read_timestamp_;
98 std::vector<int> counts_; 98 std::vector<int> counts_;
99 99
100 DISALLOW_COPY_AND_ASSIGN(StreamReader); 100 DISALLOW_COPY_AND_ASSIGN(StreamReader);
101 }; 101 };
102 102
103 StreamReader::StreamReader(media::Demuxer* demuxer, 103 StreamReader::StreamReader(media::Demuxer* demuxer,
104 bool enable_bitstream_converter) { 104 bool enable_bitstream_converter) {
105 media::DemuxerStream* stream = 105 std::vector<media::DemuxerStream*> streams = demuxer->GetAllStreams();
106 demuxer->GetStream(media::DemuxerStream::AUDIO); 106 for (const auto& stream : streams) {
107 if (stream) {
108 streams_.push_back(stream); 107 streams_.push_back(stream);
109 end_of_stream_.push_back(false); 108 end_of_stream_.push_back(false);
110 last_read_timestamp_.push_back(media::kNoTimestamp); 109 last_read_timestamp_.push_back(media::kNoTimestamp);
111 counts_.push_back(0); 110 counts_.push_back(0);
112 } 111 if (enable_bitstream_converter && stream->type() == DemuxerStream::VIDEO)
113
114 stream = demuxer->GetStream(media::DemuxerStream::VIDEO);
115 if (stream) {
116 streams_.push_back(stream);
117 end_of_stream_.push_back(false);
118 last_read_timestamp_.push_back(media::kNoTimestamp);
119 counts_.push_back(0);
120
121 if (enable_bitstream_converter)
122 stream->EnableBitstreamConverter(); 112 stream->EnableBitstreamConverter();
123 } 113 }
124 } 114 }
125 115
126 StreamReader::~StreamReader() {} 116 StreamReader::~StreamReader() {}
127 117
128 void StreamReader::Read() { 118 void StreamReader::Read() {
129 int index = GetNextStreamIndexToRead(); 119 int index = GetNextStreamIndexToRead();
130 bool end_of_stream = false; 120 bool end_of_stream = false;
131 base::TimeDelta timestamp; 121 base::TimeDelta timestamp;
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 #if BUILDFLAG(USE_PROPRIETARY_CODECS) 233 #if BUILDFLAG(USE_PROPRIETARY_CODECS)
244 RunDemuxerBenchmark("bear-1280x720.mp4"); 234 RunDemuxerBenchmark("bear-1280x720.mp4");
245 RunDemuxerBenchmark("sfx.mp3"); 235 RunDemuxerBenchmark("sfx.mp3");
246 #endif 236 #endif
247 #if BUILDFLAG(USE_PROPRIETARY_CODECS) && defined(OS_CHROMEOS) 237 #if BUILDFLAG(USE_PROPRIETARY_CODECS) && defined(OS_CHROMEOS)
248 RunDemuxerBenchmark("bear.avi"); 238 RunDemuxerBenchmark("bear.avi");
249 #endif 239 #endif
250 } 240 }
251 241
252 } // namespace media 242 } // namespace media
OLDNEW
« no previous file with comments | « chromecast/media/service/cast_renderer.cc ('k') | media/base/demuxer_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698