2023-11-26 23:05:35 +08:00
|
|
|
|
|
|
|
#include "interface/codec.h"
|
|
|
|
|
|
|
|
Codec *codecFind(const char *name)
|
|
|
|
{
|
2023-11-27 14:31:00 +08:00
|
|
|
extern const int __start_codecdef;
|
|
|
|
extern const int __stop_codecdef;
|
|
|
|
codec_def *start = (codec_def *)&__start_codecdef;
|
|
|
|
codec_def *end = (codec_def *)&__stop_codecdef;
|
2023-11-26 23:05:35 +08:00
|
|
|
codec_def *item = 0;
|
2023-11-27 14:31:00 +08:00
|
|
|
for (item = start; item < end; item++)
|
2023-11-26 23:05:35 +08:00
|
|
|
{
|
|
|
|
if (item != nullptr)
|
|
|
|
{
|
|
|
|
if (strcmp(name, item->name) == 0)
|
|
|
|
return item->codec_get_fun();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
qWarning("can not find codec named '%s'", name);
|
|
|
|
return nullptr;
|
|
|
|
}
|