diff options
Diffstat (limited to 'libavutil/hwcontext.c')
-rw-r--r-- | libavutil/hwcontext.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/libavutil/hwcontext.c b/libavutil/hwcontext.c index 6dc95bba15..7f8e22736c 100644 --- a/libavutil/hwcontext.c +++ b/libavutil/hwcontext.c @@ -1,18 +1,18 @@ /* - * This file is part of Libav. + * This file is part of FFmpeg. * - * Libav is free software; you can redistribute it and/or + * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * - * Libav is distributed in the hope that it will be useful, + * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with Libav; if not, write to the Free Software + * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ @@ -35,10 +35,13 @@ static const HWContextType * const hw_table[] = { #if CONFIG_D3D11VA &ff_hwcontext_type_d3d11va, #endif +#if CONFIG_LIBDRM + &ff_hwcontext_type_drm, +#endif #if CONFIG_DXVA2 &ff_hwcontext_type_dxva2, #endif -#if CONFIG_LIBMFX +#if CONFIG_QSV &ff_hwcontext_type_qsv, #endif #if CONFIG_VAAPI @@ -47,16 +50,21 @@ static const HWContextType * const hw_table[] = { #if CONFIG_VDPAU &ff_hwcontext_type_vdpau, #endif +#if CONFIG_VIDEOTOOLBOX + &ff_hwcontext_type_videotoolbox, +#endif NULL, }; static const char *const hw_type_names[] = { [AV_HWDEVICE_TYPE_CUDA] = "cuda", + [AV_HWDEVICE_TYPE_DRM] = "drm", [AV_HWDEVICE_TYPE_DXVA2] = "dxva2", [AV_HWDEVICE_TYPE_D3D11VA] = "d3d11va", [AV_HWDEVICE_TYPE_QSV] = "qsv", [AV_HWDEVICE_TYPE_VAAPI] = "vaapi", [AV_HWDEVICE_TYPE_VDPAU] = "vdpau", + [AV_HWDEVICE_TYPE_VIDEOTOOLBOX] = "videotoolbox", }; enum AVHWDeviceType av_hwdevice_find_type_by_name(const char *name) @@ -232,7 +240,7 @@ AVBufferRef *av_hwframe_ctx_alloc(AVBufferRef *device_ref_in) AVHWDeviceContext *device_ctx = (AVHWDeviceContext*)device_ref_in->data; const HWContextType *hw_type = device_ctx->internal->hw_type; AVHWFramesContext *ctx; - AVBufferRef *buf, *device_ref = NULL;; + AVBufferRef *buf, *device_ref = NULL; ctx = av_mallocz(sizeof(*ctx)); if (!ctx) @@ -643,6 +651,10 @@ int av_hwdevice_ctx_create_derived(AVBufferRef **dst_ref_ptr, goto fail; done: + ret = av_hwdevice_ctx_init(dst_ref); + if (ret < 0) + goto fail; + *dst_ref_ptr = dst_ref; return 0; |