| 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_,
|
| - ×tamp_offset_);
|
| + ×tamp_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
|
|
|