MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / output_frame

Function output_frame

libavcodec/h264dec.c:859–896  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

857}
858
859static int output_frame(H264Context *h, AVFrame *dst, H264Picture *srcp)
860{
861 int ret;
862
863 ret = av_frame_ref(dst, srcp->needs_fg ? srcp->f_grain : srcp->f);
864 if (ret < 0)
865 return ret;
866
867 if (srcp->needs_fg && (ret = av_frame_copy_props(dst, srcp->f)) < 0)
868 return ret;
869
870 if (srcp->decode_error_flags) {
871 atomic_int *decode_error = srcp->decode_error_flags;
872 /* The following is not supposed to provide synchronisation at all:
873 * given that srcp has already finished decoding, decode_error
874 * has already been set to its final value. */
875 dst->decode_error_flags |= atomic_load_explicit(decode_error, memory_order_relaxed);
876 }
877
878 av_dict_set(&dst->metadata, "stereo_mode", ff_h264_sei_stereo_mode(&h->sei.common.frame_packing), 0);
879
880 if (srcp->sei_recovery_frame_cnt == 0)
881 dst->flags |= AV_FRAME_FLAG_KEY;
882
883 if (h->avctx->export_side_data & AV_CODEC_EXPORT_DATA_VIDEO_ENC_PARAMS) {
884 ret = h264_export_enc_params(dst, srcp);
885 if (ret < 0)
886 goto fail;
887 }
888
889 if (!(h->avctx->export_side_data & AV_CODEC_EXPORT_DATA_FILM_GRAIN))
890 av_frame_remove_side_data(dst, AV_FRAME_DATA_FILM_GRAIN_PARAMS);
891
892 return 0;
893fail:
894 av_frame_unref(dst);
895 return ret;
896}
897
898static int is_avcc_extradata(const uint8_t *buf, int buf_size)
899{

Callers 1

finalize_frameFunction · 0.70

Calls 7

av_frame_refFunction · 0.85
av_frame_copy_propsFunction · 0.85
av_dict_setFunction · 0.85
ff_h264_sei_stereo_modeFunction · 0.85
h264_export_enc_paramsFunction · 0.85
av_frame_unrefFunction · 0.85

Tested by

no test coverage detected