2017-04-13 01:21:46 +00:00
|
|
|
#include <gst/gst.h>
|
|
|
|
|
|
|
|
GstObject *gst_c_module(Gst *vm, const GstModuleItem *mod) {
|
|
|
|
GstObject *module = gst_object(vm, 10);
|
|
|
|
while (mod->name != NULL) {
|
2017-04-14 17:41:32 +00:00
|
|
|
GstValue key = gst_load_cstring(vm, mod->name);
|
2017-04-13 01:21:46 +00:00
|
|
|
GstValue val;
|
|
|
|
val.type = GST_CFUNCTION;
|
|
|
|
val.data.cfunction = mod->data;
|
|
|
|
gst_object_put(vm, module, key, val);
|
|
|
|
mod++;
|
|
|
|
}
|
|
|
|
return module;
|
|
|
|
}
|
|
|
|
|
|
|
|
void gst_c_register(Gst *vm, const char *packagename, GstObject *mod) {
|
|
|
|
GstValue modv;
|
|
|
|
if (vm->rootenv == NULL)
|
|
|
|
vm->rootenv = gst_object(vm, 10);
|
|
|
|
modv.type = GST_OBJECT;
|
|
|
|
modv.data.object = mod;
|
2017-04-14 17:41:32 +00:00
|
|
|
gst_object_put(vm, vm->rootenv, gst_load_cstring(vm, packagename), modv);
|
2017-04-13 01:21:46 +00:00
|
|
|
}
|