| OLD | NEW |
| 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_unified_win.h" | 5 #include "media/audio/win/audio_unified_win.h" |
| 6 | 6 |
| 7 #include <Functiondiscoverykeys_devpkey.h> | 7 #include <Functiondiscoverykeys_devpkey.h> |
| 8 | 8 |
| 9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
| 10 #include "base/time.h" | 10 #include "base/time.h" |
| (...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 563 if (mm_task && !avrt::AvRevertMmThreadCharacteristics(mm_task)) { | 563 if (mm_task && !avrt::AvRevertMmThreadCharacteristics(mm_task)) { |
| 564 PLOG(WARNING) << "Failed to disable MMCSS"; | 564 PLOG(WARNING) << "Failed to disable MMCSS"; |
| 565 } | 565 } |
| 566 } | 566 } |
| 567 | 567 |
| 568 void WASAPIUnifiedStream::HandleError(HRESULT err) { | 568 void WASAPIUnifiedStream::HandleError(HRESULT err) { |
| 569 CHECK((started() && GetCurrentThreadId() == audio_io_thread_->tid()) || | 569 CHECK((started() && GetCurrentThreadId() == audio_io_thread_->tid()) || |
| 570 (!started() && GetCurrentThreadId() == creating_thread_id_)); | 570 (!started() && GetCurrentThreadId() == creating_thread_id_)); |
| 571 NOTREACHED() << "Error code: " << std::hex << err; | 571 NOTREACHED() << "Error code: " << std::hex << err; |
| 572 if (source_) | 572 if (source_) |
| 573 source_->OnError(this, static_cast<int>(err)); | 573 source_->OnError(this); |
| 574 } | 574 } |
| 575 | 575 |
| 576 void WASAPIUnifiedStream::StopAndJoinThread(HRESULT err) { | 576 void WASAPIUnifiedStream::StopAndJoinThread(HRESULT err) { |
| 577 CHECK(GetCurrentThreadId() == creating_thread_id_); | 577 CHECK(GetCurrentThreadId() == creating_thread_id_); |
| 578 DCHECK(audio_io_thread_.get()); | 578 DCHECK(audio_io_thread_.get()); |
| 579 SetEvent(stop_streaming_event_.Get()); | 579 SetEvent(stop_streaming_event_.Get()); |
| 580 audio_io_thread_->Join(); | 580 audio_io_thread_->Join(); |
| 581 audio_io_thread_.reset(); | 581 audio_io_thread_.reset(); |
| 582 HandleError(err); | 582 HandleError(err); |
| 583 } | 583 } |
| 584 | 584 |
| 585 } // namespace media | 585 } // namespace media |
| OLD | NEW |