34 #define DEINT_ID_GENR MKTAG('g', 'e', 'n', 'r')
35 #define DEINT_ID_INT0 MKTAG('I', 'n', 't', '0')
36 #define DEINT_ID_INT4 MKTAG('I', 'n', 't', '4')
37 #define DEINT_ID_SIPR MKTAG('s', 'i', 'p', 'r')
38 #define DEINT_ID_VBRF MKTAG('v', 'b', 'r', 'f')
39 #define DEINT_ID_VBRS MKTAG('v', 'b', 'r', 's')
77 if (buf_size > 0) *q =
'\0';
104 get_strl(pb, buf,
sizeof(buf), len);
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++){
380 0x10000, fps, (1 << 30) - 1);
381 #if FF_API_R_FRAME_RATE
403 unsigned int size, n_pkts, str_id, next_off,
n, pos, pts;
423 "Invalid stream index %d for index at pos %"PRId64
"\n",
428 "Nr. of packets in packet index for stream index %d "
429 "exceeds filesize (%"PRId64
" at %"PRId64
" = %"PRId64
")\n",
435 for (n = 0; n < n_pkts; n++) {
445 if (next_off &&
avio_tell(pb) < next_off &&
448 "Non-linear index detected, not supported\n");
477 unsigned int data_off = 0, indx_off = 0;
478 char buf[128], mime[128];
482 if (tag ==
MKTAG(
'.',
'r',
'a', 0xfd)) {
485 }
else if (tag !=
MKTAG(
'.',
'R',
'M',
'F')) {
498 av_dlog(s,
"tag=%c%c%c%c (%08x) size=%d\n",
505 if (tag_size < 10 && tag !=
MKTAG(
'D',
'A',
'T',
'A'))
508 case MKTAG(
'P',
'R',
'O',
'P'):
523 case MKTAG(
'C',
'O',
'N',
'T'):
526 case MKTAG(
'M',
'D',
'P',
'R'):
550 case MKTAG(
'D',
'A',
'T',
'A'):
567 avio_seek(pb, indx_off, SEEK_SET) >= 0) {
587 return (n << 16) | n1;
592 #define RAW_PACKET_SIZE 1000
598 uint32_t
state=0xFFFFFFFF;
609 state= (state<<8) +
avio_r8(pb);
611 if(state ==
MKBETAG(
'I',
'N',
'D',
'X')){
612 int n_pkts, expected_len;
616 expected_len = 20 + n_pkts * 14;
620 else if (len != expected_len)
622 "Index size %d (%d pkts) is wrong, should be %d.\n",
623 len, n_pkts, expected_len);
628 }
else if (state ==
MKBETAG(
'D',
'A',
'T',
'A')) {
630 "DATA tag in middle of chunk, file may be broken.\n");
633 if(state > (
unsigned)0xFFFF || state <= 12)
668 int seq = 0, pic_num = 0, len2 = 0, pos = 0;
706 return ret < 0 ? ret :
AVERROR(EIO);
713 if((seq & 0x7F) == 1 || vst->
curpic_num != pic_num){
718 vst->
slices = ((hdr & 0x3F) << 1) + 1;
730 len =
FFMIN(len, pos);
755 #if FF_API_DESTRUCT_PACKET
757 vst->
pkt.destruct = NULL;
781 for (j=0;j<pkt->
size;j+=2) {
782 FFSWAP(
int, ptr[0], ptr[1]);
791 if (ret >= 0) memset(dst + ret, 0, n - ret);
792 else memset(dst , 0, n);
801 int *seq,
int flags, int64_t timestamp)
810 return ret < 0 ? ret : -1;
829 for (x = 0; x < h/2; x++)
833 for (x = 0; x < w/sps; x++)
873 int seq= 128*(pkt->
data[2]&0x7F) + (pkt->
data[3]>>1);
876 seq |= (timestamp&~0x3FFF);
877 if(seq - timestamp > 0x2000) seq -= 0x4000;
878 if(seq - timestamp < -0x2000) seq += 0x4000;
883 pkt->
pts = timestamp;
924 int64_t timestamp, pos;
944 flags = (seq++ == 1) ? 2 : 0;
947 len=
sync(s, ×tamp, &flags, &i, &pos);
956 &seq, flags, timestamp);
959 if((flags&2) && (seq&0x7F) == 1)
988 if ((p->
buf[0] ==
'.' && p->
buf[1] ==
'R' &&
989 p->
buf[2] ==
'M' && p->
buf[3] ==
'F' &&
990 p->
buf[4] == 0 && p->
buf[5] == 0) ||
991 (p->
buf[0] ==
'.' && p->
buf[1] ==
'r' &&
992 p->
buf[2] ==
'a' && p->
buf[3] == 0xfd))
999 int64_t *ppos, int64_t pos_limit)
1018 len=
sync(s, &dts, &flags, &stream_index2, &pos);
1022 st = s->
streams[stream_index2];
1030 if((flags&2) && (seq&0x7F) == 1){
1031 av_dlog(s,
"%d %d-%d %"PRId64
" %d\n",
1032 flags, stream_index2, stream_index, dts, seq);
1034 if(stream_index2 == stream_index)
1045 int64_t pts,
int flags)