00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef FFMPEG_MPEG_H
00023 #define FFMPEG_MPEG_H
00024
00025 #define PACK_START_CODE ((unsigned int)0x000001ba)
00026 #define SYSTEM_HEADER_START_CODE ((unsigned int)0x000001bb)
00027 #define SEQUENCE_END_CODE ((unsigned int)0x000001b7)
00028 #define PACKET_START_CODE_MASK ((unsigned int)0xffffff00)
00029 #define PACKET_START_CODE_PREFIX ((unsigned int)0x00000100)
00030 #define ISO_11172_END_CODE ((unsigned int)0x000001b9)
00031
00032
00033 #define PROGRAM_STREAM_MAP 0x1bc
00034 #define PRIVATE_STREAM_1 0x1bd
00035 #define PADDING_STREAM 0x1be
00036 #define PRIVATE_STREAM_2 0x1bf
00037
00038 #define AUDIO_ID 0xc0
00039 #define VIDEO_ID 0xe0
00040 #define AC3_ID 0x80
00041 #define DTS_ID 0x8a
00042 #define LPCM_ID 0xa0
00043 #define SUB_ID 0x20
00044
00045 #define STREAM_TYPE_VIDEO_MPEG1 0x01
00046 #define STREAM_TYPE_VIDEO_MPEG2 0x02
00047 #define STREAM_TYPE_AUDIO_MPEG1 0x03
00048 #define STREAM_TYPE_AUDIO_MPEG2 0x04
00049 #define STREAM_TYPE_PRIVATE_SECTION 0x05
00050 #define STREAM_TYPE_PRIVATE_DATA 0x06
00051 #define STREAM_TYPE_AUDIO_AAC 0x0f
00052 #define STREAM_TYPE_VIDEO_MPEG4 0x10
00053 #define STREAM_TYPE_VIDEO_H264 0x1b
00054
00055 #define STREAM_TYPE_AUDIO_AC3 0x81
00056 #define STREAM_TYPE_AUDIO_DTS 0x8a
00057
00058 static const int lpcm_freq_tab[4] = { 48000, 96000, 44100, 32000 };
00059
00063 static inline int64_t ff_parse_pes_pts(uint8_t *buf) {
00064 return (int64_t)(*buf & 0x0e) << 29 |
00065 (AV_RB16(buf+1) >> 1) << 15 |
00066 AV_RB16(buf+3) >> 1;
00067 }
00068
00069 #endif