| Index: media/mojo/clients/mojo_demuxer_stream_impl.cc
|
| diff --git a/media/mojo/clients/mojo_demuxer_stream_impl.cc b/media/mojo/clients/mojo_demuxer_stream_impl.cc
|
| index dea19dc4a203090011a489ce2e929232ea4b825d..e952e43f76478a97ba3c2a82c9cfa3808766b6d7 100644
|
| --- a/media/mojo/clients/mojo_demuxer_stream_impl.cc
|
| +++ b/media/mojo/clients/mojo_demuxer_stream_impl.cc
|
| @@ -35,10 +35,10 @@ void MojoDemuxerStreamImpl::Initialize(const InitializeCallback& callback) {
|
| // Prepare the initial config.
|
| mojom::AudioDecoderConfigPtr audio_config;
|
| mojom::VideoDecoderConfigPtr video_config;
|
| - if (stream_->type() == media::DemuxerStream::AUDIO) {
|
| + if (stream_->type() == Type::AUDIO) {
|
| audio_config =
|
| mojom::AudioDecoderConfig::From(stream_->audio_decoder_config());
|
| - } else if (stream_->type() == media::DemuxerStream::VIDEO) {
|
| + } else if (stream_->type() == Type::VIDEO) {
|
| video_config =
|
| mojom::VideoDecoderConfig::From(stream_->video_decoder_config());
|
| } else {
|
| @@ -50,9 +50,8 @@ void MojoDemuxerStreamImpl::Initialize(const InitializeCallback& callback) {
|
| mojo_decoder_buffer_writer_ =
|
| MojoDecoderBufferWriter::Create(stream_->type(), &remote_consumer_handle);
|
|
|
| - callback.Run(static_cast<mojom::DemuxerStream::Type>(stream_->type()),
|
| - std::move(remote_consumer_handle), std::move(audio_config),
|
| - std::move(video_config));
|
| + callback.Run(stream_->type(), std::move(remote_consumer_handle),
|
| + std::move(audio_config), std::move(video_config));
|
| }
|
|
|
| void MojoDemuxerStreamImpl::Read(const ReadCallback& callback) {
|
| @@ -66,19 +65,19 @@ void MojoDemuxerStreamImpl::EnableBitstreamConverter() {
|
|
|
| void MojoDemuxerStreamImpl::OnBufferReady(
|
| const ReadCallback& callback,
|
| - media::DemuxerStream::Status status,
|
| + Status status,
|
| const scoped_refptr<media::DecoderBuffer>& buffer) {
|
| mojom::AudioDecoderConfigPtr audio_config;
|
| mojom::VideoDecoderConfigPtr video_config;
|
|
|
| - if (status == media::DemuxerStream::kConfigChanged) {
|
| + if (status == Status::kConfigChanged) {
|
| DVLOG(2) << __FUNCTION__ << ": ConfigChange!";
|
| // Send the config change so our client can read it once it parses the
|
| // Status obtained via Run() below.
|
| - if (stream_->type() == media::DemuxerStream::AUDIO) {
|
| + if (stream_->type() == Type::AUDIO) {
|
| audio_config =
|
| mojom::AudioDecoderConfig::From(stream_->audio_decoder_config());
|
| - } else if (stream_->type() == media::DemuxerStream::VIDEO) {
|
| + } else if (stream_->type() == Type::VIDEO) {
|
| video_config =
|
| mojom::VideoDecoderConfig::From(stream_->video_decoder_config());
|
| } else {
|
| @@ -86,35 +85,31 @@ void MojoDemuxerStreamImpl::OnBufferReady(
|
| << stream_->type();
|
| }
|
|
|
| - callback.Run(mojom::DemuxerStream::Status::CONFIG_CHANGED,
|
| - mojom::DecoderBufferPtr(), std::move(audio_config),
|
| - std::move(video_config));
|
| + callback.Run(Status::kConfigChanged, mojom::DecoderBufferPtr(),
|
| + std::move(audio_config), std::move(video_config));
|
| return;
|
| }
|
|
|
| - if (status == media::DemuxerStream::kAborted) {
|
| - callback.Run(mojom::DemuxerStream::Status::ABORTED,
|
| - mojom::DecoderBufferPtr(), std::move(audio_config),
|
| - std::move(video_config));
|
| + if (status == Status::kAborted) {
|
| + callback.Run(Status::kAborted, mojom::DecoderBufferPtr(),
|
| + std::move(audio_config), std::move(video_config));
|
| return;
|
| }
|
|
|
| - DCHECK_EQ(status, media::DemuxerStream::kOk);
|
| + DCHECK_EQ(status, Status::kOk);
|
|
|
| mojom::DecoderBufferPtr mojo_buffer =
|
| mojo_decoder_buffer_writer_->WriteDecoderBuffer(buffer);
|
| if (!mojo_buffer) {
|
| - callback.Run(mojom::DemuxerStream::Status::ABORTED,
|
| - mojom::DecoderBufferPtr(), std::move(audio_config),
|
| - std::move(video_config));
|
| + callback.Run(Status::kAborted, mojom::DecoderBufferPtr(),
|
| + std::move(audio_config), std::move(video_config));
|
| return;
|
| }
|
|
|
| // TODO(dalecurtis): Once we can write framed data to the DataPipe, fill via
|
| // the producer handle and then read more to keep the pipe full. Waiting for
|
| // space can be accomplished using an AsyncWaiter.
|
| - callback.Run(static_cast<mojom::DemuxerStream::Status>(status),
|
| - std::move(mojo_buffer), std::move(audio_config),
|
| + callback.Run(status, std::move(mojo_buffer), std::move(audio_config),
|
| std::move(video_config));
|
| }
|
|
|
|
|