Mercurial > mplayer.hg
annotate loader/dshow/mediatype.h @ 25161:d21bc7f05de6
Add an example for play DTS-CD with passsthrough.
author | ulion |
---|---|
date | Wed, 28 Nov 2007 13:08:36 +0000 |
parents | 4691811bd8c7 |
children | de09fcf0b4f1 |
rev | line source |
---|---|
22305
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
1 /* |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
2 ------------------------------------------------------------------- |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
3 AM_MEDIA_TYPE service functions declarations |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
4 ------------------------------------------------------------------- |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
5 */ |
23493 | 6 #ifndef DS_MEDIATYPE_H |
7 #define DS_MEDIATYPE_H | |
22305
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
8 #include "guids.h" |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
9 |
24428
4691811bd8c7
Move AM_MEDIA_TYPE structure definition to mediatype.h.
voroshil
parents:
23493
diff
changeset
|
10 typedef struct __attribute__((__packed__)) _MediaType |
4691811bd8c7
Move AM_MEDIA_TYPE structure definition to mediatype.h.
voroshil
parents:
23493
diff
changeset
|
11 { |
4691811bd8c7
Move AM_MEDIA_TYPE structure definition to mediatype.h.
voroshil
parents:
23493
diff
changeset
|
12 GUID majortype; //0x0 |
4691811bd8c7
Move AM_MEDIA_TYPE structure definition to mediatype.h.
voroshil
parents:
23493
diff
changeset
|
13 GUID subtype; //0x10 |
4691811bd8c7
Move AM_MEDIA_TYPE structure definition to mediatype.h.
voroshil
parents:
23493
diff
changeset
|
14 int bFixedSizeSamples; //0x20 |
4691811bd8c7
Move AM_MEDIA_TYPE structure definition to mediatype.h.
voroshil
parents:
23493
diff
changeset
|
15 int bTemporalCompression; //0x24 |
4691811bd8c7
Move AM_MEDIA_TYPE structure definition to mediatype.h.
voroshil
parents:
23493
diff
changeset
|
16 unsigned long lSampleSize; //0x28 |
4691811bd8c7
Move AM_MEDIA_TYPE structure definition to mediatype.h.
voroshil
parents:
23493
diff
changeset
|
17 GUID formattype; //0x2c |
4691811bd8c7
Move AM_MEDIA_TYPE structure definition to mediatype.h.
voroshil
parents:
23493
diff
changeset
|
18 IUnknown* pUnk; //0x3c |
4691811bd8c7
Move AM_MEDIA_TYPE structure definition to mediatype.h.
voroshil
parents:
23493
diff
changeset
|
19 unsigned long cbFormat; //0x40 |
4691811bd8c7
Move AM_MEDIA_TYPE structure definition to mediatype.h.
voroshil
parents:
23493
diff
changeset
|
20 char* pbFormat; //0x44 |
4691811bd8c7
Move AM_MEDIA_TYPE structure definition to mediatype.h.
voroshil
parents:
23493
diff
changeset
|
21 } AM_MEDIA_TYPE; |
4691811bd8c7
Move AM_MEDIA_TYPE structure definition to mediatype.h.
voroshil
parents:
23493
diff
changeset
|
22 |
22305
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
23 /** |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
24 * \brief print info from AM_MEDIA_TYPE structure |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
25 * =param[in] label short lable for media type |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
26 * \param[in] pmt pointer to AM_MEDIA_TYPE |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
27 * |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
28 * routine used for debug purposes |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
29 * |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
30 */ |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
31 void DisplayMediaType(const char * label,const AM_MEDIA_TYPE* pmt); |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
32 /** |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
33 * \brief frees memory, pointed by pbFormat and pUnk members of AM_MEDIA_TYPE structure |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
34 * |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
35 * \param[in] pmt pointer to structure |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
36 * |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
37 * \note |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
38 * routine does not frees memory allocated for AM_MEDIA_TYPE, so given pointer will be |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
39 * valid after this routine call. |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
40 * |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
41 */ |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
42 void FreeMediaType(AM_MEDIA_TYPE* pmt); |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
43 /** |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
44 * \brief frees memory allocated for AM_MEDIA_TYPE structure, including pbFormat and pUnk |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
45 * members |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
46 * |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
47 * \param[in] pmt pointer to structure |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
48 * |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
49 * \note |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
50 * after call to this routine, pointer to AM_MEDIA_TYPE will not be valid anymore |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
51 * |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
52 */ |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
53 void DeleteMediaType(AM_MEDIA_TYPE* pmt); |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
54 /** |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
55 * \brief copyies info from source to destination AM_MEDIA_TYPE structures |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
56 * |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
57 * \param[in] pSrc pointer to AM_MEDIA_TYPE structure to copy data from |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
58 * \param[out] pDst pointer to AM_MEDIA_TYPE structure to copy data to |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
59 * |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
60 * \return S_OK - success |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
61 * \return E_POINTER - pSrc or pDst is NULL or (pSrc->cbFormat && !pSrc->pbFormat) |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
62 * \return E_INVALIDARG - (pSrc == pDst) |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
63 * \return E_OUTOFMEMORY - Insufficient memory |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
64 * |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
65 * \note |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
66 * - pDst must point to existing AM_MEDIA_TYPE structure (all data will be overwritten) |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
67 * - if pDst->pbFormat!=NULL this will cause memory leak (as described in Directshow SDK)! |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
68 * |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
69 */ |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
70 HRESULT CopyMediaType(AM_MEDIA_TYPE* pDst,const AM_MEDIA_TYPE* pSrc); |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
71 /** |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
72 * \brief allocates new AM_MEDIA_TYPE structure and fills it with info from given one |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
73 * |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
74 * \param[in] pSrc pointer to AM_MEDIA_TYPE structure to copy data from |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
75 * |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
76 * \return result code, returned from CopyMediaType |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
77 * |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
78 */ |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
79 AM_MEDIA_TYPE* CreateMediaType(const AM_MEDIA_TYPE* pSrc); |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
80 |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
81 /** |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
82 * \brief compares two AM_MEDIA_TYPE structures for compatibility |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
83 * |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
84 * \param[in] pmt1 first AM_MEDIA_TYPE structure for compare |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
85 * \param[in] pmt2 second AM_MEDIA_TYPE structure for compare |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
86 * \param[in] bWildcards 1 means that GUID_NULL of one structure will be compatible with any value of another structure |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
87 * |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
88 * \return 1 if structures are compatible |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
89 * \return 0 if structures are not compatible |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
90 * |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
91 */ |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
diff
changeset
|
92 int CompareMediaTypes(const AM_MEDIA_TYPE * pmt1, const AM_MEDIA_TYPE * pmt2, int bWildcards); |
23493 | 93 |
94 #endif // DS_MEDIA_TYPE_H |