lavc: Mark all AVHWAccel structures as const

This commit is contained in:
Mark Thompson 2017-11-04 18:53:26 +00:00
parent 2a4d34d462
commit 2117725dc5
23 changed files with 74 additions and 71 deletions

View File

@ -13,6 +13,9 @@ libavutil: 2017-03-23
API changes, most recent first:
2017-xx-xx - xxxxxxx - lavc 58.8.0 - avcodec.h
Add const to AVCodecContext.hwaccel.
2017-xx-xx - xxxxxxx - lavc 58.7.0 - avcodec.h
Deprecate user visibility of the AVHWAccel structure and the functions
av_register_hwaccel() and av_hwaccel_next().

View File

@ -2307,7 +2307,7 @@ typedef struct AVCodecContext {
* - encoding: unused.
* - decoding: Set by libavcodec
*/
struct AVHWAccel *hwaccel;
const struct AVHWAccel *hwaccel;
/**
* Hardware accelerator context.

View File

@ -163,7 +163,7 @@ static int cuvid_h264_decode_init(AVCodecContext *avctx)
return ff_cuvid_decode_init(avctx, sps->ref_frame_count + sps->num_reorder_frames);
}
AVHWAccel ff_h264_cuvid_hwaccel = {
const AVHWAccel ff_h264_cuvid_hwaccel = {
.name = "h264_cuvid",
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_H264,

View File

@ -266,7 +266,7 @@ static int cuvid_hevc_decode_init(AVCodecContext *avctx)
return ff_cuvid_decode_init(avctx, sps->temporal_layer[sps->max_sub_layers - 1].max_dec_pic_buffering + 1);
}
AVHWAccel ff_hevc_cuvid_hwaccel = {
const AVHWAccel ff_hevc_cuvid_hwaccel = {
.name = "hevc_cuvid",
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_HEVC,

View File

@ -812,7 +812,7 @@ static int hwaccel_init(AVCodecContext *avctx,
return AVERROR(ENOMEM);
}
avctx->hwaccel = (AVHWAccel*)hwaccel;
avctx->hwaccel = hwaccel;
err = hwaccel->init(avctx);
if (err < 0) {
av_log(avctx, AV_LOG_ERROR, "Failed setup for format %s: "

View File

@ -513,7 +513,7 @@ static int dxva2_h264_end_frame(AVCodecContext *avctx)
}
#if CONFIG_H264_DXVA2_HWACCEL
AVHWAccel ff_h264_dxva2_hwaccel = {
const AVHWAccel ff_h264_dxva2_hwaccel = {
.name = "h264_dxva2",
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_H264,
@ -530,7 +530,7 @@ AVHWAccel ff_h264_dxva2_hwaccel = {
#endif
#if CONFIG_H264_D3D11VA_HWACCEL
AVHWAccel ff_h264_d3d11va_hwaccel = {
const AVHWAccel ff_h264_d3d11va_hwaccel = {
.name = "h264_d3d11va",
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_H264,
@ -547,7 +547,7 @@ AVHWAccel ff_h264_d3d11va_hwaccel = {
#endif
#if CONFIG_H264_D3D11VA2_HWACCEL
AVHWAccel ff_h264_d3d11va2_hwaccel = {
const AVHWAccel ff_h264_d3d11va2_hwaccel = {
.name = "h264_d3d11va2",
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_H264,

View File

@ -422,7 +422,7 @@ static int dxva2_hevc_end_frame(AVCodecContext *avctx)
}
#if CONFIG_HEVC_DXVA2_HWACCEL
AVHWAccel ff_hevc_dxva2_hwaccel = {
const AVHWAccel ff_hevc_dxva2_hwaccel = {
.name = "hevc_dxva2",
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_HEVC,
@ -439,7 +439,7 @@ AVHWAccel ff_hevc_dxva2_hwaccel = {
#endif
#if CONFIG_HEVC_D3D11VA_HWACCEL
AVHWAccel ff_hevc_d3d11va_hwaccel = {
const AVHWAccel ff_hevc_d3d11va_hwaccel = {
.name = "hevc_d3d11va",
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_HEVC,
@ -456,7 +456,7 @@ AVHWAccel ff_hevc_d3d11va_hwaccel = {
#endif
#if CONFIG_HEVC_D3D11VA2_HWACCEL
AVHWAccel ff_hevc_d3d11va2_hwaccel = {
const AVHWAccel ff_hevc_d3d11va2_hwaccel = {
.name = "hevc_d3d11va2",
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_HEVC,

View File

@ -318,7 +318,7 @@ static int dxva2_mpeg2_end_frame(AVCodecContext *avctx)
}
#if CONFIG_MPEG2_DXVA2_HWACCEL
AVHWAccel ff_mpeg2_dxva2_hwaccel = {
const AVHWAccel ff_mpeg2_dxva2_hwaccel = {
.name = "mpeg2_dxva2",
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_MPEG2VIDEO,
@ -335,7 +335,7 @@ AVHWAccel ff_mpeg2_dxva2_hwaccel = {
#endif
#if CONFIG_MPEG2_D3D11VA_HWACCEL
AVHWAccel ff_mpeg2_d3d11va_hwaccel = {
const AVHWAccel ff_mpeg2_d3d11va_hwaccel = {
.name = "mpeg2_d3d11va",
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_MPEG2VIDEO,
@ -352,7 +352,7 @@ AVHWAccel ff_mpeg2_d3d11va_hwaccel = {
#endif
#if CONFIG_MPEG2_D3D11VA2_HWACCEL
AVHWAccel ff_mpeg2_d3d11va2_hwaccel = {
const AVHWAccel ff_mpeg2_d3d11va2_hwaccel = {
.name = "mpeg2_d3d11va2",
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_MPEG2VIDEO,

View File

@ -318,7 +318,7 @@ static int dxva2_vc1_end_frame(AVCodecContext *avctx)
}
#if CONFIG_WMV3_DXVA2_HWACCEL
AVHWAccel ff_wmv3_dxva2_hwaccel = {
const AVHWAccel ff_wmv3_dxva2_hwaccel = {
.name = "wmv3_dxva2",
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_WMV3,
@ -335,7 +335,7 @@ AVHWAccel ff_wmv3_dxva2_hwaccel = {
#endif
#if CONFIG_VC1_DXVA2_HWACCEL
AVHWAccel ff_vc1_dxva2_hwaccel = {
const AVHWAccel ff_vc1_dxva2_hwaccel = {
.name = "vc1_dxva2",
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_VC1,
@ -352,7 +352,7 @@ AVHWAccel ff_vc1_dxva2_hwaccel = {
#endif
#if CONFIG_WMV3_D3D11VA_HWACCEL
AVHWAccel ff_wmv3_d3d11va_hwaccel = {
const AVHWAccel ff_wmv3_d3d11va_hwaccel = {
.name = "wmv3_d3d11va",
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_WMV3,
@ -369,7 +369,7 @@ AVHWAccel ff_wmv3_d3d11va_hwaccel = {
#endif
#if CONFIG_WMV3_D3D11VA2_HWACCEL
AVHWAccel ff_wmv3_d3d11va2_hwaccel = {
const AVHWAccel ff_wmv3_d3d11va2_hwaccel = {
.name = "wmv3_d3d11va2",
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_WMV3,
@ -386,7 +386,7 @@ AVHWAccel ff_wmv3_d3d11va2_hwaccel = {
#endif
#if CONFIG_VC1_D3D11VA_HWACCEL
AVHWAccel ff_vc1_d3d11va_hwaccel = {
const AVHWAccel ff_vc1_d3d11va_hwaccel = {
.name = "vc1_d3d11va",
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_VC1,
@ -403,7 +403,7 @@ AVHWAccel ff_vc1_d3d11va_hwaccel = {
#endif
#if CONFIG_VC1_D3D11VA2_HWACCEL
AVHWAccel ff_vc1_d3d11va2_hwaccel = {
const AVHWAccel ff_vc1_d3d11va2_hwaccel = {
.name = "vc1_d3d11va2",
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_VC1,

View File

@ -21,39 +21,39 @@
#include "avcodec.h"
extern AVHWAccel ff_h263_vaapi_hwaccel;
extern AVHWAccel ff_h264_cuvid_hwaccel;
extern AVHWAccel ff_h264_d3d11va_hwaccel;
extern AVHWAccel ff_h264_d3d11va2_hwaccel;
extern AVHWAccel ff_h264_dxva2_hwaccel;
extern AVHWAccel ff_h264_vaapi_hwaccel;
extern AVHWAccel ff_h264_vda_hwaccel;
extern AVHWAccel ff_h264_vda_old_hwaccel;
extern AVHWAccel ff_h264_vdpau_hwaccel;
extern AVHWAccel ff_hevc_cuvid_hwaccel;
extern AVHWAccel ff_hevc_d3d11va_hwaccel;
extern AVHWAccel ff_hevc_d3d11va2_hwaccel;
extern AVHWAccel ff_hevc_dxva2_hwaccel;
extern AVHWAccel ff_hevc_vaapi_hwaccel;
extern AVHWAccel ff_hevc_vdpau_hwaccel;
extern AVHWAccel ff_mpeg1_vdpau_hwaccel;
extern AVHWAccel ff_mpeg2_d3d11va_hwaccel;
extern AVHWAccel ff_mpeg2_d3d11va2_hwaccel;
extern AVHWAccel ff_mpeg2_dxva2_hwaccel;
extern AVHWAccel ff_mpeg2_vaapi_hwaccel;
extern AVHWAccel ff_mpeg2_vdpau_hwaccel;
extern AVHWAccel ff_mpeg4_vaapi_hwaccel;
extern AVHWAccel ff_mpeg4_vdpau_hwaccel;
extern AVHWAccel ff_vc1_d3d11va_hwaccel;
extern AVHWAccel ff_vc1_d3d11va2_hwaccel;
extern AVHWAccel ff_vc1_dxva2_hwaccel;
extern AVHWAccel ff_vc1_vaapi_hwaccel;
extern AVHWAccel ff_vc1_vdpau_hwaccel;
extern AVHWAccel ff_vp8_vaapi_hwaccel;
extern AVHWAccel ff_wmv3_d3d11va_hwaccel;
extern AVHWAccel ff_wmv3_d3d11va2_hwaccel;
extern AVHWAccel ff_wmv3_dxva2_hwaccel;
extern AVHWAccel ff_wmv3_vaapi_hwaccel;
extern AVHWAccel ff_wmv3_vdpau_hwaccel;
extern const AVHWAccel ff_h263_vaapi_hwaccel;
extern const AVHWAccel ff_h264_cuvid_hwaccel;
extern const AVHWAccel ff_h264_d3d11va_hwaccel;
extern const AVHWAccel ff_h264_d3d11va2_hwaccel;
extern const AVHWAccel ff_h264_dxva2_hwaccel;
extern const AVHWAccel ff_h264_vaapi_hwaccel;
extern const AVHWAccel ff_h264_vda_hwaccel;
extern const AVHWAccel ff_h264_vda_old_hwaccel;
extern const AVHWAccel ff_h264_vdpau_hwaccel;
extern const AVHWAccel ff_hevc_cuvid_hwaccel;
extern const AVHWAccel ff_hevc_d3d11va_hwaccel;
extern const AVHWAccel ff_hevc_d3d11va2_hwaccel;
extern const AVHWAccel ff_hevc_dxva2_hwaccel;
extern const AVHWAccel ff_hevc_vaapi_hwaccel;
extern const AVHWAccel ff_hevc_vdpau_hwaccel;
extern const AVHWAccel ff_mpeg1_vdpau_hwaccel;
extern const AVHWAccel ff_mpeg2_d3d11va_hwaccel;
extern const AVHWAccel ff_mpeg2_d3d11va2_hwaccel;
extern const AVHWAccel ff_mpeg2_dxva2_hwaccel;
extern const AVHWAccel ff_mpeg2_vaapi_hwaccel;
extern const AVHWAccel ff_mpeg2_vdpau_hwaccel;
extern const AVHWAccel ff_mpeg4_vaapi_hwaccel;
extern const AVHWAccel ff_mpeg4_vdpau_hwaccel;
extern const AVHWAccel ff_vc1_d3d11va_hwaccel;
extern const AVHWAccel ff_vc1_d3d11va2_hwaccel;
extern const AVHWAccel ff_vc1_dxva2_hwaccel;
extern const AVHWAccel ff_vc1_vaapi_hwaccel;
extern const AVHWAccel ff_vc1_vdpau_hwaccel;
extern const AVHWAccel ff_vp8_vaapi_hwaccel;
extern const AVHWAccel ff_wmv3_d3d11va_hwaccel;
extern const AVHWAccel ff_wmv3_d3d11va2_hwaccel;
extern const AVHWAccel ff_wmv3_dxva2_hwaccel;
extern const AVHWAccel ff_wmv3_vaapi_hwaccel;
extern const AVHWAccel ff_wmv3_vdpau_hwaccel;
#endif /* AVCODEC_HWACCELS_H */

View File

@ -388,7 +388,7 @@ static int vaapi_h264_decode_slice(AVCodecContext *avctx,
return 0;
}
AVHWAccel ff_h264_vaapi_hwaccel = {
const AVHWAccel ff_h264_vaapi_hwaccel = {
.name = "h264_vaapi",
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_H264,

View File

@ -423,7 +423,7 @@ static int vaapi_hevc_decode_slice(AVCodecContext *avctx,
return 0;
}
AVHWAccel ff_hevc_vaapi_hwaccel = {
const AVHWAccel ff_hevc_vaapi_hwaccel = {
.name = "hevc_vaapi",
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_HEVC,

View File

@ -173,7 +173,7 @@ static int vaapi_mpeg2_decode_slice(AVCodecContext *avctx, const uint8_t *buffer
return 0;
}
AVHWAccel ff_mpeg2_vaapi_hwaccel = {
const AVHWAccel ff_mpeg2_vaapi_hwaccel = {
.name = "mpeg2_vaapi",
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_MPEG2VIDEO,

View File

@ -189,7 +189,7 @@ static int vaapi_mpeg4_decode_slice(AVCodecContext *avctx, const uint8_t *buffer
}
#if CONFIG_MPEG4_VAAPI_HWACCEL
AVHWAccel ff_mpeg4_vaapi_hwaccel = {
const AVHWAccel ff_mpeg4_vaapi_hwaccel = {
.name = "mpeg4_vaapi",
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_MPEG4,
@ -207,7 +207,7 @@ AVHWAccel ff_mpeg4_vaapi_hwaccel = {
#endif
#if CONFIG_H263_VAAPI_HWACCEL
AVHWAccel ff_h263_vaapi_hwaccel = {
const AVHWAccel ff_h263_vaapi_hwaccel = {
.name = "h263_vaapi",
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_H263,

View File

@ -388,7 +388,7 @@ static int vaapi_vc1_decode_slice(AVCodecContext *avctx, const uint8_t *buffer,
}
#if CONFIG_WMV3_VAAPI_HWACCEL
AVHWAccel ff_wmv3_vaapi_hwaccel = {
const AVHWAccel ff_wmv3_vaapi_hwaccel = {
.name = "wmv3_vaapi",
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_WMV3,
@ -405,7 +405,7 @@ AVHWAccel ff_wmv3_vaapi_hwaccel = {
};
#endif
AVHWAccel ff_vc1_vaapi_hwaccel = {
const AVHWAccel ff_vc1_vaapi_hwaccel = {
.name = "vc1_vaapi",
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_VC1,

View File

@ -220,7 +220,7 @@ fail:
return err;
}
AVHWAccel ff_vp8_vaapi_hwaccel = {
const AVHWAccel ff_vp8_vaapi_hwaccel = {
.name = "vp8_vaapi",
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_VP8,

View File

@ -247,7 +247,7 @@ static int vda_h264_uninit(AVCodecContext *avctx)
return 0;
}
AVHWAccel ff_h264_vda_old_hwaccel = {
const AVHWAccel ff_h264_vda_old_hwaccel = {
.name = "h264_vda",
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_H264,
@ -483,7 +483,7 @@ static int vda_h264_alloc_frame(AVCodecContext *avctx, AVFrame *frame)
return 0;
}
AVHWAccel ff_h264_vda_hwaccel = {
const AVHWAccel ff_h264_vda_hwaccel = {
.name = "h264_vda",
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_H264,

View File

@ -262,7 +262,7 @@ static int vdpau_h264_init(AVCodecContext *avctx)
return ff_vdpau_common_init(avctx, profile, level);
}
AVHWAccel ff_h264_vdpau_hwaccel = {
const AVHWAccel ff_h264_vdpau_hwaccel = {
.name = "h264_vdpau",
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_H264,

View File

@ -413,7 +413,7 @@ static int vdpau_hevc_init(AVCodecContext *avctx)
return ff_vdpau_common_init(avctx, profile, level);
}
AVHWAccel ff_hevc_vdpau_hwaccel = {
const AVHWAccel ff_hevc_vdpau_hwaccel = {
.name = "hevc_vdpau",
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_HEVC,

View File

@ -103,7 +103,7 @@ static int vdpau_mpeg1_init(AVCodecContext *avctx)
VDP_DECODER_LEVEL_MPEG1_NA);
}
AVHWAccel ff_mpeg1_vdpau_hwaccel = {
const AVHWAccel ff_mpeg1_vdpau_hwaccel = {
.name = "mpeg1_vdpau",
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_MPEG1VIDEO,
@ -138,7 +138,7 @@ static int vdpau_mpeg2_init(AVCodecContext *avctx)
return ff_vdpau_common_init(avctx, profile, VDP_DECODER_LEVEL_MPEG2_HL);
}
AVHWAccel ff_mpeg2_vdpau_hwaccel = {
const AVHWAccel ff_mpeg2_vdpau_hwaccel = {
.name = "mpeg2_vdpau",
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_MPEG2VIDEO,

View File

@ -107,7 +107,7 @@ static int vdpau_mpeg4_init(AVCodecContext *avctx)
return ff_vdpau_common_init(avctx, profile, avctx->level);
}
AVHWAccel ff_mpeg4_vdpau_hwaccel = {
const AVHWAccel ff_mpeg4_vdpau_hwaccel = {
.name = "mpeg4_vdpau",
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_MPEG4,

View File

@ -132,7 +132,7 @@ static int vdpau_vc1_init(AVCodecContext *avctx)
}
#if CONFIG_WMV3_VDPAU_HWACCEL
AVHWAccel ff_wmv3_vdpau_hwaccel = {
const AVHWAccel ff_wmv3_vdpau_hwaccel = {
.name = "wm3_vdpau",
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_WMV3,
@ -149,7 +149,7 @@ AVHWAccel ff_wmv3_vdpau_hwaccel = {
};
#endif
AVHWAccel ff_vc1_vdpau_hwaccel = {
const AVHWAccel ff_vc1_vdpau_hwaccel = {
.name = "vc1_vdpau",
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_VC1,

View File

@ -28,7 +28,7 @@
#include "libavutil/version.h"
#define LIBAVCODEC_VERSION_MAJOR 58
#define LIBAVCODEC_VERSION_MINOR 7
#define LIBAVCODEC_VERSION_MINOR 8
#define LIBAVCODEC_VERSION_MICRO 0
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \