blob: e213a7463193e93305919df891430e3969c8e3a5 (
plain)
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
|
// Copyright (c) Microsoft Corporation
//
// Author: Alper Selcuk
//
// Description:
//
// Declaration of the AudioMediaType
// The original code is copied from MF tree.
//
// Note that this implementation is only useful for some unit tests that need
// to pass bogus media types.
//
#pragma once
#include <AudioMediaType.h>
//-----------------------------------------------------------------------------
// Description:
//
// Implements a stripped down version of IAudioMediaType.
// Remarks:
//
// Most methods are not implemented, because they are not needed by the
// processor.
//
// NOTE: [alper] If this is passed to third party APO's then we may be forced
// to implement all the methods.
//
class CTestAudioMediaType : public IAudioMediaType
{
public:
//--------------------------------------------------------------------------
// Description:
//
// Used during creation
//
// Parameters:
//
// pFormat - [in] the format
// ppIAudioMediaType - [out] Pointer to the created IAudioMediaType.
//
// Return Values:
//
// S_OK On success
// error Otherwise
//
static HRESULT Create( const UNCOMPRESSEDAUDIOFORMAT* pFormat,
IAudioMediaType** ppIAudioMediaType);
// IUnknown methods
ULONG STDMETHODCALLTYPE AddRef();
ULONG STDMETHODCALLTYPE Release();
STDMETHOD( QueryInterface )( REFIID riid, LPVOID *ppvObject );
//--------------------------------------------------------------------------
// Description:
//
// Get Major Type
//
// Parameters:
//
// pguidMajorType - [out] pointer
//
// Return Values:
//
// E_NOTIMPL Not supported
//
virtual HRESULT STDMETHODCALLTYPE GetMajorType(GUID * /* pguidMajorType */)
{
return E_NOTIMPL;
}
//--------------------------------------------------------------------------
// Description:
//
// Checks to see if the format is compressed.
//
// Parameters:
//
// pfCompressed - [out] On S_OK, this is set TRUE.
//
// Return Values:
//
// S_OK On success
// E_POINTER Bad pointer
//
virtual HRESULT STDMETHODCALLTYPE IsCompressedFormat(
/* [out] */ BOOL* pfCompressed
)
{
if (NULL == pfCompressed)
{
return( E_POINTER );
}
*pfCompressed = TRUE;
return( S_OK );
}
//--------------------------------------------------------------------------
// Description:
//
// Checks to see if the media types are equal.
//
// Parameters:
//
// pAudioMediaType - [in] Media type.
// pdwFlags - [out] flags
//
// Return Values:
//
// S_OK On success
// error Otherwise
//
virtual HRESULT STDMETHODCALLTYPE IsEqual( IAudioMediaType *pAudioMediaType,DWORD *pdwFlags);
//--------------------------------------------------------------------------
// Description:
//
// Gets the Audio Format.
//
// Results:
//
// Returns a WAVEFORMATEX pointer.
//
virtual const WAVEFORMATEX *STDMETHODCALLTYPE GetAudioFormat( void);
//--------------------------------------------------------------------------
// Description:
//
// Gets the Uncompressed Audio Format.
//
// Parameters:
//
// pUncompressedAudioFormat - [out] gets the format.
//
// Return Values:
//
// S_OK On success
// error Otherwise
//
virtual HRESULT STDMETHODCALLTYPE GetUncompressedAudioFormat(
UNCOMPRESSEDAUDIOFORMAT* pUncompressedAudioFormat );
protected:
CTestAudioMediaType();
protected:
LONG m_cRef;
UNCOMPRESSEDAUDIOFORMAT m_Format;
WAVEFORMATEXTENSIBLE m_Wfx;
};
//-----------------------------------------------------------------------------
// Called on creation
inline CTestAudioMediaType::CTestAudioMediaType()
{
m_cRef = 0;
} // CTestAudioMediaType
|