| 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 "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "media/base/audio_decoder_config.h" | 9 #include "media/base/audio_decoder_config.h" |
| 10 #include "media/base/video_decoder_config.h" | 10 #include "media/base/video_decoder_config.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 mojo::VideoDecoderConfig::From(stream_->video_decoder_config())); | 44 mojo::VideoDecoderConfig::From(stream_->video_decoder_config())); |
| 45 } | 45 } |
| 46 } | 46 } |
| 47 | 47 |
| 48 // TODO(tim): Once using DataPipe, fill via the producer handle and then | 48 // TODO(tim): Once using DataPipe, fill via the producer handle and then |
| 49 // read more to keep the pipe full. | 49 // read more to keep the pipe full. |
| 50 callback.Run(static_cast<mojo::DemuxerStream::Status>(status), | 50 callback.Run(static_cast<mojo::DemuxerStream::Status>(status), |
| 51 mojo::MediaDecoderBuffer::From(buffer)); | 51 mojo::MediaDecoderBuffer::From(buffer)); |
| 52 } | 52 } |
| 53 | 53 |
| 54 void MojoDemuxerStreamImpl::DidConnect() { | 54 void MojoDemuxerStreamImpl::OnConnectionEstablished() { |
| 55 // This is called when our DemuxerStreamClient has connected itself and is | 55 // This is called when our DemuxerStreamClient has connected itself and is |
| 56 // ready to receive messages. Send an initial config and notify it that | 56 // ready to receive messages. Send an initial config and notify it that |
| 57 // we are now ready for business. | 57 // we are now ready for business. |
| 58 if (stream_->type() == media::DemuxerStream::AUDIO) { | 58 if (stream_->type() == media::DemuxerStream::AUDIO) { |
| 59 client()->OnAudioDecoderConfigChanged( | 59 client()->OnAudioDecoderConfigChanged( |
| 60 mojo::AudioDecoderConfig::From(stream_->audio_decoder_config())); | 60 mojo::AudioDecoderConfig::From(stream_->audio_decoder_config())); |
| 61 } else if (stream_->type() == media::DemuxerStream::VIDEO) { | 61 } else if (stream_->type() == media::DemuxerStream::VIDEO) { |
| 62 client()->OnVideoDecoderConfigChanged( | 62 client()->OnVideoDecoderConfigChanged( |
| 63 mojo::VideoDecoderConfig::From(stream_->video_decoder_config())); | 63 mojo::VideoDecoderConfig::From(stream_->video_decoder_config())); |
| 64 } | 64 } |
| 65 | 65 |
| 66 // TODO(tim): Create a DataPipe, hold the producer handle, and pass the | 66 // TODO(tim): Create a DataPipe, hold the producer handle, and pass the |
| 67 // consumer handle here. | 67 // consumer handle here. |
| 68 client()->OnStreamReady(mojo::ScopedDataPipeConsumerHandle()); | 68 client()->OnStreamReady(mojo::ScopedDataPipeConsumerHandle()); |
| 69 } | 69 } |
| 70 | 70 |
| 71 } // namespace media | 71 } // namespace media |
| OLD | NEW |