36 #define DEINT_ID_GENR MKTAG('g', 'e', 'n', 'r')
37 #define DEINT_ID_INT0 MKTAG('I', 'n', 't', '0')
38 #define DEINT_ID_INT4 MKTAG('I', 'n', 't', '4')
39 #define DEINT_ID_SIPR MKTAG('s', 'i', 'p', 'r')
40 #define DEINT_ID_VBRF MKTAG('v', 'b', 'r', 'f')
41 #define DEINT_ID_VBRS MKTAG('v', 'b', 'r', 's')
79 if (buf_size > 0) *q =
'\0';
103 get_strl(pb, buf,
sizeof(buf), len);
130 unsigned bytes_per_minute;
137 if ((startpos + header_size) >=
avio_tell(pb) + 2) {
143 if ((startpos + header_size) >
avio_tell(pb))
145 if (bytes_per_minute)
154 int flavor, sub_packet_h, coded_framesize, sub_packet_size;
155 int codecdata_length;
156 unsigned bytes_per_minute;
168 if (bytes_per_minute)
211 codecdata_length = 0;
232 if(sub_packet_size <= 0){
251 if (codecdata_length >= 1) {
319 if (v ==
MKBETAG(
'M',
'L',
'T',
'I')) {
323 for (i = 0; i<number_of_streams; i++)
326 if (number_of_mdpr != 1) {
333 if (v ==
MKTAG(0xfd,
'a',
'r',
'.')) {
337 }
else if (v ==
MKBETAG(
'L',
'S',
'D',
':')) {
346 }
else if(mime && !strcmp(mime,
"logical-fileinfo")){
347 int stream_count, rule_count, property_count, i;
358 for(i=0; i<property_count; i++){
399 0x10000, fps, (1 << 30) - 1);
400 #if FF_API_R_FRAME_RATE
422 unsigned int size, n_pkts, str_id, next_off,
n, pos, pts;
442 "Invalid stream index %d for index at pos %"PRId64
"\n",
447 "Nr. of packets in packet index for stream index %d "
448 "exceeds filesize (%"PRId64
" at %"PRId64
" = %"PRId64
")\n",
454 for (n = 0; n < n_pkts; n++) {
464 if (next_off &&
avio_tell(pb) < next_off &&
467 "Non-linear index detected, not supported\n");
496 unsigned int data_off = 0, indx_off = 0;
497 char buf[128], mime[128];
501 if (tag ==
MKTAG(
'.',
'r',
'a', 0xfd)) {
504 }
else if (tag !=
MKTAG(
'.',
'R',
'M',
'F')) {
517 av_dlog(s,
"tag=%c%c%c%c (%08x) size=%d\n",
524 if (tag_size < 10 && tag !=
MKTAG(
'D',
'A',
'T',
'A'))
527 case MKTAG(
'P',
'R',
'O',
'P'):
542 case MKTAG(
'C',
'O',
'N',
'T'):
545 case MKTAG(
'M',
'D',
'P',
'R'):
569 case MKTAG(
'D',
'A',
'T',
'A'):
586 avio_seek(pb, indx_off, SEEK_SET) >= 0) {
606 return (n << 16) | n1;
611 #define RAW_PACKET_SIZE 1000
617 uint32_t
state=0xFFFFFFFF;
628 state= (state<<8) +
avio_r8(pb);
630 if(state ==
MKBETAG(
'I',
'N',
'D',
'X')){
631 int n_pkts, expected_len;
635 expected_len = 20 + n_pkts * 14;
639 else if (len != expected_len)
641 "Index size %d (%d pkts) is wrong, should be %d.\n",
642 len, n_pkts, expected_len);
647 }
else if (state ==
MKBETAG(
'D',
'A',
'T',
'A')) {
649 "DATA tag in middle of chunk, file may be broken.\n");
652 if(state > (
unsigned)0xFFFF || state <= 12)
687 int seq = 0, pic_num = 0, len2 = 0, pos = 0;
725 return ret < 0 ? ret :
AVERROR(EIO);
732 if((seq & 0x7F) == 1 || vst->
curpic_num != pic_num){
737 vst->
slices = ((hdr & 0x3F) << 1) + 1;
749 len =
FFMIN(len, pos);
774 #if FF_API_DESTRUCT_PACKET
800 for (j=0;j<pkt->
size;j+=2) {
801 FFSWAP(
int, ptr[0], ptr[1]);
810 if (ret >= 0) memset(dst + ret, 0, n - ret);
811 else memset(dst , 0, n);
820 int *seq,
int flags, int64_t timestamp)
829 return ret < 0 ? ret : -1;
848 for (x = 0; x < h/2; x++)
852 for (x = 0; x < w/sps; x++)
892 int seq= 128*(pkt->
data[2]&0x7F) + (pkt->
data[3]>>1);
895 seq |= (timestamp&~0x3FFF);
896 if(seq - timestamp > 0x2000) seq -= 0x4000;
897 if(seq - timestamp < -0x2000) seq += 0x4000;
902 pkt->
pts = timestamp;
942 int i,
len, res, seq = 1;
943 int64_t timestamp, pos;
963 flags = (seq++ == 1) ? 2 : 0;
966 len=
sync(s, ×tamp, &flags, &i, &pos);
975 &seq, flags, timestamp);
978 if((flags&2) && (seq&0x7F) == 1)
1007 if ((p->
buf[0] ==
'.' && p->
buf[1] ==
'R' &&
1008 p->
buf[2] ==
'M' && p->
buf[3] ==
'F' &&
1009 p->
buf[4] == 0 && p->
buf[5] == 0) ||
1010 (p->
buf[0] ==
'.' && p->
buf[1] ==
'r' &&
1011 p->
buf[2] ==
'a' && p->
buf[3] == 0xfd))
1018 int64_t *ppos, int64_t pos_limit)
1037 len=
sync(s, &dts, &flags, &stream_index2, &pos);
1041 st = s->
streams[stream_index2];
1049 if((flags&2) && (seq&0x7F) == 1){
1050 av_dlog(s,
"%d %d-%d %"PRId64
" %d\n",
1051 flags, stream_index2, stream_index, dts, seq);
1053 if(stream_index2 == stream_index)
1064 int64_t pts,
int flags)