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

libavformat/nut.h

Go to the documentation of this file.
00001 /*
00002  * "NUT" Container Format (de)muxer
00003  * Copyright (c) 2006 Michael Niedermayer
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_NUT_H
00023 #define AVFORMAT_NUT_H
00024 
00025 //#include <limits.h>
00026 //#include "libavutil/adler32.h"
00027 //#include "libavcodec/mpegaudio.h"
00028 #include "avformat.h"
00029 #include "riff.h"
00030 
00031 #define      MAIN_STARTCODE (0x7A561F5F04ADULL + (((uint64_t)('N'<<8) + 'M')<<48))
00032 #define    STREAM_STARTCODE (0x11405BF2F9DBULL + (((uint64_t)('N'<<8) + 'S')<<48))
00033 #define SYNCPOINT_STARTCODE (0xE4ADEECA4569ULL + (((uint64_t)('N'<<8) + 'K')<<48))
00034 #define     INDEX_STARTCODE (0xDD672F23E64EULL + (((uint64_t)('N'<<8) + 'X')<<48))
00035 #define      INFO_STARTCODE (0xAB68B596BA78ULL + (((uint64_t)('N'<<8) + 'I')<<48))
00036 
00037 #define ID_STRING "nut/multimedia container\0"
00038 
00039 #define MAX_DISTANCE (1024*32-1)
00040 
00041 typedef enum{
00042     FLAG_KEY        =   1, 
00043     FLAG_EOR        =   2, 
00044     FLAG_CODED_PTS  =   8, 
00045     FLAG_STREAM_ID  =  16, 
00046     FLAG_SIZE_MSB   =  32, 
00047     FLAG_CHECKSUM   =  64, 
00048     FLAG_RESERVED   = 128, 
00049     FLAG_HEADER_IDX =1024, 
00050     FLAG_MATCH_TIME =2048, 
00051     FLAG_CODED      =4096, 
00052     FLAG_INVALID    =8192, 
00053 } Flag;
00054 
00055 typedef struct {
00056     uint64_t pos;
00057     uint64_t back_ptr;
00058 //    uint64_t global_key_pts;
00059     int64_t ts;
00060 } Syncpoint;
00061 
00062 typedef struct {
00063     uint16_t flags;
00064     uint8_t  stream_id;
00065     uint16_t size_mul;
00066     uint16_t size_lsb;
00067     int16_t  pts_delta;
00068     uint8_t  reserved_count;
00069     uint8_t  header_idx;
00070 } FrameCode;
00071 
00072 typedef struct {
00073     int last_flags;
00074     int skip_until_key_frame;
00075     int64_t last_pts;
00076     int time_base_id;
00077     AVRational *time_base;
00078     int msb_pts_shift;
00079     int max_pts_distance;
00080     int decode_delay; //FIXME duplicate of has_b_frames
00081 } StreamContext;
00082 
00083 typedef struct {
00084     AVFormatContext *avf;
00085 //    int written_packet_size;
00086 //    int64_t packet_start;
00087     FrameCode frame_code[256];
00088     uint8_t header_len[128];
00089     const uint8_t *header[128];
00090     uint64_t next_startcode;     
00091     StreamContext *stream;
00092     unsigned int max_distance;
00093     unsigned int time_base_count;
00094     int64_t last_syncpoint_pos;
00095     int header_count;
00096     AVRational *time_base;
00097     struct AVTreeNode *syncpoints;
00098 } NUTContext;
00099 
00100 extern const AVCodecTag ff_nut_subtitle_tags[];
00101 
00102 typedef struct {
00103     char str[9];
00104     int flag;
00105 } Dispositions;
00106 
00107 void ff_nut_reset_ts(NUTContext *nut, AVRational time_base, int64_t val);
00108 int64_t ff_lsb2full(StreamContext *stream, int64_t lsb);
00109 int ff_nut_sp_pos_cmp(Syncpoint *a, Syncpoint *b);
00110 int ff_nut_sp_pts_cmp(Syncpoint *a, Syncpoint *b);
00111 void ff_nut_add_sp(NUTContext *nut, int64_t pos, int64_t back_ptr, int64_t ts);
00112 
00113 extern const Dispositions ff_nut_dispositions[];
00114 
00115 #endif /* AVFORMAT_NUT_H */

Generated on Sat Feb 16 2013 09:23:15 for ffmpeg by  doxygen 1.7.1