1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#![allow(non_camel_case_types, non_snake_case)]
use crate::decl::*;
use crate::mf::vts::*;
use crate::ole::privs::*;
use crate::prelude::*;
com_interface! { IMFPresentationDescriptor: "03cb2711-24d7-4db6-a17f-f3a7a479a536";
/// [`IMFPresentationDescriptor`](https://learn.microsoft.com/en-us/windows/win32/api/mfidl/nn-mfidl-imfpresentationdescriptor)
/// COM interface.
///
/// Automatically calls
/// [`Release`](https://learn.microsoft.com/en-us/windows/win32/api/unknwn/nf-unknwn-iunknown-release)
/// when the object goes out of scope.
}
impl mf_IMFAttributes for IMFPresentationDescriptor {}
impl mf_IMFPresentationDescriptor for IMFPresentationDescriptor {}
/// This trait is enabled with the `mf` feature, and provides methods for
/// [`IMFPresentationDescriptor`](crate::IMFPresentationDescriptor).
///
/// Prefer importing this trait through the prelude:
///
/// ```no_run
/// use winsafe::prelude::*;
/// ```
pub trait mf_IMFPresentationDescriptor: mf_IMFAttributes {
fn_com_interface_get! { Clone: IMFPresentationDescriptorVT => IMFPresentationDescriptor;
/// [`IMFPresentationDescriptor::Clone`](https://learn.microsoft.com/en-us/windows/win32/api/mfidl/nf-mfidl-imfpresentationdescriptor-clone)
/// method.
}
/// [`IMFPresentationDescriptor::DeselectStream`](https://learn.microsoft.com/en-us/windows/win32/api/mfidl/nf-mfidl-imfpresentationdescriptor-deselectstream)
/// method.
fn DeselectStream(&self, descriptor_index: u32) -> HrResult<()> {
HrRet(unsafe {
(vt::<IMFPresentationDescriptorVT>(self).DeselectStream)(self.ptr(), descriptor_index)
}).to_hrresult()
}
/// [`IMFPresentationDescriptor::GetStreamDescriptorByIndex`](https://learn.microsoft.com/en-us/windows/win32/api/mfidl/nf-mfidl-imfpresentationdescriptor-getstreamdescriptorbyindex)
/// method.
#[must_use]
fn GetStreamDescriptorByIndex(&self, index: u32) -> HrResult<(bool, IMFStreamDescriptor)> {
let mut selected = 0;
let mut queried = unsafe { IMFStreamDescriptor::null() };
HrRet(unsafe {
(vt::<IMFPresentationDescriptorVT>(self).GetStreamDescriptorByIndex)(
self.ptr(),
index,
&mut selected,
queried.as_mut(),
)
}).to_hrresult()
.map(|_| (selected != 0, queried))
}
/// [`IMFPresentationDescriptor::GetStreamDescriptorCount`](https://learn.microsoft.com/en-us/windows/win32/api/mfidl/nf-mfidl-imfpresentationdescriptor-getstreamdescriptorcount)
/// method.
#[must_use]
fn GetStreamDescriptorCount(&self) -> HrResult<u32> {
let mut descriptor_count = 0u32;
HrRet(unsafe {
(vt::<IMFPresentationDescriptorVT>(self).GetStreamDescriptorCount)(
self.ptr(),
&mut descriptor_count,
)
}).to_hrresult()
.map(|_| descriptor_count)
}
/// [`IMFPresentationDescriptor::SelectStream`](https://learn.microsoft.com/en-us/windows/win32/api/mfidl/nf-mfidl-imfpresentationdescriptor-selectstream)
/// method.
fn SelectStream(&self, descriptor_index: u32) -> HrResult<()> {
HrRet(unsafe {
(vt::<IMFPresentationDescriptorVT>(self).SelectStream)(self.ptr(), descriptor_index)
}).to_hrresult()
}
}