| 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_adapter.h" | 5 #include "media/mojo/services/mojo_demuxer_stream_adapter.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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 void MojoDemuxerStreamAdapter::OnBufferReady( | 90 void MojoDemuxerStreamAdapter::OnBufferReady( |
| 91 interfaces::DemuxerStream::Status status, | 91 interfaces::DemuxerStream::Status status, |
| 92 interfaces::DecoderBufferPtr buffer, | 92 interfaces::DecoderBufferPtr buffer, |
| 93 interfaces::AudioDecoderConfigPtr audio_config, | 93 interfaces::AudioDecoderConfigPtr audio_config, |
| 94 interfaces::VideoDecoderConfigPtr video_config) { | 94 interfaces::VideoDecoderConfigPtr video_config) { |
| 95 DVLOG(3) << __FUNCTION__; | 95 DVLOG(3) << __FUNCTION__; |
| 96 DCHECK(!read_cb_.is_null()); | 96 DCHECK(!read_cb_.is_null()); |
| 97 DCHECK_NE(type_, DemuxerStream::UNKNOWN); | 97 DCHECK_NE(type_, DemuxerStream::UNKNOWN); |
| 98 DCHECK(stream_pipe_.is_valid()); | 98 DCHECK(stream_pipe_.is_valid()); |
| 99 | 99 |
| 100 if (status == interfaces::DemuxerStream::STATUS_CONFIG_CHANGED) { | 100 if (status == interfaces::DemuxerStream::Status::CONFIG_CHANGED) { |
| 101 UpdateConfig(std::move(audio_config), std::move(video_config)); | 101 UpdateConfig(std::move(audio_config), std::move(video_config)); |
| 102 base::ResetAndReturn(&read_cb_).Run(DemuxerStream::kConfigChanged, nullptr); | 102 base::ResetAndReturn(&read_cb_).Run(DemuxerStream::kConfigChanged, nullptr); |
| 103 return; | 103 return; |
| 104 } | 104 } |
| 105 | 105 |
| 106 if (status == interfaces::DemuxerStream::STATUS_ABORTED) { | 106 if (status == interfaces::DemuxerStream::Status::ABORTED) { |
| 107 base::ResetAndReturn(&read_cb_).Run(DemuxerStream::kAborted, nullptr); | 107 base::ResetAndReturn(&read_cb_).Run(DemuxerStream::kAborted, nullptr); |
| 108 return; | 108 return; |
| 109 } | 109 } |
| 110 | 110 |
| 111 DCHECK_EQ(status, interfaces::DemuxerStream::STATUS_OK); | 111 DCHECK_EQ(status, interfaces::DemuxerStream::Status::OK); |
| 112 scoped_refptr<DecoderBuffer> media_buffer( | 112 scoped_refptr<DecoderBuffer> media_buffer( |
| 113 buffer.To<scoped_refptr<DecoderBuffer>>()); | 113 buffer.To<scoped_refptr<DecoderBuffer>>()); |
| 114 | 114 |
| 115 if (!media_buffer->end_of_stream()) { | 115 if (!media_buffer->end_of_stream()) { |
| 116 DCHECK_GT(media_buffer->data_size(), 0u); | 116 DCHECK_GT(media_buffer->data_size(), 0u); |
| 117 | 117 |
| 118 // Wait for the data to become available in the DataPipe. | 118 // Wait for the data to become available in the DataPipe. |
| 119 MojoHandleSignalsState state; | 119 MojoHandleSignalsState state; |
| 120 CHECK_EQ(MOJO_RESULT_OK, | 120 CHECK_EQ(MOJO_RESULT_OK, |
| 121 MojoWait(stream_pipe_.get().value(), MOJO_HANDLE_SIGNAL_READABLE, | 121 MojoWait(stream_pipe_.get().value(), MOJO_HANDLE_SIGNAL_READABLE, |
| (...skipping 26 matching lines...) Expand all Loading... |
| 148 case DemuxerStream::VIDEO: | 148 case DemuxerStream::VIDEO: |
| 149 DCHECK(video_config && !audio_config); | 149 DCHECK(video_config && !audio_config); |
| 150 video_config_ = video_config.To<VideoDecoderConfig>(); | 150 video_config_ = video_config.To<VideoDecoderConfig>(); |
| 151 break; | 151 break; |
| 152 default: | 152 default: |
| 153 NOTREACHED(); | 153 NOTREACHED(); |
| 154 } | 154 } |
| 155 } | 155 } |
| 156 | 156 |
| 157 } // namespace media | 157 } // namespace media |
| OLD | NEW |