forked from naudio/NAudio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIMFAttributes.cs
170 lines (140 loc) · 7.1 KB
/
IMFAttributes.cs
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
using System;
using System.Runtime.InteropServices;
using System.Text;
using NAudio.CoreAudioApi.Interfaces;
namespace NAudio.MediaFoundation
{
/// <summary>
/// Provides a generic way to store key/value pairs on an object.
/// http://msdn.microsoft.com/en-gb/library/windows/desktop/ms704598%28v=vs.85%29.aspx
/// </summary>
[ComImport, InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("2CD2D921-C447-44A7-A13C-4ADABFC247E3")]
public interface IMFAttributes
{
/// <summary>
/// Retrieves the value associated with a key.
/// </summary>
void GetItem([In, MarshalAs(UnmanagedType.LPStruct)] Guid guidKey, [In, Out] IntPtr pValue);
/// <summary>
/// Retrieves the data type of the value associated with a key.
/// </summary>
void GetItemType([In, MarshalAs(UnmanagedType.LPStruct)] Guid guidKey, out int pType);
/// <summary>
/// Queries whether a stored attribute value equals a specified PROPVARIANT.
/// </summary>
void CompareItem([In, MarshalAs(UnmanagedType.LPStruct)] Guid guidKey, IntPtr value, [MarshalAs(UnmanagedType.Bool)] out bool pbResult);
/// <summary>
/// Compares the attributes on this object with the attributes on another object.
/// </summary>
void Compare([MarshalAs(UnmanagedType.Interface)] IMFAttributes pTheirs, int matchType, [MarshalAs(UnmanagedType.Bool)] out bool pbResult);
/// <summary>
/// Retrieves a UINT32 value associated with a key.
/// </summary>
void GetUINT32([In, MarshalAs(UnmanagedType.LPStruct)] Guid guidKey, out int punValue);
/// <summary>
/// Retrieves a UINT64 value associated with a key.
/// </summary>
void GetUINT64([In, MarshalAs(UnmanagedType.LPStruct)] Guid guidKey, out long punValue);
/// <summary>
/// Retrieves a double value associated with a key.
/// </summary>
void GetDouble([In, MarshalAs(UnmanagedType.LPStruct)] Guid guidKey, out double pfValue);
/// <summary>
/// Retrieves a GUID value associated with a key.
/// </summary>
void GetGUID([In, MarshalAs(UnmanagedType.LPStruct)] Guid guidKey, out Guid pguidValue);
/// <summary>
/// Retrieves the length of a string value associated with a key.
/// </summary>
void GetStringLength([In, MarshalAs(UnmanagedType.LPStruct)] Guid guidKey, out int pcchLength);
/// <summary>
/// Retrieves a wide-character string associated with a key.
/// </summary>
void GetString([In, MarshalAs(UnmanagedType.LPStruct)] Guid guidKey, [Out, MarshalAs(UnmanagedType.LPWStr)] StringBuilder pwszValue, int cchBufSize,
out int pcchLength);
/// <summary>
/// Retrieves a wide-character string associated with a key. This method allocates the memory for the string.
/// </summary>
void GetAllocatedString([In, MarshalAs(UnmanagedType.LPStruct)] Guid guidKey, [MarshalAs(UnmanagedType.LPWStr)] out string ppwszValue,
out int pcchLength);
/// <summary>
/// Retrieves the length of a byte array associated with a key.
/// </summary>
void GetBlobSize([In, MarshalAs(UnmanagedType.LPStruct)] Guid guidKey, out int pcbBlobSize);
/// <summary>
/// Retrieves a byte array associated with a key.
/// </summary>
void GetBlob([In, MarshalAs(UnmanagedType.LPStruct)] Guid guidKey, [Out, MarshalAs(UnmanagedType.LPArray)] byte[] pBuf, int cbBufSize,
out int pcbBlobSize);
/// <summary>
/// Retrieves a byte array associated with a key. This method allocates the memory for the array.
/// </summary>
void GetAllocatedBlob([In, MarshalAs(UnmanagedType.LPStruct)] Guid guidKey, out IntPtr ip, out int pcbSize);
/// <summary>
/// Retrieves an interface pointer associated with a key.
/// </summary>
void GetUnknown([In, MarshalAs(UnmanagedType.LPStruct)] Guid guidKey, [In, MarshalAs(UnmanagedType.LPStruct)] Guid riid,
[MarshalAs(UnmanagedType.IUnknown)] out object ppv);
/// <summary>
/// Associates an attribute value with a key.
/// </summary>
void SetItem([In, MarshalAs(UnmanagedType.LPStruct)] Guid guidKey, IntPtr Value);
/// <summary>
/// Removes a key/value pair from the object's attribute list.
/// </summary>
void DeleteItem([In, MarshalAs(UnmanagedType.LPStruct)] Guid guidKey);
/// <summary>
/// Removes all key/value pairs from the object's attribute list.
/// </summary>
void DeleteAllItems();
/// <summary>
/// Associates a UINT32 value with a key.
/// </summary>
void SetUINT32([In, MarshalAs(UnmanagedType.LPStruct)] Guid guidKey, int unValue);
/// <summary>
/// Associates a UINT64 value with a key.
/// </summary>
void SetUINT64([In, MarshalAs(UnmanagedType.LPStruct)] Guid guidKey, long unValue);
/// <summary>
/// Associates a double value with a key.
/// </summary>
void SetDouble([In, MarshalAs(UnmanagedType.LPStruct)] Guid guidKey, double fValue);
/// <summary>
/// Associates a GUID value with a key.
/// </summary>
void SetGUID([In, MarshalAs(UnmanagedType.LPStruct)] Guid guidKey, [In, MarshalAs(UnmanagedType.LPStruct)] Guid guidValue);
/// <summary>
/// Associates a wide-character string with a key.
/// </summary>
void SetString([In, MarshalAs(UnmanagedType.LPStruct)] Guid guidKey, [In, MarshalAs(UnmanagedType.LPWStr)] string wszValue);
/// <summary>
/// Associates a byte array with a key.
/// </summary>
void SetBlob([In, MarshalAs(UnmanagedType.LPStruct)] Guid guidKey, [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 2)] byte[] pBuf,
int cbBufSize);
/// <summary>
/// Associates an IUnknown pointer with a key.
/// </summary>
void SetUnknown([MarshalAs(UnmanagedType.LPStruct)] Guid guidKey, [In, MarshalAs(UnmanagedType.IUnknown)] object pUnknown);
/// <summary>
/// Locks the attribute store so that no other thread can access it.
/// </summary>
void LockStore();
/// <summary>
/// Unlocks the attribute store.
/// </summary>
void UnlockStore();
/// <summary>
/// Retrieves the number of attributes that are set on this object.
/// </summary>
void GetCount(out int pcItems);
/// <summary>
/// Retrieves an attribute at the specified index.
/// </summary>
void GetItemByIndex(int unIndex, out Guid pGuidKey, [In, Out] IntPtr pValue);
/// <summary>
/// Copies all of the attributes from this object into another attribute store.
/// </summary>
void CopyAllItems([In, MarshalAs(UnmanagedType.Interface)] IMFAttributes pDest);
}
}