Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(42)

Side by Side Diff: media/mojo/clients/mojo_audio_decoder.cc

Issue 2408063009: media: Use native DecodeStatus in media mojo interfaces (Closed)
Patch Set: comments addressed Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « media/mojo/clients/mojo_audio_decoder.h ('k') | media/mojo/clients/mojo_video_decoder.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/clients/mojo_audio_decoder.h" 5 #include "media/mojo/clients/mojo_audio_decoder.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/callback_helpers.h" 9 #include "base/callback_helpers.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 mojo::ScopedDataPipeConsumerHandle remote_consumer_handle; 168 mojo::ScopedDataPipeConsumerHandle remote_consumer_handle;
169 mojo_decoder_buffer_writer_ = MojoDecoderBufferWriter::Create( 169 mojo_decoder_buffer_writer_ = MojoDecoderBufferWriter::Create(
170 DemuxerStream::AUDIO, &remote_consumer_handle); 170 DemuxerStream::AUDIO, &remote_consumer_handle);
171 // Pass consumer end to |remote_decoder_|. 171 // Pass consumer end to |remote_decoder_|.
172 remote_decoder_->SetDataSource(std::move(remote_consumer_handle)); 172 remote_decoder_->SetDataSource(std::move(remote_consumer_handle));
173 } 173 }
174 174
175 base::ResetAndReturn(&init_cb_).Run(success); 175 base::ResetAndReturn(&init_cb_).Run(success);
176 } 176 }
177 177
178 void MojoAudioDecoder::OnDecodeStatus(mojom::DecodeStatus status) { 178 void MojoAudioDecoder::OnDecodeStatus(DecodeStatus status) {
179 DVLOG(1) << __FUNCTION__ << ": status:" << status; 179 DVLOG(1) << __FUNCTION__ << ": status:" << status;
180 DCHECK(task_runner_->BelongsToCurrentThread()); 180 DCHECK(task_runner_->BelongsToCurrentThread());
181 181
182 DCHECK(!decode_cb_.is_null()); 182 DCHECK(!decode_cb_.is_null());
183 base::ResetAndReturn(&decode_cb_).Run(static_cast<DecodeStatus>(status)); 183 base::ResetAndReturn(&decode_cb_).Run(status);
184 } 184 }
185 185
186 void MojoAudioDecoder::OnResetDone() { 186 void MojoAudioDecoder::OnResetDone() {
187 DVLOG(1) << __FUNCTION__; 187 DVLOG(1) << __FUNCTION__;
188 DCHECK(task_runner_->BelongsToCurrentThread()); 188 DCHECK(task_runner_->BelongsToCurrentThread());
189 189
190 // For pending decodes OnDecodeStatus() should arrive before OnResetDone(). 190 // For pending decodes OnDecodeStatus() should arrive before OnResetDone().
191 DCHECK(decode_cb_.is_null()); 191 DCHECK(decode_cb_.is_null());
192 192
193 DCHECK(!reset_cb_.is_null()); 193 DCHECK(!reset_cb_.is_null());
194 base::ResetAndReturn(&reset_cb_).Run(); 194 base::ResetAndReturn(&reset_cb_).Run();
195 } 195 }
196 196
197 } // namespace media 197 } // namespace media
OLDNEW
« no previous file with comments | « media/mojo/clients/mojo_audio_decoder.h ('k') | media/mojo/clients/mojo_video_decoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698