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

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: Rebase to ToT in preparation for dcommit 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
« no previous file with comments | « media/filters/frame_processor_base.h ('k') | media/filters/frame_processor_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..09b1b86c3b39011ce2d0a6cc406ebc80af98ef15 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,11 +25,23 @@ 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) {}
+ : sequence_mode_(false),
+ group_start_timestamp_(kNoTimestamp()) {}
FrameProcessorBase::~FrameProcessorBase() {
DVLOG(2) << __FUNCTION__ << "()";
@@ -34,6 +49,14 @@ FrameProcessorBase::~FrameProcessorBase() {
STLDeleteValues(&track_buffers_);
}
+void FrameProcessorBase::SetGroupStartTimestampIfInSequenceMode(
+ base::TimeDelta timestamp_offset) {
+ DVLOG(2) << __FUNCTION__ << "(" << timestamp_offset.InSecondsF() << ")";
+ DCHECK(kNoTimestamp() != timestamp_offset);
+ if (sequence_mode_)
+ group_start_timestamp_ = timestamp_offset;
+}
+
bool FrameProcessorBase::AddTrack(StreamParser::TrackId id,
ChunkDemuxerStream* stream) {
DVLOG(2) << __FUNCTION__ << "(): id=" << id;
@@ -63,4 +86,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
« no previous file with comments | « media/filters/frame_processor_base.h ('k') | media/filters/frame_processor_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698