• Home
  • Raw
  • Download

Lines Matching refs:avs

171     AviSynthContext *avs = s->priv_data;  in avisynth_context_create()  local
178 avs->env = avs_library.avs_create_script_environment(3); in avisynth_context_create()
180 const char *error = avs_library.avs_get_error(avs->env); in avisynth_context_create()
188 avs_ctx_list = avs; in avisynth_context_create()
190 avs->next = avs_ctx_list; in avisynth_context_create()
191 avs_ctx_list = avs; in avisynth_context_create()
197 static av_cold void avisynth_context_destroy(AviSynthContext *avs) in avisynth_context_destroy() argument
202 if (avs == avs_ctx_list) { in avisynth_context_destroy()
203 avs_ctx_list = avs->next; in avisynth_context_destroy()
206 while (prev->next != avs) in avisynth_context_destroy()
208 prev->next = avs->next; in avisynth_context_destroy()
211 if (avs->clip) { in avisynth_context_destroy()
212 avs_library.avs_release_clip(avs->clip); in avisynth_context_destroy()
213 avs->clip = NULL; in avisynth_context_destroy()
215 if (avs->env) { in avisynth_context_destroy()
216 avs_library.avs_delete_script_environment(avs->env); in avisynth_context_destroy()
217 avs->env = NULL; in avisynth_context_destroy()
223 AviSynthContext *avs = avs_ctx_list; in avisynth_atexit_handler() local
225 while (avs) { in avisynth_atexit_handler()
226 AviSynthContext *next = avs->next; in avisynth_atexit_handler()
227 avisynth_context_destroy(avs); in avisynth_atexit_handler()
228 avs = next; in avisynth_atexit_handler()
238 AviSynthContext *avs = s->priv_data; in avisynth_create_stream_video() local
243 st->codecpar->width = avs->vi->width; in avisynth_create_stream_video()
244 st->codecpar->height = avs->vi->height; in avisynth_create_stream_video()
246 st->avg_frame_rate = (AVRational) { avs->vi->fps_numerator, in avisynth_create_stream_video()
247 avs->vi->fps_denominator }; in avisynth_create_stream_video()
249 st->duration = avs->vi->num_frames; in avisynth_create_stream_video()
250 st->nb_frames = avs->vi->num_frames; in avisynth_create_stream_video()
251 avpriv_set_pts_info(st, 32, avs->vi->fps_denominator, avs->vi->fps_numerator); in avisynth_create_stream_video()
253 av_log(s, AV_LOG_TRACE, "avs_is_field_based: %d\n", avs_is_field_based(avs->vi)); in avisynth_create_stream_video()
254 av_log(s, AV_LOG_TRACE, "avs_is_parity_known: %d\n", avs_is_parity_known(avs->vi)); in avisynth_create_stream_video()
261 if (avs_is_field_based(avs->vi)) { in avisynth_create_stream_video()
262 if (avs_is_tff(avs->vi)) { in avisynth_create_stream_video()
265 else if (avs_is_bff(avs->vi)) { in avisynth_create_stream_video()
270 switch (avs->vi->pixel_type) { in avisynth_create_stream_video()
475 "unknown AviSynth colorspace %d\n", avs->vi->pixel_type); in avisynth_create_stream_video()
476 avs->error = 1; in avisynth_create_stream_video()
482 avs->n_planes = 4; in avisynth_create_stream_video()
483 avs->planes = avs_planes_rgba; in avisynth_create_stream_video()
486 avs->n_planes = 4; in avisynth_create_stream_video()
487 avs->planes = avs_planes_yuva; in avisynth_create_stream_video()
490 avs->n_planes = 3; in avisynth_create_stream_video()
491 avs->planes = avs_planes_rgb; in avisynth_create_stream_video()
494 avs->n_planes = 1; in avisynth_create_stream_video()
495 avs->planes = avs_planes_grey; in avisynth_create_stream_video()
498 avs->n_planes = 3; in avisynth_create_stream_video()
499 avs->planes = avs_planes_yuv; in avisynth_create_stream_video()
502 avs->n_planes = 1; in avisynth_create_stream_video()
503 avs->planes = avs_planes_packed; in avisynth_create_stream_video()
510 AviSynthContext *avs = s->priv_data; in avisynth_create_stream_audio() local
513 st->codecpar->sample_rate = avs->vi->audio_samples_per_second; in avisynth_create_stream_audio()
514 st->codecpar->channels = avs->vi->nchannels; in avisynth_create_stream_audio()
515 st->duration = avs->vi->num_audio_samples; in avisynth_create_stream_audio()
516 avpriv_set_pts_info(st, 64, 1, avs->vi->audio_samples_per_second); in avisynth_create_stream_audio()
518 switch (avs->vi->sample_type) { in avisynth_create_stream_audio()
536 "unknown AviSynth sample type %d\n", avs->vi->sample_type); in avisynth_create_stream_audio()
537 avs->error = 1; in avisynth_create_stream_audio()
545 AviSynthContext *avs = s->priv_data; in avisynth_create_stream() local
550 if (avs_has_video(avs->vi)) { in avisynth_create_stream()
558 if (avs_has_audio(avs->vi)) { in avisynth_create_stream()
571 AviSynthContext *avs = s->priv_data; in avisynth_open_file() local
591 val = avs_library.avs_invoke(avs->env, "Import", arg, 0); in avisynth_open_file()
603 avs->clip = avs_library.avs_take_clip(val, avs->env); in avisynth_open_file()
604 avs->vi = avs_library.avs_get_video_info(avs->clip); in avisynth_open_file()
610 if (avs_library.avs_get_version(avs->clip) < 6) { in avisynth_open_file()
626 avisynth_context_destroy(avs); in avisynth_open_file()
633 AviSynthContext *avs = s->priv_data; in avisynth_next_stream() local
635 avs->curr_stream++; in avisynth_next_stream()
636 avs->curr_stream %= s->nb_streams; in avisynth_next_stream()
638 *st = s->streams[avs->curr_stream]; in avisynth_next_stream()
651 AviSynthContext *avs = s->priv_data; in avisynth_read_packet_video() local
658 if (avs->curr_frame >= avs->vi->num_frames) in avisynth_read_packet_video()
662 n = avs->curr_frame++; in avisynth_read_packet_video()
666 bits = avs_library.avs_bits_per_pixel(avs->vi); in avisynth_read_packet_video()
670 pkt->size = (((int64_t)avs->vi->width * in avisynth_read_packet_video()
671 (int64_t)avs->vi->height) * bits) / 8; in avisynth_read_packet_video()
681 pkt->stream_index = avs->curr_stream; in avisynth_read_packet_video()
683 frame = avs_library.avs_get_frame(avs->clip, n); in avisynth_read_packet_video()
684 error = avs_library.avs_clip_get_error(avs->clip); in avisynth_read_packet_video()
687 avs->error = 1; in avisynth_read_packet_video()
693 for (i = 0; i < avs->n_planes; i++) { in avisynth_read_packet_video()
694 plane = avs->planes[i]; in avisynth_read_packet_video()
702 if (avs_library.avs_is_color_space(avs->vi, AVS_CS_BGR) || in avisynth_read_packet_video()
703 avs_library.avs_is_color_space(avs->vi, AVS_CS_BGR48) || in avisynth_read_packet_video()
704 avs_library.avs_is_color_space(avs->vi, AVS_CS_BGR64)) { in avisynth_read_packet_video()
709 avs_library.avs_bit_blt(avs->env, dst_p, rowsize, src_p, pitch, in avisynth_read_packet_video()
721 AviSynthContext *avs = s->priv_data; in avisynth_read_packet_audio() local
727 if (avs->curr_sample >= avs->vi->num_audio_samples) in avisynth_read_packet_audio()
730 fps.num = avs->vi->fps_numerator; in avisynth_read_packet_audio()
731 fps.den = avs->vi->fps_denominator; in avisynth_read_packet_audio()
732 samplerate.num = avs->vi->audio_samples_per_second; in avisynth_read_packet_audio()
735 if (avs_has_video(avs->vi)) { in avisynth_read_packet_audio()
736 if (avs->curr_frame < avs->vi->num_frames) in avisynth_read_packet_audio()
737 samples = av_rescale_q(avs->curr_frame, samplerate, fps) - in avisynth_read_packet_audio()
738 avs->curr_sample; in avisynth_read_packet_audio()
752 if (avs->curr_sample + samples > avs->vi->num_audio_samples) in avisynth_read_packet_audio()
753 samples = avs->vi->num_audio_samples - avs->curr_sample; in avisynth_read_packet_audio()
756 n = avs->curr_sample; in avisynth_read_packet_audio()
757 avs->curr_sample += samples; in avisynth_read_packet_audio()
761 pkt->size = avs_bytes_per_channel_sample(avs->vi) * in avisynth_read_packet_audio()
762 samples * avs->vi->nchannels; in avisynth_read_packet_audio()
772 pkt->stream_index = avs->curr_stream; in avisynth_read_packet_audio()
774 avs_library.avs_get_audio(avs->clip, pkt->data, n, samples); in avisynth_read_packet_audio()
775 error = avs_library.avs_clip_get_error(avs->clip); in avisynth_read_packet_audio()
778 avs->error = 1; in avisynth_read_packet_audio()
804 AviSynthContext *avs = s->priv_data; in avisynth_read_packet() local
809 if (avs->error) in avisynth_read_packet()
817 if (ret == AVERROR_EOF && avs_has_audio(avs->vi)) { in avisynth_read_packet()
823 if (ret == AVERROR_EOF && avs_has_video(avs->vi)) { in avisynth_read_packet()
845 AviSynthContext *avs = s->priv_data; in avisynth_read_seek() local
849 if (avs->error) in avisynth_read_seek()
852 fps = (AVRational) { avs->vi->fps_numerator, in avisynth_read_seek()
853 avs->vi->fps_denominator }; in avisynth_read_seek()
854 samplerate = (AVRational) { avs->vi->audio_samples_per_second, 1 }; in avisynth_read_seek()
859 if ((timestamp >= avs->vi->num_frames) || in avisynth_read_seek()
863 avs->curr_frame = timestamp; in avisynth_read_seek()
864 if (avs_has_audio(avs->vi)) in avisynth_read_seek()
865 avs->curr_sample = av_rescale_q(timestamp, samplerate, fps); in avisynth_read_seek()
867 if ((timestamp >= avs->vi->num_audio_samples) || (timestamp < 0)) in avisynth_read_seek()
870 if (avs_has_video(avs->vi)) { in avisynth_read_seek()
871 avs->curr_frame = av_rescale_q(timestamp, fps, samplerate); in avisynth_read_seek()
872 avs->curr_sample = av_rescale_q(avs->curr_frame, samplerate, fps); in avisynth_read_seek()
874 avs->curr_sample = timestamp; in avisynth_read_seek()