comparison nut.c @ 272:13cbfe47f085 libavformat

fixed codec specific data headers
author al3x
date Thu, 02 Oct 2003 22:41:08 +0000
parents e35faf19f79f
children a313e1080322
comparison
equal deleted inserted replaced
271:e35faf19f79f 272:13cbfe47f085
1 /* 1 /*
2 * NUT (de)muxer based on initial draft 2 * "NUT" Container Format muxer and demuxer (DRAFT-20031003)
3 * Copyright (c) 2003 Alex Beregszaszi 3 * Copyright (c) 2003 Alex Beregszaszi
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public 6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
16 * License along with this library; if not, write to the Free Software 16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 * 18 *
19 * NUT DRAFT can be found in MPlayer CVS at DOCS/tech/mpcf.txt 19 * NUT DRAFT can be found in MPlayer CVS at DOCS/tech/mpcf.txt
20 * 20 *
21 * Compatible with draft version 20030906 21 * AND http://people.fsn.hu/~alex/nut/ (TeX, pdf, ps, dvi, ..)
22 * 22 *
23 */ 23 */
24 24
25 /* 25 /*
26 * TODO: 26 * TODO:
27 * - checksumming 27 * - checksumming
28 * - correct timestamp handling 28 * - optimal timestamp handling
29 * - index writing 29 * - index writing
30 * - info and index packet reading support 30 * - info and index packet reading support
31 * - startcode searching for broken streams 31 * - startcode searching for broken streams
32 * - subpacket support 32 * - subpacket support
33 * - handling of codec specific headers
34 */ 33 */
35 34
36 //#define DEBUG 1 35 //#define DEBUG 1
37 36
38 #include "avformat.h" 37 #include "avformat.h"
90 89
91 len = get_v(bc); 90 len = get_v(bc);
92 for (i = 0; i < len && i < maxlen; i++) 91 for (i = 0; i < len && i < maxlen; i++)
93 data[i] = get_byte(bc); 92 data[i] = get_byte(bc);
94 /* skip remaining bytes */ 93 /* skip remaining bytes */
95 for (; i < len; i++) 94 url_fskip(bc, len-i);
96 get_byte(bc);
97 95
98 return 0; 96 return 0;
99 } 97 }
100 98
101 static int get_bi(ByteIOContext *bc) 99 static int get_bi(ByteIOContext *bc)
104 102
105 len = get_v(bc); 103 len = get_v(bc);
106 for (i = 0; i < len && i <= 4; i++) 104 for (i = 0; i < len && i <= 4; i++)
107 val |= get_byte(bc) << (i * 8); 105 val |= get_byte(bc) << (i * 8);
108 /* skip remaining bytes */ 106 /* skip remaining bytes */
109 for (; i < len; i++) 107 url_fskip(bc, len-i);
110 get_byte(bc);
111 108
112 return val; 109 return val;
113 } 110 }
114 111
115 static int get_packetheader(NUTContext *nut, ByteIOContext *bc) 112 static int get_packetheader(NUTContext *nut, ByteIOContext *bc)
472 nom = get_v(bc); 469 nom = get_v(bc);
473 denom = get_v(bc); 470 denom = get_v(bc);
474 get_v(bc); /* FIXME: msb timestamp base */ 471 get_v(bc); /* FIXME: msb timestamp base */
475 get_v(bc); /* shuffle type */ 472 get_v(bc); /* shuffle type */
476 get_byte(bc); /* flags */ 473 get_byte(bc); /* flags */
477 474
478 get_v(bc); /* FIXME: codec specific data headers */ 475 /* codec specific data headers */
476 while(get_v(bc) != 0)
477 url_fskip(bc, get_v(bc));
479 478
480 if (class == 0) /* VIDEO */ 479 if (class == 0) /* VIDEO */
481 { 480 {
482 st->codec.width = get_v(bc); 481 st->codec.width = get_v(bc);
483 st->codec.height = get_v(bc); 482 st->codec.height = get_v(bc);