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

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: fix windows Created 8 years, 5 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
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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 bool KeyNeededF(scoped_array<uint8> init_data, int init_data_size) { 91 bool KeyNeededF(scoped_array<uint8> init_data, int init_data_size) {
92 DVLOG(1) << "KeyNeededF: " << init_data_size; 92 DVLOG(1) << "KeyNeededF: " << init_data_size;
93 return true; 93 return true;
94 } 94 }
95 95
96 void NewSegmentF(TimeDelta start_dts) { 96 void NewSegmentF(TimeDelta start_dts) {
97 DVLOG(1) << "NewSegmentF: " << start_dts.InMilliseconds(); 97 DVLOG(1) << "NewSegmentF: " << start_dts.InMilliseconds();
98 segment_start_ = start_dts; 98 segment_start_ = start_dts;
99 } 99 }
100 100
101 void EndOfSegmentF() {
102 DVLOG(1) << "EndOfSegmentF()";
103 }
104
101 void InitializeParser() { 105 void InitializeParser() {
102 parser_->Init( 106 parser_->Init(
103 base::Bind(&MP4StreamParserTest::InitF, base::Unretained(this)), 107 base::Bind(&MP4StreamParserTest::InitF, base::Unretained(this)),
104 base::Bind(&MP4StreamParserTest::NewConfigF, base::Unretained(this)), 108 base::Bind(&MP4StreamParserTest::NewConfigF, base::Unretained(this)),
105 base::Bind(&MP4StreamParserTest::NewBuffersF, base::Unretained(this)), 109 base::Bind(&MP4StreamParserTest::NewBuffersF, base::Unretained(this)),
106 base::Bind(&MP4StreamParserTest::NewBuffersF, base::Unretained(this)), 110 base::Bind(&MP4StreamParserTest::NewBuffersF, base::Unretained(this)),
107 base::Bind(&MP4StreamParserTest::KeyNeededF, base::Unretained(this)), 111 base::Bind(&MP4StreamParserTest::KeyNeededF, base::Unretained(this)),
108 base::Bind(&MP4StreamParserTest::NewSegmentF, base::Unretained(this))); 112 base::Bind(&MP4StreamParserTest::NewSegmentF, base::Unretained(this)),
113 base::Bind(&MP4StreamParserTest::EndOfSegmentF,
114 base::Unretained(this)));
109 } 115 }
110 116
111 bool ParseMP4File(const std::string& filename, int append_size) { 117 bool ParseMP4File(const std::string& filename, int append_size) {
112 InitializeParser(); 118 InitializeParser();
113 119
114 scoped_refptr<DecoderBuffer> buffer = ReadTestDataFile(filename); 120 scoped_refptr<DecoderBuffer> buffer = ReadTestDataFile(filename);
115 EXPECT_TRUE(AppendDataInPieces(buffer->GetData(), 121 EXPECT_TRUE(AppendDataInPieces(buffer->GetData(),
116 buffer->GetDataSize(), 122 buffer->GetDataSize(),
117 append_size)); 123 append_size));
118 return true; 124 return true;
(...skipping 16 matching lines...) Expand all
135 EXPECT_TRUE(AppendDataInPieces(buffer->GetData(), 141 EXPECT_TRUE(AppendDataInPieces(buffer->GetData(),
136 buffer->GetDataSize(), 142 buffer->GetDataSize(),
137 512)); 143 512));
138 EXPECT_TRUE(AppendDataInPieces(buffer->GetData(), 144 EXPECT_TRUE(AppendDataInPieces(buffer->GetData(),
139 buffer->GetDataSize(), 145 buffer->GetDataSize(),
140 512)); 146 512));
141 } 147 }
142 148
143 } // namespace mp4 149 } // namespace mp4
144 } // namespace media 150 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698