| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 <memory> | 5 #include <memory> |
| 6 | 6 |
| 7 #include "mojo/public/c/system/main.h" | 7 #include "mojo/public/c/system/main.h" |
| 8 #include "mojo/public/cpp/application/application_delegate.h" | 8 #include "mojo/public/cpp/application/application_delegate.h" |
| 9 #include "mojo/public/cpp/application/application_impl.h" | 9 #include "mojo/public/cpp/application/application_impl.h" |
| 10 #include "mojo/public/cpp/application/application_runner.h" | 10 #include "mojo/public/cpp/application/application_runner.h" |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 AudioTrackConfigurationPtr cfg; | 260 AudioTrackConfigurationPtr cfg; |
| 261 cfg = AudioTrackConfiguration::New(); | 261 cfg = AudioTrackConfiguration::New(); |
| 262 cfg->max_frames = USecToFrames(BUF_DEPTH_USEC); | 262 cfg->max_frames = USecToFrames(BUF_DEPTH_USEC); |
| 263 cfg->audio_frame_ratio = tmp.numerator; | 263 cfg->audio_frame_ratio = tmp.numerator; |
| 264 cfg->media_time_ratio = tmp.denominator; | 264 cfg->media_time_ratio = tmp.denominator; |
| 265 | 265 |
| 266 LpcmMediaTypeDetailsPtr pcm_cfg = LpcmMediaTypeDetails::New(); | 266 LpcmMediaTypeDetailsPtr pcm_cfg = LpcmMediaTypeDetails::New(); |
| 267 pcm_cfg->sample_format = (wav_info_.bits_per_sample == 8) | 267 pcm_cfg->sample_format = (wav_info_.bits_per_sample == 8) |
| 268 ? LpcmSampleFormat::UNSIGNED_8 | 268 ? LpcmSampleFormat::UNSIGNED_8 |
| 269 : LpcmSampleFormat::SIGNED_16; | 269 : LpcmSampleFormat::SIGNED_16; |
| 270 pcm_cfg->samples_per_frame = wav_info_.channel_count; | 270 pcm_cfg->interleaved = true; |
| 271 pcm_cfg->channels = wav_info_.channel_count; |
| 271 pcm_cfg->frames_per_second = wav_info_.frame_rate; | 272 pcm_cfg->frames_per_second = wav_info_.frame_rate; |
| 272 | 273 |
| 273 cfg->media_type = MediaType::New(); | 274 cfg->media_type = MediaType::New(); |
| 274 cfg->media_type->scheme = MediaTypeScheme::LPCM; | 275 cfg->media_type->scheme = MediaTypeScheme::LPCM; |
| 275 cfg->media_type->details = MediaTypeDetails::New(); | 276 cfg->media_type->details = MediaTypeDetails::New(); |
| 276 cfg->media_type->details->set_lpcm(pcm_cfg.Pass()); | 277 cfg->media_type->details->set_lpcm(pcm_cfg.Pass()); |
| 277 | 278 |
| 278 // Configure the track based on the WAV header information. | 279 // Configure the track based on the WAV header information. |
| 279 MediaPipePtr media_pipe; | 280 MediaPipePtr media_pipe; |
| 280 audio_track_->Configure(cfg.Pass(), GetProxy(&media_pipe), | 281 audio_track_->Configure(cfg.Pass(), GetProxy(&media_pipe), |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 559 | 560 |
| 560 } // namespace examples | 561 } // namespace examples |
| 561 } // namespace audio | 562 } // namespace audio |
| 562 } // namespace media | 563 } // namespace media |
| 563 } // namespace mojo | 564 } // namespace mojo |
| 564 | 565 |
| 565 MojoResult MojoMain(MojoHandle app_request) { | 566 MojoResult MojoMain(MojoHandle app_request) { |
| 566 mojo::ApplicationRunner runner(new mojo::media::audio::examples::PlayWAVApp); | 567 mojo::ApplicationRunner runner(new mojo::media::audio::examples::PlayWAVApp); |
| 567 return runner.Run(app_request); | 568 return runner.Run(app_request); |
| 568 } | 569 } |
| OLD | NEW |