[vlc-commits] LUA:Expose vout

Akash Mehrotra git at videolan.org
Tue Aug 23 21:38:50 CEST 2011


vlc | branch: master | Akash Mehrotra <mehrotra.akash at gmail.com> | Thu Aug  4 18:08:23 2011 +0530| [b743e4aa60d9cb4d6a23e30ebd832b3b3199bb7b] | committer: Rémi Denis-Courmont

LUA:Expose vout

Signed-off-by: Rémi Denis-Courmont <remi at remlab.net>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b743e4aa60d9cb4d6a23e30ebd832b3b3199bb7b
---

 modules/lua/libs/objects.c              |   18 ++++++++++++++++++
 share/lua/intf/modules/httprequests.lua |    2 +-
 2 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/modules/lua/libs/objects.c b/modules/lua/libs/objects.c
index ab795d8..9a2adad 100644
--- a/modules/lua/libs/objects.c
+++ b/modules/lua/libs/objects.c
@@ -33,6 +33,7 @@
 #endif
 
 #include <vlc_common.h>
+#include <vlc_vout.h>
 
 #include <lua.h>        /* Low level lua C API */
 #include <lauxlib.h>    /* Higher level C API */
@@ -111,6 +112,22 @@ int vlclua_push_vlc_object( lua_State *L, vlc_object_t *p_obj )
     lua_setmetatable( L, -2 );
     return 1;
 }
+static int vlclua_get_vout( lua_State *L )
+{
+    input_thread_t *p_input= vlclua_get_input_internal( L );
+    if( p_input )
+    {
+        vout_thread_t *p_vout = input_GetVout( p_input );
+        vlc_object_release( p_input );
+        if(p_vout)
+        {
+            vlclua_push_vlc_object( L, (vlc_object_t *) p_vout );
+            return 1;
+        }
+    }
+    lua_pushnil( L );
+    return 1;
+}
 
 /*****************************************************************************
  *
@@ -120,6 +137,7 @@ static const luaL_Reg vlclua_object_reg[] = {
     { "playlist", vlclua_get_playlist },
     { "libvlc", vlclua_get_libvlc },
     { "find", vlclua_object_find },
+    { "vout", vlclua_get_vout},
     { NULL, NULL }
 };
 
diff --git a/share/lua/intf/modules/httprequests.lua b/share/lua/intf/modules/httprequests.lua
index b00584c..b96cb9e 100644
--- a/share/lua/intf/modules/httprequests.lua
+++ b/share/lua/intf/modules/httprequests.lua
@@ -306,7 +306,7 @@ getstatus = function (includecategories)
 local input = vlc.object.input()
 local item = vlc.input.item()
 local playlist = vlc.object.playlist()
-local vout = input and vlc.object.find(input,'vout','child')
+local vout = vlc.object.vout()
 
 	local s ={}
 	



More information about the vlc-commits mailing list