Initial commit: ROW Client source code

Game client codebase including:
- CharacterActionControl: Character and creature management
- GlobalScript: Network, items, skills, quests, utilities
- RYLClient: Main client application with GUI and event handlers
- Engine: 3D rendering engine (RYLGL)
- MemoryManager: Custom memory allocation
- Library: Third-party dependencies (DirectX, boost, etc.)
- Tools: Development utilities

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-11-29 16:24:34 +09:00
commit e067522598
5135 changed files with 1745744 additions and 0 deletions

View File

@@ -0,0 +1,337 @@
//------------------------------------------------------------------------------
// File: DShowASF.h
//
// Desc: DirectShow sample code - prototypes for methods used by DirectShow
// to interface with ASF content.
//
// Copyright (c) 1999-2001 Microsoft Corporation. All rights reserved.
//------------------------------------------------------------------------------
#pragma warning( disable: 4049 ) /* more than 64k source lines */
/* this ALWAYS GENERATED file contains the definitions for the interfaces */
/* File created by MIDL compiler version 6.00.0334 */
/* Compiler settings for dshowasf.idl:
Oicf, W1, Zp8, env=Win32 (32b run)
protocol : dce , ms_ext, c_ext, robust
error checks: allocation ref bounds_check enum stub_data
VC __declspec() decoration level:
__declspec(uuid()), __declspec(selectany), __declspec(novtable)
DECLSPEC_UUID(), MIDL_INTERFACE()
*/
//@@MIDL_FILE_HEADING( )
/* verify that the <rpcndr.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCNDR_H_VERSION__
#define __REQUIRED_RPCNDR_H_VERSION__ 475
#endif
#include "rpc.h"
#include "rpcndr.h"
#ifndef __RPCNDR_H_VERSION__
#error this stub requires an updated version of <rpcndr.h>
#endif // __RPCNDR_H_VERSION__
#ifndef COM_NO_WINDOWS_H
#include "windows.h"
#include "ole2.h"
#endif /*COM_NO_WINDOWS_H*/
#ifndef __dshowasf_h__
#define __dshowasf_h__
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
#pragma once
#endif
/* Forward Declarations */
#ifndef __IConfigAsfWriter_FWD_DEFINED__
#define __IConfigAsfWriter_FWD_DEFINED__
typedef interface IConfigAsfWriter IConfigAsfWriter;
#endif /* __IConfigAsfWriter_FWD_DEFINED__ */
/* header files for imported files */
#include "unknwn.h"
#include "objidl.h"
#include "strmif.h"
#include "wmsdkidl.h"
#ifdef __cplusplus
extern "C"{
#endif
void * __RPC_USER MIDL_user_allocate(size_t);
void __RPC_USER MIDL_user_free( void * );
/* interface __MIDL_itf_dshowasf_0000 */
/* [local] */
EXTERN_GUID( IID_IConfigAsfWriter,0x45086030,0xF7E4,0x486a,0xB5,0x04,0x82,0x6B,0xB5,0x79,0x2A,0x3B );
extern RPC_IF_HANDLE __MIDL_itf_dshowasf_0000_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_dshowasf_0000_v0_0_s_ifspec;
#ifndef __IConfigAsfWriter_INTERFACE_DEFINED__
#define __IConfigAsfWriter_INTERFACE_DEFINED__
/* interface IConfigAsfWriter */
/* [unique][uuid][object] */
EXTERN_C const IID IID_IConfigAsfWriter;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("45086030-F7E4-486a-B504-826BB5792A3B")
IConfigAsfWriter : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE ConfigureFilterUsingProfileId(
/* [in] */ DWORD dwProfileId) = 0;
virtual HRESULT STDMETHODCALLTYPE GetCurrentProfileId(
/* [out] */ DWORD *pdwProfileId) = 0;
virtual HRESULT STDMETHODCALLTYPE ConfigureFilterUsingProfileGuid(
/* [in] */ REFGUID guidProfile) = 0;
virtual HRESULT STDMETHODCALLTYPE GetCurrentProfileGuid(
/* [out] */ GUID *pProfileGuid) = 0;
virtual HRESULT STDMETHODCALLTYPE ConfigureFilterUsingProfile(
/* [in] */ IWMProfile *pProfile) = 0;
virtual HRESULT STDMETHODCALLTYPE GetCurrentProfile(
/* [out] */ IWMProfile **ppProfile) = 0;
virtual HRESULT STDMETHODCALLTYPE SetIndexMode(
/* [in] */ BOOL bIndexFile) = 0;
virtual HRESULT STDMETHODCALLTYPE GetIndexMode(
/* [out] */ BOOL *pbIndexFile) = 0;
};
#else /* C style interface */
typedef struct IConfigAsfWriterVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
IConfigAsfWriter * This,
/* [in] */ REFIID riid,
/* [iid_is][out] */ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IConfigAsfWriter * This);
ULONG ( STDMETHODCALLTYPE *Release )(
IConfigAsfWriter * This);
HRESULT ( STDMETHODCALLTYPE *ConfigureFilterUsingProfileId )(
IConfigAsfWriter * This,
/* [in] */ DWORD dwProfileId);
HRESULT ( STDMETHODCALLTYPE *GetCurrentProfileId )(
IConfigAsfWriter * This,
/* [out] */ DWORD *pdwProfileId);
HRESULT ( STDMETHODCALLTYPE *ConfigureFilterUsingProfileGuid )(
IConfigAsfWriter * This,
/* [in] */ REFGUID guidProfile);
HRESULT ( STDMETHODCALLTYPE *GetCurrentProfileGuid )(
IConfigAsfWriter * This,
/* [out] */ GUID *pProfileGuid);
HRESULT ( STDMETHODCALLTYPE *ConfigureFilterUsingProfile )(
IConfigAsfWriter * This,
/* [in] */ IWMProfile *pProfile);
HRESULT ( STDMETHODCALLTYPE *GetCurrentProfile )(
IConfigAsfWriter * This,
/* [out] */ IWMProfile **ppProfile);
HRESULT ( STDMETHODCALLTYPE *SetIndexMode )(
IConfigAsfWriter * This,
/* [in] */ BOOL bIndexFile);
HRESULT ( STDMETHODCALLTYPE *GetIndexMode )(
IConfigAsfWriter * This,
/* [out] */ BOOL *pbIndexFile);
END_INTERFACE
} IConfigAsfWriterVtbl;
interface IConfigAsfWriter
{
CONST_VTBL struct IConfigAsfWriterVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define IConfigAsfWriter_QueryInterface(This,riid,ppvObject) \
(This)->lpVtbl -> QueryInterface(This,riid,ppvObject)
#define IConfigAsfWriter_AddRef(This) \
(This)->lpVtbl -> AddRef(This)
#define IConfigAsfWriter_Release(This) \
(This)->lpVtbl -> Release(This)
#define IConfigAsfWriter_ConfigureFilterUsingProfileId(This,dwProfileId) \
(This)->lpVtbl -> ConfigureFilterUsingProfileId(This,dwProfileId)
#define IConfigAsfWriter_GetCurrentProfileId(This,pdwProfileId) \
(This)->lpVtbl -> GetCurrentProfileId(This,pdwProfileId)
#define IConfigAsfWriter_ConfigureFilterUsingProfileGuid(This,guidProfile) \
(This)->lpVtbl -> ConfigureFilterUsingProfileGuid(This,guidProfile)
#define IConfigAsfWriter_GetCurrentProfileGuid(This,pProfileGuid) \
(This)->lpVtbl -> GetCurrentProfileGuid(This,pProfileGuid)
#define IConfigAsfWriter_ConfigureFilterUsingProfile(This,pProfile) \
(This)->lpVtbl -> ConfigureFilterUsingProfile(This,pProfile)
#define IConfigAsfWriter_GetCurrentProfile(This,ppProfile) \
(This)->lpVtbl -> GetCurrentProfile(This,ppProfile)
#define IConfigAsfWriter_SetIndexMode(This,bIndexFile) \
(This)->lpVtbl -> SetIndexMode(This,bIndexFile)
#define IConfigAsfWriter_GetIndexMode(This,pbIndexFile) \
(This)->lpVtbl -> GetIndexMode(This,pbIndexFile)
#endif /* COBJMACROS */
#endif /* C style interface */
HRESULT STDMETHODCALLTYPE IConfigAsfWriter_ConfigureFilterUsingProfileId_Proxy(
IConfigAsfWriter * This,
/* [in] */ DWORD dwProfileId);
void __RPC_STUB IConfigAsfWriter_ConfigureFilterUsingProfileId_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
HRESULT STDMETHODCALLTYPE IConfigAsfWriter_GetCurrentProfileId_Proxy(
IConfigAsfWriter * This,
/* [out] */ DWORD *pdwProfileId);
void __RPC_STUB IConfigAsfWriter_GetCurrentProfileId_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
HRESULT STDMETHODCALLTYPE IConfigAsfWriter_ConfigureFilterUsingProfileGuid_Proxy(
IConfigAsfWriter * This,
/* [in] */ REFGUID guidProfile);
void __RPC_STUB IConfigAsfWriter_ConfigureFilterUsingProfileGuid_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
HRESULT STDMETHODCALLTYPE IConfigAsfWriter_GetCurrentProfileGuid_Proxy(
IConfigAsfWriter * This,
/* [out] */ GUID *pProfileGuid);
void __RPC_STUB IConfigAsfWriter_GetCurrentProfileGuid_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
HRESULT STDMETHODCALLTYPE IConfigAsfWriter_ConfigureFilterUsingProfile_Proxy(
IConfigAsfWriter * This,
/* [in] */ IWMProfile *pProfile);
void __RPC_STUB IConfigAsfWriter_ConfigureFilterUsingProfile_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
HRESULT STDMETHODCALLTYPE IConfigAsfWriter_GetCurrentProfile_Proxy(
IConfigAsfWriter * This,
/* [out] */ IWMProfile **ppProfile);
void __RPC_STUB IConfigAsfWriter_GetCurrentProfile_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
HRESULT STDMETHODCALLTYPE IConfigAsfWriter_SetIndexMode_Proxy(
IConfigAsfWriter * This,
/* [in] */ BOOL bIndexFile);
void __RPC_STUB IConfigAsfWriter_SetIndexMode_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
HRESULT STDMETHODCALLTYPE IConfigAsfWriter_GetIndexMode_Proxy(
IConfigAsfWriter * This,
/* [out] */ BOOL *pbIndexFile);
void __RPC_STUB IConfigAsfWriter_GetIndexMode_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
#endif /* __IConfigAsfWriter_INTERFACE_DEFINED__ */
/* Additional Prototypes for ALL interfaces */
/* end of Additional Prototypes */
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,618 @@
//------------------------------------------------------------------------------
// File: DShowUtil.cpp
//
// Desc: DirectShow sample code - utility functions.
//
// Copyright (c) 2000-2001 Microsoft Corporation. All rights reserved.
//------------------------------------------------------------------------------
#include "stdafx.h"
#include <atlbase.h>
#include <dshow.h>
#include <mtype.h>
#include <wxdebug.h>
#include <reftime.h>
#include "dshowutil.h"
HRESULT FindRenderer(IGraphBuilder *pGB, const GUID *mediatype, IBaseFilter **ppFilter)
{
HRESULT hr;
IEnumFilters *pEnum = NULL;
IBaseFilter *pFilter = NULL;
IPin *pPin;
ULONG ulFetched, ulInPins, ulOutPins;
BOOL bFound=FALSE;
// Verify graph builder interface
if (!pGB)
return E_NOINTERFACE;
// Verify that a media type was passed
if (!mediatype)
return E_POINTER;
// Clear the filter pointer in case there is no match
if (ppFilter)
*ppFilter = NULL;
// Get filter enumerator
hr = pGB->EnumFilters(&pEnum);
if (FAILED(hr))
return hr;
pEnum->Reset();
// Enumerate all filters in the graph
while(!bFound && (pEnum->Next(1, &pFilter, &ulFetched) == S_OK))
{
#ifdef DEBUG
// Read filter name for debugging purposes
FILTER_INFO FilterInfo;
TCHAR szName[256];
hr = pFilter->QueryFilterInfo(&FilterInfo);
if (SUCCEEDED(hr))
{
// Show filter name in debugger
#ifdef UNICODE
lstrcpy(szName, FilterInfo.achName);
#else
WideCharToMultiByte(CP_ACP, 0, FilterInfo.achName, -1, szName, 256, 0, 0);
#endif
FilterInfo.pGraph->Release();
}
#endif
// Find a filter with one input and no output pins
hr = CountFilterPins(pFilter, &ulInPins, &ulOutPins);
if (FAILED(hr))
break;
if ((ulInPins == 1) && (ulOutPins == 0))
{
// Get the first pin on the filter
pPin=0;
pPin = GetInPin(pFilter, 0);
// Read this pin's major media type
AM_MEDIA_TYPE type={0};
hr = pPin->ConnectionMediaType(&type);
if (FAILED(hr))
break;
// Is this pin's media type the requested type?
// If so, then this is the renderer for which we are searching.
// Copy the interface pointer and return.
if (type.majortype == *mediatype)
{
// Found our filter
*ppFilter = pFilter;
bFound = TRUE;;
}
// This is not the renderer, so release the interface.
else
pFilter->Release();
// Delete memory allocated by ConnectionMediaType()
FreeMediaType(type);
}
else
{
// No match, so release the interface
pFilter->Release();
}
}
pEnum->Release();
return hr;
}
HRESULT FindAudioRenderer(IGraphBuilder *pGB, IBaseFilter **ppFilter)
{
return FindRenderer(pGB, &MEDIATYPE_Audio, ppFilter);
}
HRESULT FindVideoRenderer(IGraphBuilder *pGB, IBaseFilter **ppFilter)
{
return FindRenderer(pGB, &MEDIATYPE_Video, ppFilter);
}
HRESULT CountFilterPins(IBaseFilter *pFilter, ULONG *pulInPins, ULONG *pulOutPins)
{
HRESULT hr=S_OK;
IEnumPins *pEnum=0;
ULONG ulFound;
IPin *pPin;
// Verify input
if (!pFilter || !pulInPins || !pulOutPins)
return E_POINTER;
// Clear number of pins found
*pulInPins = 0;
*pulOutPins = 0;
// Get pin enumerator
hr = pFilter->EnumPins(&pEnum);
if(FAILED(hr))
return hr;
pEnum->Reset();
// Count every pin on the filter
while(S_OK == pEnum->Next(1, &pPin, &ulFound))
{
PIN_DIRECTION pindir = (PIN_DIRECTION)3;
hr = pPin->QueryDirection(&pindir);
if(pindir == PINDIR_INPUT)
(*pulInPins)++;
else
(*pulOutPins)++;
pPin->Release();
}
pEnum->Release();
return hr;
}
HRESULT CountTotalFilterPins(IBaseFilter *pFilter, ULONG *pulPins)
{
HRESULT hr;
IEnumPins *pEnum=0;
ULONG ulFound;
IPin *pPin;
// Verify input
if (!pFilter || !pulPins)
return E_POINTER;
// Clear number of pins found
*pulPins = 0;
// Get pin enumerator
hr = pFilter->EnumPins(&pEnum);
if(FAILED(hr))
return hr;
// Count every pin on the filter, ignoring direction
while(S_OK == pEnum->Next(1, &pPin, &ulFound))
{
(*pulPins)++;
pPin->Release();
}
pEnum->Release();
return hr;
}
HRESULT GetPin( IBaseFilter * pFilter, PIN_DIRECTION dirrequired, int iNum, IPin **ppPin)
{
CComPtr< IEnumPins > pEnum;
*ppPin = NULL;
HRESULT hr = pFilter->EnumPins(&pEnum);
if(FAILED(hr))
return hr;
ULONG ulFound;
IPin *pPin;
hr = E_FAIL;
while(S_OK == pEnum->Next(1, &pPin, &ulFound))
{
PIN_DIRECTION pindir = (PIN_DIRECTION)3;
pPin->QueryDirection(&pindir);
if(pindir == dirrequired)
{
if(iNum == 0)
{
*ppPin = pPin;
// Found requested pin, so clear error
hr = S_OK;
break;
}
iNum--;
}
pPin->Release();
}
return hr;
}
IPin * GetInPin( IBaseFilter * pFilter, int Num )
{
CComPtr< IPin > pComPin;
GetPin(pFilter, PINDIR_INPUT, Num, &pComPin);
return pComPin;
}
IPin * GetOutPin( IBaseFilter * pFilter, int Num )
{
CComPtr< IPin > pComPin;
GetPin(pFilter, PINDIR_OUTPUT, Num, &pComPin);
return pComPin;
}
HRESULT FindOtherSplitterPin(IPin *pPinIn, GUID guid, int nStream, IPin **ppSplitPin)
{
if (!ppSplitPin)
return E_POINTER;
CComPtr< IPin > pPinOut;
pPinOut = pPinIn;
while(pPinOut)
{
PIN_INFO ThisPinInfo;
pPinOut->QueryPinInfo(&ThisPinInfo);
if(ThisPinInfo.pFilter) ThisPinInfo.pFilter->Release();
pPinOut = NULL;
CComPtr< IEnumPins > pEnumPins;
ThisPinInfo.pFilter->EnumPins(&pEnumPins);
if(!pEnumPins)
{
return NULL;
}
// look at every pin on the current filter...
//
ULONG Fetched = 0;
while(1)
{
CComPtr< IPin > pPin;
Fetched = 0;
ASSERT(!pPin); // is it out of scope?
pEnumPins->Next(1, &pPin, &Fetched);
if(!Fetched)
{
break;
}
PIN_INFO pi;
pPin->QueryPinInfo(&pi);
if(pi.pFilter) pi.pFilter->Release();
// if it's an input pin...
//
if(pi.dir == PINDIR_INPUT)
{
// continue searching upstream from this pin
//
pPin->ConnectedTo(&pPinOut);
// a pin that supports the required media type is the
// splitter pin we are looking for! We are done
//
}
else
{
CComPtr< IEnumMediaTypes > pMediaEnum;
pPin->EnumMediaTypes(&pMediaEnum);
if(pMediaEnum)
{
Fetched = 0;
AM_MEDIA_TYPE *pMediaType;
pMediaEnum->Next(1, &pMediaType, &Fetched);
if(Fetched)
{
if(pMediaType->majortype == guid)
{
if(nStream-- == 0)
{
DeleteMediaType(pMediaType);
*ppSplitPin = pPin;
(*ppSplitPin)->AddRef();
return S_OK;
}
}
DeleteMediaType(pMediaType);
}
}
}
// go try the next pin
} // while
}
ASSERT(FALSE);
return E_FAIL;
}
HRESULT SeekNextFrame( IMediaSeeking * pSeeking, double FPS, long Frame )
{
// try seeking by frames first
//
HRESULT hr = pSeeking->SetTimeFormat(&TIME_FORMAT_FRAME);
REFERENCE_TIME Pos = 0;
if(!FAILED(hr))
{
pSeeking->GetCurrentPosition(&Pos);
Pos++;
}
else
{
// couldn't seek by frames, use Frame and FPS to calculate time
//
Pos = REFERENCE_TIME(double( Frame * UNITS ) / FPS);
// add a half-frame to seek to middle of the frame
//
Pos += REFERENCE_TIME(double( UNITS ) * 0.5 / FPS);
}
hr = pSeeking->SetPositions(&Pos, AM_SEEKING_AbsolutePositioning,
NULL, AM_SEEKING_NoPositioning);
return hr;
}
#ifdef DEBUG
// for debugging purposes
const INT iMAXLEVELS = 5; // Maximum debug categories
extern DWORD m_Levels[iMAXLEVELS]; // Debug level per category
#endif
void TurnOnDebugDllDebugging( )
{
#ifdef DEBUG
for(int i = 0 ; i < iMAXLEVELS ; i++)
{
m_Levels[i] = 1;
}
#endif
}
void DbgPrint( char * pText )
{
DbgLog(( LOG_TRACE, 1, "%s", pText ));
}
void ErrPrint( char * pText )
{
printf(pText);
return;
}
// Adds a DirectShow filter graph to the Running Object Table,
// allowing GraphEdit to "spy" on a remote filter graph.
HRESULT AddGraphToRot(IUnknown *pUnkGraph, DWORD *pdwRegister)
{
IMoniker * pMoniker;
IRunningObjectTable *pROT;
WCHAR wsz[128];
HRESULT hr;
if (FAILED(GetRunningObjectTable(0, &pROT)))
return E_FAIL;
wsprintfW(wsz, L"FilterGraph %08x pid %08x", (DWORD_PTR)pUnkGraph,
GetCurrentProcessId());
hr = CreateItemMoniker(L"!", wsz, &pMoniker);
if (SUCCEEDED(hr))
{
hr = pROT->Register(0, pUnkGraph, pMoniker, pdwRegister);
pMoniker->Release();
}
pROT->Release();
return hr;
}
// Removes a filter graph from the Running Object Table
void RemoveGraphFromRot(DWORD pdwRegister)
{
IRunningObjectTable *pROT;
if (SUCCEEDED(GetRunningObjectTable(0, &pROT)))
{
pROT->Revoke(pdwRegister);
pROT->Release();
}
}
void ShowFilenameByCLSID(REFCLSID clsid, TCHAR *szFilename)
{
HRESULT hr;
LPOLESTR strCLSID;
// Convert binary CLSID to a readable version
hr = StringFromCLSID(clsid, &strCLSID);
if(SUCCEEDED(hr))
{
TCHAR szKey[512];
CString strQuery(strCLSID);
// Create key name for reading filename registry
wsprintf(szKey, TEXT("Software\\Classes\\CLSID\\%s\\InprocServer32\0"),
strQuery);
// Free memory associated with strCLSID (allocated in StringFromCLSID)
CoTaskMemFree(strCLSID);
HKEY hkeyFilter=0;
DWORD dwSize=MAX_PATH;
BYTE szFile[MAX_PATH];
int rc=0;
// Open the CLSID key that contains information about the filter
rc = RegOpenKey(HKEY_LOCAL_MACHINE, szKey, &hkeyFilter);
if (rc == ERROR_SUCCESS)
{
rc = RegQueryValueEx(hkeyFilter, NULL, // Read (Default) value
NULL, NULL, szFile, &dwSize);
if (rc == ERROR_SUCCESS)
wsprintf(szFilename, TEXT("%s"), szFile);
else
wsprintf(szFilename, TEXT("<Unknown>\0"));
rc = RegCloseKey(hkeyFilter);
}
}
}
HRESULT GetFileDurationString(IMediaSeeking *pMS, TCHAR *szDuration)
{
HRESULT hr;
if (!pMS)
return E_NOINTERFACE;
if (!szDuration)
return E_POINTER;
// Initialize the display in case we can't read the duration
wsprintf(szDuration, TEXT("<00:00.000>"));
// Is media time supported for this file?
if (S_OK != pMS->IsFormatSupported(&TIME_FORMAT_MEDIA_TIME))
return E_NOINTERFACE;
// Read the time format to restore later
GUID guidOriginalFormat;
hr = pMS->GetTimeFormat(&guidOriginalFormat);
if (FAILED(hr))
return hr;
// Ensure media time format for easy display
hr = pMS->SetTimeFormat(&TIME_FORMAT_MEDIA_TIME);
if (FAILED(hr))
return hr;
// Read the file's duration
LONGLONG llDuration;
hr = pMS->GetDuration(&llDuration);
if (FAILED(hr))
return hr;
// Return to the original format
if (guidOriginalFormat != TIME_FORMAT_MEDIA_TIME)
{
hr = pMS->SetTimeFormat(&guidOriginalFormat);
if (FAILED(hr))
return hr;
}
// Convert the LONGLONG duration into human-readable format
unsigned long nTotalMS = (unsigned long) llDuration / 10000; // 100ns -> ms
int nMS = nTotalMS % 1000;
int nSeconds = nTotalMS / 1000;
int nMinutes = nSeconds / 60;
nSeconds %= 60;
// Update the string
wsprintf(szDuration, _T("%02dm:%02d.%03ds\0"), nMinutes, nSeconds, nMS);
return hr;
}
BOOL SupportsPropertyPage(IBaseFilter *pFilter)
{
HRESULT hr;
ISpecifyPropertyPages *pSpecify;
// Discover if this filter contains a property page
hr = pFilter->QueryInterface(IID_ISpecifyPropertyPages, (void **)&pSpecify);
if (SUCCEEDED(hr))
{
pSpecify->Release();
return TRUE;
}
else
return FALSE;
}
HRESULT ShowFilterPropertyPage(IBaseFilter *pFilter, HWND hwndParent)
{
HRESULT hr;
ISpecifyPropertyPages *pSpecify=0;
if (!pFilter)
return E_NOINTERFACE;
// Discover if this filter contains a property page
hr = pFilter->QueryInterface(IID_ISpecifyPropertyPages, (void **)&pSpecify);
if (SUCCEEDED(hr))
{
do
{
FILTER_INFO FilterInfo;
hr = pFilter->QueryFilterInfo(&FilterInfo);
if (FAILED(hr))
break;
CAUUID caGUID;
hr = pSpecify->GetPages(&caGUID);
if (FAILED(hr))
break;
pSpecify->Release();
// Display the filter's property page
OleCreatePropertyFrame(
hwndParent, // Parent window
0, // x (Reserved)
0, // y (Reserved)
FilterInfo.achName, // Caption for the dialog box
1, // Number of filters
(IUnknown **)&pFilter, // Pointer to the filter
caGUID.cElems, // Number of property pages
caGUID.pElems, // Pointer to property page CLSIDs
0, // Locale identifier
0, // Reserved
NULL // Reserved
);
CoTaskMemFree(caGUID.pElems);
FilterInfo.pGraph->Release();
} while(0);
}
pFilter->Release();
return hr;
}
//
// Some hardware decoders and video renderers support stepping media
// frame by frame with the IVideoFrameStep interface. See the interface
// documentation for more details on frame stepping.
//
BOOL CanFrameStep(IGraphBuilder *pGB)
{
HRESULT hr;
IVideoFrameStep* pFS;
hr = pGB->QueryInterface(__uuidof(IVideoFrameStep), (PVOID *)&pFS);
if (FAILED(hr))
return FALSE;
// Check if this decoder can step
hr = pFS->CanStep(0L, NULL);
pFS->Release();
if (hr == S_OK)
return TRUE;
else
return FALSE;
}

View File

@@ -0,0 +1,51 @@
//------------------------------------------------------------------------------
// File: DShowUtil.h
//
// Desc: DirectShow sample code - prototypes for utility functions
//
// Copyright (c) 2000-2001 Microsoft Corporation. All rights reserved.
//------------------------------------------------------------------------------
//
// Function prototypes for DirectShow applications
//
HRESULT GetPin(IBaseFilter * pFilter, PIN_DIRECTION dirrequired,
int iNum, IPin **ppPin);
HRESULT FindOtherSplitterPin(IPin *pPinIn, GUID guid,
int nStream, IPin **ppSplitPin);
HRESULT SeekNextFrame(IMediaSeeking * pSeeking, double FPS, long Frame );
IPin * GetInPin ( IBaseFilter *pFilter, int Num );
IPin * GetOutPin( IBaseFilter *pFilter, int Num );
HRESULT CountFilterPins(IBaseFilter *pFilter, ULONG *pulInPins, ULONG *pulOutPins);
HRESULT CountTotalFilterPins(IBaseFilter *pFilter, ULONG *pulPins);
// Find a renderer filter in an existing graph
HRESULT FindRenderer(IGraphBuilder *pGB, const GUID *mediatype, IBaseFilter **ppFilter);
HRESULT FindAudioRenderer(IGraphBuilder *pGB, IBaseFilter **ppFilter);
HRESULT FindVideoRenderer(IGraphBuilder *pGB, IBaseFilter **ppFilter);
// Finds a filter's server name
void ShowFilenameByCLSID(REFCLSID clsid, TCHAR *szFilename);
// Media file information
HRESULT GetFileDurationString(IMediaSeeking *pMS, TCHAR *szDuration);
// Property pages and capabilities
BOOL SupportsPropertyPage(IBaseFilter *pFilter);
HRESULT ShowFilterPropertyPage(IBaseFilter *pFilter, HWND hwndParent);
BOOL CanFrameStep(IGraphBuilder *pGB);
// Debug helper functions
void TurnOnDebugDllDebugging( );
void DbgPrint( char * pText );
void ErrPrint( char * pText );
// Adds/removes a DirectShow filter graph from the Running Object Table,
// allowing GraphEdit to "spy" on a remote filter graph if enabled.
HRESULT AddGraphToRot(IUnknown *pUnkGraph, DWORD *pdwRegister);
void RemoveGraphFromRot(DWORD pdwRegister);

View File

@@ -0,0 +1,112 @@
//------------------------------------------------------------------------------
// File: MFCDMOUtil.cpp
//
// Desc: DirectShow sample code - DMO utility functions used by MFC applications.
//
// Copyright (c) 2000-2001 Microsoft Corporation. All rights reserved.
//------------------------------------------------------------------------------
#include "stdafx.h"
#include <dshow.h>
#include <dmo.h>
#include "namedguid.h"
#include "mfcdmoutil.h"
#include "mfcutil.h"
HRESULT AddDMOsToList(const GUID *clsid, CListBox& ListFilters, BOOL bIncludeKeyed)
{
HRESULT hr;
IEnumDMO *pEnum = NULL;
int nFilters=0;
DWORD dwFlags = bIncludeKeyed ? DMO_ENUMF_INCLUDE_KEYED : 0;
// Enumerate all DMOs of the selected category
hr = DMOEnum(*clsid, dwFlags, 0, NULL, 0, NULL, &pEnum);
if (FAILED(hr))
return hr;
// Enumerate all filters using the category enumerator
hr = EnumDMOsToList(pEnum, ListFilters, nFilters);
// Now that the DMOs (if any) are enumerated and added
// to the list, go ahead and select the first one.
ListFilters.SetCurSel(0);
pEnum->Release();
return hr;
}
HRESULT EnumDMOsToList(IEnumDMO *pEnumCat, CListBox& ListFilters, int& nFilters)
{
HRESULT hr=S_OK;
ULONG cFetched;
WCHAR *wszName;
CLSID clsid;
// Clear the current filter list
ClearFilterListWithCLSID(ListFilters);
nFilters = 0;
// If there are no filters of a requested type, show default string
if (!pEnumCat)
{
ListFilters.AddString(TEXT("<< No entries >>"));
return S_FALSE;
}
// Enumerate all items associated with the moniker
while(pEnumCat->Next(1, &clsid, &wszName, &cFetched) == S_OK)
{
nFilters++;
CString str(wszName);
// Add filter's name and CLSID to the list box
AddFilterToListWithCLSID(str, &clsid, ListFilters);
CoTaskMemFree(wszName);
}
// If no DMOs matched the query, show a default item
if (nFilters == 0)
ListFilters.AddString(TEXT("<< No entries >>"));
return hr;
}
void DisplayDMOTypeInfo(const GUID *pCLSID,
ULONG& ulNumInputsSupplied, CListBox& ListInputTypes,
ULONG& ulNumOutputsSupplied, CListBox& ListOutputTypes)
{
const int NUM_PAIRS=20;
HRESULT hr;
DMO_PARTIAL_MEDIATYPE aInputTypes[NUM_PAIRS]={0},
aOutputTypes[NUM_PAIRS]={0};
ULONG ulNumInputTypes=NUM_PAIRS, ulNumOutputTypes=NUM_PAIRS, i;
TCHAR szCLSID[128];
// Read type/subtype information
hr = DMOGetTypes(
*pCLSID,
ulNumInputTypes, &ulNumInputsSupplied, aInputTypes,
ulNumOutputTypes, &ulNumOutputsSupplied, aOutputTypes);
if (FAILED(hr))
return;
// Show input type/subtype pairs
for (i=0; i<ulNumInputsSupplied; i++)
{
GetTypeSubtypeString(szCLSID, aInputTypes[i]);
ListInputTypes.AddString(szCLSID);
}
// Show output type/subtype pairs
for (i=0; i<ulNumOutputsSupplied; i++)
{
GetTypeSubtypeString(szCLSID, aOutputTypes[i]);
ListOutputTypes.AddString(szCLSID);
}
}

View File

@@ -0,0 +1,53 @@
//------------------------------------------------------------------------------
// File: MFCDMOUtil.h
//
// Desc: DirectShow sample code - Header for DMO utility functions
// used by MFC applications.
//
// Copyright (c) 2000-2001 Microsoft Corporation. All rights reserved.
//------------------------------------------------------------------------------
//
// Global data structure for storing GUIDs and friendly strings
//
typedef struct _dmo_category_info
{
const GUID *pclsid;
TCHAR szName[128];
} DMO_CATEGORY_INFO;
// The DirectShow reference documentation lists a set of DMO categories
// for which you can enumerate corresponding filters. See 'Category GUIDs'
// under 'DirectShow->DirectX Media Objects->DMO Reference' in the SDK docs.
const DMO_CATEGORY_INFO dmo_categories[] = {
&GUID_NULL, TEXT("All categories"),
&DMOCATEGORY_AUDIO_DECODER, TEXT("Audio Decoder"),
&DMOCATEGORY_AUDIO_EFFECT, TEXT("Audio Effect"),
&DMOCATEGORY_AUDIO_ENCODER, TEXT("Audio Encoder"),
&DMOCATEGORY_VIDEO_DECODER, TEXT("Video Decoder"),
&DMOCATEGORY_VIDEO_EFFECT, TEXT("Video Effect"),
&DMOCATEGORY_VIDEO_ENCODER, TEXT("Video Encoder"),
&DMOCATEGORY_AUDIO_CAPTURE_EFFECT, TEXT("Audio Capture Effect"),
};
//
// Constants
//
#define NUM_CATEGORIES (sizeof(dmo_categories) / sizeof(DMO_CATEGORY_INFO))
#define STR_CLASSES TEXT("DMO Categories")
#define STR_FILTERS TEXT("Registered DMOs")
#define STR_UNKNOWN TEXT("<?>")
#define STR_NOTDMO TEXT("---")
//
// Function prototypes
//
HRESULT EnumDMOsToList(IEnumDMO *pEnumCat, CListBox& ListFilters, int& nFilters);
HRESULT AddDMOsToList(const GUID *clsid, CListBox& ListFilters, BOOL bIncludeKeyed);
void DisplayDMOTypeInfo(const GUID *pCLSID,
ULONG& ulNumInputsSupplied, CListBox& ListInputTypes,
ULONG& ulNumOutputsSupplied, CListBox& ListOutputTypes);

View File

@@ -0,0 +1,707 @@
//------------------------------------------------------------------------------
// File: MFCUtil.cpp
//
// Desc: DirectShow sample code - Utility functions used by MFC applications.
//
// Copyright (c) 2000-2001 Microsoft Corporation. All rights reserved.
//------------------------------------------------------------------------------
#include "stdafx.h"
#include <dshow.h>
#include <atlbase.h>
#include "mfcutil.h"
HRESULT AddGraphFiltersToList (IGraphBuilder *pGB, CListBox& m_ListFilters)
{
HRESULT hr;
IEnumFilters *pEnum = NULL;
IBaseFilter *pFilter = NULL;
ULONG cFetched;
// Clear filters list box
m_ListFilters.ResetContent();
// Verify graph builder interface
if (!pGB)
return E_NOINTERFACE;
// Get filter enumerator
hr = pGB->EnumFilters(&pEnum);
if (FAILED(hr))
{
m_ListFilters.AddString(TEXT("<ERROR>"));
return hr;
}
// Enumerate all filters in the graph
while(pEnum->Next(1, &pFilter, &cFetched) == S_OK)
{
FILTER_INFO FilterInfo;
TCHAR szName[256];
hr = pFilter->QueryFilterInfo(&FilterInfo);
if (FAILED(hr))
{
m_ListFilters.AddString(TEXT("<ERROR>"));
}
else
{
USES_CONVERSION;
// Add the filter name to the filters listbox
lstrcpy(szName, W2T(FilterInfo.achName));
m_ListFilters.AddString(szName);
// Must release filter graph reference
FilterInfo.pGraph->Release();
}
pFilter->Release();
}
pEnum->Release();
return hr;
}
//
// The GraphBuilder interface provides a FindFilterByName() method,
// which provides similar functionality to the method below.
// This local method is provided for educational purposes.
//
IBaseFilter *FindFilterFromName(IGraphBuilder *pGB, LPTSTR szNameToFind)
{
USES_CONVERSION;
HRESULT hr;
IEnumFilters *pEnum = NULL;
IBaseFilter *pFilter = NULL;
ULONG cFetched;
BOOL bFound = FALSE;
// Verify graph builder interface
if (!pGB)
return NULL;
// Get filter enumerator
hr = pGB->EnumFilters(&pEnum);
if (FAILED(hr))
return NULL;
// Enumerate all filters in the graph
while((pEnum->Next(1, &pFilter, &cFetched) == S_OK) && (!bFound))
{
FILTER_INFO FilterInfo;
TCHAR szName[256];
hr = pFilter->QueryFilterInfo(&FilterInfo);
if (FAILED(hr))
{
pFilter->Release();
pEnum->Release();
return NULL;
}
// Compare this filter's name with the one we want
lstrcpy(szName, W2T(FilterInfo.achName));
if (! lstrcmp(szName, szNameToFind))
{
bFound = TRUE;
}
FilterInfo.pGraph->Release();
// If we found the right filter, don't release its interface.
// The caller will use it and release it later.
if (!bFound)
pFilter->Release();
else
break;
}
pEnum->Release();
return (bFound ? pFilter : NULL);
}
HRESULT EnumFiltersWithCLSIDToList(ICreateDevEnum *pSysDevEnum,
const GUID *clsid, CListBox& List)
{
HRESULT hr;
IEnumMoniker *pEnumCat = NULL;
// Instantiate the system device enumerator if it doesn't exist
if (pSysDevEnum == NULL)
{
hr = CoCreateInstance(CLSID_SystemDeviceEnum, NULL,
CLSCTX_INPROC, IID_ICreateDevEnum,
(void **)&pSysDevEnum);
if FAILED(hr)
return hr;
}
// Enumerate all filters of the selected category
hr = pSysDevEnum->CreateClassEnumerator(*clsid, &pEnumCat, 0);
if (SUCCEEDED(hr))
{
// Enumerate all filters using the category enumerator
hr = EnumFiltersAndCLSIDsToList(pEnumCat, List);
SAFE_RELEASE(pEnumCat);
}
pSysDevEnum->Release();
return hr;
}
HRESULT EnumFiltersWithMonikerToList(ICreateDevEnum *pSysDevEnum,
const GUID *clsid, CListBox& List)
{
HRESULT hr;
IEnumMoniker *pEnumCat = NULL;
// Instantiate the system device enumerator if it doesn't exist
if (pSysDevEnum == NULL)
{
hr = CoCreateInstance(CLSID_SystemDeviceEnum, NULL,
CLSCTX_INPROC, IID_ICreateDevEnum,
(void **)&pSysDevEnum);
if FAILED(hr)
return hr;
}
// Enumerate all filters of the selected category
hr = pSysDevEnum->CreateClassEnumerator(*clsid, &pEnumCat, 0);
if (SUCCEEDED(hr))
{
// Enumerate all filters using the category enumerator
hr = EnumFiltersAndMonikersToList(pEnumCat, List);
SAFE_RELEASE(pEnumCat);
}
pSysDevEnum->Release();
return hr;
}
HRESULT EnumFiltersAndMonikersToList(IEnumMoniker *pEnumCat, CListBox& ListFilters)
{
HRESULT hr=S_OK;
IMoniker *pMoniker;
ULONG cFetched;
VARIANT varName={0};
int nFilters=0;
// If there are no filters of a requested type, show default string
if (!pEnumCat)
{
ListFilters.AddString(TEXT("<< No entries >>"));
return S_FALSE;
}
// Enumerate all items associated with the moniker
while(pEnumCat->Next(1, &pMoniker, &cFetched) == S_OK)
{
IPropertyBag *pPropBag;
ASSERT(pMoniker);
// Associate moniker with a file
hr = pMoniker->BindToStorage(0, 0, IID_IPropertyBag,
(void **)&pPropBag);
ASSERT(SUCCEEDED(hr));
ASSERT(pPropBag);
if (FAILED(hr))
continue;
// Read filter name from property bag
varName.vt = VT_BSTR;
hr = pPropBag->Read(L"FriendlyName", &varName, 0);
if (FAILED(hr))
continue;
// Get filter name (converting BSTR name to a CString)
CString str(varName.bstrVal);
SysFreeString(varName.bstrVal);
nFilters++;
// Add the filter name and moniker to the listbox
AddFilterToListWithMoniker(str, pMoniker, ListFilters);
// Cleanup interfaces
SAFE_RELEASE(pPropBag);
// Intentionally DO NOT release the pMoniker, since it is
// stored in a listbox for later use
}
return hr;
}
HRESULT EnumFiltersAndCLSIDsToList(IEnumMoniker *pEnumCat, CListBox& ListFilters)
{
HRESULT hr=S_OK;
IMoniker *pMoniker;
ULONG cFetched;
VARIANT varName={0};
int nFilters=0;
// If there are no filters of a requested type, show default string
if (!pEnumCat)
{
ListFilters.AddString(TEXT("<< No entries >>"));
return S_FALSE;
}
// Enumerate all items associated with the moniker
while(pEnumCat->Next(1, &pMoniker, &cFetched) == S_OK)
{
IPropertyBag *pPropBag;
ASSERT(pMoniker);
// Associate moniker with a file
hr = pMoniker->BindToStorage(0, 0, IID_IPropertyBag,
(void **)&pPropBag);
ASSERT(SUCCEEDED(hr));
ASSERT(pPropBag);
if (FAILED(hr))
continue;
// Read filter name from property bag
varName.vt = VT_BSTR;
hr = pPropBag->Read(L"FriendlyName", &varName, 0);
if (FAILED(hr))
continue;
// Get filter name (converting BSTR name to a CString)
CString str(varName.bstrVal);
SysFreeString(varName.bstrVal);
nFilters++;
// Read filter's CLSID from property bag. This CLSID string will be
// converted to a binary CLSID and passed to AddFilter(), which will
// add the filter's name to the listbox and its CLSID to the listbox
// item's DataPtr item. When the user clicks on a filter name in
// the listbox, we'll read the stored CLSID, convert it to a string,
// and use it to find the filter's filename in the registry.
VARIANT varFilterClsid;
varFilterClsid.vt = VT_BSTR;
// Read CLSID string from property bag
hr = pPropBag->Read(L"CLSID", &varFilterClsid, 0);
if(SUCCEEDED(hr))
{
CLSID clsidFilter;
// Add filter name and CLSID to listbox
if(CLSIDFromString(varFilterClsid.bstrVal, &clsidFilter) == S_OK)
{
AddFilterToListWithCLSID(str, &clsidFilter, ListFilters);
}
SysFreeString(varFilterClsid.bstrVal);
}
// Cleanup interfaces
SAFE_RELEASE(pPropBag);
SAFE_RELEASE(pMoniker);
}
return hr;
}
HRESULT EnumPinsOnFilter (IBaseFilter *pFilter, PIN_DIRECTION PinDir,
CListBox& Listbox)
{
HRESULT hr;
IEnumPins *pEnum = NULL;
IPin *pPin = NULL;
// Clear the specified listbox (input or output)
Listbox.ResetContent();
// Verify filter interface
if (!pFilter)
return E_NOINTERFACE;
// Get pin enumerator
hr = pFilter->EnumPins(&pEnum);
if (FAILED(hr))
{
Listbox.AddString(TEXT("<ERROR>"));
return hr;
}
pEnum->Reset();
// Enumerate all pins on this filter
while((hr = pEnum->Next(1, &pPin, 0)) == S_OK)
{
PIN_DIRECTION PinDirThis;
hr = pPin->QueryDirection(&PinDirThis);
if (FAILED(hr))
{
Listbox.AddString(TEXT("<ERROR>"));
pPin->Release();
continue;
}
// Does the pin's direction match the requested direction?
if (PinDir == PinDirThis)
{
PIN_INFO pininfo={0};
// Direction matches, so add pin name to listbox
hr = pPin->QueryPinInfo(&pininfo);
if (SUCCEEDED(hr))
{
CString str(pininfo.achName);
Listbox.AddString(str);
//RetailOutput(_T("pPin=0x%x\n"), pPin);
}
// The pininfo structure contains a reference to an IBaseFilter,
// so you must release its reference to prevent resource a leak.
pininfo.pFilter->Release();
}
pPin->Release();
}
pEnum->Release();
return hr;
}
HRESULT AddFilterPinsToLists (IGraphBuilder *pGB, CListBox& m_ListFilters,
CListBox& m_ListPinsInput, CListBox& m_ListPinsOutput)
{
HRESULT hr;
IBaseFilter *pFilter = NULL;
TCHAR szNameToFind[128];
// Read the current filter name from the list box
int nCurSel = m_ListFilters.GetCurSel();
m_ListFilters.GetText(nCurSel, szNameToFind);
// Read the current list box name and find it in the graph
pFilter = FindFilterFromName(pGB, szNameToFind);
if (!pFilter)
return E_UNEXPECTED;
// Now that we have filter information, enumerate pins by direction
// and add their names to the appropriate listboxes
//RetailOutput(_T("Listing input pins on filter %s\n"), szNameToFind);
hr = EnumPinsOnFilter(pFilter, PINDIR_INPUT, m_ListPinsInput);
if (SUCCEEDED(hr))
{
//RetailOutput(_T("Listing output pins on filter %s\n"), szNameToFind);
hr = EnumPinsOnFilter(pFilter, PINDIR_OUTPUT, m_ListPinsOutput);
}
// Must release the filter interface returned from FindFilterByName()
pFilter->Release();
return hr;
}
BOOL GetFileInfoStrings(LPTSTR szFile, TCHAR *szSize, TCHAR *szDate)
{
HANDLE hFile;
LONGLONG llSize=0;
DWORD dwSizeLow=0, dwSizeHigh=0;
// Open the specified file to read size and date information
hFile = CreateFile(szFile, GENERIC_READ, FILE_SHARE_READ, NULL,
OPEN_EXISTING, (DWORD) 0, NULL);
if (hFile == INVALID_HANDLE_VALUE)
{
RetailOutput(TEXT("*** Failed(0x%x) to open file (to read size)!\r\n"),
GetLastError());
return FALSE;
}
if (szSize)
{
dwSizeLow = GetFileSize(hFile, &dwSizeHigh);
if ((dwSizeLow == 0xFFFFFFFF) && (GetLastError() != NO_ERROR))
{
RetailOutput(TEXT("*** Error(0x%x) reading file size!\r\n"),
GetLastError());
CloseHandle(hFile);
return FALSE;
}
// Large files will also use the upper DWORD to report size.
// Add them together for the true size if necessary.
if (dwSizeHigh)
llSize = (dwSizeHigh << 16) + dwSizeLow;
else
llSize = dwSizeLow;
// Update size string
wsprintf(szSize, TEXT("Size: %d bytes\0"), dwSizeLow);
}
if (szDate)
{
// Read date information
BY_HANDLE_FILE_INFORMATION fi;
if (GetFileInformationByHandle(hFile, &fi))
{
CTime time(fi.ftLastWriteTime);
// Update date string
wsprintf(szDate, TEXT("File date: %02d/%02d/%d\0"),
time.GetMonth(), time.GetDay(), time.GetYear());
}
}
CloseHandle(hFile);
return TRUE;
}
void AddEventToList(CListBox& ListEvents, long lEventCode)
{
static TCHAR szMsg[256];
BOOL bMatch = TRUE;
#define HANDLE_EC(c) \
case c: \
wsprintf(szMsg, TEXT("%s\0"), TEXT(#c)); \
break;
switch (lEventCode)
{
HANDLE_EC(EC_ACTIVATE);
HANDLE_EC(EC_BUFFERING_DATA);
HANDLE_EC(EC_CLOCK_CHANGED);
HANDLE_EC(EC_COMPLETE);
HANDLE_EC(EC_DEVICE_LOST);
HANDLE_EC(EC_DISPLAY_CHANGED);
HANDLE_EC(EC_END_OF_SEGMENT);
HANDLE_EC(EC_ERROR_STILLPLAYING);
HANDLE_EC(EC_ERRORABORT);
HANDLE_EC(EC_EXTDEVICE_MODE_CHANGE);
HANDLE_EC(EC_FULLSCREEN_LOST);
HANDLE_EC(EC_GRAPH_CHANGED);
HANDLE_EC(EC_LENGTH_CHANGED);
HANDLE_EC(EC_NEED_RESTART);
HANDLE_EC(EC_NOTIFY_WINDOW);
HANDLE_EC(EC_OLE_EVENT);
HANDLE_EC(EC_OPENING_FILE);
HANDLE_EC(EC_PALETTE_CHANGED);
HANDLE_EC(EC_PAUSED);
HANDLE_EC(EC_QUALITY_CHANGE);
HANDLE_EC(EC_REPAINT);
HANDLE_EC(EC_SEGMENT_STARTED);
HANDLE_EC(EC_SHUTTING_DOWN);
HANDLE_EC(EC_SNDDEV_IN_ERROR);
HANDLE_EC(EC_SNDDEV_OUT_ERROR);
HANDLE_EC(EC_STARVATION);
HANDLE_EC(EC_STEP_COMPLETE);
HANDLE_EC(EC_STREAM_CONTROL_STARTED);
HANDLE_EC(EC_STREAM_CONTROL_STOPPED);
HANDLE_EC(EC_STREAM_ERROR_STILLPLAYING);
HANDLE_EC(EC_STREAM_ERROR_STOPPED);
HANDLE_EC(EC_TIMECODE_AVAILABLE);
HANDLE_EC(EC_USERABORT);
HANDLE_EC(EC_VIDEO_SIZE_CHANGED);
HANDLE_EC(EC_WINDOW_DESTROYED);
default:
bMatch = FALSE;
RetailOutput(TEXT(" Received unknown event code (0x%x)\r\n"), lEventCode);
break;
}
// If a recognized event was found, add its name to the events list box
if (bMatch)
ListEvents.AddString(szMsg);
}
void RetailOutput(TCHAR *tszErr, ...)
{
TCHAR tszErrOut[MAX_PATH + 256];
va_list valist;
va_start(valist,tszErr);
wvsprintf(tszErrOut, tszErr, valist);
OutputDebugString(tszErrOut);
va_end (valist);
}
void AddFilterCategoriesToList(CListBox& ListFilters)
{
HRESULT hr;
IEnumMoniker *pEmCat = 0;
ICreateDevEnum *pCreateDevEnum = NULL;
int nClasses=0;
// Create an enumerator
hr = CoCreateInstance(CLSID_SystemDeviceEnum, NULL, CLSCTX_INPROC_SERVER,
IID_ICreateDevEnum, (void**)&pCreateDevEnum);
ASSERT(SUCCEEDED(hr));
if (FAILED(hr))
return;
// Use the meta-category that contains a list of all categories.
// This emulates the behavior of GraphEdit.
hr = pCreateDevEnum->CreateClassEnumerator(
CLSID_ActiveMovieCategories, &pEmCat, 0);
ASSERT(SUCCEEDED(hr));
if(hr == S_OK)
{
IMoniker *pMCat;
ULONG cFetched;
// Enumerate over every category
while(hr = pEmCat->Next(1, &pMCat, &cFetched),
hr == S_OK)
{
IPropertyBag *pPropBag;
// Associate moniker with a file
hr = pMCat->BindToStorage(0, 0, IID_IPropertyBag, (void **)&pPropBag);
if(SUCCEEDED(hr))
{
VARIANT varCatClsid;
varCatClsid.vt = VT_BSTR;
// Read CLSID string from property bag
hr = pPropBag->Read(L"CLSID", &varCatClsid, 0);
if(SUCCEEDED(hr))
{
CLSID clsidCat;
if(CLSIDFromString(varCatClsid.bstrVal, &clsidCat) == S_OK)
{
USES_CONVERSION;
// Use the guid if we can't get the name
WCHAR *wszCatName;
TCHAR szCatDesc[MAX_PATH];
VARIANT varCatName;
varCatName.vt = VT_BSTR;
// Read filter name
hr = pPropBag->Read(L"FriendlyName", &varCatName, 0);
if(SUCCEEDED(hr))
wszCatName = varCatName.bstrVal;
else
wszCatName = varCatClsid.bstrVal;
lstrcpy(szCatDesc, W2T(wszCatName));
if(SUCCEEDED(hr))
SysFreeString(varCatName.bstrVal);
// Add category name and CLSID to list box
AddFilterToListWithCLSID(szCatDesc, &clsidCat, ListFilters);
nClasses++;
}
SysFreeString(varCatClsid.bstrVal);
}
pPropBag->Release();
}
else
{
break;
}
pMCat->Release();
} // for loop
pEmCat->Release();
}
pCreateDevEnum->Release();
}
void AddFilterToListWithCLSID(const TCHAR *szFilterName, const GUID *pCatGuid, CListBox& ListFilters)
{
// Allocate a new CLSID, whose pointer will be stored in
// the listbox. When the listbox is cleared, these will be deleted.
CLSID *pclsid = new CLSID;
// Add the category name and a pointer to its CLSID to the list box
int nSuccess = ListFilters.AddString(szFilterName);
int nIndexNew = ListFilters.FindStringExact(-1, szFilterName);
if (pclsid)
{
*pclsid = *pCatGuid;
nSuccess = ListFilters.SetItemDataPtr(nIndexNew, pclsid);
}
}
void ClearFilterListWithCLSID(CListBox& ListFilters)
{
CLSID *pStoredId = NULL;
int nCount = ListFilters.GetCount();
// Delete any CLSID pointers that were stored in the listbox item data
for (int i=0; i < nCount; i++)
{
pStoredId = (CLSID *) ListFilters.GetItemDataPtr(i);
if (pStoredId != 0)
{
delete pStoredId;
pStoredId = NULL;
}
}
// Clean up
ListFilters.ResetContent();
}
void AddFilterToListWithMoniker(const TCHAR *szFilterName,
IMoniker *pMoniker, CListBox& ListFilters)
{
// Add the category name and a pointer to its CLSID to the list box
int nSuccess = ListFilters.AddString(szFilterName);
int nIndexNew = ListFilters.FindStringExact(-1, szFilterName);
nSuccess = ListFilters.SetItemDataPtr(nIndexNew, pMoniker);
}
void ClearFilterListWithMoniker(CListBox& ListFilters)
{
IMoniker *pMoniker = NULL;
int nCount = ListFilters.GetCount();
// Delete any CLSID pointers that were stored in the listbox item data
for (int i=0; i < nCount; i++)
{
pMoniker = (IMoniker *) ListFilters.GetItemDataPtr(i);
if (pMoniker != 0)
{
pMoniker->Release();
pMoniker = NULL;
}
}
// Clean up
ListFilters.ResetContent();
}

View File

@@ -0,0 +1,58 @@
//------------------------------------------------------------------------------
// File: MFCUtil.h
//
// Desc: DirectShow sample code - prototypes for utility functions
// used by MFC applications.
//
// Copyright (c) 2000-2001 Microsoft Corporation. All rights reserved.
//------------------------------------------------------------------------------
//
// Application-defined messages
//
#define WM_GRAPHNOTIFY WM_APP + 1
#ifndef SAFE_RELEASE
#define SAFE_RELEASE(x) if(x) {x->Release(); x=0;}
#endif
#define JIF(x) if (FAILED(hr=(x))) \
{RetailOutput(TEXT("FAILED(0x%x) ") TEXT(#x) TEXT("\n"), hr); goto CLEANUP;}
//
// Function prototypes
//
HRESULT AddGraphFiltersToList (IGraphBuilder *pGB, CListBox& m_ListFilters);
HRESULT AddFilterPinsToLists (IGraphBuilder *pGB, CListBox& m_ListFilters,
CListBox& m_ListPinsInput, CListBox& m_ListPinsOutput);
HRESULT EnumPinsOnFilter (IBaseFilter *pFilter, PIN_DIRECTION PinDir, CListBox& Listbox);
// Enumeration functions that add extra data to the listbox
HRESULT EnumFiltersAndMonikersToList(IEnumMoniker *pEnumCat, CListBox& ListFilters);
HRESULT EnumFiltersAndCLSIDsToList(IEnumMoniker *pEnumCat, CListBox& ListFilters);
HRESULT EnumFiltersWithCLSIDToList(ICreateDevEnum *pSysDevEnum,
const GUID *clsid, CListBox& List);
HRESULT EnumFiltersWithMonikerToList(ICreateDevEnum *pSysDevEnum,
const GUID *clsid, CListBox& List);
// Similar to IGraphBuilder::FindFilterByName()
IBaseFilter *FindFilterFromName(IGraphBuilder *pGB, LPTSTR szNameToFind);
// Listbox add/clear functions that store extra data
void AddFilterToListWithCLSID (const TCHAR *szFilterName,
const GUID *pCatGuid, CListBox& ListFilters);
void AddFilterToListWithMoniker(const TCHAR *szFilterName,
IMoniker *pMoniker, CListBox& ListFilters);
void ClearFilterListWithCLSID (CListBox& ListFilters);
void ClearFilterListWithMoniker(CListBox& ListFilters);
// Listbox manipulation functions
void AddEventToList(CListBox& ListEvents, long lEventCode);
void AddFilterCategoriesToList(CListBox& ListFilters);
// Debug output
void RetailOutput(TCHAR *tszErr, ...);
BOOL GetFileInfoStrings(LPTSTR szFile, TCHAR *szSize, TCHAR *szDate);

View File

@@ -0,0 +1,420 @@
//------------------------------------------------------------------------------
// File: NamedGuid.cpp
//
// Desc: DirectShow sample code - helps in converting GUIDs to strings
//
// Copyright (c) 1996-2001 Microsoft Corporation. All rights reserved.
//------------------------------------------------------------------------------
#include <stdafx.h>
#include <dshow.h>
#include <dmo.h>
#include "namedguid.h"
//
// Create a large table to allow searches by CLSID, media type, IID, etc.
//
const NamedGuid rgng[] =
{
{&MEDIASUBTYPE_AIFF, TEXT("MEDIASUBTYPE_AIFF")},
{&MEDIASUBTYPE_AU, TEXT("MEDIASUBTYPE_AU")},
{&MEDIASUBTYPE_AnalogVideo_NTSC_M, TEXT("MEDIASUBTYPE_AnalogVideo_NTSC_M")},
{&MEDIASUBTYPE_AnalogVideo_PAL_B, TEXT("MEDIASUBTYPE_AnalogVideo_PAL_B")},
{&MEDIASUBTYPE_AnalogVideo_PAL_D, TEXT("MEDIASUBTYPE_AnalogVideo_PAL_D")},
{&MEDIASUBTYPE_AnalogVideo_PAL_G, TEXT("MEDIASUBTYPE_AnalogVideo_PAL_G")},
{&MEDIASUBTYPE_AnalogVideo_PAL_H, TEXT("MEDIASUBTYPE_AnalogVideo_PAL_H")},
{&MEDIASUBTYPE_AnalogVideo_PAL_I, TEXT("MEDIASUBTYPE_AnalogVideo_PAL_I")},
{&MEDIASUBTYPE_AnalogVideo_PAL_M, TEXT("MEDIASUBTYPE_AnalogVideo_PAL_M")},
{&MEDIASUBTYPE_AnalogVideo_PAL_N, TEXT("MEDIASUBTYPE_AnalogVideo_PAL_N")},
{&MEDIASUBTYPE_AnalogVideo_SECAM_B, TEXT("MEDIASUBTYPE_AnalogVideo_SECAM_B")},
{&MEDIASUBTYPE_AnalogVideo_SECAM_D, TEXT("MEDIASUBTYPE_AnalogVideo_SECAM_D")},
{&MEDIASUBTYPE_AnalogVideo_SECAM_G, TEXT("MEDIASUBTYPE_AnalogVideo_SECAM_G")},
{&MEDIASUBTYPE_AnalogVideo_SECAM_H, TEXT("MEDIASUBTYPE_AnalogVideo_SECAM_H")},
{&MEDIASUBTYPE_AnalogVideo_SECAM_K, TEXT("MEDIASUBTYPE_AnalogVideo_SECAM_K")},
{&MEDIASUBTYPE_AnalogVideo_SECAM_K1, TEXT("MEDIASUBTYPE_AnalogVideo_SECAM_K1")},
{&MEDIASUBTYPE_AnalogVideo_SECAM_L, TEXT("MEDIASUBTYPE_AnalogVideo_SECAM_L")},
{&MEDIASUBTYPE_Asf, TEXT("MEDIASUBTYPE_Asf")},
{&MEDIASUBTYPE_Avi, TEXT("MEDIASUBTYPE_Avi")},
{&MEDIASUBTYPE_CFCC, TEXT("MEDIASUBTYPE_CFCC")},
{&MEDIASUBTYPE_CLJR, TEXT("MEDIASUBTYPE_CLJR")},
{&MEDIASUBTYPE_CPLA, TEXT("MEDIASUBTYPE_CPLA")},
{&MEDIASUBTYPE_DOLBY_AC3, TEXT("MEDIASUBTYPE_DOLBY_AC3")},
{&MEDIASUBTYPE_DVCS, TEXT("MEDIASUBTYPE_DVCS")},
{&MEDIASUBTYPE_DVD_LPCM_AUDIO, TEXT("MEDIASUBTYPE_DVD_LPCM_AUDIO")},
{&MEDIASUBTYPE_DVD_NAVIGATION_DSI, TEXT("MEDIASUBTYPE_DVD_NAVIGATION_DSI")},
{&MEDIASUBTYPE_DVD_NAVIGATION_PCI, TEXT("MEDIASUBTYPE_DVD_NAVIGATION_PCI")},
{&MEDIASUBTYPE_DVD_NAVIGATION_PROVIDER, TEXT("MEDIASUBTYPE_DVD_NAVIGATION_PROVIDER")},
{&MEDIASUBTYPE_DVD_SUBPICTURE, TEXT("MEDIASUBTYPE_DVD_SUBPICTURE")},
{&MEDIASUBTYPE_DVSD, TEXT("MEDIASUBTYPE_DVSD")},
{&MEDIASUBTYPE_DssAudio, TEXT("MEDIASUBTYPE_DssAudio")},
{&MEDIASUBTYPE_DssVideo, TEXT("MEDIASUBTYPE_DssVideo")},
{&MEDIASUBTYPE_IF09, TEXT("MEDIASUBTYPE_IF09")},
{&MEDIASUBTYPE_IJPG, TEXT("MEDIASUBTYPE_IJPG")},
{&MEDIASUBTYPE_Line21_BytePair, TEXT("MEDIASUBTYPE_Line21_BytePair")},
{&MEDIASUBTYPE_Line21_GOPPacket, TEXT("MEDIASUBTYPE_Line21_GOPPacket")},
{&MEDIASUBTYPE_Line21_VBIRawData, TEXT("MEDIASUBTYPE_Line21_VBIRawData")},
{&MEDIASUBTYPE_MDVF, TEXT("MEDIASUBTYPE_MDVF")},
{&MEDIASUBTYPE_MJPG, TEXT("MEDIASUBTYPE_MJPG")},
{&MEDIASUBTYPE_MPEG1Audio, TEXT("MEDIASUBTYPE_MPEG1Audio")},
{&MEDIASUBTYPE_MPEG1AudioPayload, TEXT("MEDIASUBTYPE_MPEG1AudioPayload")},
{&MEDIASUBTYPE_MPEG1Packet, TEXT("MEDIASUBTYPE_MPEG1Packet")},
{&MEDIASUBTYPE_MPEG1Payload, TEXT("MEDIASUBTYPE_MPEG1Payload")},
{&MEDIASUBTYPE_MPEG1System, TEXT("MEDIASUBTYPE_MPEG1System")},
{&MEDIASUBTYPE_MPEG1Video, TEXT("MEDIASUBTYPE_MPEG1Video")},
{&MEDIASUBTYPE_MPEG1VideoCD, TEXT("MEDIASUBTYPE_MPEG1VideoCD")},
{&MEDIASUBTYPE_MPEG2_AUDIO, TEXT("MEDIASUBTYPE_MPEG2_AUDIO")},
{&MEDIASUBTYPE_MPEG2_PROGRAM, TEXT("MEDIASUBTYPE_MPEG2_PROGRAM")},
{&MEDIASUBTYPE_MPEG2_TRANSPORT, TEXT("MEDIASUBTYPE_MPEG2_TRANSPORT")},
{&MEDIASUBTYPE_MPEG2_VIDEO, TEXT("MEDIASUBTYPE_MPEG2_VIDEO")},
{&MEDIASUBTYPE_None, TEXT("MEDIASUBTYPE_None")},
{&MEDIASUBTYPE_Overlay, TEXT("MEDIASUBTYPE_Overlay")},
{&MEDIASUBTYPE_PCM, TEXT("MEDIASUBTYPE_PCM")},
{&MEDIASUBTYPE_PCMAudio_Obsolete, TEXT("MEDIASUBTYPE_PCMAudio_Obsolete")},
{&MEDIASUBTYPE_Plum, TEXT("MEDIASUBTYPE_Plum")},
{&MEDIASUBTYPE_QTJpeg, TEXT("MEDIASUBTYPE_QTJpeg")},
{&MEDIASUBTYPE_QTMovie, TEXT("MEDIASUBTYPE_QTMovie")},
{&MEDIASUBTYPE_QTRle, TEXT("MEDIASUBTYPE_QTRle")},
{&MEDIASUBTYPE_QTRpza, TEXT("MEDIASUBTYPE_QTRpza")},
{&MEDIASUBTYPE_QTSmc, TEXT("MEDIASUBTYPE_QTSmc")},
{&MEDIASUBTYPE_RGB1, TEXT("MEDIASUBTYPE_RGB1")},
{&MEDIASUBTYPE_RGB24, TEXT("MEDIASUBTYPE_RGB24")},
{&MEDIASUBTYPE_RGB32, TEXT("MEDIASUBTYPE_RGB32")},
{&MEDIASUBTYPE_RGB4, TEXT("MEDIASUBTYPE_RGB4")},
{&MEDIASUBTYPE_RGB555, TEXT("MEDIASUBTYPE_RGB555")},
{&MEDIASUBTYPE_RGB565, TEXT("MEDIASUBTYPE_RGB565")},
{&MEDIASUBTYPE_RGB8, TEXT("MEDIASUBTYPE_RGB8")},
{&MEDIASUBTYPE_TVMJ, TEXT("MEDIASUBTYPE_TVMJ")},
{&MEDIASUBTYPE_UYVY, TEXT("MEDIASUBTYPE_UYVY")},
{&MEDIASUBTYPE_VPVBI, TEXT("MEDIASUBTYPE_VPVBI")},
{&MEDIASUBTYPE_VPVideo, TEXT("MEDIASUBTYPE_VPVideo")},
{&MEDIASUBTYPE_WAKE, TEXT("MEDIASUBTYPE_WAKE")},
{&MEDIASUBTYPE_WAVE, TEXT("MEDIASUBTYPE_WAVE")},
{&MEDIASUBTYPE_Y211, TEXT("MEDIASUBTYPE_Y211")},
{&MEDIASUBTYPE_Y411, TEXT("MEDIASUBTYPE_Y411")},
{&MEDIASUBTYPE_Y41P, TEXT("MEDIASUBTYPE_Y41P")},
{&MEDIASUBTYPE_YUY2, TEXT("MEDIASUBTYPE_YUY2")},
{&MEDIASUBTYPE_YV12, TEXT("MEDIASUBTYPE_YV12")},
{&MEDIASUBTYPE_YVU9, TEXT("MEDIASUBTYPE_YVU9")},
{&MEDIASUBTYPE_YVYU, TEXT("MEDIASUBTYPE_YVYU")},
{&MEDIASUBTYPE_dvhd, TEXT("MEDIASUBTYPE_dvhd")},
{&MEDIASUBTYPE_dvsd, TEXT("MEDIASUBTYPE_dvsd")},
{&MEDIASUBTYPE_dvsl, TEXT("MEDIASUBTYPE_dvsl")},
{&MEDIATYPE_AUXLine21Data, TEXT("MEDIATYPE_AUXLine21Data")},
{&MEDIATYPE_AnalogAudio, TEXT("MEDIATYPE_AnalogAudio")},
{&MEDIATYPE_AnalogVideo, TEXT("MEDIATYPE_AnalogVideo")},
{&MEDIATYPE_Audio, TEXT("MEDIATYPE_Audio")},
{&MEDIATYPE_DVD_ENCRYPTED_PACK, TEXT("MEDIATYPE_DVD_ENCRYPTED_PACK")},
{&MEDIATYPE_DVD_NAVIGATION, TEXT("MEDIATYPE_DVD_NAVIGATION")},
{&MEDIATYPE_File, TEXT("MEDIATYPE_File")},
{&MEDIATYPE_Interleaved, TEXT("MEDIATYPE_Interleaved")},
{&MEDIATYPE_LMRT, TEXT("MEDIATYPE_LMRT")},
{&MEDIATYPE_MPEG1SystemStream, TEXT("MEDIATYPE_MPEG1SystemStream")},
{&MEDIATYPE_MPEG2_PES, TEXT("MEDIATYPE_MPEG2_PES")},
{&MEDIATYPE_Midi, TEXT("MEDIATYPE_Midi")},
{&MEDIATYPE_ScriptCommand, TEXT("MEDIATYPE_ScriptCommand")},
{&MEDIATYPE_Stream, TEXT("MEDIATYPE_Stream")},
{&MEDIATYPE_Text, TEXT("MEDIATYPE_Text")},
{&MEDIATYPE_Timecode, TEXT("MEDIATYPE_Timecode")},
{&MEDIATYPE_URL_STREAM, TEXT("MEDIATYPE_URL_STREAM")},
{&MEDIATYPE_Video, TEXT("MEDIATYPE_Video")},
{&WMMEDIASUBTYPE_Base, TEXT("WMMEDIASUBTYPE_Base")},
{&WMMEDIASUBTYPE_RGB1, TEXT("WMMEDIASUBTYPE_RGB1")},
{&WMMEDIASUBTYPE_RGB4, TEXT("WMMEDIASUBTYPE_RGB4")},
{&WMMEDIASUBTYPE_RGB8, TEXT("WMMEDIASUBTYPE_RGB8")},
{&WMMEDIASUBTYPE_RGB565, TEXT("WMMEDIASUBTYPE_RGB565")},
{&WMMEDIASUBTYPE_RGB555, TEXT("WMMEDIASUBTYPE_RGB555")},
{&WMMEDIASUBTYPE_RGB24, TEXT("WMMEDIASUBTYPE_RGB24")},
{&WMMEDIASUBTYPE_RGB32, TEXT("WMMEDIASUBTYPE_RGB32")},
{&WMMEDIASUBTYPE_I420, TEXT("WMMEDIASUBTYPE_I420")},
{&WMMEDIASUBTYPE_IYUV, TEXT("WMMEDIASUBTYPE_IYUV")},
{&WMMEDIASUBTYPE_YV12, TEXT("WMMEDIASUBTYPE_YV12")},
{&WMMEDIASUBTYPE_YUY2, TEXT("WMMEDIASUBTYPE_YUY2")},
{&WMMEDIASUBTYPE_UYVY, TEXT("WMMEDIASUBTYPE_UYVY")},
{&WMMEDIASUBTYPE_YVYU, TEXT("WMMEDIASUBTYPE_YVYU")},
{&WMMEDIASUBTYPE_YVU9, TEXT("WMMEDIASUBTYPE_YVU9")},
{&WMMEDIASUBTYPE_MP43, TEXT("WMMEDIASUBTYPE_MP43")},
{&WMMEDIASUBTYPE_MP4S, TEXT("WMMEDIASUBTYPE_MP4S")},
{&WMMEDIASUBTYPE_WMV1, TEXT("WMMEDIASUBTYPE_WMV1")},
{&WMMEDIASUBTYPE_MSS1, TEXT("WMMEDIASUBTYPE_MSS1")},
{&WMMEDIASUBTYPE_PCM, TEXT("WMMEDIASUBTYPE_PCM")},
{&WMMEDIASUBTYPE_DRM, TEXT("WMMEDIASUBTYPE_DRM")},
{&WMMEDIASUBTYPE_WMAudioV7, TEXT("WMMEDIASUBTYPE_WMAudioV7")},
{&WMMEDIASUBTYPE_WMAudioV2, TEXT("WMMEDIASUBTYPE_WMAudioV2")},
{&WMMEDIASUBTYPE_ACELPnet, TEXT("WMMEDIASUBTYPE_ACELPnet")},
{&WMMEDIATYPE_Audio, TEXT("WMMEDIATYPE_Audio")},
{&WMMEDIATYPE_Video, TEXT("WMMEDIATYPE_Video")},
{&WMMEDIATYPE_Script, TEXT("WMMEDIATYPE_Script")},
{&WMMEDIATYPE_Image, TEXT("WMMEDIATYPE_Image")},
{&WMFORMAT_VideoInfo, TEXT("WMFORMAT_VideoInfo")},
{&WMFORMAT_WaveFormatEx, TEXT("WMFORMAT_WaveFormatEx")},
{&WMFORMAT_Script, TEXT("WMFORMAT_Script")},
{&WMSCRIPTTYPE_TwoStrings, TEXT("WMSCRIPTTYPE_TwoStrings")},
{&PIN_CATEGORY_ANALOGVIDEOIN, TEXT("PIN_CATEGORY_ANALOGVIDEOIN")},
{&PIN_CATEGORY_CAPTURE, TEXT("PIN_CATEGORY_CAPTURE")},
{&PIN_CATEGORY_CC, TEXT("PIN_CATEGORY_CC")},
{&PIN_CATEGORY_EDS, TEXT("PIN_CATEGORY_EDS")},
{&PIN_CATEGORY_NABTS, TEXT("PIN_CATEGORY_NABTS")},
{&PIN_CATEGORY_PREVIEW, TEXT("PIN_CATEGORY_PREVIEW")},
{&PIN_CATEGORY_STILL, TEXT("PIN_CATEGORY_STILL")},
{&PIN_CATEGORY_TELETEXT, TEXT("PIN_CATEGORY_TELETEXT")},
{&PIN_CATEGORY_TIMECODE, TEXT("PIN_CATEGORY_TIMECODE")},
{&PIN_CATEGORY_VBI, TEXT("PIN_CATEGORY_VBI")},
{&PIN_CATEGORY_VIDEOPORT, TEXT("PIN_CATEGORY_VIDEOPORT")},
{&PIN_CATEGORY_VIDEOPORT_VBI, TEXT("PIN_CATEGORY_VIDEOPORT_VBI")},
{&CLSID_ACMWrapper, TEXT("CLSID_ACMWrapper")},
{&CLSID_AVICo, TEXT("CLSID_AVICo")},
{&CLSID_AVIDec, TEXT("CLSID_AVIDec")},
{&CLSID_AVIDoc, TEXT("CLSID_AVIDoc")},
{&CLSID_AVIDraw, TEXT("CLSID_AVIDraw")},
{&CLSID_AVIMIDIRender, TEXT("CLSID_AVIMIDIRender")},
{&CLSID_ActiveMovieCategories, TEXT("CLSID_ActiveMovieCategories")},
{&CLSID_AnalogVideoDecoderPropertyPage, TEXT("CLSID_AnalogVideoDecoderPropertyPage")},
{&CLSID_WMAsfReader, TEXT("CLSID_WMAsfReader")},
{&CLSID_WMAsfWriter, TEXT("CLSID_WMAsfWriter")},
{&CLSID_AsyncReader, TEXT("CLSID_AsyncReader")},
{&CLSID_AudioCompressorCategory, TEXT("CLSID_AudioCompressorCategory")},
{&CLSID_AudioInputDeviceCategory, TEXT("CLSID_AudioInputDeviceCategory")},
{&CLSID_AudioProperties, TEXT("CLSID_AudioProperties")},
{&CLSID_AudioRecord, TEXT("CLSID_AudioRecord")},
{&CLSID_AudioRender, TEXT("CLSID_AudioRender")},
{&CLSID_AudioRendererCategory, TEXT("CLSID_AudioRendererCategory")},
{&CLSID_AviDest, TEXT("CLSID_AviDest")},
{&CLSID_AviMuxProptyPage, TEXT("CLSID_AviMuxProptyPage")},
{&CLSID_AviMuxProptyPage1, TEXT("CLSID_AviMuxProptyPage1")},
{&CLSID_AviReader, TEXT("CLSID_AviReader")},
{&CLSID_AviSplitter, TEXT("CLSID_AviSplitter")},
{&CLSID_CAcmCoClassManager, TEXT("CLSID_CAcmCoClassManager")},
{&CLSID_CDeviceMoniker, TEXT("CLSID_CDeviceMoniker")},
{&CLSID_CIcmCoClassManager, TEXT("CLSID_CIcmCoClassManager")},
{&CLSID_CMidiOutClassManager, TEXT("CLSID_CMidiOutClassManager")},
{&CLSID_CMpegAudioCodec, TEXT("CLSID_CMpegAudioCodec")},
{&CLSID_CMpegVideoCodec, TEXT("CLSID_CMpegVideoCodec")},
{&CLSID_CQzFilterClassManager, TEXT("CLSID_CQzFilterClassManager")},
{&CLSID_CVidCapClassManager, TEXT("CLSID_CVidCapClassManager")},
{&CLSID_CWaveOutClassManager, TEXT("CLSID_CWaveOutClassManager")},
{&CLSID_CWaveinClassManager, TEXT("CLSID_CWaveinClassManager")},
{&CLSID_CameraControlPropertyPage, TEXT("CLSID_CameraControlPropertyPage")},
{&CLSID_CaptureGraphBuilder, TEXT("CLSID_CaptureGraphBuilder")},
{&CLSID_CaptureProperties, TEXT("CLSID_CaptureProperties")},
{&CLSID_Colour, TEXT("CLSID_Colour")},
{&CLSID_CrossbarFilterPropertyPage, TEXT("CLSID_CrossbarFilterPropertyPage")},
{&CLSID_DSoundRender, TEXT("CLSID_DSoundRender")},
{&CLSID_DVDHWDecodersCategory, TEXT("CLSID_DVDHWDecodersCategory")},
{&CLSID_DVDNavigator, TEXT("CLSID_DVDNavigator")},
{&CLSID_DVDecPropertiesPage, TEXT("CLSID_DVDecPropertiesPage")},
{&CLSID_DVEncPropertiesPage, TEXT("CLSID_DVEncPropertiesPage")},
{&CLSID_DVMux, TEXT("CLSID_DVMux")},
{&CLSID_DVMuxPropertyPage, TEXT("CLSID_DVMuxPropertyPage")},
{&CLSID_DVSplitter, TEXT("CLSID_DVSplitter")},
{&CLSID_DVVideoCodec, TEXT("CLSID_DVVideoCodec")},
{&CLSID_DVVideoEnc, TEXT("CLSID_DVVideoEnc")},
{&CLSID_DirectDraw, TEXT("CLSID_DirectDraw")},
{&CLSID_DirectDrawClipper, TEXT("CLSID_DirectDrawClipper")},
{&CLSID_DirectDrawProperties, TEXT("CLSID_DirectDrawProperties")},
{&CLSID_Dither, TEXT("CLSID_Dither")},
{&CLSID_DvdGraphBuilder, TEXT("CLSID_DvdGraphBuilder")},
{&CLSID_FGControl, TEXT("CLSID_FGControl")},
{&CLSID_FileSource, TEXT("CLSID_FileSource")},
{&CLSID_FileWriter, TEXT("CLSID_FileWriter")},
{&CLSID_FilterGraph, TEXT("CLSID_FilterGraph")},
{&CLSID_FilterGraphNoThread, TEXT("CLSID_FilterGraphNoThread")},
{&CLSID_FilterMapper, TEXT("CLSID_FilterMapper")},
{&CLSID_FilterMapper2, TEXT("CLSID_FilterMapper2")},
{&CLSID_InfTee, TEXT("CLSID_InfTee")},
{&CLSID_LegacyAmFilterCategory, TEXT("CLSID_LegacyAmFilterCategory")},
{&CLSID_Line21Decoder, TEXT("CLSID_Line21Decoder")},
{&CLSID_MOVReader, TEXT("CLSID_MOVReader")},
{&CLSID_MPEG1Doc, TEXT("CLSID_MPEG1Doc")},
{&CLSID_MPEG1PacketPlayer, TEXT("CLSID_MPEG1PacketPlayer")},
{&CLSID_MPEG1Splitter, TEXT("CLSID_MPEG1Splitter")},
{&CLSID_MediaPropertyBag, TEXT("CLSID_MediaPropertyBag")},
{&CLSID_MemoryAllocator, TEXT("CLSID_MemoryAllocator")},
{&CLSID_MidiRendererCategory, TEXT("CLSID_MidiRendererCategory")},
{&CLSID_ModexProperties, TEXT("CLSID_ModexProperties")},
{&CLSID_ModexRenderer, TEXT("CLSID_ModexRenderer")},
{&CLSID_OverlayMixer, TEXT("CLSID_OverlayMixer")},
{&CLSID_PerformanceProperties, TEXT("CLSID_PerformanceProperties")},
{&CLSID_PersistMonikerPID, TEXT("CLSID_PersistMonikerPID")},
{&CLSID_ProtoFilterGraph, TEXT("CLSID_ProtoFilterGraph")},
{&CLSID_QualityProperties, TEXT("CLSID_QualityProperties")},
{&CLSID_SeekingPassThru, TEXT("CLSID_SeekingPassThru")},
{&CLSID_SmartTee, TEXT("CLSID_SmartTee")},
{&CLSID_SystemClock, TEXT("CLSID_SystemClock")},
{&CLSID_SystemDeviceEnum, TEXT("CLSID_SystemDeviceEnum")},
{&CLSID_TVAudioFilterPropertyPage, TEXT("CLSID_TVAudioFilterPropertyPage")},
{&CLSID_TVTunerFilterPropertyPage, TEXT("CLSID_TVTunerFilterPropertyPage")},
{&CLSID_TextRender, TEXT("CLSID_TextRender")},
{&CLSID_URLReader, TEXT("CLSID_URLReader")},
{&CLSID_VBISurfaces, TEXT("CLSID_VBISurfaces")},
{&CLSID_VPObject, TEXT("CLSID_VPObject")},
{&CLSID_VPVBIObject, TEXT("CLSID_VPVBIObject")},
{&CLSID_VfwCapture, TEXT("CLSID_VfwCapture")},
{&CLSID_VideoCompressorCategory, TEXT("CLSID_VideoCompressorCategory")},
{&CLSID_VideoInputDeviceCategory, TEXT("CLSID_VideoInputDeviceCategory")},
{&CLSID_VideoProcAmpPropertyPage, TEXT("CLSID_VideoProcAmpPropertyPage")},
{&CLSID_VideoRenderer, TEXT("CLSID_VideoRenderer")},
{&CLSID_VideoStreamConfigPropertyPage, TEXT("CLSID_VideoStreamConfigPropertyPage")},
{&FORMAT_AnalogVideo, TEXT("FORMAT_AnalogVideo")},
{&FORMAT_DVD_LPCMAudio, TEXT("FORMAT_DVD_LPCMAudio")},
{&FORMAT_DolbyAC3, TEXT("FORMAT_DolbyAC3")},
{&FORMAT_DvInfo, TEXT("FORMAT_DvInfo")},
{&FORMAT_MPEG2Audio, TEXT("FORMAT_MPEG2Audio")},
{&FORMAT_MPEG2Video, TEXT("FORMAT_MPEG2Video")},
{&FORMAT_MPEG2_VIDEO, TEXT("FORMAT_MPEG2_VIDEO")},
{&FORMAT_MPEGStreams, TEXT("FORMAT_MPEGStreams")},
{&FORMAT_MPEGVideo, TEXT("FORMAT_MPEGVideo")},
{&FORMAT_None, TEXT("FORMAT_None")},
{&FORMAT_VIDEOINFO2, TEXT("FORMAT_VIDEOINFO2")},
{&FORMAT_VideoInfo, TEXT("FORMAT_VideoInfo")},
{&FORMAT_VideoInfo2, TEXT("FORMAT_VideoInfo2")},
{&FORMAT_WaveFormatEx, TEXT("FORMAT_WaveFormatEx")},
{&TIME_FORMAT_BYTE, TEXT("TIME_FORMAT_BYTE")},
{&TIME_FORMAT_FIELD, TEXT("TIME_FORMAT_FIELD")},
{&TIME_FORMAT_FRAME, TEXT("TIME_FORMAT_FRAME")},
{&TIME_FORMAT_MEDIA_TIME, TEXT("TIME_FORMAT_MEDIA_TIME")},
{&TIME_FORMAT_SAMPLE, TEXT("TIME_FORMAT_SAMPLE")},
{&AMPROPSETID_Pin, TEXT("AMPROPSETID_Pin")},
{&AM_INTERFACESETID_Standard, TEXT("AM_INTERFACESETID_Standard")},
{&AM_KSCATEGORY_AUDIO, TEXT("AM_KSCATEGORY_AUDIO")},
{&AM_KSCATEGORY_CAPTURE, TEXT("AM_KSCATEGORY_CAPTURE")},
{&AM_KSCATEGORY_CROSSBAR, TEXT("AM_KSCATEGORY_CROSSBAR")},
{&AM_KSCATEGORY_DATACOMPRESSOR, TEXT("AM_KSCATEGORY_DATACOMPRESSOR")},
{&AM_KSCATEGORY_RENDER, TEXT("AM_KSCATEGORY_RENDER")},
{&AM_KSCATEGORY_TVAUDIO, TEXT("AM_KSCATEGORY_TVAUDIO")},
{&AM_KSCATEGORY_TVTUNER, TEXT("AM_KSCATEGORY_TVTUNER")},
{&AM_KSCATEGORY_VIDEO, TEXT("AM_KSCATEGORY_VIDEO")},
{&AM_KSPROPSETID_AC3, TEXT("AM_KSPROPSETID_AC3")},
{&AM_KSPROPSETID_CopyProt, TEXT("AM_KSPROPSETID_CopyProt")},
{&AM_KSPROPSETID_DvdSubPic, TEXT("AM_KSPROPSETID_DvdSubPic")},
{&AM_KSPROPSETID_TSRateChange, TEXT("AM_KSPROPSETID_TSRateChange")},
{&IID_IAMDirectSound, TEXT("IID_IAMDirectSound")},
{&IID_IAMLine21Decoder, TEXT("IID_IAMLine21Decoder")},
{&IID_IBaseVideoMixer, TEXT("IID_IBaseVideoMixer")},
{&IID_IDDVideoPortContainer, TEXT("IID_IDDVideoPortContainer")},
{&IID_IDirectDraw, TEXT("IID_IDirectDraw")},
{&IID_IDirectDraw2, TEXT("IID_IDirectDraw2")},
{&IID_IDirectDrawClipper, TEXT("IID_IDirectDrawClipper")},
{&IID_IDirectDrawColorControl, TEXT("IID_IDirectDrawColorControl")},
{&IID_IDirectDrawKernel, TEXT("IID_IDirectDrawKernel")},
{&IID_IDirectDrawPalette, TEXT("IID_IDirectDrawPalette")},
{&IID_IDirectDrawSurface, TEXT("IID_IDirectDrawSurface")},
{&IID_IDirectDrawSurface2, TEXT("IID_IDirectDrawSurface2")},
{&IID_IDirectDrawSurface3, TEXT("IID_IDirectDrawSurface3")},
{&IID_IDirectDrawSurfaceKernel, TEXT("IID_IDirectDrawSurfaceKernel")},
{&IID_IDirectDrawVideo, TEXT("IID_IDirectDrawVideo")},
{&IID_IFullScreenVideo, TEXT("IID_IFullScreenVideo")},
{&IID_IFullScreenVideoEx, TEXT("IID_IFullScreenVideoEx")},
{&IID_IKsDataTypeHandler, TEXT("IID_IKsDataTypeHandler")},
{&IID_IKsInterfaceHandler, TEXT("IID_IKsInterfaceHandler")},
{&IID_IKsPin, TEXT("IID_IKsPin")},
{&IID_IMixerPinConfig, TEXT("IID_IMixerPinConfig")},
{&IID_IMixerPinConfig2, TEXT("IID_IMixerPinConfig2")},
{&IID_IMpegAudioDecoder, TEXT("IID_IMpegAudioDecoder")},
{&IID_IQualProp, TEXT("IID_IQualProp")},
{&IID_IVPConfig, TEXT("IID_IVPConfig")},
{&IID_IVPControl, TEXT("IID_IVPControl")},
{&IID_IVPNotify, TEXT("IID_IVPNotify")},
{&IID_IVPNotify2, TEXT("IID_IVPNotify2")},
{&IID_IVPObject, TEXT("IID_IVPObject")},
{&IID_IVPVBIConfig, TEXT("IID_IVPVBIConfig")},
{&IID_IVPVBINotify, TEXT("IID_IVPVBINotify")},
{&IID_IVPVBIObject, TEXT("IID_IVPVBIObject")},
{&LOOK_DOWNSTREAM_ONLY, TEXT("LOOK_DOWNSTREAM_ONLY")},
{&LOOK_UPSTREAM_ONLY, TEXT("LOOK_UPSTREAM_ONLY")},
{0, 0},
};
void GetGUIDString(TCHAR *szString, GUID *pGUID)
{
int i=0;
// Find format GUID's name in the named guids table
while (rgng[i].pguid != 0)
{
if(*pGUID == *(rgng[i].pguid))
{
wsprintf(szString, TEXT("%s\0"), rgng[i].psz);
return;
}
i++;
}
// If we got here, there was no match
wsprintf(szString, TEXT("GUID_NULL\0"));
}
void GetFormatString(TCHAR *szFormat, DMO_MEDIA_TYPE *pType)
{
int i=0;
// Find format GUID's name in the named guids table
while (rgng[i].pguid != 0)
{
if(pType->formattype == *(rgng[i].pguid))
{
wsprintf(szFormat, TEXT("%s\0"), rgng[i].psz);
return;
}
i++;
}
// If we got here, there was no match
wsprintf(szFormat, TEXT("Format_None\0"));
}
void GetTypeSubtypeString(TCHAR *szCLSID, DMO_PARTIAL_MEDIATYPE& aList)
{
HRESULT hr;
CString strType, strSubtype;
int j;
LPOLESTR szType, szSubtype;
// Convert binary CLSID to a readable version
hr = StringFromCLSID(aList.type, &szType);
if(FAILED(hr))
return;
hr = StringFromCLSID(aList.subtype, &szSubtype);
if(FAILED(hr))
return;
// Set default type/subtype strings to their actual GUID values
strType = szType;
strSubtype = szSubtype;
// Find type GUID's name in the named guids table
j=0;
while (rgng[j].pguid != 0)
{
if(aList.type == *(rgng[j].pguid))
{
strType = rgng[j].psz; // Save type name
break;
}
j++;
}
// Find subtype GUID's name in the named guids table
j=0;
while (rgng[j].pguid != 0)
{
if(aList.subtype == *(rgng[j].pguid))
{
strSubtype = rgng[j].psz; // Save subtype name
break;
}
j++;
}
// Build a string with the type/subtype information.
// If a friendly name was found, it will be used.
// Otherwise, the type/subtype's GUID will be displayed.
wsprintf(szCLSID, TEXT("%s\t%s"), strType, strSubtype);
}

View File

@@ -0,0 +1,128 @@
//------------------------------------------------------------------------------
// File: NamedGuid.h
//
// Desc: DirectShow sample code - helps in converting GUIDs to strings
//
// Copyright (c) 2000-2001 Microsoft Corporation. All rights reserved.
//------------------------------------------------------------------------------
#ifndef NAMEDGUID_H_DEFINED
#define NAMEDGUID_H_DEFINED
// Function prototypes
void GetGUIDString(TCHAR *szString, GUID *pGUID);
void GetFormatString(TCHAR *szFormat, DMO_MEDIA_TYPE *pType);
void GetTypeSubtypeString(TCHAR *szCLSID, DMO_PARTIAL_MEDIATYPE& aList);
struct NamedGuid
{
const GUID *pguid;
const TCHAR *psz;
};
extern const NamedGuid rgng[];
//
// Define some Windows Media GUIDs to remove need for large WM header files.
// This is OK since GUIDs don't change.
//
// 00000000-0000-0010-8000-00AA00389B71 WMMEDIASUBTYPE_Base
EXTERN_GUID(WMMEDIASUBTYPE_Base,
0x00000000, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71);
// 73646976-0000-0010-8000-00AA00389B71 'vids' == WMMEDIATYPE_Video
EXTERN_GUID(WMMEDIATYPE_Video,
0x73646976, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
// e436eb78-524f-11ce-9f53-0020af0ba770 MEDIASUBTYPE_RGB1
EXTERN_GUID(WMMEDIASUBTYPE_RGB1,
0xe436eb78, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70);
// e436eb79-524f-11ce-9f53-0020af0ba770 MEDIASUBTYPE_RGB4
EXTERN_GUID(WMMEDIASUBTYPE_RGB4,
0xe436eb79, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70);
// e436eb7a-524f-11ce-9f53-0020af0ba770 MEDIASUBTYPE_RGB8
EXTERN_GUID(WMMEDIASUBTYPE_RGB8,
0xe436eb7a, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70);
// e436eb7b-524f-11ce-9f53-0020af0ba770 MEDIASUBTYPE_RGB565
EXTERN_GUID(WMMEDIASUBTYPE_RGB565,
0xe436eb7b, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70);
// e436eb7c-524f-11ce-9f53-0020af0ba770 MEDIASUBTYPE_RGB555
EXTERN_GUID(WMMEDIASUBTYPE_RGB555,
0xe436eb7c, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70);
// e436eb7d-524f-11ce-9f53-0020af0ba770 MEDIASUBTYPE_RGB24
EXTERN_GUID(WMMEDIASUBTYPE_RGB24,
0xe436eb7d, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70);
// e436eb7e-524f-11ce-9f53-0020af0ba770 MEDIASUBTYPE_RGB32
EXTERN_GUID(WMMEDIASUBTYPE_RGB32,
0xe436eb7e, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70);
// 30323449-0000-0010-8000-00AA00389B71 'YV12' == MEDIASUBTYPE_I420
EXTERN_GUID(WMMEDIASUBTYPE_I420,
0x30323449, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
// 56555949-0000-0010-8000-00AA00389B71 'YV12' == MEDIASUBTYPE_IYUV
EXTERN_GUID(WMMEDIASUBTYPE_IYUV,
0x56555949, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
// 31313259-0000-0010-8000-00AA00389B71 'YV12' == MEDIASUBTYPE_YV12
EXTERN_GUID(WMMEDIASUBTYPE_YV12,
0x32315659, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
// 32595559-0000-0010-8000-00AA00389B71 'YUY2' == MEDIASUBTYPE_YUY2
EXTERN_GUID(WMMEDIASUBTYPE_YUY2,
0x32595559, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
// 59565955-0000-0010-8000-00AA00389B71 'UYVY' == MEDIASUBTYPE_UYVY
EXTERN_GUID(WMMEDIASUBTYPE_UYVY,
0x59565955, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
// 55595659-0000-0010-8000-00AA00389B71 'YVYU' == MEDIASUBTYPE_YVYU
EXTERN_GUID(WMMEDIASUBTYPE_YVYU,
0x55595659, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
// 39555659-0000-0010-8000-00AA00389B71 'YVU9' == MEDIASUBTYPE_YVU9
EXTERN_GUID(WMMEDIASUBTYPE_YVU9,
0x39555659, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
// 3334504D-0000-0010-8000-00AA00389B71 WMMEDIASUBTYPE_MP43
EXTERN_GUID(WMMEDIASUBTYPE_MP43,
0x3334504D, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71);
// 5334504D-0000-0010-8000-00AA00389B71 WMMEDIASUBTYPE_MP4S
EXTERN_GUID(WMMEDIASUBTYPE_MP4S,
0x5334504D, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71);
// 31564D57-0000-0010-8000-00AA00389B71 WMMEDIASUBTYPE_WMV1
EXTERN_GUID(WMMEDIASUBTYPE_WMV1,
0x31564D57, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71);
// 3153534D-0000-0010-8000-00AA00389B71 WMMEDIASUBTYPE_MSS1
EXTERN_GUID(WMMEDIASUBTYPE_MSS1,
0x3153534D, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71);
// 73647561-0000-0010-8000-00AA00389B71 'auds' == WMMEDIATYPE_Audio
EXTERN_GUID(WMMEDIATYPE_Audio,
0x73647561, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
// 00000001-0000-0010-8000-00AA00389B71 WMMEDIASUBTYPE_PCM
EXTERN_GUID(WMMEDIASUBTYPE_PCM,
0x00000001, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71);
// 00000009-0000-0010-8000-00AA00389B71 WMMEDIASUBTYPE_DRM
EXTERN_GUID(WMMEDIASUBTYPE_DRM,
0x00000009, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71);
// 00000161-0000-0010-8000-00AA00389B71 WMMEDIASUBTYPE_WMAudioV7
EXTERN_GUID(WMMEDIASUBTYPE_WMAudioV7,
0x00000161, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71);
// 00000161-0000-0010-8000-00AA00389B71 WMMEDIASUBTYPE_WMAudioV2
EXTERN_GUID(WMMEDIASUBTYPE_WMAudioV2,
0x00000161, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71);
// 00000130-0000-0010-8000-00AA00389B71 WMMEDIASUBTYPE_ACELPnet
EXTERN_GUID(WMMEDIASUBTYPE_ACELPnet,
0x00000130, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71);
// 73636d64-0000-0010-8000-00AA00389B71 'scmd' == MEDIATYPE_Script
EXTERN_GUID(WMMEDIATYPE_Script,
0x73636d64, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
// 34A50FD8-8AA5-4386-81FE-A0EFE0488E31 WMMEDIATYPE_Image
EXTERN_GUID(WMMEDIATYPE_Image,
0x34a50fd8, 0x8aa5, 0x4386, 0x81, 0xfe, 0xa0, 0xef, 0xe0, 0x48, 0x8e, 0x31);
// 05589f80-c356-11ce-bf01-00aa0055595a WMFORMAT_VideoInfo
EXTERN_GUID(WMFORMAT_VideoInfo,
0x05589f80, 0xc356, 0x11ce, 0xbf, 0x01, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a);
// 05589f81-c356-11ce-bf01-00aa0055595a WMFORMAT_WaveFormatEx
EXTERN_GUID(WMFORMAT_WaveFormatEx,
0x05589f81, 0xc356, 0x11ce, 0xbf, 0x01, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a);
// 5C8510F2-DEBE-4ca7-BBA5-F07A104F8DFF WMFORMAT_Script
EXTERN_GUID(WMFORMAT_Script,
0x5c8510f2, 0xdebe, 0x4ca7, 0xbb, 0xa5, 0xf0, 0x7a, 0x10, 0x4f, 0x8d, 0xff);
// 82f38a70-c29f-11d1-97ad-00a0c95ea850 WMSCRIPTTYPE_TwoStrings
EXTERN_GUID( WMSCRIPTTYPE_TwoStrings,
0x82f38a70,0xc29f,0x11d1,0x97,0xad,0x00,0xa0,0xc9,0x5e,0xa8,0x50);
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,2 @@
This directory contains useful functions that are used by several
of the DirectShow samples.

View File

@@ -0,0 +1,162 @@
//------------------------------------------------------------------------------
// File: SeekUtil.cpp
//
// Desc: DirectShow sample code - utility functions.
//
// Copyright (c) 2000-2001 Microsoft Corporation. All rights reserved.
//------------------------------------------------------------------------------
#include "stdafx.h"
#include <dshow.h>
//
// Constants
//
const int TICKLEN=100, TIMERID=55;
//
// Global data
//
static REFERENCE_TIME g_rtTotalTime=0;
static UINT_PTR g_wTimerID=0;
static HWND g_hwnd=0;
HRESULT ConfigureSeekbar(IMediaSeeking *pMS, CSliderCtrl Seekbar, CStatic& strPosition);
void StartSeekTimer();
void StopSeekTimer();
void UpdatePosition(IMediaSeeking *pMS, REFERENCE_TIME rtNow, CStatic& strPosition);
void ReadMediaPosition(IMediaSeeking *pMS, CSliderCtrl& Seekbar, CStatic& strPosition);
void HandleTrackbar(IMediaControl *pMC, IMediaSeeking *pMS,
CSliderCtrl& Seekbar, CStatic& strPosition, WPARAM wReq);
HRESULT ConfigureSeekbar(IMediaSeeking *pMS, CSliderCtrl Seekbar, CStatic& strPosition, HWND hwndOwner)
{
HRESULT hr;
// Disable seekbar for new file and reset tracker/position label
Seekbar.SetPos(0);
Seekbar.EnableWindow(FALSE);
g_rtTotalTime=0;
strPosition.SetWindowText(TEXT("Position: 00m:00s\0"));
DWORD dwSeekCaps = AM_SEEKING_CanSeekAbsolute | AM_SEEKING_CanGetDuration;
// Can we seek this file? If so, enable trackbar.
if (pMS && (S_OK == pMS->CheckCapabilities(&dwSeekCaps)))
{
hr = pMS->GetDuration(&g_rtTotalTime);
Seekbar.EnableWindow(TRUE);
}
g_hwnd = hwndOwner;
return hr;
}
void StartSeekTimer()
{
// Cancel any pending timer event
StopSeekTimer();
// Create a new timer
g_wTimerID = SetTimer(g_hwnd, TIMERID, TICKLEN, NULL);
}
void StopSeekTimer()
{
// Cancel the timer
if(g_wTimerID)
{
KillTimer(g_hwnd, g_wTimerID);
g_wTimerID = 0;
}
}
void ReadMediaPosition(IMediaSeeking *pMS, CSliderCtrl& Seekbar, CStatic& strPosition)
{
HRESULT hr;
REFERENCE_TIME rtNow;
// Read the current stream position
hr = pMS->GetCurrentPosition(&rtNow);
if (FAILED(hr))
return;
// Convert position into a percentage value and update slider position
long lTick = (long)((rtNow * 100) / g_rtTotalTime);
Seekbar.SetPos(lTick);
// Update the 'current position' string on the main dialog
UpdatePosition(pMS, rtNow, strPosition);
}
void UpdatePosition(IMediaSeeking *pMS, REFERENCE_TIME rtNow, CStatic& strPosition)
{
HRESULT hr;
// If no reference time was passed in, read the current position
if (rtNow == 0)
{
// Read the current stream position
hr = pMS->GetCurrentPosition(&rtNow);
if (FAILED(hr))
return;
}
// Convert the LONGLONG duration into human-readable format
unsigned long nTotalMS = (unsigned long) rtNow / 10000; // 100ns -> ms
int nSeconds = nTotalMS / 1000;
int nMinutes = nSeconds / 60;
nSeconds %= 60;
// Update the display
TCHAR szPosition[24];
wsprintf(szPosition, _T("Position: %02dm:%02ds\0"), nMinutes, nSeconds);
strPosition.SetWindowText(szPosition);
}
void HandleTrackbar(IMediaControl *pMC, IMediaSeeking *pMS,
CSliderCtrl& Seekbar, CStatic& strPosition, WPARAM wReq)
{
HRESULT hr;
static OAFilterState state;
static BOOL bStartOfScroll = TRUE;
// If the file is not seekable, the trackbar is disabled.
DWORD dwPosition = Seekbar.GetPos();
// Pause when the scroll action begins.
if (bStartOfScroll)
{
hr = pMC->GetState(10, &state);
bStartOfScroll = FALSE;
hr = pMC->Pause();
}
// Update the position continuously.
REFERENCE_TIME rtNew = (g_rtTotalTime * dwPosition) / 100;
hr = pMS->SetPositions(&rtNew, AM_SEEKING_AbsolutePositioning,
NULL, AM_SEEKING_NoPositioning);
// Restore the state at the end.
if (wReq == TB_ENDTRACK)
{
if (state == State_Stopped)
hr = pMC->Stop();
else if (state == State_Running)
hr = pMC->Run();
bStartOfScroll = TRUE;
}
// Update the 'current position' string on the main dialog.
UpdatePosition(pMS, rtNew, strPosition);
}

View File

@@ -0,0 +1,25 @@
//------------------------------------------------------------------------------
// File: SeekUtil.h
//
// Desc: DirectShow sample code - prototypes for seeking utility functions
//
// Copyright (c) 2000-2001 Microsoft Corporation. All rights reserved.
//------------------------------------------------------------------------------
//
// Constants
//
const int TICKLEN=100, TIMERID=55;
//
// Function prototypes
//
HRESULT ConfigureSeekbar(IMediaSeeking *pMS, CSliderCtrl Seekbar, CStatic& strPosition);
void StartSeekTimer();
void StopSeekTimer();
void UpdatePosition(IMediaSeeking *pMS, REFERENCE_TIME rtNow, CStatic& strPosition);
void ReadMediaPosition(IMediaSeeking *pMS, CSliderCtrl& Seekbar, CStatic& strPosition);
void HandleTrackbar(IMediaControl *pMC, IMediaSeeking *pMS,
CSliderCtrl& Seekbar, CStatic& strPosition, WPARAM wReq);

View File

@@ -0,0 +1,550 @@
/* this ALWAYS GENERATED file contains the definitions for the interfaces */
/* File created by MIDL compiler version 5.01.0164 */
/* at Mon Jun 26 06:49:07 2000
*/
/* Compiler settings for .\wmsbuffer.idl:
Oicf (OptLev=i2), W1, Zp8, env=Win32, ms_ext, c_ext
error checks: allocation ref bounds_check enum stub_data
*/
//@@MIDL_FILE_HEADING( )
/* verify that the <rpcndr.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCNDR_H_VERSION__
#define __REQUIRED_RPCNDR_H_VERSION__ 440
#endif
#include "rpc.h"
#include "rpcndr.h"
#ifndef __RPCNDR_H_VERSION__
#error this stub requires an updated version of <rpcndr.h>
#endif // __RPCNDR_H_VERSION__
#ifndef COM_NO_WINDOWS_H
#include "windows.h"
#include "ole2.h"
#endif /*COM_NO_WINDOWS_H*/
#ifndef __wmsbuffer_h__
#define __wmsbuffer_h__
#ifdef __cplusplus
extern "C"{
#endif
/* Forward Declarations */
#ifndef __INSSBuffer_FWD_DEFINED__
#define __INSSBuffer_FWD_DEFINED__
typedef interface INSSBuffer INSSBuffer;
#endif /* __INSSBuffer_FWD_DEFINED__ */
#ifndef __INSSBuffer2_FWD_DEFINED__
#define __INSSBuffer2_FWD_DEFINED__
typedef interface INSSBuffer2 INSSBuffer2;
#endif /* __INSSBuffer2_FWD_DEFINED__ */
#ifndef __IWMSBufferAllocator_FWD_DEFINED__
#define __IWMSBufferAllocator_FWD_DEFINED__
typedef interface IWMSBufferAllocator IWMSBufferAllocator;
#endif /* __IWMSBufferAllocator_FWD_DEFINED__ */
/* header files for imported files */
#include "objidl.h"
#include "ocidl.h"
void __RPC_FAR * __RPC_USER MIDL_user_allocate(size_t);
void __RPC_USER MIDL_user_free( void __RPC_FAR * );
/* interface __MIDL_itf_wmsbuffer_0000 */
/* [local] */
//=========================================================================
//
// Microsoft Windows Media Technologies
// Copyright (C) Microsoft Corporation, 1999-2001. All Rights Reserved.
//
//=========================================================================
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
EXTERN_GUID( IID_INSSBuffer, 0xE1CD3524,0x03D7,0x11d2,0x9E,0xED,0x00,0x60,0x97,0xD2,0xD7,0xCF );
EXTERN_GUID( IID_IWMSBuffer, 0xE1CD3524,0x03D7,0x11d2,0x9E,0xED,0x00,0x60,0x97,0xD2,0xD7,0xCF );
EXTERN_GUID( IID_IWMSBufferAllocator, 0x61103CA4,0x2033,0x11d2,0x9E,0xF1,0x00,0x60,0x97,0xD2,0xD7,0xCF );
EXTERN_GUID( IID_INSSBuffer2, 0x4f528693, 0x1035, 0x43fe, 0xb4, 0x28, 0x75, 0x75, 0x61, 0xad, 0x3a, 0x68);
#define IWMSBuffer INSSBuffer
extern RPC_IF_HANDLE __MIDL_itf_wmsbuffer_0000_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_wmsbuffer_0000_v0_0_s_ifspec;
#ifndef __INSSBuffer_INTERFACE_DEFINED__
#define __INSSBuffer_INTERFACE_DEFINED__
/* interface INSSBuffer */
/* [version][uuid][unique][object][local] */
EXTERN_C const IID IID_INSSBuffer;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("E1CD3524-03D7-11d2-9EED-006097D2D7CF")
INSSBuffer : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE GetLength(
/* [out] */ DWORD __RPC_FAR *pdwLength) = 0;
virtual HRESULT STDMETHODCALLTYPE SetLength(
/* [in] */ DWORD dwLength) = 0;
virtual HRESULT STDMETHODCALLTYPE GetMaxLength(
/* [out] */ DWORD __RPC_FAR *pdwLength) = 0;
virtual HRESULT STDMETHODCALLTYPE GetBuffer(
/* [out] */ BYTE __RPC_FAR *__RPC_FAR *ppdwBuffer) = 0;
virtual HRESULT STDMETHODCALLTYPE GetBufferAndLength(
/* [out] */ BYTE __RPC_FAR *__RPC_FAR *ppdwBuffer,
/* [out] */ DWORD __RPC_FAR *pdwLength) = 0;
};
#else /* C style interface */
typedef struct INSSBufferVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE __RPC_FAR *QueryInterface )(
INSSBuffer __RPC_FAR * This,
/* [in] */ REFIID riid,
/* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject);
ULONG ( STDMETHODCALLTYPE __RPC_FAR *AddRef )(
INSSBuffer __RPC_FAR * This);
ULONG ( STDMETHODCALLTYPE __RPC_FAR *Release )(
INSSBuffer __RPC_FAR * This);
HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetLength )(
INSSBuffer __RPC_FAR * This,
/* [out] */ DWORD __RPC_FAR *pdwLength);
HRESULT ( STDMETHODCALLTYPE __RPC_FAR *SetLength )(
INSSBuffer __RPC_FAR * This,
/* [in] */ DWORD dwLength);
HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetMaxLength )(
INSSBuffer __RPC_FAR * This,
/* [out] */ DWORD __RPC_FAR *pdwLength);
HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetBuffer )(
INSSBuffer __RPC_FAR * This,
/* [out] */ BYTE __RPC_FAR *__RPC_FAR *ppdwBuffer);
HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetBufferAndLength )(
INSSBuffer __RPC_FAR * This,
/* [out] */ BYTE __RPC_FAR *__RPC_FAR *ppdwBuffer,
/* [out] */ DWORD __RPC_FAR *pdwLength);
END_INTERFACE
} INSSBufferVtbl;
interface INSSBuffer
{
CONST_VTBL struct INSSBufferVtbl __RPC_FAR *lpVtbl;
};
#ifdef COBJMACROS
#define INSSBuffer_QueryInterface(This,riid,ppvObject) \
(This)->lpVtbl -> QueryInterface(This,riid,ppvObject)
#define INSSBuffer_AddRef(This) \
(This)->lpVtbl -> AddRef(This)
#define INSSBuffer_Release(This) \
(This)->lpVtbl -> Release(This)
#define INSSBuffer_GetLength(This,pdwLength) \
(This)->lpVtbl -> GetLength(This,pdwLength)
#define INSSBuffer_SetLength(This,dwLength) \
(This)->lpVtbl -> SetLength(This,dwLength)
#define INSSBuffer_GetMaxLength(This,pdwLength) \
(This)->lpVtbl -> GetMaxLength(This,pdwLength)
#define INSSBuffer_GetBuffer(This,ppdwBuffer) \
(This)->lpVtbl -> GetBuffer(This,ppdwBuffer)
#define INSSBuffer_GetBufferAndLength(This,ppdwBuffer,pdwLength) \
(This)->lpVtbl -> GetBufferAndLength(This,ppdwBuffer,pdwLength)
#endif /* COBJMACROS */
#endif /* C style interface */
HRESULT STDMETHODCALLTYPE INSSBuffer_GetLength_Proxy(
INSSBuffer __RPC_FAR * This,
/* [out] */ DWORD __RPC_FAR *pdwLength);
void __RPC_STUB INSSBuffer_GetLength_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
HRESULT STDMETHODCALLTYPE INSSBuffer_SetLength_Proxy(
INSSBuffer __RPC_FAR * This,
/* [in] */ DWORD dwLength);
void __RPC_STUB INSSBuffer_SetLength_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
HRESULT STDMETHODCALLTYPE INSSBuffer_GetMaxLength_Proxy(
INSSBuffer __RPC_FAR * This,
/* [out] */ DWORD __RPC_FAR *pdwLength);
void __RPC_STUB INSSBuffer_GetMaxLength_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
HRESULT STDMETHODCALLTYPE INSSBuffer_GetBuffer_Proxy(
INSSBuffer __RPC_FAR * This,
/* [out] */ BYTE __RPC_FAR *__RPC_FAR *ppdwBuffer);
void __RPC_STUB INSSBuffer_GetBuffer_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
HRESULT STDMETHODCALLTYPE INSSBuffer_GetBufferAndLength_Proxy(
INSSBuffer __RPC_FAR * This,
/* [out] */ BYTE __RPC_FAR *__RPC_FAR *ppdwBuffer,
/* [out] */ DWORD __RPC_FAR *pdwLength);
void __RPC_STUB INSSBuffer_GetBufferAndLength_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
#endif /* __INSSBuffer_INTERFACE_DEFINED__ */
#ifndef __INSSBuffer2_INTERFACE_DEFINED__
#define __INSSBuffer2_INTERFACE_DEFINED__
/* interface INSSBuffer2 */
/* [version][uuid][unique][object][local] */
EXTERN_C const IID IID_INSSBuffer2;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("4F528693-1035-43fe-B428-757561AD3A68")
INSSBuffer2 : public INSSBuffer
{
public:
virtual HRESULT STDMETHODCALLTYPE GetSampleProperties(
/* [in] */ DWORD cbProperties,
/* [out] */ BYTE __RPC_FAR *pbProperties) = 0;
virtual HRESULT STDMETHODCALLTYPE SetSampleProperties(
/* [in] */ DWORD cbProperties,
/* [in] */ BYTE __RPC_FAR *pbProperties) = 0;
};
#else /* C style interface */
typedef struct INSSBuffer2Vtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE __RPC_FAR *QueryInterface )(
INSSBuffer2 __RPC_FAR * This,
/* [in] */ REFIID riid,
/* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject);
ULONG ( STDMETHODCALLTYPE __RPC_FAR *AddRef )(
INSSBuffer2 __RPC_FAR * This);
ULONG ( STDMETHODCALLTYPE __RPC_FAR *Release )(
INSSBuffer2 __RPC_FAR * This);
HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetLength )(
INSSBuffer2 __RPC_FAR * This,
/* [out] */ DWORD __RPC_FAR *pdwLength);
HRESULT ( STDMETHODCALLTYPE __RPC_FAR *SetLength )(
INSSBuffer2 __RPC_FAR * This,
/* [in] */ DWORD dwLength);
HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetMaxLength )(
INSSBuffer2 __RPC_FAR * This,
/* [out] */ DWORD __RPC_FAR *pdwLength);
HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetBuffer )(
INSSBuffer2 __RPC_FAR * This,
/* [out] */ BYTE __RPC_FAR *__RPC_FAR *ppdwBuffer);
HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetBufferAndLength )(
INSSBuffer2 __RPC_FAR * This,
/* [out] */ BYTE __RPC_FAR *__RPC_FAR *ppdwBuffer,
/* [out] */ DWORD __RPC_FAR *pdwLength);
HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetSampleProperties )(
INSSBuffer2 __RPC_FAR * This,
/* [in] */ DWORD cbProperties,
/* [out] */ BYTE __RPC_FAR *pbProperties);
HRESULT ( STDMETHODCALLTYPE __RPC_FAR *SetSampleProperties )(
INSSBuffer2 __RPC_FAR * This,
/* [in] */ DWORD cbProperties,
/* [in] */ BYTE __RPC_FAR *pbProperties);
END_INTERFACE
} INSSBuffer2Vtbl;
interface INSSBuffer2
{
CONST_VTBL struct INSSBuffer2Vtbl __RPC_FAR *lpVtbl;
};
#ifdef COBJMACROS
#define INSSBuffer2_QueryInterface(This,riid,ppvObject) \
(This)->lpVtbl -> QueryInterface(This,riid,ppvObject)
#define INSSBuffer2_AddRef(This) \
(This)->lpVtbl -> AddRef(This)
#define INSSBuffer2_Release(This) \
(This)->lpVtbl -> Release(This)
#define INSSBuffer2_GetLength(This,pdwLength) \
(This)->lpVtbl -> GetLength(This,pdwLength)
#define INSSBuffer2_SetLength(This,dwLength) \
(This)->lpVtbl -> SetLength(This,dwLength)
#define INSSBuffer2_GetMaxLength(This,pdwLength) \
(This)->lpVtbl -> GetMaxLength(This,pdwLength)
#define INSSBuffer2_GetBuffer(This,ppdwBuffer) \
(This)->lpVtbl -> GetBuffer(This,ppdwBuffer)
#define INSSBuffer2_GetBufferAndLength(This,ppdwBuffer,pdwLength) \
(This)->lpVtbl -> GetBufferAndLength(This,ppdwBuffer,pdwLength)
#define INSSBuffer2_GetSampleProperties(This,cbProperties,pbProperties) \
(This)->lpVtbl -> GetSampleProperties(This,cbProperties,pbProperties)
#define INSSBuffer2_SetSampleProperties(This,cbProperties,pbProperties) \
(This)->lpVtbl -> SetSampleProperties(This,cbProperties,pbProperties)
#endif /* COBJMACROS */
#endif /* C style interface */
HRESULT STDMETHODCALLTYPE INSSBuffer2_GetSampleProperties_Proxy(
INSSBuffer2 __RPC_FAR * This,
/* [in] */ DWORD cbProperties,
/* [out] */ BYTE __RPC_FAR *pbProperties);
void __RPC_STUB INSSBuffer2_GetSampleProperties_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
HRESULT STDMETHODCALLTYPE INSSBuffer2_SetSampleProperties_Proxy(
INSSBuffer2 __RPC_FAR * This,
/* [in] */ DWORD cbProperties,
/* [in] */ BYTE __RPC_FAR *pbProperties);
void __RPC_STUB INSSBuffer2_SetSampleProperties_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
#endif /* __INSSBuffer2_INTERFACE_DEFINED__ */
#ifndef __IWMSBufferAllocator_INTERFACE_DEFINED__
#define __IWMSBufferAllocator_INTERFACE_DEFINED__
/* interface IWMSBufferAllocator */
/* [version][uuid][unique][object][local] */
EXTERN_C const IID IID_IWMSBufferAllocator;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("61103CA4-2033-11d2-9EF1-006097D2D7CF")
IWMSBufferAllocator : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE AllocateBuffer(
/* [in] */ DWORD dwMaxBufferSize,
/* [out] */ INSSBuffer __RPC_FAR *__RPC_FAR *ppBuffer) = 0;
virtual HRESULT STDMETHODCALLTYPE AllocatePageSizeBuffer(
/* [in] */ DWORD dwMaxBufferSize,
/* [out] */ INSSBuffer __RPC_FAR *__RPC_FAR *ppBuffer) = 0;
};
#else /* C style interface */
typedef struct IWMSBufferAllocatorVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE __RPC_FAR *QueryInterface )(
IWMSBufferAllocator __RPC_FAR * This,
/* [in] */ REFIID riid,
/* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject);
ULONG ( STDMETHODCALLTYPE __RPC_FAR *AddRef )(
IWMSBufferAllocator __RPC_FAR * This);
ULONG ( STDMETHODCALLTYPE __RPC_FAR *Release )(
IWMSBufferAllocator __RPC_FAR * This);
HRESULT ( STDMETHODCALLTYPE __RPC_FAR *AllocateBuffer )(
IWMSBufferAllocator __RPC_FAR * This,
/* [in] */ DWORD dwMaxBufferSize,
/* [out] */ INSSBuffer __RPC_FAR *__RPC_FAR *ppBuffer);
HRESULT ( STDMETHODCALLTYPE __RPC_FAR *AllocatePageSizeBuffer )(
IWMSBufferAllocator __RPC_FAR * This,
/* [in] */ DWORD dwMaxBufferSize,
/* [out] */ INSSBuffer __RPC_FAR *__RPC_FAR *ppBuffer);
END_INTERFACE
} IWMSBufferAllocatorVtbl;
interface IWMSBufferAllocator
{
CONST_VTBL struct IWMSBufferAllocatorVtbl __RPC_FAR *lpVtbl;
};
#ifdef COBJMACROS
#define IWMSBufferAllocator_QueryInterface(This,riid,ppvObject) \
(This)->lpVtbl -> QueryInterface(This,riid,ppvObject)
#define IWMSBufferAllocator_AddRef(This) \
(This)->lpVtbl -> AddRef(This)
#define IWMSBufferAllocator_Release(This) \
(This)->lpVtbl -> Release(This)
#define IWMSBufferAllocator_AllocateBuffer(This,dwMaxBufferSize,ppBuffer) \
(This)->lpVtbl -> AllocateBuffer(This,dwMaxBufferSize,ppBuffer)
#define IWMSBufferAllocator_AllocatePageSizeBuffer(This,dwMaxBufferSize,ppBuffer) \
(This)->lpVtbl -> AllocatePageSizeBuffer(This,dwMaxBufferSize,ppBuffer)
#endif /* COBJMACROS */
#endif /* C style interface */
HRESULT STDMETHODCALLTYPE IWMSBufferAllocator_AllocateBuffer_Proxy(
IWMSBufferAllocator __RPC_FAR * This,
/* [in] */ DWORD dwMaxBufferSize,
/* [out] */ INSSBuffer __RPC_FAR *__RPC_FAR *ppBuffer);
void __RPC_STUB IWMSBufferAllocator_AllocateBuffer_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
HRESULT STDMETHODCALLTYPE IWMSBufferAllocator_AllocatePageSizeBuffer_Proxy(
IWMSBufferAllocator __RPC_FAR * This,
/* [in] */ DWORD dwMaxBufferSize,
/* [out] */ INSSBuffer __RPC_FAR *__RPC_FAR *ppBuffer);
void __RPC_STUB IWMSBufferAllocator_AllocatePageSizeBuffer_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
#endif /* __IWMSBufferAllocator_INTERFACE_DEFINED__ */
/* Additional Prototypes for ALL interfaces */
/* end of Additional Prototypes */
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,14 @@
//============================================================================
//
// Microsoft Windows Media Technology
// Copyright (C) Microsoft Corporation, 1999-2001. All Rights Reserved.
//
// File: wmsdk.h
//
// Description: WMSDK global include file
//
//============================================================================
#include "wmsdkidl.h"
#include "asferr.h"
#include "nserror.h"

File diff suppressed because it is too large Load Diff