[FFmpeg-devel] [PATCH v2 01/12] lavc/videotoolboxenc: Use shared pixel buffer pool

Carl Eugen Hoyos cehoyos at ag.or.at
Sat Apr 23 18:23:55 CEST 2016


Rick Kern <kernrj <at> gmail.com> writes:

> +    if(!*refPtr) return;

Is this needed (I don't know)?
If yes, please make it two lines.

> +    CFRelease(*refPtr);
> +    *refPtr = NULL;
> +    switch (fmt) {
> +        case AV_PIX_FMT_NV12:
> +            switch (range) {
> +                case AVCOL_RANGE_MPEG:
> +                    *av_pixel_format = 
> kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange;
> +                    break;
> +
> +                case AVCOL_RANGE_JPEG:
> +                    *av_pixel_format = 
> kCVPixelFormatType_420YpCbCr8BiPlanarFullRange;
> +                    break;
> +
> +                default:
> +                    if (range_guessed) *range_guessed = 1;
> +                    *av_pixel_format = 
> kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange;

You can rearrange this to make the patch smaller (and 
the default case easier to read).
Same below.

>  static const enum AVPixelFormat pix_fmts[] = {
>      AV_PIX_FMT_NV12,
> -#if !TARGET_OS_IPHONE
>      AV_PIX_FMT_YUV420P,
> -#endif
>      AV_PIX_FMT_NONE

Sorry: How is this related?

Carl Eugen



More information about the ffmpeg-devel mailing list