[FFmpeg-devel] [PATCH] avcodec/videotoolboxenc: add hevc_videotoolbox encoder

Carl Eugen Hoyos ceffmpeg at gmail.com
Sun Nov 12 14:46:18 EET 2017


2017-11-11 4:57 GMT+01:00 Aman Gupta <ffmpeg at tmm1.net>:

> -    status = CMVideoFormatDescriptionGetH264ParameterSetAtIndex(vid_fmt,
> -                                                                0,
> -                                                                NULL,
> -                                                                NULL,
> -                                                                &ps_count,
> -                                                                NULL);
> +    status = vtctx->get_param_set_func(vid_fmt,

> +                                       0,
> +                                       NULL,
> +                                       NULL,
> +                                       &ps_count,
> +                                       NULL);

Please don't do this: It makes reviewing your changes (not only now)
unnecessarily difficult

> -    if(vtctx->has_b_frames && vtctx->profile == H264_PROF_BASELINE){
> -        av_log(avctx, AV_LOG_WARNING, "Cannot use B-frames with baseline profile. Output will not contain B-frames.\n");
> -        vtctx->has_b_frames = false;

> +        vtctx->has_b_frames = avctx->max_b_frames > 0;
> +        if(vtctx->has_b_frames && vtctx->profile == H264_PROF_BASELINE){
> +            av_log(avctx, AV_LOG_WARNING, "Cannot use B-frames with baseline profile. Output will not contain B-frames.\n");
> +            vtctx->has_b_frames = false;

This is much worse: Do not re-indent, push another commit with
white-space changes only.

Thank you, Carl Eugen


More information about the ffmpeg-devel mailing list