• Main Page
  • Related Pages
  • Modules
  • Data Structures
  • Files
  • File List
  • Globals

libavformat/mpeg.h

Go to the documentation of this file.
00001 /*
00002  * MPEG1/2 muxer and demuxer common defines
00003  * Copyright (c) 2000, 2001, 2002 Fabrice Bellard
00004  *
00005  * This file is part of FFmpeg.
00006  *
00007  * FFmpeg is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU Lesser General Public
00009  * License as published by the Free Software Foundation; either
00010  * version 2.1 of the License, or (at your option) any later version.
00011  *
00012  * FFmpeg is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015  * Lesser General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU Lesser General Public
00018  * License along with FFmpeg; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
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 /* mpeg2 */
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(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 /* AVFORMAT_MPEG_H */

Generated on Fri Sep 16 2011 17:17:49 for FFmpeg by  doxygen 1.7.1