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

Unified Diff: media/filters/chunk_demuxer.cc

Issue 10803019: Chrome-side implementation of media source timestamp offset (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: media/filters/chunk_demuxer.cc
diff --git a/media/filters/chunk_demuxer.cc b/media/filters/chunk_demuxer.cc
index 06a8d62923e6fa9d98e90db81d32968681a404b6..db9ef8f93654f5c2d288221bf0ee325861c9dfa2 100644
--- a/media/filters/chunk_demuxer.cc
+++ b/media/filters/chunk_demuxer.cc
@@ -99,7 +99,7 @@ static bool IsSupported(const std::string& type,
*has_audio = false;
*has_video = false;
- // Search for the SupportedTypeInfo for |type|
+ // Search for the SupportedTypeInfo for |type|.
for (size_t i = 0; i < arraysize(kSupportedTypeInfo); ++i) {
const SupportedTypeInfo& type_info = kSupportedTypeInfo[i];
if (type == type_info.type) {
@@ -759,6 +759,22 @@ void ChunkDemuxer::Abort(const std::string& id) {
stream_parser_map_[id]->Flush();
}
+void ChunkDemuxer::TimestampOffset(const std::string& id, float offset) {
+ DVLOG(1) << "TimestampOffset(" << id << ", " << offset << ")";
+ DCHECK_GT(stream_parser_map_.count(id), 0u);
+
+ TimeDelta time_offset = TimeDelta::FromMicroseconds(
+ offset * base::Time::kMicrosecondsPerSecond);
+ stream_parser_map_[id]->SetTimestampOffset(time_offset);
+}
+
+void ChunkDemuxer::ClearTimestampOffset(const std::string& id) {
+ DVLOG(1) << "ClearTimestampOffset(" << id << ")";
+ DCHECK_GT(stream_parser_map_.count(id), 0u);
+
+ stream_parser_map_[id]->ClearTimestampOffset();
+}
+
bool ChunkDemuxer::EndOfStream(PipelineStatus status) {
DVLOG(1) << "EndOfStream(" << status << ")";
base::AutoLock auto_lock(lock_);

Powered by Google App Engine
This is Rietveld 408576698