[FFmpeg-devel] avcodec/videotoolbox: add support for full range and 10bit pixel formats

Jan Ekström jeebjp at gmail.com
Tue Apr 9 20:34:12 EEST 2019


Hi,

On Wed, Mar 27, 2019 at 11:34 PM der richter <der.richter at gmx.de> wrote:
>
> apparently the first patch didn't make it through
>

Sorry for this taking a while.

This has been generally tested to build and work with XCode 10.1 (I
think this is the newest version still available for 10.13.x) and
generally seems to follow the style of what's been done before.

Only nit regarding the pix_fmt descriptor: since other parts of the
module seem to utilize the !pointer style of checking and early exit,
I think you should switch

>     if (descriptor != NULL) {
>         int depth = descriptor->comp[0].depth;
>         if (depth > 8) {
>             return AV_PIX_FMT_P010;
>         }
>     }
>
>     return AV_PIX_FMT_NV12; // same as av_videotoolbox_alloc_context()

to:

    if (!descriptor)
        return AV_PIX_FMT_NV12; // same as av_videotoolbox_alloc_context()

    int depth = descriptor->comp[0].depth;
    if (depth > 8) {
        return AV_PIX_FMT_P010;
    }

or so.

Best regards,
Jan


More information about the ffmpeg-devel mailing list