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

Unified Diff: media/formats/mp4/mp4_stream_parser_unittest.cc

Issue 447963003: Introduce DecodeTimestamp class to make it easier to distiguish presentation and decode timestamps. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
Index: media/formats/mp4/mp4_stream_parser_unittest.cc
diff --git a/media/formats/mp4/mp4_stream_parser_unittest.cc b/media/formats/mp4/mp4_stream_parser_unittest.cc
index 8805c05c3a75d6e7a4f55bfd7ba6f4dc1fbcfec3..c44e0ce96ccb2095a37e7337aa53ee6d30bd4863 100644
--- a/media/formats/mp4/mp4_stream_parser_unittest.cc
+++ b/media/formats/mp4/mp4_stream_parser_unittest.cc
@@ -32,7 +32,8 @@ class MP4StreamParserTest : public testing::Test {
public:
MP4StreamParserTest()
: configs_received_(false),
- lower_bound_(base::TimeDelta::Max()) {
+ lower_bound_(
+ DecodeTimestamp::FromPresentationTime(base::TimeDelta::Max())) {
std::set<int> audio_object_types;
audio_object_types.insert(kISO_14496_3);
parser_.reset(new MP4StreamParser(audio_object_types, false));
@@ -41,7 +42,7 @@ class MP4StreamParserTest : public testing::Test {
protected:
scoped_ptr<MP4StreamParser> parser_;
bool configs_received_;
- base::TimeDelta lower_bound_;
+ DecodeTimestamp lower_bound_;
bool AppendData(const uint8* data, size_t length) {
return parser_->Parse(data, length);
@@ -99,17 +100,17 @@ class MP4StreamParserTest : public testing::Test {
// Find the second highest timestamp so that we know what the
// timestamps on the next set of buffers must be >= than.
- base::TimeDelta audio = !audio_buffers.empty() ?
- audio_buffers.back()->GetDecodeTimestamp() : kNoTimestamp();
- base::TimeDelta video = !video_buffers.empty() ?
- video_buffers.back()->GetDecodeTimestamp() : kNoTimestamp();
- base::TimeDelta second_highest_timestamp =
- (audio == kNoTimestamp() ||
- (video != kNoTimestamp() && audio > video)) ? video : audio;
+ DecodeTimestamp audio = !audio_buffers.empty() ?
+ audio_buffers.back()->GetDecodeTimestamp() : kNoDecodeTimestamp();
+ DecodeTimestamp video = !video_buffers.empty() ?
+ video_buffers.back()->GetDecodeTimestamp() : kNoDecodeTimestamp();
+ DecodeTimestamp second_highest_timestamp =
+ (audio == kNoDecodeTimestamp() ||
+ (video != kNoDecodeTimestamp() && audio > video)) ? video : audio;
- DCHECK(second_highest_timestamp != kNoTimestamp());
+ DCHECK(second_highest_timestamp != kNoDecodeTimestamp());
- if (lower_bound_ != kNoTimestamp() &&
+ if (lower_bound_ != kNoDecodeTimestamp() &&
second_highest_timestamp < lower_bound_) {
return false;
}
@@ -127,12 +128,13 @@ class MP4StreamParserTest : public testing::Test {
void NewSegmentF() {
DVLOG(1) << "NewSegmentF";
- lower_bound_ = kNoTimestamp();
+ lower_bound_ = kNoDecodeTimestamp();
}
void EndOfSegmentF() {
DVLOG(1) << "EndOfSegmentF()";
- lower_bound_ = base::TimeDelta::Max();
+ lower_bound_ =
+ DecodeTimestamp::FromPresentationTime(base::TimeDelta::Max());
}
void InitializeParser() {

Powered by Google App Engine
This is Rietveld 408576698