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

Side by Side Diff: media/audio/audio_output_device.cc

Issue 2466463005: Support (E)AC3 passthrough
Patch Set: Add unit tests Created 3 years, 6 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/audio/audio_output_device.h" 5 #include "media/audio/audio_output_device.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <cmath> 10 #include <cmath>
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 base::TimeDelta delay = 487 base::TimeDelta delay =
488 base::TimeDelta::FromMicroseconds(buffer->params.delay); 488 base::TimeDelta::FromMicroseconds(buffer->params.delay);
489 489
490 base::TimeTicks delay_timestamp = 490 base::TimeTicks delay_timestamp =
491 base::TimeTicks() + 491 base::TimeTicks() +
492 base::TimeDelta::FromMicroseconds(buffer->params.delay_timestamp); 492 base::TimeDelta::FromMicroseconds(buffer->params.delay_timestamp);
493 493
494 DVLOG(4) << __func__ << " delay:" << delay << " delay_timestamp:" << delay 494 DVLOG(4) << __func__ << " delay:" << delay << " delay_timestamp:" << delay
495 << " frames_skipped:" << frames_skipped; 495 << " frames_skipped:" << frames_skipped;
496 496
497 output_bus_->set_is_bitstream_format(audio_parameters_.IsBitstreamFormat());
DaleCurtis 2017/06/15 21:46:31 if (audio_parameters_.IsBitstreamFormat()) { out
AndyWu 2017/08/02 01:43:39 Done.
498 if (audio_parameters_.IsBitstreamFormat()) {
499 // Reset the data size and frame count.
500 // For compressed audio formats, the data size and frame count will be
501 // updated by |render_callback_|.
502 output_bus_->set_data_size(0);
503 output_bus_->set_frames(audio_parameters_.frames_per_buffer());
504 }
505
497 // Update the audio-delay measurement, inform about the number of skipped 506 // Update the audio-delay measurement, inform about the number of skipped
498 // frames, and ask client to render audio. Since |output_bus_| is wrapping 507 // frames, and ask client to render audio. Since |output_bus_| is wrapping
499 // the shared memory the Render() call is writing directly into the shared 508 // the shared memory the Render() call is writing directly into the shared
500 // memory. 509 // memory.
501 render_callback_->Render(delay, delay_timestamp, frames_skipped, 510 render_callback_->Render(delay, delay_timestamp, frames_skipped,
502 output_bus_.get()); 511 output_bus_.get());
512 buffer->params.frames = output_bus_->frames();
DaleCurtis 2017/06/15 21:46:31 Hmm, this is always audio_parameters_.frames_per_b
AndyWu 2017/08/02 01:43:39 To make things clear, I changed to GetBitstreamFra
513 buffer->params.data_size = output_bus_->data_size();
503 } 514 }
504 515
505 bool AudioOutputDevice::AudioThreadCallback:: 516 bool AudioOutputDevice::AudioThreadCallback::
506 CurrentThreadIsAudioDeviceThread() { 517 CurrentThreadIsAudioDeviceThread() {
507 return thread_checker_.CalledOnValidThread(); 518 return thread_checker_.CalledOnValidThread();
508 } 519 }
509 520
510 } // namespace media 521 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698