History

avcodec/libvpxenc: switch to get_supported_config()

Niklas Haas committed 2 years ago

Commit 0977d961 parent de421ca1 file · +19 −7Browse files

Unified · Split

libavcodec/libvpxenc.c+19−7
@@ -2088,13 +2088,25 @@ static const enum AVPixelFormat vp9_pix_fmts_highbd[] = { · 2087 unmodified lines
2088 AV_PIX_FMT_NONE2088 AV_PIX_FMT_NONE
2089};2089};
2090 2090
2091static av_cold void vp9_init_static(FFCodec *codec)2091static int vp9_get_supported_config(const AVCodecContext *avctx,
2092 const AVCodec *codec,
2093 enum AVCodecConfig config,
2094 unsigned flags, const void **out,
2095 int *out_num)
2092{2096{
2093 vpx_codec_caps_t codec_caps = vpx_codec_get_caps(vpx_codec_vp9_cx());2097 if (config == AV_CODEC_CONFIG_PIX_FORMAT) {
2094 if (codec_caps & VPX_CODEC_CAP_HIGHBITDEPTH)2098 vpx_codec_caps_t codec_caps = vpx_codec_get_caps(vpx_codec_vp9_cx());
2095 codec->p.pix_fmts = vp9_pix_fmts_highbd;2099 if (codec_caps & VPX_CODEC_CAP_HIGHBITDEPTH) {
2096 else2100 *out = vp9_pix_fmts_highbd;
2097 codec->p.pix_fmts = vp9_pix_fmts_highcol;2101 *out_num = FF_ARRAY_ELEMS(vp9_pix_fmts_highbd) - 1;
2102 } else {
2103 *out = vp9_pix_fmts_highcol;
2104 *out_num = FF_ARRAY_ELEMS(vp9_pix_fmts_highcol) - 1;
2105 }
2106 return 0;
2107 }
2108
2109 return ff_default_get_supported_config(avctx, codec, config, flags, out, out_num);
2098}2110}
2099 2111
2100static const AVClass class_vp9 = {2112static const AVClass class_vp9 = {
@@ -2124,6 +2136,6 @@ FFCodec ff_libvpx_vp9_encoder = { · 23 unmodified lines
2124 FF_CODEC_CAP_INIT_CLEANUP |2136 FF_CODEC_CAP_INIT_CLEANUP |
2125 FF_CODEC_CAP_AUTO_THREADS,2137 FF_CODEC_CAP_AUTO_THREADS,
2126 .defaults = defaults,2138 .defaults = defaults,
2127 .init_static_data = vp9_init_static,2139 .get_supported_config = vp9_get_supported_config,
2128};2140};
2129#endif /* CONFIG_LIBVPX_VP9_ENCODER */2141#endif /* CONFIG_LIBVPX_VP9_ENCODER */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t