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';
101 get_strl(pb, buf,
sizeof(buf), len);
128 unsigned bytes_per_minute;
135 if ((startpos + header_size) >=
avio_tell(pb) + 2) {
141 if ((startpos + header_size) >
avio_tell(pb))
143 if (bytes_per_minute)
152 int flavor, sub_packet_h, coded_framesize, sub_packet_size;
153 int codecdata_length;
154 unsigned bytes_per_minute;
166 if (bytes_per_minute)
209 codecdata_length = 0;
230 if(sub_packet_size <= 0){
249 if (codecdata_length >= 1) {
318 if (v ==
MKTAG(0xfd,
'a',
'r',
'.')) {
322 }
else if (v ==
MKBETAG(
'L',
'S',
'D',
':')) {
331 }
else if(mime && !strcmp(mime,
"logical-fileinfo")){
332 int stream_count, rule_count, property_count, i;
343 for(i=0; i<property_count; i++){
384 0x10000, fps, (1 << 30) - 1);
385 #if FF_API_R_FRAME_RATE
407 unsigned int size, n_pkts, str_id, next_off,
n, pos, pts;
427 "Invalid stream index %d for index at pos %"PRId64
"\n",
432 "Nr. of packets in packet index for stream index %d "
433 "exceeds filesize (%"PRId64
" at %"PRId64
" = %"PRId64
")\n",
439 for (n = 0; n < n_pkts; n++) {
449 if (next_off &&
avio_tell(pb) < next_off &&
452 "Non-linear index detected, not supported\n");
481 unsigned int data_off = 0, indx_off = 0;
482 char buf[128], mime[128];
486 if (tag ==
MKTAG(
'.',
'r',
'a', 0xfd)) {
489 }
else if (tag !=
MKTAG(
'.',
'R',
'M',
'F')) {
502 av_dlog(s,
"tag=%c%c%c%c (%08x) size=%d\n",
509 if (tag_size < 10 && tag !=
MKTAG(
'D',
'A',
'T',
'A'))
512 case MKTAG(
'P',
'R',
'O',
'P'):
527 case MKTAG(
'C',
'O',
'N',
'T'):
530 case MKTAG(
'M',
'D',
'P',
'R'):
554 case MKTAG(
'D',
'A',
'T',
'A'):
571 avio_seek(pb, indx_off, SEEK_SET) >= 0) {
591 return (n << 16) | n1;
596 #define RAW_PACKET_SIZE 1000
602 uint32_t
state=0xFFFFFFFF;
613 state= (state<<8) +
avio_r8(pb);
615 if(state ==
MKBETAG(
'I',
'N',
'D',
'X')){
616 int n_pkts, expected_len;
620 expected_len = 20 + n_pkts * 14;
624 else if (len != expected_len)
626 "Index size %d (%d pkts) is wrong, should be %d.\n",
627 len, n_pkts, expected_len);
632 }
else if (state ==
MKBETAG(
'D',
'A',
'T',
'A')) {
634 "DATA tag in middle of chunk, file may be broken.\n");
637 if(state > (
unsigned)0xFFFF || state <= 12)
672 int seq = 0, pic_num = 0, len2 = 0, pos = 0;
710 return ret < 0 ? ret :
AVERROR(EIO);
717 if((seq & 0x7F) == 1 || vst->
curpic_num != pic_num){
722 vst->
slices = ((hdr & 0x3F) << 1) + 1;
734 len =
FFMIN(len, pos);
759 #if FF_API_DESTRUCT_PACKET
785 for (j=0;j<pkt->
size;j+=2) {
786 FFSWAP(
int, ptr[0], ptr[1]);
795 if (ret >= 0) memset(dst + ret, 0, n - ret);
796 else memset(dst , 0, n);
805 int *seq,
int flags, int64_t timestamp)
814 return ret < 0 ? ret : -1;
833 for (x = 0; x < h/2; x++)
837 for (x = 0; x < w/sps; x++)
877 int seq= 128*(pkt->
data[2]&0x7F) + (pkt->
data[3]>>1);
880 seq |= (timestamp&~0x3FFF);
881 if(seq - timestamp > 0x2000) seq -= 0x4000;
882 if(seq - timestamp < -0x2000) seq += 0x4000;
887 pkt->
pts = timestamp;
928 int64_t timestamp, pos;
948 flags = (seq++ == 1) ? 2 : 0;
951 len=
sync(s, ×tamp, &flags, &i, &pos);
960 &seq, flags, timestamp);
963 if((flags&2) && (seq&0x7F) == 1)
992 if ((p->
buf[0] ==
'.' && p->
buf[1] ==
'R' &&
993 p->
buf[2] ==
'M' && p->
buf[3] ==
'F' &&
994 p->
buf[4] == 0 && p->
buf[5] == 0) ||
995 (p->
buf[0] ==
'.' && p->
buf[1] ==
'r' &&
996 p->
buf[2] ==
'a' && p->
buf[3] == 0xfd))
1003 int64_t *ppos, int64_t pos_limit)
1022 len=
sync(s, &dts, &flags, &stream_index2, &pos);
1026 st = s->
streams[stream_index2];
1034 if((flags&2) && (seq&0x7F) == 1){
1035 av_dlog(s,
"%d %d-%d %"PRId64
" %d\n",
1036 flags, stream_index2, stream_index, dts, seq);
1038 if(stream_index2 == stream_index)
1049 int64_t pts,
int flags)