summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-07-04 15:01:03 +0200
committerwm4 <wm4@nowhere>2017-07-04 15:01:03 +0200
commitabe01fd18a341c5c163d4ce8f019ca366feec628 (patch)
tree2794ca2feeb5735f1c699653e4a3e842d23774d0
parente76d56d57bb0382cc33bdf0a4c2eaa08b3c315c4 (diff)
downloadmpv-abe01fd18a341c5c163d4ce8f019ca366feec628.tar.bz2
mpv-abe01fd18a341c5c163d4ce8f019ca366feec628.tar.xz
vd_lavc: remove unused hwaccel support code
Was used by old hwaccel implementations.
-rw-r--r--video/decode/lavc.h6
-rw-r--r--video/decode/vd_lavc.c38
2 files changed, 1 insertions, 43 deletions
diff --git a/video/decode/lavc.h b/video/decode/lavc.h
index e567a49b4e..44b103e3f5 100644
--- a/video/decode/lavc.h
+++ b/video/decode/lavc.h
@@ -133,16 +133,10 @@ struct hwdec_profile_entry {
uint64_t hw_profile;
};
-const struct hwdec_profile_entry *hwdec_find_profile(
- struct lavc_ctx *ctx, const struct hwdec_profile_entry *table);
-bool hwdec_check_codec_support(const char *codec,
- const struct hwdec_profile_entry *table);
int hwdec_get_max_refs(struct lavc_ctx *ctx);
int hwdec_setup_hw_frames_ctx(struct lavc_ctx *ctx, AVBufferRef *device_ctx,
int av_sw_format, int initial_pool_size);
-const char *hwdec_find_decoder(const char *codec, const char *suffix);
-
#define NEW_CUDA_HWACCEL \
(HAVE_CUDA_HWACCEL && LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 94, 100))
diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c
index b7ab23f89d..1e4a26d4bf 100644
--- a/video/decode/vd_lavc.c
+++ b/video/decode/vd_lavc.c
@@ -308,42 +308,6 @@ static bool hwdec_codec_allowed(struct dec_video *vd, const char *codec)
return false;
}
-// Find the correct profile entry for the current codec and profile.
-// Assumes the table has higher profiles first (for each codec).
-const struct hwdec_profile_entry *hwdec_find_profile(
- struct lavc_ctx *ctx, const struct hwdec_profile_entry *table)
-{
- assert(AV_CODEC_ID_NONE == 0);
- struct vd_lavc_params *lavc_param = ctx->opts->vd_lavc_params;
- enum AVCodecID codec = ctx->avctx->codec_id;
- int profile = ctx->avctx->profile;
- // Assume nobody cares about these aspects of the profile
- if (codec == AV_CODEC_ID_H264) {
- if (profile == FF_PROFILE_H264_CONSTRAINED_BASELINE)
- profile = FF_PROFILE_H264_MAIN;
- }
- for (int n = 0; table[n].av_codec; n++) {
- if (table[n].av_codec == codec) {
- if (table[n].ff_profile == profile ||
- !lavc_param->check_hw_profile)
- return &table[n];
- }
- }
- return NULL;
-}
-
-// Check codec support, without checking the profile.
-bool hwdec_check_codec_support(const char *codec,
- const struct hwdec_profile_entry *table)
-{
- enum AVCodecID codecid = mp_codec_to_av_codec_id(codec);
- for (int n = 0; table[n].av_codec; n++) {
- if (table[n].av_codec == codecid)
- return true;
- }
- return false;
-}
-
int hwdec_get_max_refs(struct lavc_ctx *ctx)
{
switch (ctx->avctx->codec_id) {
@@ -363,7 +327,7 @@ int hwdec_get_max_refs(struct lavc_ctx *ctx)
// hwdec_find_decoder("h264", "_mmal").
// Just concatenating the two names will not always work due to inconsistencies
// (e.g. "mpeg2video" vs. "mpeg2").
-const char *hwdec_find_decoder(const char *codec, const char *suffix)
+static const char *hwdec_find_decoder(const char *codec, const char *suffix)
{
enum AVCodecID codec_id = mp_codec_to_av_codec_id(codec);
if (codec_id == AV_CODEC_ID_NONE)