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

Side by Side Diff: media/audio/win/audio_low_latency_input_win.cc

Issue 598243002: Remove implicit HANDLE conversions from media. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 | « no previous file | media/audio/win/audio_low_latency_output_win.cc » ('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 (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/win/audio_low_latency_input_win.h" 5 #include "media/audio/win/audio_low_latency_input_win.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "media/audio/win/audio_manager_win.h" 10 #include "media/audio/win/audio_manager_win.h"
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 size_t buffer_frame_index = 0; 358 size_t buffer_frame_index = 0;
359 size_t capture_buffer_size = std::max( 359 size_t capture_buffer_size = std::max(
360 2 * endpoint_buffer_size_frames_ * frame_size_, 360 2 * endpoint_buffer_size_frames_ * frame_size_,
361 2 * packet_size_frames_ * frame_size_); 361 2 * packet_size_frames_ * frame_size_);
362 scoped_ptr<uint8[]> capture_buffer(new uint8[capture_buffer_size]); 362 scoped_ptr<uint8[]> capture_buffer(new uint8[capture_buffer_size]);
363 363
364 LARGE_INTEGER now_count; 364 LARGE_INTEGER now_count;
365 bool recording = true; 365 bool recording = true;
366 bool error = false; 366 bool error = false;
367 double volume = GetVolume(); 367 double volume = GetVolume();
368 HANDLE wait_array[2] = {stop_capture_event_, audio_samples_ready_event_}; 368 HANDLE wait_array[2] =
369 { stop_capture_event_.Get(), audio_samples_ready_event_.Get() };
369 370
370 while (recording && !error) { 371 while (recording && !error) {
371 HRESULT hr = S_FALSE; 372 HRESULT hr = S_FALSE;
372 373
373 // Wait for a close-down event or a new capture event. 374 // Wait for a close-down event or a new capture event.
374 DWORD wait_result = WaitForMultipleObjects(2, wait_array, FALSE, INFINITE); 375 DWORD wait_result = WaitForMultipleObjects(2, wait_array, FALSE, INFINITE);
375 switch (wait_result) { 376 switch (wait_result) {
376 case WAIT_FAILED: 377 case WAIT_FAILED:
377 error = true; 378 error = true;
378 break; 379 break;
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
741 return hr; 742 return hr;
742 743
743 // Obtain a reference to the ISimpleAudioVolume interface which enables 744 // Obtain a reference to the ISimpleAudioVolume interface which enables
744 // us to control the master volume level of an audio session. 745 // us to control the master volume level of an audio session.
745 hr = audio_client_->GetService(__uuidof(ISimpleAudioVolume), 746 hr = audio_client_->GetService(__uuidof(ISimpleAudioVolume),
746 simple_audio_volume_.ReceiveVoid()); 747 simple_audio_volume_.ReceiveVoid());
747 return hr; 748 return hr;
748 } 749 }
749 750
750 } // namespace media 751 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | media/audio/win/audio_low_latency_output_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698