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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
9 #include "media/base/decoder_buffer.h" | 9 #include "media/base/decoder_buffer.h" |
10 #include "media/mojo/services/media_type_converters.h" | 10 #include "media/mojo/services/media_type_converters.h" |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 | 78 |
79 type_ = static_cast<DemuxerStream::Type>(type); | 79 type_ = static_cast<DemuxerStream::Type>(type); |
80 stream_pipe_ = pipe.Pass(); | 80 stream_pipe_ = pipe.Pass(); |
81 UpdateConfig(audio_config.Pass(), video_config.Pass()); | 81 UpdateConfig(audio_config.Pass(), video_config.Pass()); |
82 | 82 |
83 stream_ready_cb_.Run(); | 83 stream_ready_cb_.Run(); |
84 } | 84 } |
85 | 85 |
86 void MojoDemuxerStreamAdapter::OnBufferReady( | 86 void MojoDemuxerStreamAdapter::OnBufferReady( |
87 interfaces::DemuxerStream::Status status, | 87 interfaces::DemuxerStream::Status status, |
88 interfaces::MediaDecoderBufferPtr buffer, | 88 interfaces::DecoderBufferPtr buffer, |
89 interfaces::AudioDecoderConfigPtr audio_config, | 89 interfaces::AudioDecoderConfigPtr audio_config, |
90 interfaces::VideoDecoderConfigPtr video_config) { | 90 interfaces::VideoDecoderConfigPtr video_config) { |
91 DVLOG(3) << __FUNCTION__; | 91 DVLOG(3) << __FUNCTION__; |
92 DCHECK(!read_cb_.is_null()); | 92 DCHECK(!read_cb_.is_null()); |
93 DCHECK_NE(type_, DemuxerStream::UNKNOWN); | 93 DCHECK_NE(type_, DemuxerStream::UNKNOWN); |
94 DCHECK(stream_pipe_.is_valid()); | 94 DCHECK(stream_pipe_.is_valid()); |
95 | 95 |
96 if (status == interfaces::DemuxerStream::STATUS_CONFIG_CHANGED) { | 96 if (status == interfaces::DemuxerStream::STATUS_CONFIG_CHANGED) { |
97 UpdateConfig(audio_config.Pass(), video_config.Pass()); | 97 UpdateConfig(audio_config.Pass(), video_config.Pass()); |
98 base::ResetAndReturn(&read_cb_).Run(DemuxerStream::kConfigChanged, nullptr); | 98 base::ResetAndReturn(&read_cb_).Run(DemuxerStream::kConfigChanged, nullptr); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 case DemuxerStream::VIDEO: | 135 case DemuxerStream::VIDEO: |
136 DCHECK(video_config && !audio_config); | 136 DCHECK(video_config && !audio_config); |
137 video_config_ = video_config.To<VideoDecoderConfig>(); | 137 video_config_ = video_config.To<VideoDecoderConfig>(); |
138 break; | 138 break; |
139 default: | 139 default: |
140 NOTREACHED(); | 140 NOTREACHED(); |
141 } | 141 } |
142 } | 142 } |
143 | 143 |
144 } // namespace media | 144 } // namespace media |
OLD | NEW |