comparison loader/dshow/mediatype.h @ 22305:3d1b23cf3d08

Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
author voroshil
date Fri, 23 Feb 2007 09:58:01 +0000
parents
children 133b63fc16a2
comparison
equal deleted inserted replaced
22304:254733f57707 22305:3d1b23cf3d08
1 /*
2 -------------------------------------------------------------------
3 AM_MEDIA_TYPE service functions declarations
4 -------------------------------------------------------------------
5 */
6 #include "guids.h"
7
8 /**
9 * \brief print info from AM_MEDIA_TYPE structure
10 * =param[in] label short lable for media type
11 * \param[in] pmt pointer to AM_MEDIA_TYPE
12 *
13 * routine used for debug purposes
14 *
15 */
16 void DisplayMediaType(const char * label,const AM_MEDIA_TYPE* pmt);
17 /**
18 * \brief frees memory, pointed by pbFormat and pUnk members of AM_MEDIA_TYPE structure
19 *
20 * \param[in] pmt pointer to structure
21 *
22 * \note
23 * routine does not frees memory allocated for AM_MEDIA_TYPE, so given pointer will be
24 * valid after this routine call.
25 *
26 */
27 void FreeMediaType(AM_MEDIA_TYPE* pmt);
28 /**
29 * \brief frees memory allocated for AM_MEDIA_TYPE structure, including pbFormat and pUnk
30 * members
31 *
32 * \param[in] pmt pointer to structure
33 *
34 * \note
35 * after call to this routine, pointer to AM_MEDIA_TYPE will not be valid anymore
36 *
37 */
38 void DeleteMediaType(AM_MEDIA_TYPE* pmt);
39 /**
40 * \brief copyies info from source to destination AM_MEDIA_TYPE structures
41 *
42 * \param[in] pSrc pointer to AM_MEDIA_TYPE structure to copy data from
43 * \param[out] pDst pointer to AM_MEDIA_TYPE structure to copy data to
44 *
45 * \return S_OK - success
46 * \return E_POINTER - pSrc or pDst is NULL or (pSrc->cbFormat && !pSrc->pbFormat)
47 * \return E_INVALIDARG - (pSrc == pDst)
48 * \return E_OUTOFMEMORY - Insufficient memory
49 *
50 * \note
51 * - pDst must point to existing AM_MEDIA_TYPE structure (all data will be overwritten)
52 * - if pDst->pbFormat!=NULL this will cause memory leak (as described in Directshow SDK)!
53 *
54 */
55 HRESULT CopyMediaType(AM_MEDIA_TYPE* pDst,const AM_MEDIA_TYPE* pSrc);
56 /**
57 * \brief allocates new AM_MEDIA_TYPE structure and fills it with info from given one
58 *
59 * \param[in] pSrc pointer to AM_MEDIA_TYPE structure to copy data from
60 *
61 * \return result code, returned from CopyMediaType
62 *
63 */
64 AM_MEDIA_TYPE* CreateMediaType(const AM_MEDIA_TYPE* pSrc);
65
66 /**
67 * \brief compares two AM_MEDIA_TYPE structures for compatibility
68 *
69 * \param[in] pmt1 first AM_MEDIA_TYPE structure for compare
70 * \param[in] pmt2 second AM_MEDIA_TYPE structure for compare
71 * \param[in] bWildcards 1 means that GUID_NULL of one structure will be compatible with any value of another structure
72 *
73 * \return 1 if structures are compatible
74 * \return 0 if structures are not compatible
75 *
76 */
77 int CompareMediaTypes(const AM_MEDIA_TYPE * pmt1, const AM_MEDIA_TYPE * pmt2, int bWildcards);