33 #define DEINT_ID_GENR MKTAG('g', 'e', 'n', 'r')
34 #define DEINT_ID_INT0 MKTAG('I', 'n', 't', '0')
35 #define DEINT_ID_INT4 MKTAG('I', 'n', 't', '4')
36 #define DEINT_ID_SIPR MKTAG('s', 'i', 'p', 'r')
37 #define DEINT_ID_VBRF MKTAG('v', 'b', 'r', 'f')
38 #define DEINT_ID_VBRS MKTAG('v', 'b', 'r', 's')
76 if (buf_size > 0) *q =
'\0';
105 get_strl(pb, buf,
sizeof(buf), len);
132 unsigned bytes_per_minute;
139 if ((startpos + header_size) >=
avio_tell(pb) + 2) {
145 if ((startpos + header_size) >
avio_tell(pb))
147 if (bytes_per_minute)
156 int flavor, sub_packet_h, coded_framesize, sub_packet_size;
157 int codecdata_length;
158 unsigned bytes_per_minute;
170 if (bytes_per_minute)
212 codecdata_length = 0;
233 if(sub_packet_size <= 0){
252 if (codecdata_length >= 1) {
315 if (v ==
MKTAG(0xfd,
'a',
'r',
'.')) {
319 }
else if (v ==
MKBETAG(
'L',
'S',
'D',
':')) {
328 }
else if(mime && !strcmp(mime,
"logical-fileinfo")){
329 int stream_count, rule_count, property_count, i;
340 for(i=0; i<property_count; i++){
380 0x10000, fps, (1 << 30) - 1);
381 #if FF_API_R_FRAME_RATE
399 unsigned int size, n_pkts, str_id, next_off,
n, pos, pts;
419 "Invalid stream index %d for index at pos %"PRId64
"\n",
424 "Nr. of packets in packet index for stream index %d "
425 "exceeds filesize (%"PRId64
" at %"PRId64
" = %"PRId64
")\n",
431 for (n = 0; n < n_pkts; n++) {
441 if (next_off &&
avio_tell(pb) < next_off &&
444 "Non-linear index detected, not supported\n");
473 unsigned int data_off = 0, indx_off = 0;
474 char buf[128], mime[128];
478 if (tag ==
MKTAG(
'.',
'r',
'a', 0xfd)) {
481 }
else if (tag !=
MKTAG(
'.',
'R',
'M',
'F')) {
494 av_dlog(s,
"tag=%c%c%c%c (%08x) size=%d\n",
501 if (tag_size < 10 && tag !=
MKTAG(
'D',
'A',
'T',
'A'))
504 case MKTAG(
'P',
'R',
'O',
'P'):
519 case MKTAG(
'C',
'O',
'N',
'T'):
522 case MKTAG(
'M',
'D',
'P',
'R'):
546 case MKTAG(
'D',
'A',
'T',
'A'):
563 avio_seek(pb, indx_off, SEEK_SET) >= 0) {
583 return (n << 16) | n1;
588 #define RAW_PACKET_SIZE 1000
594 uint32_t
state=0xFFFFFFFF;
605 state= (state<<8) +
avio_r8(pb);
607 if(state ==
MKBETAG(
'I',
'N',
'D',
'X')){
608 int n_pkts, expected_len;
612 expected_len = 20 + n_pkts * 14;
616 else if (len != expected_len)
618 "Index size %d (%d pkts) is wrong, should be %d.\n",
619 len, n_pkts, expected_len);
624 }
else if (state ==
MKBETAG(
'D',
'A',
'T',
'A')) {
626 "DATA tag in middle of chunk, file may be broken.\n");
629 if(state > (
unsigned)0xFFFF || state <= 12)
664 int seq = 0, pic_num = 0, len2 = 0, pos = 0;
697 return ret < 0 ? ret :
AVERROR(EIO);
704 if((seq & 0x7F) == 1 || vst->
curpic_num != pic_num){
709 vst->
slices = ((hdr & 0x3F) << 1) + 1;
721 len =
FFMIN(len, pos);
740 #if FF_API_DESTRUCT_PACKET
741 vst->
pkt.destruct = NULL;
764 for (j=0;j<pkt->
size;j+=2) {
765 FFSWAP(
int, ptr[0], ptr[1]);
774 int *seq,
int flags, int64_t timestamp)
800 for (x = 0; x < h/2; x++)
804 for (x = 0; x < w/sps; x++)
844 int seq= 128*(pkt->
data[2]&0x7F) + (pkt->
data[3]>>1);
847 seq |= (timestamp&~0x3FFF);
848 if(seq - timestamp > 0x2000) seq -= 0x4000;
849 if(seq - timestamp < -0x2000) seq += 0x4000;
854 pkt->
pts = timestamp;
895 int64_t timestamp, pos;
915 flags = (seq++ == 1) ? 2 : 0;
918 len=
sync(s, ×tamp, &flags, &i, &pos);
927 &seq, flags, timestamp);
928 if((flags&2) && (seq&0x7F) == 1)
957 if ((p->
buf[0] ==
'.' && p->
buf[1] ==
'R' &&
958 p->
buf[2] ==
'M' && p->
buf[3] ==
'F' &&
959 p->
buf[4] == 0 && p->
buf[5] == 0) ||
960 (p->
buf[0] ==
'.' && p->
buf[1] ==
'r' &&
961 p->
buf[2] ==
'a' && p->
buf[3] == 0xfd))
968 int64_t *ppos, int64_t pos_limit)
987 len=
sync(s, &dts, &flags, &stream_index2, &pos);
991 st = s->
streams[stream_index2];
999 if((flags&2) && (seq&0x7F) == 1){
1000 av_dlog(s,
"%d %d-%d %"PRId64
" %d\n",
1001 flags, stream_index2, stream_index, dts, seq);
1003 if(stream_index2 == stream_index)
1014 int64_t pts,
int flags)