Lines Matching refs:nsv

219     NSVContext *nsv = s->priv_data;  in nsv_resync()  local
227 nsv->state = NSV_UNSYNC; in nsv_resync()
238 nsv->state = NSV_FOUND_BEEF; in nsv_resync()
244 nsv->state = NSV_FOUND_NSVF; in nsv_resync()
249 nsv->state = NSV_FOUND_NSVS; in nsv_resync()
260 NSVContext *nsv = s->priv_data; in nsv_parse_NSVf_header() local
269 nsv->state = NSV_UNSYNC; /* in case we fail */ in nsv_parse_NSVf_header()
271 if (nsv->nsvf) { in nsv_parse_NSVf_header()
275 nsv->nsvf = 1; in nsv_parse_NSVf_header()
280 nsv->NSVf_end = size; in nsv_parse_NSVf_header()
286 nsv->duration = duration = avio_rl32(pb); /* in ms */ in nsv_parse_NSVf_header()
339 nsv->index_entries = table_entries_used; in nsv_parse_NSVf_header()
342 nsv->nsvs_file_offset = av_malloc_array((unsigned)table_entries_used, sizeof(uint32_t)); in nsv_parse_NSVf_header()
343 if (!nsv->nsvs_file_offset) in nsv_parse_NSVf_header()
349 nsv->nsvs_file_offset[i] = avio_rl32(pb) + size; in nsv_parse_NSVf_header()
354 nsv->nsvs_timestamps = av_malloc_array((unsigned)table_entries_used, sizeof(uint32_t)); in nsv_parse_NSVf_header()
355 if (!nsv->nsvs_timestamps) in nsv_parse_NSVf_header()
358 nsv->nsvs_timestamps[i] = avio_rl32(pb); in nsv_parse_NSVf_header()
365 …avio_seek(pb, nsv->base_offset + size, SEEK_SET); /* required for dumbdriving-271.nsv (2 extra byt… in nsv_parse_NSVf_header()
369 nsv->state = NSV_HAS_READ_NSVF; in nsv_parse_NSVf_header()
375 NSVContext *nsv = s->priv_data; in nsv_parse_NSVs_header() local
408 nsv->avsync = avio_rl16(pb); in nsv_parse_NSVs_header()
409 nsv->framerate = framerate; in nsv_parse_NSVs_header()
415 nsv->vtag = vtag; in nsv_parse_NSVs_header()
416 nsv->atag = atag; in nsv_parse_NSVs_header()
417 nsv->vwidth = vwidth; in nsv_parse_NSVs_header()
418 nsv->vheight = vwidth; in nsv_parse_NSVs_header()
439 st->duration = av_rescale(nsv->duration, framerate.num, 1000*framerate.den); in nsv_parse_NSVs_header()
441 for(i=0;i<nsv->index_entries;i++) { in nsv_parse_NSVs_header()
442 if(nsv->nsvs_timestamps) { in nsv_parse_NSVs_header()
443 av_add_index_entry(st, nsv->nsvs_file_offset[i], nsv->nsvs_timestamps[i], in nsv_parse_NSVs_header()
446 … int64_t ts = av_rescale(i*nsv->duration/nsv->index_entries, framerate.num, 1000*framerate.den); in nsv_parse_NSVs_header()
447 av_add_index_entry(st, nsv->nsvs_file_offset[i], ts, 0, 0, AVINDEX_KEYFRAME); in nsv_parse_NSVs_header()
470 st->duration = (int64_t)nsv->duration * framerate.num; in nsv_parse_NSVs_header()
473 … if (nsv->vtag != vtag || nsv->atag != atag || nsv->vwidth != vwidth || nsv->vheight != vwidth) { in nsv_parse_NSVs_header()
479 nsv->state = NSV_HAS_READ_NSVS; in nsv_parse_NSVs_header()
483 nsv->state = NSV_UNSYNC; in nsv_parse_NSVs_header()
489 NSVContext *nsv = s->priv_data; in nsv_read_header() local
492 nsv->state = NSV_UNSYNC; in nsv_read_header()
493 nsv->ahead[0].data = nsv->ahead[1].data = NULL; in nsv_read_header()
499 if (nsv->state == NSV_FOUND_NSVF) { in nsv_read_header()
505 if (nsv->state == NSV_FOUND_NSVS) { in nsv_read_header()
529 NSVContext *nsv = s->priv_data; in nsv_read_chunk() local
541 if (nsv->ahead[0].data || nsv->ahead[1].data) in nsv_read_chunk()
548 for (i = 0; i < NSV_MAX_RESYNC_TRIES && nsv->state < NSV_FOUND_NSVS && !err; i++) in nsv_read_chunk()
552 if (nsv->state == NSV_FOUND_NSVS) in nsv_read_chunk()
556 if (nsv->state != NSV_HAS_READ_NSVS && nsv->state != NSV_FOUND_BEEF) in nsv_read_chunk()
577 nsv->state = NSV_UNSYNC; in nsv_read_chunk()
589 pkt = &nsv->ahead[NSV_ST_VIDEO]; in nsv_read_chunk()
594 …pkt->flags |= nsv->state == NSV_HAS_READ_NSVS ? AV_PKT_FLAG_KEY : 0; /* keyframe only likely on a … in nsv_read_chunk()
603 pkt = &nsv->ahead[NSV_ST_AUDIO]; in nsv_read_chunk()
635 …pkt->flags |= nsv->state == NSV_HAS_READ_NSVS ? AV_PKT_FLAG_KEY : 0; /* keyframe only likely on a … in nsv_read_chunk()
636 if( nsv->state == NSV_HAS_READ_NSVS && st[NSV_ST_VIDEO] ) { in nsv_read_chunk()
639 pkt->dts *= (int64_t)1000 * nsv->framerate.den; in nsv_read_chunk()
640 pkt->dts += (int64_t)nsv->avsync * nsv->framerate.num; in nsv_read_chunk()
641 av_log(s, AV_LOG_TRACE, "NSV AUDIO: sync:%d, dts:%"PRId64, nsv->avsync, pkt->dts); in nsv_read_chunk()
646 nsv->state = NSV_UNSYNC; in nsv_read_chunk()
653 NSVContext *nsv = s->priv_data; in nsv_read_packet() local
657 if (!nsv->ahead[0].data && !nsv->ahead[1].data) in nsv_read_packet()
664 if (nsv->ahead[i].data) { in nsv_read_packet()
665 av_packet_move_ref(pkt, &nsv->ahead[i]); in nsv_read_packet()
676 NSVContext *nsv = s->priv_data; in nsv_read_seek() local
689 nsv->state = NSV_UNSYNC; in nsv_read_seek()
695 NSVContext *nsv = s->priv_data; in nsv_read_close() local
697 av_freep(&nsv->nsvs_file_offset); in nsv_read_close()
698 av_freep(&nsv->nsvs_timestamps); in nsv_read_close()
699 if (nsv->ahead[0].data) in nsv_read_close()
700 av_packet_unref(&nsv->ahead[0]); in nsv_read_close()
701 if (nsv->ahead[1].data) in nsv_read_close()
702 av_packet_unref(&nsv->ahead[1]); in nsv_read_close()