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';
131 unsigned bytes_per_minute;
138 if ((startpos + header_size) >=
avio_tell(pb) + 2) {
144 if ((startpos + header_size) >
avio_tell(pb))
146 if (bytes_per_minute)
155 int flavor, sub_packet_h, coded_framesize, sub_packet_size;
156 int codecdata_length;
157 unsigned bytes_per_minute;
169 if (bytes_per_minute)
211 codecdata_length = 0;
232 if(sub_packet_size <= 0){
251 if (codecdata_length >= 1) {
314 if (v ==
MKTAG(0xfd,
'a',
'r',
'.')) {
318 }
else if (v ==
MKBETAG(
'L',
'S',
'D',
':')) {
327 }
else if(mime && !strcmp(mime,
"logical-fileinfo")){
328 int stream_count, rule_count, property_count, i;
339 for(i=0; i<property_count; i++){
379 0x10000, fps, (1 << 30) - 1);
380 #if FF_API_R_FRAME_RATE
398 unsigned int size, n_pkts, str_id, next_off, n, pos, pts;
418 "Invalid stream index %d for index at pos %"PRId64
"\n",
423 "Nr. of packets in packet index for stream index %d "
424 "exceeds filesize (%"PRId64
" at %"PRId64
" = %"PRId64
")\n",
430 for (n = 0; n < n_pkts; n++) {
440 if (next_off &&
avio_tell(pb) < next_off &&
443 "Non-linear index detected, not supported\n");
472 unsigned int data_off = 0, indx_off = 0;
473 char buf[128], mime[128];
477 if (tag ==
MKTAG(
'.',
'r',
'a', 0xfd)) {
480 }
else if (tag !=
MKTAG(
'.',
'R',
'M',
'F')) {
493 av_dlog(s,
"tag=%c%c%c%c (%08x) size=%d\n",
500 if (tag_size < 10 && tag !=
MKTAG(
'D',
'A',
'T',
'A'))
503 case MKTAG(
'P',
'R',
'O',
'P'):
518 case MKTAG(
'C',
'O',
'N',
'T'):
521 case MKTAG(
'M',
'D',
'P',
'R'):
545 case MKTAG(
'D',
'A',
'T',
'A'):
562 avio_seek(pb, indx_off, SEEK_SET) >= 0) {
582 return (n << 16) | n1;
587 #define RAW_PACKET_SIZE 1000
593 uint32_t
state=0xFFFFFFFF;
604 state= (state<<8) +
avio_r8(pb);
606 if(state ==
MKBETAG(
'I',
'N',
'D',
'X')){
607 int n_pkts, expected_len;
611 expected_len = 20 + n_pkts * 14;
615 else if (len != expected_len)
617 "Index size %d (%d pkts) is wrong, should be %d.\n",
618 len, n_pkts, expected_len);
623 }
else if (state ==
MKBETAG(
'D',
'A',
'T',
'A')) {
625 "DATA tag in middle of chunk, file may be broken.\n");
628 if(state > (
unsigned)0xFFFF || state <= 12)
663 int seq = 0, pic_num = 0, len2 = 0, pos = 0;
699 if((seq & 0x7F) == 1 || vst->
curpic_num != pic_num){
704 vst->
slices = ((hdr & 0x3F) << 1) + 1;
715 len =
FFMIN(len, pos);
754 for (j=0;j<pkt->
size;j+=2) {
755 FFSWAP(
int, ptr[0], ptr[1]);
764 int *seq,
int flags, int64_t timestamp)
790 for (x = 0; x < h/2; x++)
794 for (x = 0; x < w/sps; x++)
834 int seq= 128*(pkt->
data[2]&0x7F) + (pkt->
data[3]>>1);
837 seq |= (timestamp&~0x3FFF);
838 if(seq - timestamp > 0x2000) seq -= 0x4000;
839 if(seq - timestamp < -0x2000) seq += 0x4000;
844 pkt->
pts = timestamp;
884 int i,
len, res, seq = 1;
885 int64_t timestamp, pos;
905 flags = (seq++ == 1) ? 2 : 0;
908 len=
sync(s, ×tamp, &flags, &i, &pos);
917 &seq, flags, timestamp);
918 if((flags&2) && (seq&0x7F) == 1)
947 if ((p->
buf[0] ==
'.' && p->
buf[1] ==
'R' &&
948 p->
buf[2] ==
'M' && p->
buf[3] ==
'F' &&
949 p->
buf[4] == 0 && p->
buf[5] == 0) ||
950 (p->
buf[0] ==
'.' && p->
buf[1] ==
'r' &&
951 p->
buf[2] ==
'a' && p->
buf[3] == 0xfd))
958 int64_t *ppos, int64_t pos_limit)
977 len=
sync(s, &dts, &flags, &stream_index2, &pos);
981 st = s->
streams[stream_index2];
989 if((flags&2) && (seq&0x7F) == 1){
990 av_dlog(s,
"%d %d-%d %"PRId64
" %d\n",
991 flags, stream_index2, stream_index, dts, seq);
993 if(stream_index2 == stream_index)
1004 int64_t pts,
int flags)