Lines Matching refs:pb
113 AVIOContext *pb = s->pb;
138 idx->cluster[cl][id].pos = avio_tell(pb) - avi->movi_list;
161 static int64_t avi_start_new_riff(AVFormatContext *s, AVIOContext *pb,
175 avi->riff_start = ff_start_tag(pb, "RIFF");
176 ffio_wfourcc(pb, riff_tag);
177 loff = ff_start_tag(pb, "LIST");
178 ffio_wfourcc(pb, list_tag);
203 AVIOContext *pb = s->pb;
209 file_size = avio_tell(pb);
215 avio_seek(pb, avist->frames_hdr_strm, SEEK_SET);
218 avio_wl32(pb, avist->packet_count);
220 avio_wl32(pb, avist->audio_strm_length / au_ssize);
226 avio_seek(pb, avi->frames_hdr_all, SEEK_SET);
227 avio_wl32(pb, nb_frames);
229 avio_seek(pb, file_size, SEEK_SET);
236 AVIOContext *pb = s->pb;
247 avist->indexes.indx_start = ff_start_tag(pb, "JUNK");
248 avio_wl16(pb, 4); /* wLongsPerEntry */
249 avio_w8(pb, 0); /* bIndexSubType (0 == frame index) */
250 avio_w8(pb, 0); /* bIndexType (0 == AVI_INDEX_OF_INDEXES) */
251 avio_wl32(pb, 0); /* nEntriesInUse (will fill out later on) */
252 ffio_wfourcc(pb, avi_stream2fourcc(tag, stream_index, par->codec_type));
254 ffio_fill(pb, 0, 3 * 4 /* dwReserved[3] */
256 ff_end_tag(pb, avist->indexes.indx_start);
262 AVIOContext *pb = s->pb;
287 list1 = avi_start_new_riff(s, pb, "AVI ", "hdrl");
290 ffio_wfourcc(pb, "avih");
291 avio_wl32(pb, 14 * 4);
329 avio_wl32(pb, (uint32_t) (INT64_C(1000000) * video_st->time_base.num /
332 avio_wl32(pb, 0);
333 avio_wl32(pb, bitrate / 8); /* XXX: not quite exact */
334 avio_wl32(pb, 0); /* padding */
335 if (!(pb->seekable & AVIO_SEEKABLE_NORMAL))
336 avio_wl32(pb, AVIF_TRUSTCKTYPE | AVIF_ISINTERLEAVED); /* flags */
338 avio_wl32(pb, AVIF_TRUSTCKTYPE | AVIF_HASINDEX | AVIF_ISINTERLEAVED); /* flags */
339 avi->frames_hdr_all = avio_tell(pb); /* remember this offset to fill later */
340 avio_wl32(pb, nb_frames); /* nb frames, filled later */
341 avio_wl32(pb, 0); /* initial frame */
342 avio_wl32(pb, s->nb_streams); /* nb streams */
343 avio_wl32(pb, 1024 * 1024); /* suggested buffer size */
345 avio_wl32(pb, video_par->width);
346 avio_wl32(pb, video_par->height);
348 avio_wl32(pb, 0);
349 avio_wl32(pb, 0);
351 ffio_fill(pb, 0, 4 * 4); /* reserved */
358 list2 = ff_start_tag(pb, "LIST");
359 ffio_wfourcc(pb, "strl");
362 strh = ff_start_tag(pb, "strh");
372 ffio_wfourcc(pb, "vids");
375 ffio_wfourcc(pb, "auds");
378 // ffio_wfourcc(pb, "txts");
381 ffio_wfourcc(pb, "dats");
386 avio_wl32(pb, par->codec_tag);
388 avio_wl32(pb, 1);
389 avist->strh_flags_offset = avio_tell(pb);
390 avio_wl32(pb, 0); /* flags */
391 avio_wl16(pb, 0); /* priority */
392 avio_wl16(pb, 0); /* language */
393 avio_wl32(pb, 0); /* initial frame */
407 avio_wl32(pb, au_scale); /* scale */
408 avio_wl32(pb, au_byterate); /* rate */
410 avio_wl32(pb, 0); /* start */
412 avist->frames_hdr_strm = avio_tell(pb);
413 if (!(pb->seekable & AVIO_SEEKABLE_NORMAL))
415 avio_wl32(pb, AVI_MAX_RIFF_SIZE);
417 avio_wl32(pb, 0); /* length, XXX: filled later */
421 avio_wl32(pb, 1024 * 1024);
423 avio_wl32(pb, 12 * 1024);
425 avio_wl32(pb, 0);
426 avio_wl32(pb, -1); /* quality */
427 avio_wl32(pb, au_ssize); /* sample size */
428 avio_wl32(pb, 0);
433 avio_wl16(pb, par->width);
434 avio_wl16(pb, par->height);
435 ff_end_tag(pb, strh);
441 strf = ff_start_tag(pb, "strf");
455 avist->pal_offset = avio_tell(pb) + 40;
456 ff_put_bmp_header(pb, par, 0, 0, avi->flipped_raw_rgb);
476 if ((ret = ff_put_wav_header(s, pb, par, flags)) < 0)
485 ff_end_tag(pb, strf);
487 ff_riff_write_info_tag(s->pb, "strn", t->value);
498 ff_riff_write_info_tag(s->pb, "strn", str);
504 if (pb->seekable & AVIO_SEEKABLE_NORMAL) {
511 int vprp = ff_start_tag(pb, "vprp");
524 avio_wl32(pb, 0); // video format = unknown
525 avio_wl32(pb, 0); // video standard = unknown
527 avio_wl32(pb, (2LL*st->time_base.den + st->time_base.num - 1) / (2LL * st->time_base.num));
528 avio_wl32(pb, par->width);
529 avio_wl32(pb, par->height);
530 avio_wl16(pb, den);
531 avio_wl16(pb, num);
532 avio_wl32(pb, par->width);
533 avio_wl32(pb, par->height);
534 avio_wl32(pb, fields); // fields per frame
549 avio_wl32(pb, par->height / fields); // compressed bitmap height
550 avio_wl32(pb, par->width); // compressed bitmap width
551 avio_wl32(pb, par->height / fields); // valid bitmap height
552 avio_wl32(pb, par->width); // valid bitmap width
553 avio_wl32(pb, 0); // valid bitmap X offset
554 avio_wl32(pb, 0); // valid bitmap Y offset
555 avio_wl32(pb, 0); // valid X offset in T
556 avio_wl32(pb, start_line); // valid Y start line
558 ff_end_tag(pb, vprp);
561 ff_end_tag(pb, list2);
564 if (pb->seekable & AVIO_SEEKABLE_NORMAL) {
566 avi->odml_list = ff_start_tag(pb, "JUNK");
567 ffio_wfourcc(pb, "odml");
568 ffio_wfourcc(pb, "dmlh");
569 avio_wl32(pb, 248);
570 ffio_fill(pb, 0, 248);
571 ff_end_tag(pb, avi->odml_list);
574 ff_end_tag(pb, list1);
585 list2 = ff_start_tag(pb, "JUNK");
586 ffio_fill(pb, 0, FFALIGN((uint32_t)padding, 4));
587 ff_end_tag(pb, list2);
590 avi->movi_list = ff_start_tag(pb, "LIST");
591 ffio_wfourcc(pb, "movi");
598 AVIOContext *pb = s->pb;
604 pos = avio_tell(pb);
607 avio_seek(pb, avist->indexes.indx_start - 8, SEEK_SET);
608 ffio_wfourcc(pb, "indx"); /* enabling this entry */
609 avio_skip(pb, 8);
610 avio_wl32(pb, avi->riff_id - avist->indexes.master_odml_riff_id_base); /* nEntriesInUse */
611 avio_skip(pb, 16 * (avi->riff_id - avist->indexes.master_odml_riff_id_base));
612 avio_wl64(pb, ix); /* qwOffset */
613 avio_wl32(pb, size); /* dwSize */
621 avio_wl32(pb, audio_segm_size / au_ssize); /* dwDuration (sample count) */
623 avio_wl32(pb, avist->indexes.entry); /* dwDuration (packet count) */
625 avio_seek(pb, pos, SEEK_SET);
630 AVIOContext *pb = s->pb;
636 av_assert0(pb->seekable & AVIO_SEEKABLE_NORMAL);
644 pos = avio_tell(pb);
647 av_assert1(avio_tell(pb) - pos == size);
661 ix = avio_tell(pb);
662 ffio_wfourcc(pb, ix_tag); /* ix?? */
663 avio_wl32(pb, avist->indexes.entry * 8 + 24);
665 avio_wl16(pb, 2); /* wLongsPerEntry */
666 avio_w8(pb, 0); /* bIndexSubType (0 == frame index) */
667 avio_w8(pb, 1); /* bIndexType (1 == AVI_INDEX_OF_CHUNKS) */
668 avio_wl32(pb, avist->indexes.entry);
670 ffio_wfourcc(pb, tag); /* dwChunkId */
671 avio_wl64(pb, avi->movi_list); /* qwBaseOffset */
672 avio_wl32(pb, 0); /* dwReserved_3 (must be 0) */
676 avio_wl32(pb, ie->pos + 8);
677 avio_wl32(pb, ((uint32_t) ie->len & ~0x80000000) |
681 update_odml_entry(s, i, ix, avio_tell(pb) - ix);
688 AVIOContext *pb = s->pb;
694 if (pb->seekable & AVIO_SEEKABLE_NORMAL) {
699 idx_chunk = ff_start_tag(pb, "idx1");
722 ffio_wfourcc(pb, ie->tag);
726 ffio_wfourcc(pb, tag);
728 avio_wl32(pb, ie->flags);
729 avio_wl32(pb, ie->pos);
730 avio_wl32(pb, ie->len);
734 ff_end_tag(pb, idx_chunk);
784 AVIOContext *pb = s->pb;
805 if ((pb->seekable & AVIO_SEEKABLE_NORMAL) && avist->pal_offset) {
806 int64_t cur_offset = avio_tell(pb);
807 avio_seek(pb, avist->pal_offset, SEEK_SET);
810 avio_wl32(pb, v & 0xffffff);
812 avio_seek(pb, cur_offset, SEEK_SET);
820 if (s->pb->seekable & AVIO_SEEKABLE_NORMAL) {
822 int64_t cur_offset = avio_tell(pb);
823 avio_seek(pb, avist->strh_flags_offset, SEEK_SET);
824 avio_wl32(pb, AVISF_VIDEO_PALCHANGES);
825 avio_seek(pb, cur_offset, SEEK_SET);
833 pc_tag = ff_start_tag(pb, tag);
834 avio_w8(pb, 0);
835 avio_w8(pb, pal_size & 0xFF);
836 avio_wl16(pb, 0); // reserved
839 avio_wb32(pb, v<<8);
841 ff_end_tag(pb, pc_tag);
866 AVIOContext *pb = s->pb;
876 if ((pb->seekable & AVIO_SEEKABLE_NORMAL) &&
877 (avio_tell(pb) - avi->riff_start > AVI_MAX_RIFF_SIZE)) {
879 ff_end_tag(pb, avi->movi_list);
884 ff_end_tag(pb, avi->riff_start);
885 avi->movi_list = avi_start_new_riff(s, pb, "AVIX", "movi");
894 if (s->pb->seekable & AVIO_SEEKABLE_NORMAL) {
901 avio_write(pb, tag, 4);
902 avio_wl32(pb, size);
903 avio_write(pb, pkt->data, size);
905 avio_w8(pb, 0);
913 AVIOContext *pb = s->pb;
923 if (pb->seekable & AVIO_SEEKABLE_NORMAL) {
925 ff_end_tag(pb, avi->movi_list);
927 ff_end_tag(pb, avi->riff_start);
930 ff_end_tag(pb, avi->movi_list);
931 ff_end_tag(pb, avi->riff_start);
933 file_size = avio_tell(pb);
934 avio_seek(pb, avi->odml_list - 8, SEEK_SET);
935 ffio_wfourcc(pb, "LIST"); /* Making this AVI OpenDML one */
936 avio_skip(pb, 16);
951 avio_wl32(pb, nb_frames);
952 avio_seek(pb, file_size, SEEK_SET);
968 if (pb->seekable & AVIO_SEEKABLE_NORMAL) {
969 avio_seek(pb, avist->frames_hdr_strm + 4, SEEK_SET);
970 avio_wl32(pb, avist->max_size);