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

Unified Diff: media/blink/websourcebuffer_impl.cc

Issue 547223003: MSE: Notify Blink SourceBuffer on init segment received (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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/blink/websourcebuffer_impl.cc
diff --git a/media/blink/websourcebuffer_impl.cc b/media/blink/websourcebuffer_impl.cc
index c87c2b986308e774be00067b27ffa06217c975f8..5a3adc657617e45db54cdf51fdb4aed7d7445b6c 100644
--- a/media/blink/websourcebuffer_impl.cc
+++ b/media/blink/websourcebuffer_impl.cc
@@ -6,8 +6,12 @@
#include <limits>
+#include "base/bind.h"
+#include "base/callback.h"
+#include "base/callback_helpers.h"
#include "base/float_util.h"
#include "media/filters/chunk_demuxer.h"
+#include "third_party/WebKit/public/platform/WebSourceBufferClient.h"
namespace media {
@@ -34,12 +38,19 @@ WebSourceBufferImpl::WebSourceBufferImpl(
const std::string& id, ChunkDemuxer* demuxer)
: id_(id),
demuxer_(demuxer),
+ client_(NULL),
append_window_end_(kInfiniteDuration()) {
DCHECK(demuxer_);
}
WebSourceBufferImpl::~WebSourceBufferImpl() {
DCHECK(!demuxer_) << "Object destroyed w/o removedFromMediaSource() call";
+ DCHECK(!client_);
+}
+
+void WebSourceBufferImpl::setClient(blink::WebSourceBufferClient* client) {
+ DVLOG(0) << __FUNCTION__ << "BIG TODO remove this logging... client is: " << client;
+ client_ = client;
}
bool WebSourceBufferImpl::setMode(WebSourceBuffer::AppendMode mode) {
@@ -76,7 +87,9 @@ void WebSourceBufferImpl::append(
base::TimeDelta old_offset = timestamp_offset_;
demuxer_->AppendData(id_, data, length,
append_window_start_, append_window_end_,
- &timestamp_offset_);
+ &timestamp_offset_,
+ base::Bind(&WebSourceBufferImpl::InitSegmentReceived,
+ base::Unretained(this)));
// Coded frame processing may update the timestamp offset. If the caller
// provides a non-NULL |timestamp_offset| and frame processing changes the
@@ -131,4 +144,9 @@ void WebSourceBufferImpl::removedFromMediaSource() {
demuxer_ = NULL;
}
+void WebSourceBufferImpl::InitSegmentReceived() {
+ DVLOG(1) << __FUNCTION__;
+ client_->initializationSegmentReceived();
+}
+
} // namespace media

Powered by Google App Engine
This is Rietveld 408576698