Skip to content

Commit

Permalink
fixed merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
sidit77 committed May 29, 2024
1 parent 8215207 commit cc757a5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ ndk-glue = "0.7"

[target.'cfg(target_os = "windows")'.dependencies]
windows = { version = "0.54.0", features = [
"implement",
"Win32_Media_Audio",
"Win32_Foundation",
"Win32_Devices_Properties",
Expand Down
14 changes: 7 additions & 7 deletions src/host/wasapi/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ use std::time::Duration;

use super::com;
use super::{windows_err_to_cpal_err, windows_err_to_cpal_err_message};
use windows::core::Interface;
use windows::core::{HRESULT, implement, Interface, IUnknown, PCWSTR, PROPVARIANT};
use windows::core::GUID;
use windows::Win32::Devices::Properties;
use windows::Win32::Foundation;
use windows::Win32::Media::Audio::IAudioRenderClient;
use windows::Win32::Media::{Audio, KernelStreaming, Multimedia};
use windows::Win32::System::Com;
use windows::Win32::System::Com::{StructuredStorage, STGM_READ};
use windows::Win32::System::Com::{StructuredStorage, STGM_READ, CoTaskMemFree, StringFromIID};
use windows::Win32::System::Threading;
use windows::Win32::System::Variant::VT_LPWSTR;

Expand Down Expand Up @@ -284,11 +284,11 @@ unsafe fn format_from_waveformatex_ptr(
}

#[implement(Audio::IActivateAudioInterfaceCompletionHandler)]
struct CompletionHandler(Sender<WinResult<IUnknown>>);
struct CompletionHandler(Sender<windows::core::Result<IUnknown>>);

fn retrieve_result(
operation: &Audio::IActivateAudioInterfaceAsyncOperation,
) -> WinResult<IUnknown> {
) -> windows::core::Result<IUnknown> {
let mut result = HRESULT::default();
let mut interface: Option<IUnknown> = None;
unsafe {
Expand All @@ -302,7 +302,7 @@ impl Audio::IActivateAudioInterfaceCompletionHandler_Impl for CompletionHandler
fn ActivateCompleted(
&self,
operation: Option<&Audio::IActivateAudioInterfaceAsyncOperation>,
) -> WinResult<()> {
) -> windows::core::Result<()> {
let result = retrieve_result(operation.unwrap());
let _ = self.0.send(result);
Ok(())
Expand All @@ -313,10 +313,10 @@ impl Audio::IActivateAudioInterfaceCompletionHandler_Impl for CompletionHandler
unsafe fn ActivateAudioInterfaceSync<P0, T>(
deviceinterfacepath: P0,
activationparams: Option<*const PROPVARIANT>,
) -> WinResult<T>
) -> windows::core::Result<T>
where
P0: windows::core::IntoParam<PCWSTR>,
T: Interface + ComInterface,
T: Interface,
{
let (sender, receiver) = std::sync::mpsc::channel();
let completion: Audio::IActivateAudioInterfaceCompletionHandler =
Expand Down

0 comments on commit cc757a5

Please sign in to comment.