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