MythTV  master
fourcc.h
Go to the documentation of this file.
1 #ifndef _FOURCC_H
2 #define _FOURCC_H
3 /******************************************************************************
4  * fourcc.h - Four Character Constants
5  *
6  * Ever since the early days of the Macintosh clipboard and AmigaDOS,
7  * little 32 bit strings have been used to identify the contents of a file.
8  * TIFF, AIFF, JPEG, MPEG - they have spread everywhere.
9  * Including the MythTV source code.
10  *
11  * Time to define them in one file.
12  *
13  * $Id$
14  *****************************************************************************/
15 
16 #include "mythconfig.h"
17 
18 #ifdef __cplusplus
19 extern "C" {
20 #include "libavutil/common.h" // for MKTAG
21 }
22 #endif
23 
24 /* Probably not thread safe */
25 static inline char * fourcc_str(int i)
26 {
27  static char str[5];
28 
29  str[0] = ((char) (i & 0xFF)),
30  str[1] = ((char) ((i >> 8) & 0xFF)),
31  str[2] = ((char) ((i >> 16) & 0xFF)),
32  str[3] = ((char) ((i >> 24) & 0xFF)),
33  str[4] = '\0';
34 
35  return str;
36 }
37 
38 
39 /******************************************************************************
40  * Bitmap formats:
41  *
42  * Note: V4L2 also defines several of these FourCCs in videodev2.h
43  * (e.g. V4L2_PIX_FMT_YUV420, V4L2_PIX_FMT_MPEG).
44  * Use those only where data is being read from a tuner card
45  *****************************************************************************/
46 /* See http://www.fourcc.org/yuv.php for more info on formats */
47 
48 #define FOURCC_422P MKTAG('4','2','2','P')
49 #define FOURCC_AI44 MKTAG('A','I','4','4')
50 #define FOURCC_I420 MKTAG('I','4','2','0')
51 #define FOURCC_IA44 MKTAG('I','A','4','4')
52 #define FOURCC_IYUV MKTAG('I','Y','U','V')
53 #define FOURCC_RGB2 MKTAG('R','G','B','2')
54 #define FOURCC_RGBX MKTAG('R','G','B','X')
55 #define FOURCC_RV15 MKTAG('R','V','1','5')
56 #define FOURCC_RV16 MKTAG('R','V','1','6')
57 #define FOURCC_RV24 MKTAG('R','V','2','4')
58 #define FOURCC_RV32 MKTAG('R','V','3','2')
59 #define FOURCC_YU12 MKTAG('Y','U','1','2')
60 #define FOURCC_YUNV MKTAG('Y','U','N','V')
61 #define FOURCC_YUY2 MKTAG('Y','U','Y','2')
62 #define FOURCC_YUYV MKTAG('Y','U','Y','V')
63 #define FOURCC_YV12 MKTAG('Y','V','1','2')
64 
65 
66 /* These should probably all be defined by */
67 /* MAKEFOURCC(), MKTAG() or v4l2_fourcc() */
68 
69 #define GUID_I420_PLANAR 0x30323449
70 #define GUID_IYUV_PLANAR 0x56555949
71 #define GUID_YV12_PLANAR 0x32315659
72 #define GUID_IA44_PACKED 0x34344941
73 #define GUID_AI44_PACKED 0x34344149
74 #define GUID_YUY2_PACKED 0x32595559 /* same as YUYV */
75 #define GUID_UYVY_PACKED 0x59565955
76 
77 
78 /******************************************************************************
79  * Common audio codec IDs:
80  *****************************************************************************/
81 
82 #define FOURCC_LAME MKTAG('L','A','M','E')
83 #define FOURCC_RAWA MKTAG('R','A','W','A')
84 #define FOURCC_AC3 MKTAG('A','C','3',' ')
85 
86 
87 /******************************************************************************
88  * Common video codec IDs:
89  *****************************************************************************/
90 
91 #define FOURCC_DIV3 MKTAG('D','I','V','3') /* MPEG4 v3 */
92 #define FOURCC_DIVX MKTAG('D','I','V','X') /* MPEG4 */
93 #define FOURCC_dvsd MKTAG('d','v','s','d') /* DV cameras (FireWire/IEEE1394) */
94 #define FOURCC_H263 MKTAG('H','2','6','3')
95 #define FOURCC_H264 MKTAG('H','2','6','4')
96 #define FOURCC_HFYU MKTAG('H','F','Y','U')
97 #define FOURCC_I263 MKTAG('I','2','6','3')
98 #define FOURCC_MJPG MKTAG('M','J','P','G')
99 #define FOURCC_MP42 MKTAG('M','P','4','2') /* MPEG4 v2 */
100 #define FOURCC_MPEG MKTAG('M','P','E','G') /* MPEG1 */
101 #define FOURCC_MPG2 MKTAG('M','P','G','2') /* MPEG2 */
102 #define FOURCC_MPG4 MKTAG('M','P','G','4') /* MPEG4 v1 */
103 #define FOURCC_RJPG MKTAG('R','J','P','G')
104 #define FOURCC_WMV1 MKTAG('W','M','V','1')
105 
106 
107 /*****************************************************************************/
108 #endif // ifndef _FOURCC_H
static char * fourcc_str(int i)
Definition: fourcc.h:25