• Home
  • Raw
  • Download

Lines Matching refs:os

100         struct ogg_stream *os = ogg->streams + i;  in ogg_save()  local
101 os->buf = av_mallocz(os->bufsize + AV_INPUT_BUFFER_PADDING_SIZE); in ogg_save()
102 if (os->buf) in ogg_save()
103 memcpy(os->buf, ost->streams[i].buf, os->bufpos); in ogg_save()
106 os->new_metadata = NULL; in ogg_save()
107 os->new_metadata_size = 0; in ogg_save()
164 struct ogg_stream *os = ogg->streams + i; in ogg_reset() local
165 os->bufpos = 0; in ogg_reset()
166 os->pstart = 0; in ogg_reset()
167 os->psize = 0; in ogg_reset()
168 os->granule = -1; in ogg_reset()
169 os->lastpts = AV_NOPTS_VALUE; in ogg_reset()
170 os->lastdts = AV_NOPTS_VALUE; in ogg_reset()
171 os->sync_pos = -1; in ogg_reset()
172 os->page_pos = 0; in ogg_reset()
173 os->nsegs = 0; in ogg_reset()
174 os->segp = 0; in ogg_reset()
175 os->incomplete = 0; in ogg_reset()
176 os->got_data = 0; in ogg_reset()
178 os->lastpts = 0; in ogg_reset()
180 os->start_trimming = 0; in ogg_reset()
181 os->end_trimming = 0; in ogg_reset()
182 av_freep(&os->new_metadata); in ogg_reset()
183 os->new_metadata_size = 0; in ogg_reset()
213 struct ogg_stream *os; in ogg_replace_stream() local
229 os = &ogg->streams[0]; in ogg_replace_stream()
230 if (os->codec != codec) in ogg_replace_stream()
233 os->serial = serial; in ogg_replace_stream()
234 os->codec = codec; in ogg_replace_stream()
235 os->serial = serial; in ogg_replace_stream()
236 os->lastpts = 0; in ogg_replace_stream()
237 os->lastdts = 0; in ogg_replace_stream()
238 os->start_trimming = 0; in ogg_replace_stream()
239 os->end_trimming = 0; in ogg_replace_stream()
243 os->header = -1; in ogg_replace_stream()
253 struct ogg_stream *os; in ogg_new_stream() local
264 !(os = av_realloc(ogg->streams, size))) in ogg_new_stream()
266 ogg->streams = os; in ogg_new_stream()
267 os = ogg->streams + idx; in ogg_new_stream()
268 memset(os, 0, sizeof(*os)); in ogg_new_stream()
269 os->serial = serial; in ogg_new_stream()
270 os->bufsize = DECODER_BUFFER_SIZE; in ogg_new_stream()
271 os->buf = av_malloc(os->bufsize + AV_INPUT_BUFFER_PADDING_SIZE); in ogg_new_stream()
272 os->header = -1; in ogg_new_stream()
273 os->start_granule = OGG_NOGRANULE_VALUE; in ogg_new_stream()
274 if (!os->buf) in ogg_new_stream()
280 av_freep(&os->buf); in ogg_new_stream()
300 static int buf_realloc(struct ogg_stream *os, int size) in buf_realloc() argument
303 if (os->bufsize - os->bufpos < size) { in buf_realloc()
304 uint8_t *nb = av_realloc(os->buf, 2*os->bufsize + AV_INPUT_BUFFER_PADDING_SIZE); in buf_realloc()
307 os->buf = nb; in buf_realloc()
308 os->bufsize *= 2; in buf_realloc()
318 struct ogg_stream *os; in ogg_read_page() local
393 os = ogg->streams + idx; in ogg_read_page()
395 ret = buf_realloc(os, size); in ogg_read_page()
399 readout_buf = os->buf + os->bufpos; in ogg_read_page()
444 os = ogg->streams + idx; in ogg_read_page()
446 ret = buf_realloc(os, size); in ogg_read_page()
452 memcpy(os->buf + os->bufpos, readout_buf, size); in ogg_read_page()
457 os->page_pos = page_pos; in ogg_read_page()
458 os->nsegs = nsegs; in ogg_read_page()
459 os->segp = 0; in ogg_read_page()
460 os->got_data = !(flags & OGG_FLAG_BOS); in ogg_read_page()
461 os->bufpos += size; in ogg_read_page()
462 os->granule = gp; in ogg_read_page()
463 os->flags = flags; in ogg_read_page()
464 memcpy(os->segments, segments, nsegs); in ogg_read_page()
465 memset(os->buf + os->bufpos, 0, AV_INPUT_BUFFER_PADDING_SIZE); in ogg_read_page()
467 if (flags & OGG_FLAG_CONT || os->incomplete) { in ogg_read_page()
468 if (!os->psize) { in ogg_read_page()
472 while (os->segp < os->nsegs) { in ogg_read_page()
473 int seg = os->segments[os->segp++]; in ogg_read_page()
474 os->pstart += seg; in ogg_read_page()
478 os->sync_pos = os->page_pos; in ogg_read_page()
481 os->psize = 0; in ogg_read_page()
482 os->sync_pos = os->page_pos; in ogg_read_page()
503 struct ogg_stream *os; in ogg_packet() local
520 os = ogg->streams + idx; in ogg_packet()
523 idx, os->pstart, os->psize, os->segp, os->nsegs); in ogg_packet()
525 if (!os->codec) { in ogg_packet()
526 if (os->header < 0) { in ogg_packet()
527 os->codec = ogg_find_codec(os->buf, os->bufpos); in ogg_packet()
528 if (!os->codec) { in ogg_packet()
530 os->header = 0; in ogg_packet()
538 segp = os->segp; in ogg_packet()
539 psize = os->psize; in ogg_packet()
541 while (os->segp < os->nsegs) { in ogg_packet()
542 int ss = os->segments[os->segp++]; in ogg_packet()
543 os->psize += ss; in ogg_packet()
550 if (!complete && os->segp == os->nsegs) { in ogg_packet()
556 os->incomplete = !!os->psize; in ogg_packet()
561 if (os->granule == -1) in ogg_packet()
564 os->page_pos); in ogg_packet()
567 os->incomplete = 0; in ogg_packet()
569 if (os->header) { in ogg_packet()
570 if ((ret = os->codec->header(s, idx)) < 0) { in ogg_packet()
574 os->header = ret; in ogg_packet()
575 if (!os->header) { in ogg_packet()
576 os->segp = segp; in ogg_packet()
577 os->psize = psize; in ogg_packet()
587 s->internal->data_offset = os->sync_pos; in ogg_packet()
598 os->nb_header++; in ogg_packet()
599 os->pstart += os->psize; in ogg_packet()
600 os->psize = 0; in ogg_packet()
603 os->pflags = 0; in ogg_packet()
604 os->pduration = 0; in ogg_packet()
605 if (os->codec && os->codec->packet) { in ogg_packet()
606 if ((ret = os->codec->packet(s, idx)) < 0) { in ogg_packet()
614 *dstart = os->pstart; in ogg_packet()
616 *dsize = os->psize; in ogg_packet()
618 *fpos = os->sync_pos; in ogg_packet()
619 os->pstart += os->psize; in ogg_packet()
620 os->psize = 0; in ogg_packet()
621 if(os->pstart == os->bufpos) in ogg_packet()
622 os->bufpos = os->pstart = 0; in ogg_packet()
623 os->sync_pos = os->page_pos; in ogg_packet()
628 os->page_end = 1; in ogg_packet()
629 for (i = os->segp; i < os->nsegs; i++) in ogg_packet()
630 if (os->segments[i] < 255) { in ogg_packet()
631 os->page_end = 0; in ogg_packet()
635 if (os->segp == os->nsegs) in ogg_packet()
743 struct ogg_stream *os = ogg->streams + i; in ogg_read_header() local
749 } else if (os->codec && os->nb_header < os->codec->nb_header) { in ogg_read_header()
753 i, os->codec->nb_header, os->nb_header); in ogg_read_header()
759 if (os->start_granule != OGG_NOGRANULE_VALUE) in ogg_read_header()
760 os->lastpts = s->streams[i]->start_time = in ogg_read_header()
761 ogg_gptopts(s, i, os->start_granule, NULL); in ogg_read_header()
777 struct ogg_stream *os = ogg->streams + idx; in ogg_calc_pts() local
783 if (os->lastpts != AV_NOPTS_VALUE) { in ogg_calc_pts()
784 pts = os->lastpts; in ogg_calc_pts()
785 os->lastpts = AV_NOPTS_VALUE; in ogg_calc_pts()
787 if (os->lastdts != AV_NOPTS_VALUE) { in ogg_calc_pts()
789 *dts = os->lastdts; in ogg_calc_pts()
790 os->lastdts = AV_NOPTS_VALUE; in ogg_calc_pts()
792 if (os->page_end) { in ogg_calc_pts()
793 if (os->granule != -1LL) { in ogg_calc_pts()
794 if (os->codec && os->codec->granule_is_start) in ogg_calc_pts()
795 pts = ogg_gptopts(s, idx, os->granule, dts); in ogg_calc_pts()
797 os->lastpts = ogg_gptopts(s, idx, os->granule, &os->lastdts); in ogg_calc_pts()
798 os->granule = -1LL; in ogg_calc_pts()
807 struct ogg_stream *os = ogg->streams + idx; in ogg_validate_keyframe() local
812 invalid = !!(os->pflags & AV_PKT_FLAG_KEY) != !(os->buf[pstart] & 0x40); in ogg_validate_keyframe()
815 invalid = !!(os->pflags & AV_PKT_FLAG_KEY) != !(os->buf[pstart] & 1); in ogg_validate_keyframe()
818 os->pflags ^= AV_PKT_FLAG_KEY; in ogg_validate_keyframe()
820 (os->pflags & AV_PKT_FLAG_KEY) ? "" : "non-"); in ogg_validate_keyframe()
828 struct ogg_stream *os; in ogg_read_packet() local
847 os = ogg->streams + idx; in ogg_read_packet()
853 if (os->keyframe_seek && !(os->pflags & AV_PKT_FLAG_KEY)) in ogg_read_packet()
855 os->keyframe_seek = 0; in ogg_read_packet()
862 memcpy(pkt->data, os->buf + pstart, psize); in ogg_read_packet()
866 pkt->flags = os->pflags; in ogg_read_packet()
867 pkt->duration = os->pduration; in ogg_read_packet()
870 if (os->start_trimming || os->end_trimming) { in ogg_read_packet()
876 AV_WL32(side_data + 0, os->start_trimming); in ogg_read_packet()
877 AV_WL32(side_data + 4, os->end_trimming); in ogg_read_packet()
878 os->start_trimming = 0; in ogg_read_packet()
879 os->end_trimming = 0; in ogg_read_packet()
882 if (os->new_metadata) { in ogg_read_packet()
884 os->new_metadata, os->new_metadata_size); in ogg_read_packet()
888 os->new_metadata = NULL; in ogg_read_packet()
889 os->new_metadata_size = 0; in ogg_read_packet()
910 struct ogg_stream *os = ogg->streams + stream_index; in ogg_read_timestamp() local
912 if ( (os->flags & OGG_FLAG_EOS) in ogg_read_timestamp()
913 && !(os->flags & OGG_FLAG_BOS) in ogg_read_timestamp()
914 && os->codec == &ff_ogm_video_codec) in ogg_read_timestamp()
918 if (os->pflags & AV_PKT_FLAG_KEY) { in ogg_read_timestamp()
920 } else if (os->keyframe_seek) { in ogg_read_timestamp()
940 struct ogg_stream *os = ogg->streams + stream_index; in ogg_read_seek() local
952 os->keyframe_seek = 1; in ogg_read_seek()
956 os = ogg->streams + stream_index; in ogg_read_seek()
958 os->keyframe_seek = 0; in ogg_read_seek()