1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

file id string

max short startcode distance

Originally committed as revision 3223 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Michael Niedermayer 2004-06-14 21:30:36 +00:00
parent 0da6315a70
commit ca6ecf50f9
3 changed files with 15 additions and 8 deletions

View File

@ -49,6 +49,8 @@
#define INDEX_STARTCODE (0xDD672F23E64EULL + (((uint64_t)('N'<<8) + 'X')<<48)) #define INDEX_STARTCODE (0xDD672F23E64EULL + (((uint64_t)('N'<<8) + 'X')<<48))
#define INFO_STARTCODE (0xAB68B596BA78ULL + (((uint64_t)('N'<<8) + 'I')<<48)) #define INFO_STARTCODE (0xAB68B596BA78ULL + (((uint64_t)('N'<<8) + 'I')<<48))
#define ID_STRING "nut/multimedia container\0"
#define MAX_DISTANCE (1024*16-1) #define MAX_DISTANCE (1024*16-1)
#define MAX_SHORT_DISTANCE (1024*4-1) #define MAX_SHORT_DISTANCE (1024*4-1)
@ -84,6 +86,7 @@ typedef struct {
uint64_t next_startcode; ///< stores the next startcode if it has alraedy been parsed but the stream isnt seekable uint64_t next_startcode; ///< stores the next startcode if it has alraedy been parsed but the stream isnt seekable
StreamContext *stream; StreamContext *stream;
int max_distance; int max_distance;
int max_short_distance;
int rate_num; int rate_num;
int rate_den; int rate_den;
int short_startcode; int short_startcode;
@ -511,12 +514,18 @@ static int nut_write_header(AVFormatContext *s)
nut->stream = nut->stream =
av_mallocz(sizeof(StreamContext)*s->nb_streams); av_mallocz(sizeof(StreamContext)*s->nb_streams);
put_buffer(bc, ID_STRING, strlen(ID_STRING));
put_byte(bc, 0);
nut->packet_start[2]= url_ftell(bc);
/* main header */ /* main header */
put_be64(bc, MAIN_STARTCODE); put_be64(bc, MAIN_STARTCODE);
put_packetheader(nut, bc, 120+5*256, 1); put_packetheader(nut, bc, 120+5*256, 1);
put_v(bc, 2); /* version */ put_v(bc, 2); /* version */
put_v(bc, s->nb_streams); put_v(bc, s->nb_streams);
put_v(bc, MAX_DISTANCE); put_v(bc, MAX_DISTANCE);
put_v(bc, MAX_SHORT_DISTANCE);
put_v(bc, nut->rate_num=1); put_v(bc, nut->rate_num=1);
put_v(bc, nut->rate_den=2); put_v(bc, nut->rate_den=2);
@ -869,6 +878,7 @@ static int decode_main_header(NUTContext *nut){
nut->stream_count = get_v(bc); nut->stream_count = get_v(bc);
nut->max_distance = get_v(bc); nut->max_distance = get_v(bc);
nut->max_short_distance = get_v(bc);
nut->rate_num= get_v(bc); nut->rate_num= get_v(bc);
nut->rate_den= get_v(bc); nut->rate_den= get_v(bc);
nut->short_startcode= get_v(bc); nut->short_startcode= get_v(bc);

View File

@ -22,12 +22,9 @@ b57e3c4e0f27cbd0bf7b7fafb142fe7f *./data/b-libav.ffm
95a85df5f6cc6745235298e56920e3f4 *./data/b-libav.mov 95a85df5f6cc6745235298e56920e3f4 *./data/b-libav.mov
369865 ./data/b-libav.mov 369865 ./data/b-libav.mov
./data/b-libav.mov CRC=48f5a90d ./data/b-libav.mov CRC=48f5a90d
7d75403dd8fead169b92c18be36e7116 *./data/b-libav.nut fea20ced22451312dd463110e594eda6 *./data/b-libav.nut
332388 ./data/b-libav.nut 332415 ./data/b-libav.nut
./data/b-libav.nut CRC=001a3415 ./data/b-libav.nut CRC=001a3415
25b1c16cce152be411351dd092668d88 *./data/b-libav.dv
3600000 ./data/b-libav.dv
./data/b-libav.dv CRC=74d854aa
9a9da315747599f7718cc9a9a09c21ff *./data/b-libav.pbm 9a9da315747599f7718cc9a9a09c21ff *./data/b-libav.pbm
317075 ./data/b-libav.pbm 317075 ./data/b-libav.pbm
./data/b-libav.pbm CRC=a1057fd1 ./data/b-libav.pbm CRC=a1057fd1

View File

@ -516,9 +516,9 @@ do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src -a
do_ffmpeg_crc $file -i $file do_ffmpeg_crc $file -i $file
# dv # dv
file=${outfile}libav.dv #file=${outfile}libav.dv
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src -ar 48000 -r 25 -s pal -ac 2 $file #do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src -ar 48000 -r 25 -s pal -ac 2 $file
do_ffmpeg_crc $file -i $file #do_ffmpeg_crc $file -i $file
# XXX: need mpegts tests (add bitstreams or add output capability in ffmpeg) # XXX: need mpegts tests (add bitstreams or add output capability in ffmpeg)