TT#78900 move codec_get_type into global context

Change-Id: I12868ecca93ff6e3ffe7129c42aec415ad5f58ec
changes/48/39348/3
Richard Fuchs 6 years ago
parent 5fc326c64b
commit 35899ec27b

@ -444,18 +444,6 @@ const codec_def_t *codec_find_by_av(enum AVCodecID id) {
return g_hash_table_lookup(codecs_ht_by_av, GINT_TO_POINTER(id));
}
enum media_type codec_get_type(const str *type) {
if (!type || !type->len)
return MT_UNKNOWN;
if (!str_cmp(type, "audio"))
return MT_AUDIO;
if (!str_cmp(type, "video"))
return MT_VIDEO;
if (!str_cmp(type, "image"))
return MT_IMAGE;
return MT_OTHER;
}

@ -16,6 +16,21 @@ enum media_type {
};
#include "str.h"
INLINE enum media_type codec_get_type(const str *type) {
if (!type || !type->len)
return MT_UNKNOWN;
if (!str_cmp(type, "audio"))
return MT_AUDIO;
if (!str_cmp(type, "video"))
return MT_VIDEO;
if (!str_cmp(type, "image"))
return MT_IMAGE;
return MT_OTHER;
}
#ifndef WITHOUT_CODECLIB
@ -27,7 +42,6 @@ enum media_type {
#include <bcg729/encoder.h>
#include <bcg729/decoder.h>
#endif
#include "str.h"
@ -198,7 +212,6 @@ void codeclib_init(int);
const codec_def_t *codec_find(const str *name, enum media_type);
const codec_def_t *codec_find_by_av(enum AVCodecID);
enum media_type codec_get_type(const str *type);
decoder_t *decoder_new_fmt(const codec_def_t *def, int clockrate, int channels, int ptime, const format_t *resample_fmt);
@ -275,9 +288,6 @@ INLINE void codeclib_init(int print) {
printf("No codecs supported.\n");
}
INLINE enum media_type codec_get_type(const str *type) {
return -1;
}
INLINE const codec_def_t *codec_find(const str *name, enum media_type type) {
return NULL;
}

Loading…
Cancel
Save