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

Unified Diff: media/mp4/mp4_stream_parser_unittest.cc

Issue 10660005: Flush sample buffers when reading new segments in Media Source BMFF parser. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: FlushSamples -> SendAndFlushSamples Created 8 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/mp4/mp4_stream_parser.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/mp4/mp4_stream_parser_unittest.cc
diff --git a/media/mp4/mp4_stream_parser_unittest.cc b/media/mp4/mp4_stream_parser_unittest.cc
index 96fd9139f6ca15a44df642e16bb0b333bfc47328..9b6a9232d8ccd97162269acbc75270bf5a3be4b9 100644
--- a/media/mp4/mp4_stream_parser_unittest.cc
+++ b/media/mp4/mp4_stream_parser_unittest.cc
@@ -30,6 +30,7 @@ class MP4StreamParserTest : public testing::Test {
protected:
scoped_ptr<MP4StreamParser> parser_;
+ base::TimeDelta segment_start_;
bool AppendData(const uint8* data, size_t length) {
parser_->Parse(data, length);
@@ -72,6 +73,7 @@ class MP4StreamParserTest : public testing::Test {
DVLOG(3) << " n=" << buf - bufs.begin()
<< ", size=" << (*buf)->GetDataSize()
<< ", dur=" << (*buf)->GetDuration().InMilliseconds();
+ EXPECT_LE(segment_start_, (*buf)->GetTimestamp());
}
return true;
}
@@ -83,6 +85,7 @@ class MP4StreamParserTest : public testing::Test {
void NewSegmentF(TimeDelta start_dts) {
DVLOG(1) << "NewSegmentF: " << start_dts.InMilliseconds();
+ segment_start_ = start_dts;
}
void InitializeParser() {
@@ -95,19 +98,23 @@ class MP4StreamParserTest : public testing::Test {
base::Bind(&MP4StreamParserTest::NewSegmentF, base::Unretained(this)));
}
- bool ParseMP4File(const std::string& filename) {
+ bool ParseMP4File(const std::string& filename, int append_size) {
InitializeParser();
scoped_refptr<DecoderBuffer> buffer = ReadTestDataFile(filename);
EXPECT_TRUE(AppendDataInPieces(buffer->GetData(),
buffer->GetDataSize(),
- 512));
+ append_size));
return true;
}
};
TEST_F(MP4StreamParserTest, TestParseBearDASH) {
- ParseMP4File("bear.1280x720_dash.mp4");
+ ParseMP4File("bear.1280x720_dash.mp4", 512);
+}
+
+TEST_F(MP4StreamParserTest, TestMultiFragmentAppend) {
+ ParseMP4File("bear.1280x720_dash.mp4", 768432);
}
} // namespace mp4
« no previous file with comments | « media/mp4/mp4_stream_parser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698