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

Unified Diff: media/filters/frame_processor_base.cc

Issue 180153003: Implement core of compliant MediaSource coded frame processing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Aligned with April 1 spec editor's draft, tests added Created 6 years, 7 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/filters/frame_processor_base.cc
diff --git a/media/filters/frame_processor_base.cc b/media/filters/frame_processor_base.cc
index 3e088ed5dc2966926443e23717ddb7086d636a52..e4977f54cd71876eaffda7523741e8436f190685 100644
--- a/media/filters/frame_processor_base.cc
+++ b/media/filters/frame_processor_base.cc
@@ -10,7 +10,10 @@
namespace media {
MseTrackBuffer::MseTrackBuffer(ChunkDemuxerStream* stream)
- : needs_random_access_point_(true),
+ : last_decode_timestamp_(kNoTimestamp()),
+ last_frame_duration_(kNoTimestamp()),
+ highest_presentation_timestamp_(kNoTimestamp()),
+ needs_random_access_point_(true),
stream_(stream) {
DCHECK(stream_);
}
@@ -22,9 +25,20 @@ MseTrackBuffer::~MseTrackBuffer() {
void MseTrackBuffer::Reset() {
DVLOG(2) << __FUNCTION__ << "()";
+ last_decode_timestamp_ = kNoTimestamp();
+ last_frame_duration_ = kNoTimestamp();
+ highest_presentation_timestamp_ = kNoTimestamp();
needs_random_access_point_ = true;
}
+void MseTrackBuffer::SetHighestPresentationTimestampIfIncreased(
+ base::TimeDelta timestamp) {
+ if (highest_presentation_timestamp_ == kNoTimestamp() ||
+ timestamp > highest_presentation_timestamp_) {
+ highest_presentation_timestamp_ = timestamp;
+ }
+}
+
FrameProcessorBase::FrameProcessorBase()
: sequence_mode_(false) {}
@@ -63,4 +77,15 @@ MseTrackBuffer* FrameProcessorBase::FindTrack(StreamParser::TrackId id) {
return itr->second;
}
+void FrameProcessorBase::NotifyNewMediaSegmentStarting(
+ base::TimeDelta segment_timestamp) {
+ DVLOG(2) << __FUNCTION__ << "(" << segment_timestamp.InSecondsF() << ")";
+
+ for (TrackBufferMap::iterator itr = track_buffers_.begin();
+ itr != track_buffers_.end();
+ ++itr) {
+ itr->second->stream()->OnNewMediaSegment(segment_timestamp);
+ }
+}
+
} // namespace media

Powered by Google App Engine
This is Rietveld 408576698