codecs: remove unused family field

MPlayer used this to distinguish multiple decoder wrappers (such as
libavcodec vs. binary codec loader vs. builtin decoders). It lost
meaning in mpv as non-libavcodec things were dropped. Now it doesn't
serve any purpose anymore.

Parsing was removed quite a while ago, and the recent filter change
removed any use of the internal family field. Get rid of it.
This commit is contained in:
wm4 2018-01-31 04:21:02 +01:00
parent 4b567aeac8
commit 8b3306924d
6 changed files with 8 additions and 20 deletions

View File

@ -2104,9 +2104,6 @@ Property list
List of decoders supported. This lists decoders which can be passed to List of decoders supported. This lists decoders which can be passed to
``--vd`` and ``--ad``. ``--vd`` and ``--ad``.
``family``
Decoder driver. Usually ``lavc`` for libavcodec.
``codec`` ``codec``
Canonical codec name, which identifies the format the decoder can Canonical codec name, which identifies the format the decoder can
handle. handle.
@ -2127,7 +2124,6 @@ Property list
MPV_FORMAT_NODE_ARRAY MPV_FORMAT_NODE_ARRAY
MPV_FORMAT_NODE_MAP (for each decoder entry) MPV_FORMAT_NODE_MAP (for each decoder entry)
"family" MPV_FORMAT_STRING
"codec" MPV_FORMAT_STRING "codec" MPV_FORMAT_STRING
"driver" MPV_FORMAT_STRING "driver" MPV_FORMAT_STRING
"description" MPV_FORMAT_STRING "description" MPV_FORMAT_STRING

View File

@ -378,7 +378,7 @@ struct mp_decoder_list *select_spdif_codec(const char *codec, const char *pref)
const char *suffix_name = dts_hd_allowed ? "dts_hd" : codec; const char *suffix_name = dts_hd_allowed ? "dts_hd" : codec;
char name[80]; char name[80];
snprintf(name, sizeof(name), "spdif_%s", suffix_name); snprintf(name, sizeof(name), "spdif_%s", suffix_name);
mp_add_decoder(list, "spdif", codec, name, mp_add_decoder(list, codec, name,
"libavformat/spdifenc audio pass-through decoder"); "libavformat/spdifenc audio pass-through decoder");
return list; return list;
} }

View File

@ -227,7 +227,7 @@ void mp_add_lavc_decoders(struct mp_decoder_list *list, enum AVMediaType type)
if (!cur) if (!cur)
break; break;
if (av_codec_is_decoder(cur) && cur->type == type) { if (av_codec_is_decoder(cur) && cur->type == type) {
mp_add_decoder(list, "lavc", mp_codec_from_av_codec_id(cur->id), mp_add_decoder(list, mp_codec_from_av_codec_id(cur->id),
cur->name, cur->long_name); cur->name, cur->long_name);
} }
} }
@ -242,7 +242,7 @@ void mp_add_lavc_encoders(struct mp_decoder_list *list)
if (!cur) if (!cur)
break; break;
if (av_codec_is_encoder(cur)) { if (av_codec_is_encoder(cur)) {
mp_add_decoder(list, "lavc", mp_codec_from_av_codec_id(cur->id), mp_add_decoder(list, mp_codec_from_av_codec_id(cur->id),
cur->name, cur->long_name); cur->name, cur->long_name);
} }
} }

View File

@ -21,11 +21,10 @@
#include "common/msg.h" #include "common/msg.h"
#include "codecs.h" #include "codecs.h"
void mp_add_decoder(struct mp_decoder_list *list, const char *family, void mp_add_decoder(struct mp_decoder_list *list, const char *codec,
const char *codec, const char *decoder, const char *desc) const char *decoder, const char *desc)
{ {
struct mp_decoder_entry entry = { struct mp_decoder_entry entry = {
.family = talloc_strdup(list, family),
.codec = talloc_strdup(list, codec), .codec = talloc_strdup(list, codec),
.decoder = talloc_strdup(list, decoder), .decoder = talloc_strdup(list, decoder),
.desc = talloc_strdup(list, desc), .desc = talloc_strdup(list, desc),
@ -40,7 +39,7 @@ static void add_new(struct mp_decoder_list *to, struct mp_decoder_entry *entry,
{ {
if (!entry || (codec && strcmp(entry->codec, codec) != 0)) if (!entry || (codec && strcmp(entry->codec, codec) != 0))
return; return;
mp_add_decoder(to, entry->family, entry->codec, entry->decoder, entry->desc); mp_add_decoder(to, entry->codec, entry->decoder, entry->desc);
} }
// Select a decoder from the given list for the given codec. The selection // Select a decoder from the given list for the given codec. The selection
@ -72,11 +71,6 @@ struct mp_decoder_list *mp_select_decoders(struct mp_log *log,
stop = true; stop = true;
break; break;
} }
if (bstr_find0(entry, ":") >= 0) {
mp_err(log, "Codec family selection was removed. "
"Pass the codec name directly.\n");
break;
}
for (int n = 0; n < all->num_entries; n++) { for (int n = 0; n < all->num_entries; n++) {
struct mp_decoder_entry *cur = &all->entries[n]; struct mp_decoder_entry *cur = &all->entries[n];
if (bstr_equals0(entry, cur->decoder)) if (bstr_equals0(entry, cur->decoder))

View File

@ -21,7 +21,6 @@
struct mp_log; struct mp_log;
struct mp_decoder_entry { struct mp_decoder_entry {
const char *family; // decoder module (e.g. ad_lavc => "lavc")
const char *codec; // name of the codec (e.g. "mp3") const char *codec; // name of the codec (e.g. "mp3")
const char *decoder; // decoder name (e.g. "mp3float") const char *decoder; // decoder name (e.g. "mp3float")
const char *desc; // human readable description const char *desc; // human readable description
@ -32,8 +31,8 @@ struct mp_decoder_list {
int num_entries; int num_entries;
}; };
void mp_add_decoder(struct mp_decoder_list *list, const char *family, void mp_add_decoder(struct mp_decoder_list *list, const char *codec,
const char *codec, const char *decoder, const char *desc); const char *decoder, const char *desc);
struct mp_decoder_list *mp_select_decoders(struct mp_log *log, struct mp_decoder_list *mp_select_decoders(struct mp_log *log,
struct mp_decoder_list *all, struct mp_decoder_list *all,

View File

@ -3538,7 +3538,6 @@ static int get_decoder_entry(int item, int action, void *arg, void *ctx)
struct mp_decoder_entry *c = &codecs->entries[item]; struct mp_decoder_entry *c = &codecs->entries[item];
struct m_sub_property props[] = { struct m_sub_property props[] = {
{"family", SUB_PROP_STR(c->family)},
{"codec", SUB_PROP_STR(c->codec)}, {"codec", SUB_PROP_STR(c->codec)},
{"driver" , SUB_PROP_STR(c->decoder)}, {"driver" , SUB_PROP_STR(c->decoder)},
{"description", SUB_PROP_STR(c->desc)}, {"description", SUB_PROP_STR(c->desc)},