Ticket #9599: ticket-9599.patch

File ticket-9599.patch, 2.5 KB (added by low-batt, 6 weeks ago)

Patch that adds a separate VP9 Video Toolbox decoder.

  • libavcodec/allcodecs.c

    diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
    old mode 100644
    new mode 100755
    index 8775d15a4f..3154385331
    a b extern const FFCodec ff_vp9_mediacodec_decoder;  
    893893extern const FFCodec ff_vp9_mediacodec_encoder;
    894894extern const FFCodec ff_vp9_qsv_decoder;
    895895extern const FFCodec ff_vp9_vaapi_encoder;
     896extern const FFCodec ff_vp9_videotoolbox_decoder;
    896897extern const FFCodec ff_vp9_qsv_encoder;
    897898
    898899// null codecs
  • libavcodec/vp9.c

    diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
    old mode 100644
    new mode 100755
    index 89f7549ef0..cc873b7620
    a b const FFCodec ff_vp9_decoder = {  
    19171917#if CONFIG_VP9_VDPAU_HWACCEL
    19181918                               HWACCEL_VDPAU(vp9),
    19191919#endif
     1920                               NULL
     1921                           },
     1922};
     1923
     1924const FFCodec ff_vp9_videotoolbox_decoder = {
     1925        .p.name                = "vp9_videotoolbox",
     1926        CODEC_LONG_NAME("VideoToolbox Google VP9"),
     1927        .p.type                = AVMEDIA_TYPE_VIDEO,
     1928        .p.id                  = AV_CODEC_ID_VP9,
     1929        .priv_data_size        = sizeof(VP9Context),
     1930        .init                  = vp9_decode_init,
     1931        .close                 = vp9_decode_free,
     1932        FF_CODEC_DECODE_CB(vp9_decode_frame),
     1933        .p.capabilities        = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_SLICE_THREADS,
     1934        .caps_internal         = FF_CODEC_CAP_INIT_CLEANUP |
     1935                                 FF_CODEC_CAP_SLICE_THREAD_HAS_MF |
     1936                                 FF_CODEC_CAP_ALLOCATE_PROGRESS,
     1937        .flush                 = vp9_decode_flush,
     1938        UPDATE_THREAD_CONTEXT(vp9_decode_update_thread_context),
     1939        .p.profiles            = NULL_IF_CONFIG_SMALL(ff_vp9_profiles),
     1940#if ARCH_X86_64
     1941        /* Video Toolbox requires VP9 invisible (alt-ref) frames be merged into VP9 superframes when running on Intel
     1942         * based Macs. Violation of this requirement will cause Video Toolbox to hang due to defective error handing
     1943         * in VTDecompressionSessionDecodeFrame. See FFmpeg ticket #9599. */
     1944        .bsfs                  = "vp9_superframe",
     1945#else
     1946        .bsfs                  = "vp9_superframe_split",
     1947#endif
     1948        .hw_configs            = (const AVCodecHWConfigInternal *const []) {
    19201949#if CONFIG_VP9_VIDEOTOOLBOX_HWACCEL
    19211950                               HWACCEL_VIDEOTOOLBOX(vp9),
    19221951#endif
    19231952                               NULL
    1924                            },
     1953        },
    19251954};