ReactOS  0.4.14-dev-554-g2f8d847
amstream_private.h File Reference
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "wtypes.h"
#include "wingdi.h"
#include "winuser.h"
#include "dshow.h"
#include "mmstream.h"
#include "austream.h"
#include "amstream.h"
Include dependency graph for amstream_private.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

HRESULT AM_create (IUnknown *pUnkOuter, LPVOID *ppObj) DECLSPEC_HIDDEN
 
HRESULT AMAudioData_create (IUnknown *pUnkOuter, LPVOID *ppObj) DECLSPEC_HIDDEN
 
HRESULT MediaStreamFilter_create (IUnknown *pUnkOuter, LPVOID *ppObj) DECLSPEC_HIDDEN
 
HRESULT ddrawmediastream_create (IMultiMediaStream *Parent, const MSPID *pPurposeId, STREAM_TYPE StreamType, IAMMediaStream **ppMediaStream) DECLSPEC_HIDDEN
 
HRESULT audiomediastream_create (IMultiMediaStream *parent, const MSPID *purpose_id, STREAM_TYPE stream_type, IAMMediaStream **media_stream) DECLSPEC_HIDDEN
 

Function Documentation

◆ AM_create()

HRESULT AM_create ( IUnknown pUnkOuter,
LPVOID ppObj 
)

Definition at line 54 of file amstream.c.

55 {
57 
58  TRACE("(%p,%p)\n", pUnkOuter, ppObj);
59 
60  if( pUnkOuter )
61  return CLASS_E_NOAGGREGATION;
62 
64  if (!object)
65  return E_OUTOFMEMORY;
66 
67  object->IAMMultiMediaStream_iface.lpVtbl = &AM_Vtbl;
68  object->ref = 1;
69 
70  *ppObj = &object->IAMMultiMediaStream_iface;
71 
72  return S_OK;
73 }
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:2662
#define S_OK
Definition: intsafe.h:59
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
static const struct IAMMultiMediaStreamVtbl AM_Vtbl
Definition: amstream.c:52
void * object
Definition: jmemsys.h:48

◆ AMAudioData_create()

HRESULT AMAudioData_create ( IUnknown pUnkOuter,
LPVOID ppObj 
)

Definition at line 222 of file audiodata.c.

223 {
225 
226  TRACE("(%p,%p)\n", pUnkOuter, ppObj);
227 
228  if (pUnkOuter)
229  return CLASS_E_NOAGGREGATION;
230 
232  if (!object)
233  return E_OUTOFMEMORY;
234 
235  object->IAudioData_iface.lpVtbl = &AudioData_Vtbl;
236  object->ref = 1;
237 
238  object->wave_format.wFormatTag = WAVE_FORMAT_PCM;
239  object->wave_format.nChannels = 1;
240  object->wave_format.nSamplesPerSec = 11025;
241  object->wave_format.wBitsPerSample = 16;
242  object->wave_format.nBlockAlign = object->wave_format.wBitsPerSample * object->wave_format.nChannels / 8;
243  object->wave_format.nAvgBytesPerSec = object->wave_format.nBlockAlign * object->wave_format.nSamplesPerSec;
244 
245  *ppObj = &object->IAudioData_iface;
246 
247  return S_OK;
248 }
#define WAVE_FORMAT_PCM
Definition: constants.h:425
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:2662
#define S_OK
Definition: intsafe.h:59
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
static const struct IAudioDataVtbl AudioData_Vtbl
Definition: audiodata.c:207
void * object
Definition: jmemsys.h:48

◆ audiomediastream_create()

HRESULT audiomediastream_create ( IMultiMediaStream parent,
const MSPID purpose_id,
STREAM_TYPE  stream_type,
IAMMediaStream **  media_stream 
)

Definition at line 1146 of file mediastream.c.

1148 {
1150  PIN_INFO pin_info;
1151  HRESULT hr;
1152 
1153  TRACE("(%p,%s,%p)\n", parent, debugstr_guid(purpose_id), media_stream);
1154 
1156  if (!object)
1157  return E_OUTOFMEMORY;
1158 
1159  object->IAMMediaStream_iface.lpVtbl = &AudioMediaStreamImpl_IAMMediaStream_Vtbl;
1160  object->IAudioMediaStream_iface.lpVtbl = &AudioMediaStreamImpl_IAudioMediaStream_Vtbl;
1161  object->ref = 1;
1162 
1163  InitializeCriticalSection(&object->critical_section);
1164 
1165  pin_info.pFilter = NULL;
1166  pin_info.dir = PINDIR_INPUT;
1167  pin_info.achName[0] = 'I';
1168  StringFromGUID2(purpose_id, pin_info.achName + 1, MAX_PIN_NAME - 1);
1171  &object->critical_section, NULL, (IPin **)&object->input_pin);
1172  if (FAILED(hr))
1173  goto out_object;
1174 
1175  object->input_pin->parent = object;
1176 
1177  object->parent = parent;
1178  object->purpose_id = *purpose_id;
1179  object->stream_type = stream_type;
1180 
1181  *media_stream = &object->IAMMediaStream_iface;
1182 
1183  return S_OK;
1184 
1185 out_object:
1186  HeapFree(GetProcessHeap(), 0, object);
1187 
1188  return hr;
1189 }
HRESULT hr
Definition: shlfolder.c:183
static const struct IAudioMediaStreamVtbl AudioMediaStreamImpl_IAudioMediaStream_Vtbl
Definition: mediastream.c:1017
static const struct IAMMediaStreamVtbl AudioMediaStreamImpl_IAMMediaStream_Vtbl
Definition: mediastream.c:860
#define MAX_PIN_NAME
Definition: axcore.idl:45
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
Definition: synch.c:751
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
HRESULT BaseInputPin_Construct(const IPinVtbl *InputPin_Vtbl, LONG inputpin_size, const PIN_INFO *pPinInfo, const BaseInputPinFuncTable *pBaseInputFuncsTable, LPCRITICAL_SECTION pCritSec, IMemAllocator *, IPin **ppPin)
Definition: pin.c:1189
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
r parent
Definition: btrfs.c:2869
LONG HRESULT
Definition: typedefs.h:77
INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax)
Definition: compobj.c:2434
static const IPinVtbl AudioMediaStreamInputPin_IPin_Vtbl
Definition: mediastream.c:1063
#define S_OK
Definition: intsafe.h:59
Definition: axcore.idl:91
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
#define HeapFree(x, y, z)
Definition: compat.h:402
void * object
Definition: jmemsys.h:48
static const BaseInputPinFuncTable AudioMediaStreamInputPin_FuncTable
Definition: mediastream.c:1135

Referenced by IAMMultiMediaStreamImpl_AddMediaStream().

◆ ddrawmediastream_create()

HRESULT ddrawmediastream_create ( IMultiMediaStream Parent,
const MSPID pPurposeId,
STREAM_TYPE  StreamType,
IAMMediaStream **  ppMediaStream 
)

Definition at line 606 of file mediastream.c.

608 {
610  PIN_INFO pin_info;
611  HRESULT hr;
612 
613  TRACE("(%p,%s,%p)\n", parent, debugstr_guid(purpose_id), media_stream);
614 
616  if (!object)
617  return E_OUTOFMEMORY;
618 
619  object->IAMMediaStream_iface.lpVtbl = &DirectDrawMediaStreamImpl_IAMMediaStream_Vtbl;
620  object->IDirectDrawMediaStream_iface.lpVtbl = &DirectDrawMediaStreamImpl_IDirectDrawMediaStream_Vtbl;
621  object->ref = 1;
622 
623  InitializeCriticalSection(&object->critical_section);
624 
625  pin_info.pFilter = NULL;
626  pin_info.dir = PINDIR_INPUT;
627  pin_info.achName[0] = 'I';
628  StringFromGUID2(purpose_id, pin_info.achName + 1, MAX_PIN_NAME - 1);
631  &object->critical_section, NULL, (IPin **)&object->input_pin);
632  if (FAILED(hr))
633  goto out_object;
634 
635  object->input_pin->parent = object;
636 
637  object->parent = parent;
638  object->purpose_id = *purpose_id;
639  object->stream_type = stream_type;
640 
641  *media_stream = &object->IAMMediaStream_iface;
642 
643  return S_OK;
644 
645 out_object:
646  HeapFree(GetProcessHeap(), 0, object);
647 
648  return hr;
649 }
static const struct IDirectDrawMediaStreamVtbl DirectDrawMediaStreamImpl_IDirectDrawMediaStream_Vtbl
Definition: mediastream.c:445
HRESULT hr
Definition: shlfolder.c:183
#define MAX_PIN_NAME
Definition: axcore.idl:45
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
Definition: synch.c:751
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
HRESULT BaseInputPin_Construct(const IPinVtbl *InputPin_Vtbl, LONG inputpin_size, const PIN_INFO *pPinInfo, const BaseInputPinFuncTable *pBaseInputFuncsTable, LPCRITICAL_SECTION pCritSec, IMemAllocator *, IPin **ppPin)
Definition: pin.c:1189
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
r parent
Definition: btrfs.c:2869
static const BaseInputPinFuncTable DirectDrawMediaStreamInputPin_FuncTable
Definition: mediastream.c:595
LONG HRESULT
Definition: typedefs.h:77
INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax)
Definition: compobj.c:2434
static const IPinVtbl DirectDrawMediaStreamInputPin_IPin_Vtbl
Definition: mediastream.c:494
static const struct IAMMediaStreamVtbl DirectDrawMediaStreamImpl_IAMMediaStream_Vtbl
Definition: mediastream.c:260
#define S_OK
Definition: intsafe.h:59
Definition: axcore.idl:91
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
#define HeapFree(x, y, z)
Definition: compat.h:402
void * object
Definition: jmemsys.h:48

Referenced by IAMMultiMediaStreamImpl_AddMediaStream().

◆ MediaStreamFilter_create()

HRESULT MediaStreamFilter_create ( IUnknown pUnkOuter,
LPVOID ppObj 
)