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

Side by Side Diff: media/mp4/mp4_stream_parser_unittest.cc

Issue 10803019: Chrome-side implementation of media source timestamp offset (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase ToT Created 8 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « media/mp4/mp4_stream_parser.cc ('k') | media/webm/webm_cluster_parser.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 (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 <algorithm> 5 #include <algorithm>
6 #include <string> 6 #include <string>
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 bool KeyNeededF(scoped_array<uint8> init_data, int init_data_size) { 86 bool KeyNeededF(scoped_array<uint8> init_data, int init_data_size) {
87 DVLOG(1) << "KeyNeededF: " << init_data_size; 87 DVLOG(1) << "KeyNeededF: " << init_data_size;
88 return true; 88 return true;
89 } 89 }
90 90
91 void NewSegmentF(TimeDelta start_dts) { 91 void NewSegmentF(TimeDelta start_dts) {
92 DVLOG(1) << "NewSegmentF: " << start_dts.InMilliseconds(); 92 DVLOG(1) << "NewSegmentF: " << start_dts.InMilliseconds();
93 segment_start_ = start_dts; 93 segment_start_ = start_dts;
94 } 94 }
95 95
96 void EndOfSegmentF() {
97 DVLOG(1) << "EndOfSegmentF()";
98 }
99
96 void InitializeParser() { 100 void InitializeParser() {
97 parser_->Init( 101 parser_->Init(
98 base::Bind(&MP4StreamParserTest::InitF, base::Unretained(this)), 102 base::Bind(&MP4StreamParserTest::InitF, base::Unretained(this)),
99 base::Bind(&MP4StreamParserTest::NewConfigF, base::Unretained(this)), 103 base::Bind(&MP4StreamParserTest::NewConfigF, base::Unretained(this)),
100 base::Bind(&MP4StreamParserTest::NewBuffersF, base::Unretained(this)), 104 base::Bind(&MP4StreamParserTest::NewBuffersF, base::Unretained(this)),
101 base::Bind(&MP4StreamParserTest::NewBuffersF, base::Unretained(this)), 105 base::Bind(&MP4StreamParserTest::NewBuffersF, base::Unretained(this)),
102 base::Bind(&MP4StreamParserTest::KeyNeededF, base::Unretained(this)), 106 base::Bind(&MP4StreamParserTest::KeyNeededF, base::Unretained(this)),
103 base::Bind(&MP4StreamParserTest::NewSegmentF, base::Unretained(this))); 107 base::Bind(&MP4StreamParserTest::NewSegmentF, base::Unretained(this)),
108 base::Bind(&MP4StreamParserTest::EndOfSegmentF,
109 base::Unretained(this)));
104 } 110 }
105 111
106 bool ParseMP4File(const std::string& filename, int append_bytes) { 112 bool ParseMP4File(const std::string& filename, int append_bytes) {
107 InitializeParser(); 113 InitializeParser();
108 114
109 scoped_refptr<DecoderBuffer> buffer = ReadTestDataFile(filename); 115 scoped_refptr<DecoderBuffer> buffer = ReadTestDataFile(filename);
110 EXPECT_TRUE(AppendDataInPieces(buffer->GetData(), 116 EXPECT_TRUE(AppendDataInPieces(buffer->GetData(),
111 buffer->GetDataSize(), 117 buffer->GetDataSize(),
112 append_bytes)); 118 append_bytes));
113 return true; 119 return true;
(...skipping 22 matching lines...) Expand all
136 EXPECT_TRUE(AppendDataInPieces(buffer->GetData(), 142 EXPECT_TRUE(AppendDataInPieces(buffer->GetData(),
137 buffer->GetDataSize(), 143 buffer->GetDataSize(),
138 512)); 144 512));
139 EXPECT_TRUE(AppendDataInPieces(buffer->GetData(), 145 EXPECT_TRUE(AppendDataInPieces(buffer->GetData(),
140 buffer->GetDataSize(), 146 buffer->GetDataSize(),
141 512)); 147 512));
142 } 148 }
143 149
144 } // namespace mp4 150 } // namespace mp4
145 } // namespace media 151 } // namespace media
OLDNEW
« no previous file with comments | « media/mp4/mp4_stream_parser.cc ('k') | media/webm/webm_cluster_parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698