|
4 | 4 | // accompanying file LICENSE for details |
5 | 5 |
|
6 | 6 | use cubeb_core::{ |
7 | | - ffi, DeviceInfo, DeviceRef, DeviceType, InputProcessingParams, StreamParams, StreamParamsRef, |
| 7 | + ffi, DeviceInfo, DeviceType, InputProcessingParams, StreamParams, StreamParamsRef, |
8 | 8 | }; |
9 | 9 | use std::ffi::CStr; |
10 | 10 | use std::mem; |
@@ -54,11 +54,9 @@ macro_rules! capi_new( |
54 | 54 | stream_get_input_latency: Some($crate::capi::capi_stream_get_input_latency::<$stm>), |
55 | 55 | stream_set_volume: Some($crate::capi::capi_stream_set_volume::<$stm>), |
56 | 56 | stream_set_name: Some($crate::capi::capi_stream_set_name::<$stm>), |
57 | | - stream_get_current_device: Some($crate::capi::capi_stream_get_current_device::<$stm>), |
58 | 57 | stream_set_input_mute: Some($crate::capi::capi_stream_set_input_mute::<$stm>), |
59 | 58 | stream_set_input_processing_params: |
60 | 59 | Some($crate::capi::capi_stream_set_input_processing_params::<$stm>), |
61 | | - stream_device_destroy: Some($crate::capi::capi_stream_device_destroy::<$stm>), |
62 | 60 | stream_register_device_changed_callback: |
63 | 61 | Some($crate::capi::capi_stream_register_device_changed_callback::<$stm>), |
64 | 62 | register_device_collection_changed: |
@@ -381,22 +379,6 @@ pub unsafe extern "C" fn capi_stream_set_name<STM: StreamOps>( |
381 | 379 | } |
382 | 380 | } |
383 | 381 |
|
384 | | -/// # Safety |
385 | | -/// |
386 | | -/// Entry point from C code. |
387 | | -/// |
388 | | -/// This function is unsafe because it dereferences the given `s` and `device` pointers. |
389 | | -/// The caller should ensure those pointers are valid. |
390 | | -pub unsafe extern "C" fn capi_stream_get_current_device<STM: StreamOps>( |
391 | | - s: *mut ffi::cubeb_stream, |
392 | | - device: *mut *mut ffi::cubeb_device, |
393 | | -) -> i32 { |
394 | | - let stm = &mut *(s as *mut STM); |
395 | | - |
396 | | - *device = _try!(stm.current_device()).as_ptr(); |
397 | | - ffi::CUBEB_OK |
398 | | -} |
399 | | - |
400 | 382 | /// # Safety |
401 | 383 | /// |
402 | 384 | /// Entry point from C code. |
@@ -427,25 +409,6 @@ pub unsafe extern "C" fn capi_stream_set_input_processing_params<STM: StreamOps> |
427 | 409 | ffi::CUBEB_OK |
428 | 410 | } |
429 | 411 |
|
430 | | -/// # Safety |
431 | | -/// |
432 | | -/// Entry point from C code. |
433 | | -/// |
434 | | -/// This function is unsafe because it dereferences the given `s` and `device` pointers. |
435 | | -/// The caller should ensure those pointers are valid. |
436 | | -pub unsafe extern "C" fn capi_stream_device_destroy<STM: StreamOps>( |
437 | | - s: *mut ffi::cubeb_stream, |
438 | | - device: *mut ffi::cubeb_device, |
439 | | -) -> c_int { |
440 | | - let stm = &mut *(s as *mut STM); |
441 | | - if device.is_null() { |
442 | | - return ffi::CUBEB_ERROR_INVALID_PARAMETER; |
443 | | - } |
444 | | - let device = DeviceRef::from_ptr(device); |
445 | | - let _ = stm.device_destroy(device); |
446 | | - ffi::CUBEB_OK |
447 | | -} |
448 | | - |
449 | 412 | /// # Safety |
450 | 413 | /// |
451 | 414 | /// Entry point from C code. |
|
0 commit comments