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

Side by Side Diff: media/formats/mp2t/mp2t_stream_parser_unittest.cc

Issue 2815303006: Convert MediaLog from being ref counted to owned by WebMediaPlayer. (Closed)
Patch Set: Rebase. Created 3 years, 8 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 | « media/formats/mp2t/mp2t_stream_parser.cc ('k') | media/formats/mp4/aac.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/formats/mp2t/mp2t_stream_parser.h" 5 #include "media/formats/mp2t/mp2t_stream_parser.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 audio_track_id_(0), 167 audio_track_id_(0),
168 video_track_id_(0), 168 video_track_id_(0),
169 current_audio_config_(), 169 current_audio_config_(),
170 current_video_config_(), 170 current_video_config_(),
171 capture_buffers(false) { 171 capture_buffers(false) {
172 bool has_sbr = false; 172 bool has_sbr = false;
173 parser_.reset(new Mp2tStreamParser(has_sbr)); 173 parser_.reset(new Mp2tStreamParser(has_sbr));
174 } 174 }
175 175
176 protected: 176 protected:
177 MediaLog media_log_;
177 std::unique_ptr<Mp2tStreamParser> parser_; 178 std::unique_ptr<Mp2tStreamParser> parser_;
178 int segment_count_; 179 int segment_count_;
179 int config_count_; 180 int config_count_;
180 int audio_frame_count_; 181 int audio_frame_count_;
181 int video_frame_count_; 182 int video_frame_count_;
182 bool has_video_; 183 bool has_video_;
183 DecodeTimestamp audio_min_dts_; 184 DecodeTimestamp audio_min_dts_;
184 DecodeTimestamp audio_max_dts_; 185 DecodeTimestamp audio_max_dts_;
185 DecodeTimestamp video_min_dts_; 186 DecodeTimestamp video_min_dts_;
186 DecodeTimestamp video_max_dts_; 187 DecodeTimestamp video_max_dts_;
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 void InitializeParser() { 352 void InitializeParser() {
352 parser_->Init( 353 parser_->Init(
353 base::Bind(&Mp2tStreamParserTest::OnInit, base::Unretained(this)), 354 base::Bind(&Mp2tStreamParserTest::OnInit, base::Unretained(this)),
354 base::Bind(&Mp2tStreamParserTest::OnNewConfig, base::Unretained(this)), 355 base::Bind(&Mp2tStreamParserTest::OnNewConfig, base::Unretained(this)),
355 base::Bind(&Mp2tStreamParserTest::OnNewBuffers, base::Unretained(this)), 356 base::Bind(&Mp2tStreamParserTest::OnNewBuffers, base::Unretained(this)),
356 true, 357 true,
357 base::Bind(&Mp2tStreamParserTest::OnKeyNeeded, base::Unretained(this)), 358 base::Bind(&Mp2tStreamParserTest::OnKeyNeeded, base::Unretained(this)),
358 base::Bind(&Mp2tStreamParserTest::OnNewSegment, base::Unretained(this)), 359 base::Bind(&Mp2tStreamParserTest::OnNewSegment, base::Unretained(this)),
359 base::Bind(&Mp2tStreamParserTest::OnEndOfSegment, 360 base::Bind(&Mp2tStreamParserTest::OnEndOfSegment,
360 base::Unretained(this)), 361 base::Unretained(this)),
361 new MediaLog()); 362 &media_log_);
362 } 363 }
363 364
364 bool ParseMpeg2TsFile(const std::string& filename, int append_bytes) { 365 bool ParseMpeg2TsFile(const std::string& filename, int append_bytes) {
365 scoped_refptr<DecoderBuffer> buffer = ReadTestDataFile(filename); 366 scoped_refptr<DecoderBuffer> buffer = ReadTestDataFile(filename);
366 EXPECT_TRUE(AppendDataInPieces(buffer->data(), 367 EXPECT_TRUE(AppendDataInPieces(buffer->data(),
367 buffer->data_size(), 368 buffer->data_size(),
368 append_bytes)); 369 append_bytes));
369 return true; 370 return true;
370 } 371 }
371 }; 372 };
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
500 const auto& buffer = audio_buffer_capture_[i]; 501 const auto& buffer = audio_buffer_capture_[i];
501 std::string unencrypted_audio_buffer( 502 std::string unencrypted_audio_buffer(
502 reinterpret_cast<const char*>(buffer->data()), buffer->data_size()); 503 reinterpret_cast<const char*>(buffer->data()), buffer->data_size());
503 EXPECT_EQ(decrypted_audio_buffers[i], unencrypted_audio_buffer); 504 EXPECT_EQ(decrypted_audio_buffers[i], unencrypted_audio_buffer);
504 } 505 }
505 } 506 }
506 #endif 507 #endif
507 508
508 } // namespace mp2t 509 } // namespace mp2t
509 } // namespace media 510 } // namespace media
OLDNEW
« no previous file with comments | « media/formats/mp2t/mp2t_stream_parser.cc ('k') | media/formats/mp4/aac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698