| 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 <stdint.h> | 7 #include <stdint.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 callback.Run(static_cast<interfaces::DemuxerStream::Type>(stream_->type()), | 68 callback.Run(static_cast<interfaces::DemuxerStream::Type>(stream_->type()), |
| 69 std::move(data_pipe.consumer_handle), std::move(audio_config), | 69 std::move(data_pipe.consumer_handle), std::move(audio_config), |
| 70 std::move(video_config)); | 70 std::move(video_config)); |
| 71 } | 71 } |
| 72 | 72 |
| 73 void MojoDemuxerStreamImpl::Read(const ReadCallback& callback) { | 73 void MojoDemuxerStreamImpl::Read(const ReadCallback& callback) { |
| 74 stream_->Read(base::Bind(&MojoDemuxerStreamImpl::OnBufferReady, | 74 stream_->Read(base::Bind(&MojoDemuxerStreamImpl::OnBufferReady, |
| 75 weak_factory_.GetWeakPtr(), callback)); | 75 weak_factory_.GetWeakPtr(), callback)); |
| 76 } | 76 } |
| 77 | 77 |
| 78 void MojoDemuxerStreamImpl::EnableBitstreamConverter() { |
| 79 stream_->EnableBitstreamConverter(); |
| 80 } |
| 81 |
| 78 void MojoDemuxerStreamImpl::OnBufferReady( | 82 void MojoDemuxerStreamImpl::OnBufferReady( |
| 79 const ReadCallback& callback, | 83 const ReadCallback& callback, |
| 80 media::DemuxerStream::Status status, | 84 media::DemuxerStream::Status status, |
| 81 const scoped_refptr<media::DecoderBuffer>& buffer) { | 85 const scoped_refptr<media::DecoderBuffer>& buffer) { |
| 82 interfaces::AudioDecoderConfigPtr audio_config; | 86 interfaces::AudioDecoderConfigPtr audio_config; |
| 83 interfaces::VideoDecoderConfigPtr video_config; | 87 interfaces::VideoDecoderConfigPtr video_config; |
| 84 | 88 |
| 85 if (status == media::DemuxerStream::kConfigChanged) { | 89 if (status == media::DemuxerStream::kConfigChanged) { |
| 86 DVLOG(2) << __FUNCTION__ << ": ConfigChange!"; | 90 DVLOG(2) << __FUNCTION__ << ": ConfigChange!"; |
| 87 // Send the config change so our client can read it once it parses the | 91 // Send the config change so our client can read it once it parses the |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 | 128 |
| 125 // TODO(dalecurtis): Once we can write framed data to the DataPipe, fill via | 129 // TODO(dalecurtis): Once we can write framed data to the DataPipe, fill via |
| 126 // the producer handle and then read more to keep the pipe full. Waiting for | 130 // the producer handle and then read more to keep the pipe full. Waiting for |
| 127 // space can be accomplished using an AsyncWaiter. | 131 // space can be accomplished using an AsyncWaiter. |
| 128 callback.Run(static_cast<interfaces::DemuxerStream::Status>(status), | 132 callback.Run(static_cast<interfaces::DemuxerStream::Status>(status), |
| 129 interfaces::DecoderBuffer::From(buffer), std::move(audio_config), | 133 interfaces::DecoderBuffer::From(buffer), std::move(audio_config), |
| 130 std::move(video_config)); | 134 std::move(video_config)); |
| 131 } | 135 } |
| 132 | 136 |
| 133 } // namespace media | 137 } // namespace media |
| OLD | NEW |