Lines Matching defs:dst

394 static int transfer_data_alloc(AVFrame *dst, const AVFrame *src, int flags)
406 if (dst->format >= 0) {
407 frame_tmp->format = dst->format;
433 av_frame_move_ref(dst, frame_tmp);
440 int av_hwframe_transfer_data(AVFrame *dst, const AVFrame *src, int flags)
445 if (!dst->buf[0])
446 return transfer_data_alloc(dst, src, flags);
451 * function could be provided by either the src or dst, depending on
454 if (src->hw_frames_ctx && dst->hw_frames_ctx) {
458 (AVHWFramesContext*)dst->hw_frames_ctx->data;
474 ret = src_ctx->internal->hw_type->transfer_data_from(src_ctx, dst, src);
476 ret = dst_ctx->internal->hw_type->transfer_data_to(dst_ctx, dst, src);
483 ret = ctx->internal->hw_type->transfer_data_from(ctx, dst, src);
486 } else if (dst->hw_frames_ctx) {
487 ctx = (AVHWFramesContext*)dst->hw_frames_ctx->data;
489 ret = ctx->internal->hw_type->transfer_data_to(ctx, dst, src);
735 AVFrame *dst, const AVFrame *src,
768 dst->buf[0] = av_buffer_create((uint8_t*)hwmap, sizeof(*hwmap),
770 if (!dst->buf[0]) {
786 int av_hwframe_map(AVFrame *dst, const AVFrame *src, int flags)
788 AVBufferRef *orig_dst_frames = dst->hw_frames_ctx;
789 enum AVPixelFormat orig_dst_fmt = dst->format;
794 if (src->hw_frames_ctx && dst->hw_frames_ctx) {
796 dst_frames = (AVHWFramesContext*)dst->hw_frames_ctx->data;
800 dst->format == dst_frames->format) ||
814 av_frame_unref(dst);
815 return av_frame_ref(dst, hwmap->source);
825 dst, src, flags);
833 if (dst->hw_frames_ctx) {
834 dst_frames = (AVHWFramesContext*)dst->hw_frames_ctx->data;
836 if (dst_frames->format == dst->format &&
839 dst, src, flags);
850 // if the caller provided dst frames context, it should be preserved
853 orig_dst_frames == dst->hw_frames_ctx);
855 // preserve user-provided dst frame fields, but clean
857 dst->hw_frames_ctx = NULL;
858 av_frame_unref(dst);
860 dst->hw_frames_ctx = orig_dst_frames;
861 dst->format = orig_dst_fmt;
873 AVHWFramesContext *dst = NULL;
902 dst = (AVHWFramesContext*)dst_ref->data;
904 dst->format = format;
905 dst->sw_format = src->sw_format;
906 dst->width = src->width;
907 dst->height = src->height;
909 dst->internal->source_frames = av_buffer_ref(source_frame_ctx);
910 if (!dst->internal->source_frames) {
915 dst->internal->source_allocation_map_flags =
923 ret = src->internal->hw_type->frames_derive_from(dst, src, flags);
925 dst->internal->hw_type->frames_derive_to)
926 ret = dst->internal->hw_type->frames_derive_to(dst, src, flags);
936 if (dst)
937 av_buffer_unref(&dst->internal->source_frames);
942 int ff_hwframe_map_replace(AVFrame *dst, const AVFrame *src)
944 HWMapDescriptor *hwmap = (HWMapDescriptor*)dst->buf[0]->data;