| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "media/mojo/services/mojo_demuxer_stream_impl.h" | 5 #include "media/mojo/services/mojo_demuxer_stream_impl.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "media/base/audio_decoder_config.h" | 8 #include "media/base/audio_decoder_config.h" |
| 9 #include "media/base/decoder_buffer.h" | 9 #include "media/base/decoder_buffer.h" |
| 10 #include "media/base/video_decoder_config.h" | 10 #include "media/base/video_decoder_config.h" |
| 11 #include "media/mojo/services/media_type_converters.h" | 11 #include "media/mojo/services/media_type_converters.h" |
| 12 #include "third_party/mojo/src/mojo/public/cpp/system/data_pipe.h" | 12 #include "third_party/mojo/src/mojo/public/cpp/system/data_pipe.h" |
| 13 | 13 |
| 14 namespace media { | 14 namespace media { |
| 15 | 15 |
| 16 MojoDemuxerStreamImpl::MojoDemuxerStreamImpl(media::DemuxerStream* stream) | 16 MojoDemuxerStreamImpl::MojoDemuxerStreamImpl( |
| 17 : stream_(stream), weak_factory_(this) { | 17 media::DemuxerStream* stream, |
| 18 mojo::InterfaceRequest<mojo::DemuxerStream> request) |
| 19 : binding_(this, request.Pass()), stream_(stream), weak_factory_(this) { |
| 18 } | 20 } |
| 19 | 21 |
| 20 MojoDemuxerStreamImpl::~MojoDemuxerStreamImpl() { | 22 MojoDemuxerStreamImpl::~MojoDemuxerStreamImpl() { |
| 21 } | 23 } |
| 22 | 24 |
| 23 // This is called when our DemuxerStreamClient has connected itself and is | 25 // This is called when our DemuxerStreamClient has connected itself and is |
| 24 // ready to receive messages. Send an initial config and notify it that | 26 // ready to receive messages. Send an initial config and notify it that |
| 25 // we are now ready for business. | 27 // we are now ready for business. |
| 26 void MojoDemuxerStreamImpl::Initialize(const InitializeCallback& callback) { | 28 void MojoDemuxerStreamImpl::Initialize(const InitializeCallback& callback) { |
| 27 DVLOG(2) << __FUNCTION__; | 29 DVLOG(2) << __FUNCTION__; |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 | 118 |
| 117 // TODO(dalecurtis): Once we can write framed data to the DataPipe, fill via | 119 // TODO(dalecurtis): Once we can write framed data to the DataPipe, fill via |
| 118 // the producer handle and then read more to keep the pipe full. Waiting for | 120 // the producer handle and then read more to keep the pipe full. Waiting for |
| 119 // space can be accomplished using an AsyncWaiter. | 121 // space can be accomplished using an AsyncWaiter. |
| 120 callback.Run(static_cast<mojo::DemuxerStream::Status>(status), | 122 callback.Run(static_cast<mojo::DemuxerStream::Status>(status), |
| 121 mojo::MediaDecoderBuffer::From(buffer), audio_config.Pass(), | 123 mojo::MediaDecoderBuffer::From(buffer), audio_config.Pass(), |
| 122 video_config.Pass()); | 124 video_config.Pass()); |
| 123 } | 125 } |
| 124 | 126 |
| 125 } // namespace media | 127 } // namespace media |
| OLD | NEW |