From 862e2536078eef5752b82cf64f757fe1c1a6d916 Mon Sep 17 00:00:00 2001 From: Julian Bouzas Date: Tue, 23 Feb 2021 11:11:25 -0500 Subject: [PATCH] m-lua-scripting: add get_n_streams endpoint API --- modules/module-lua-scripting/api.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/modules/module-lua-scripting/api.c b/modules/module-lua-scripting/api.c index bb710d0e..5d6f6d08 100644 --- a/modules/module-lua-scripting/api.c +++ b/modules/module-lua-scripting/api.c @@ -744,6 +744,14 @@ static const luaL_Reg impl_session_methods[] = { /* WpEndpoint */ +static int +endpoint_get_n_streams (lua_State *L) +{ + WpEndpoint *ep = wplua_checkobject (L, 1, WP_TYPE_ENDPOINT); + lua_pushnumber (L, wp_endpoint_get_n_streams (ep)); + return 1; +} + static int endpoint_iterate_streams (lua_State *L) { @@ -763,6 +771,7 @@ endpoint_create_link (lua_State *L) } static const luaL_Reg endpoint_methods[] = { + { "get_n_streams", endpoint_get_n_streams }, { "iterate_streams", endpoint_iterate_streams }, { "create_link", endpoint_create_link }, { NULL, NULL }