[libbluray-devel] commit: change some defines to enums (john )
git at videolan.org
git at videolan.org
Mon Sep 6 19:27:56 CEST 2010
libbluray | branch: master | john <john at anonymous.org> | Mon Sep 6 10:25:11 2010 -0700| [8621bd854dda4e2177def20575be7cfd4de3405e] | committer: john
change some defines to enums
stream types, formats, rates, aspect, and char codes.
> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=8621bd854dda4e2177def20575be7cfd4de3405e
---
src/libbluray/bluray.h | 108 +++++++++++++++++++++++++++---------------------
1 files changed, 61 insertions(+), 47 deletions(-)
diff --git a/src/libbluray/bluray.h b/src/libbluray/bluray.h
index 215fc64..b5130e6 100644
--- a/src/libbluray/bluray.h
+++ b/src/libbluray/bluray.h
@@ -39,62 +39,76 @@
typedef struct bluray BLURAY;
-#define BLURAY_STREAM_TYPE_VIDEO_MPEG1 0x01
-#define BLURAY_STREAM_TYPE_VIDEO_MPEG2 0x02
-#define BLURAY_STREAM_TYPE_AUDIO_MPEG1 0x03
-#define BLURAY_STREAM_TYPE_AUDIO_MPEG2 0x04
-#define BLURAY_STREAM_TYPE_AUDIO_LPCM 0x80
-#define BLURAY_STREAM_TYPE_AUDIO_AC3 0x81
-#define BLURAY_STREAM_TYPE_AUDIO_DTS 0x82
-#define BLURAY_STREAM_TYPE_AUDIO_TRUHD 0x83
-#define BLURAY_STREAM_TYPE_AUDIO_AC3PLUS 0x84
-#define BLURAY_STREAM_TYPE_AUDIO_DTSHD 0x85
-#define BLURAY_STREAM_TYPE_AUDIO_DTSHD_MASTER 0x86
-#define BLURAY_STREAM_TYPE_VIDEO_VC1 0xea
-#define BLURAY_STREAM_TYPE_VIDEO_H264 0x1b
-#define BLURAY_STREAM_TYPE_SUB_PG 0x90
-#define BLURAY_STREAM_TYPE_SUB_IG 0x91
-#define BLURAY_STREAM_TYPE_SUB_TEXT 0x92
-
-#define BLURAY_VIDEO_FORMAT_480I 1 // ITU-R BT.601-5
-#define BLURAY_VIDEO_FORMAT_576I 2 // ITU-R BT.601-4
-#define BLURAY_VIDEO_FORMAT_480P 3 // SMPTE 293M
-#define BLURAY_VIDEO_FORMAT_1080I 4 // SMPTE 274M
-#define BLURAY_VIDEO_FORMAT_720P 5 // SMPTE 296M
-#define BLURAY_VIDEO_FORMAT_1080P 6 // SMPTE 274M
-#define BLURAY_VIDEO_FORMAT_576P 7 // ITU-R BT.1358
-
-#define BLURAY_VIDEO_RATE_24000_1001 1 // 23.976
-#define BLURAY_VIDEO_RATE_24 2
-#define BLURAY_VIDEO_RATE_25 3
-#define BLURAY_VIDEO_RATE_30000_1001 4 // 29.97
-#define BLURAY_VIDEO_RATE_50 6
-#define BLURAY_VIDEO_RATE_60000_1001 7 // 59.94
-
-#define BLURAY_ASPECT_RATIO_4_3 2
-#define BLURAY_ASPECT_RATIO_16_9 3
-
-#define BLURAY_AUDIO_FORMAT_MONO 1
-#define BLURAY_AUDIO_FORMAT_STEREO 3
-#define BLURAY_AUDIO_FORMAT_MULTI_CHAN 6
-#define BLURAY_AUDIO_FORMAT_COMBO 12 // Stereo ac3/dts,
+typedef enum {
+ BLURAY_STREAM_TYPE_VIDEO_MPEG1 = 0x01,
+ BLURAY_STREAM_TYPE_VIDEO_MPEG2 = 0x02,
+ BLURAY_STREAM_TYPE_AUDIO_MPEG1 = 0x03,
+ BLURAY_STREAM_TYPE_AUDIO_MPEG2 = 0x04,
+ BLURAY_STREAM_TYPE_AUDIO_LPCM = 0x80,
+ BLURAY_STREAM_TYPE_AUDIO_AC3 = 0x81,
+ BLURAY_STREAM_TYPE_AUDIO_DTS = 0x82,
+ BLURAY_STREAM_TYPE_AUDIO_TRUHD = 0x83,
+ BLURAY_STREAM_TYPE_AUDIO_AC3PLUS = 0x84,
+ BLURAY_STREAM_TYPE_AUDIO_DTSHD = 0x85,
+ BLURAY_STREAM_TYPE_AUDIO_DTSHD_MASTER = 0x86,
+ BLURAY_STREAM_TYPE_VIDEO_VC1 = 0xea,
+ BLURAY_STREAM_TYPE_VIDEO_H264 = 0x1b,
+ BLURAY_STREAM_TYPE_SUB_PG = 0x90,
+ BLURAY_STREAM_TYPE_SUB_IG = 0x91,
+ BLURAY_STREAM_TYPE_SUB_TEXT = 0x92
+} bd_stream_type_e;
+
+typedef enum {
+ BLURAY_VIDEO_FORMAT_480I = 1, // ITU-R BT.601-5
+ BLURAY_VIDEO_FORMAT_576I = 2, // ITU-R BT.601-4
+ BLURAY_VIDEO_FORMAT_480P = 3, // SMPTE 293M
+ BLURAY_VIDEO_FORMAT_1080I = 4, // SMPTE 274M
+ BLURAY_VIDEO_FORMAT_720P = 5, // SMPTE 296M
+ BLURAY_VIDEO_FORMAT_1080P = 6, // SMPTE 274M
+ BLURAY_VIDEO_FORMAT_576P = 7 // ITU-R BT.1358
+} bd_video_format_e;
+
+typedef enum {
+ BLURAY_VIDEO_RATE_24000_1001 = 1, // 23.976
+ BLURAY_VIDEO_RATE_24 = 2,
+ BLURAY_VIDEO_RATE_25 = 3,
+ BLURAY_VIDEO_RATE_30000_1001 = 4, // 29.97
+ BLURAY_VIDEO_RATE_50 = 6,
+ BLURAY_VIDEO_RATE_60000_1001 = 7 // 59.94
+} bd_video_rate_e;
+
+typedef enum {
+ BLURAY_ASPECT_RATIO_4_3 = 2,
+ BLURAY_ASPECT_RATIO_16_9 = 3
+} bd_video_aspect_e;
+
+typedef enum {
+ BLURAY_AUDIO_FORMAT_MONO = 1,
+ BLURAY_AUDIO_FORMAT_STEREO = 3,
+ BLURAY_AUDIO_FORMAT_MULTI_CHAN = 6,
+ BLURAY_AUDIO_FORMAT_COMBO = 12 // Stereo ac3/dts,
+} bd_audio_format_e;
// multi mlp/dts-hd
-#define BLURAY_AUDIO_RATE_48 1
-#define BLURAY_AUDIO_RATE_96 4
-#define BLURAY_AUDIO_RATE_192 5
-#define BLURAY_AUDIO_RATE_192_COMBO 12 // 48 or 96 ac3/dts
+typedef enum {
+ BLURAY_AUDIO_RATE_48 = 1,
+ BLURAY_AUDIO_RATE_96 = 4,
+ BLURAY_AUDIO_RATE_192 = 5,
+ BLURAY_AUDIO_RATE_192_COMBO = 12, // 48 or 96 ac3/dts
// 192 mpl/dts-hd
-#define BLURAY_AUDIO_RATE_96_COMBO 14 // 48 ac3/dts
+ BLURAY_AUDIO_RATE_96_COMBO = 14 // 48 ac3/dts
// 96 mpl/dts-hd
+} bd_audio_rate_e;
-#define BLURAY_TEXT_CHAR_CODE_UTF8 0x01
-#define BLURAY_TEXT_CHAR_CODE_UTF16BE 0x02
-#define BLURAY_TEXT_CHAR_CODE_SHIFT_JIS 0x03
-#define BLURAY_TEXT_CHAR_CODE_EUC_KR 0x04
-#define BLURAY_TEXT_CHAR_CODE_GB18030_20001 0x05
-#define BLURAY_TEXT_CHAR_CODE_CN_GB 0x06
-#define BLURAY_TEXT_CHAR_CODE_BIG5 0x07
+typedef enum {
+ BLURAY_TEXT_CHAR_CODE_UTF8 = 0x01,
+ BLURAY_TEXT_CHAR_CODE_UTF16BE = 0x02,
+ BLURAY_TEXT_CHAR_CODE_SHIFT_JIS = 0x03,
+ BLURAY_TEXT_CHAR_CODE_EUC_KR = 0x04,
+ BLURAY_TEXT_CHAR_CODE_GB18030_20001 = 0x05,
+ BLURAY_TEXT_CHAR_CODE_CN_GB = 0x06,
+ BLURAY_TEXT_CHAR_CODE_BIG5 = 0x07
+} bd_char_code_e;
typedef struct bd_stream_info {
uint8_t coding_type;
More information about the libbluray-devel
mailing list