Add "tmedia_converter_video_plugin_registry_count()" ANSI-C API function.
This commit is contained in:
parent
d24b79868d
commit
7be3935cb6
|
@ -285,9 +285,13 @@ int tdav_init()
|
|||
|
||||
/* === Register converters === */
|
||||
#if HAVE_LIBYUV
|
||||
tmedia_converter_video_plugin_register(tdav_converter_video_libyuv_plugin_def_t);
|
||||
if(tmedia_converter_video_plugin_registry_count() == 0) {
|
||||
tmedia_converter_video_plugin_register(tdav_converter_video_libyuv_plugin_def_t);
|
||||
}
|
||||
#elif HAVE_FFMPEG || HAVE_SWSSCALE
|
||||
tmedia_converter_video_plugin_register(tdav_converter_video_ffmpeg_plugin_def_t);
|
||||
if(tmedia_converter_video_plugin_registry_count() == 0) {
|
||||
tmedia_converter_video_plugin_register(tdav_converter_video_ffmpeg_plugin_def_t);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* === Register consumers === */
|
||||
|
|
|
@ -100,6 +100,7 @@ tmedia_converter_video_plugin_def_t;
|
|||
TINYMEDIA_API tmedia_converter_video_t* tmedia_converter_video_create(tsk_size_t srcWidth, tsk_size_t srcHeight, tmedia_chroma_t srcChroma, tsk_size_t dstWidth, tsk_size_t dstHeight, tmedia_chroma_t dstChroma);
|
||||
|
||||
TINYMEDIA_API int tmedia_converter_video_plugin_register(const tmedia_converter_video_plugin_def_t* plugin);
|
||||
TINYMEDIA_API tsk_size_t tmedia_converter_video_plugin_registry_count();
|
||||
TINYMEDIA_API int tmedia_converter_video_plugin_unregister(const tmedia_converter_video_plugin_def_t* plugin);
|
||||
|
||||
TMEDIA_END_DECLS
|
||||
|
|
|
@ -83,6 +83,15 @@ int tmedia_converter_video_plugin_register(const tmedia_converter_video_plugin_d
|
|||
return -2;
|
||||
}
|
||||
|
||||
tsk_size_t tmedia_converter_video_plugin_registry_count()
|
||||
{
|
||||
tsk_size_t count;
|
||||
for(count = 0;
|
||||
count < TMED_CONVERTER_VIDEO_MAX_PLUGINS && __tmedia_converter_video_plugins[count];
|
||||
++count) ;
|
||||
return count;
|
||||
}
|
||||
|
||||
int tmedia_converter_video_plugin_unregister(const tmedia_converter_video_plugin_def_t* plugin)
|
||||
{
|
||||
tsk_size_t i;
|
||||
|
|
Loading…
Reference in New Issue