~ubuntu-branches/ubuntu/precise/crtmpserver/precise-backports

« back to all changes in this revision

Viewing changes to applications/vmapp/src/vm/lua/luaapi_protocols.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Andriy Beregovenko, Andriy Beregovenko, Alessio Treglia
  • Date: 2011-06-06 19:41:18 UTC
  • mfrom: (3.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20110606194118-3bmdj5tz10jp571e
[ Andriy Beregovenko ]
* Update debian changelog.
* Imported Upstream version 0.0~dfsg+svn474.
* Update patches relative to new upstream upload.

[ Alessio Treglia ]
* Add script to retrieve sources from upstream's SVN and regenerate the
  tarball.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* 
 
2
 *  Copyright (c) 2010,
 
3
 *  Gavriloaie Eugen-Andrei (shiretu@gmail.com)
 
4
 *
 
5
 *  This file is part of crtmpserver.
 
6
 *  crtmpserver is free software: you can redistribute it and/or modify
 
7
 *  it under the terms of the GNU General Public License as published by
 
8
 *  the Free Software Foundation, either version 3 of the License, or
 
9
 *  (at your option) any later version.
 
10
 *
 
11
 *  crtmpserver is distributed in the hope that it will be useful,
 
12
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
 *  GNU General Public License for more details.
 
15
 *
 
16
 *  You should have received a copy of the GNU General Public License
 
17
 *  along with crtmpserver.  If not, see <http://www.gnu.org/licenses/>.
 
18
 */
 
19
 
 
20
#ifdef HAS_LUA
 
21
#include "vm/lua/luaapi_protocols.h"
 
22
#include "vm/lua/luaapi_helpers.h"
 
23
#include "protocols/baseprotocol.h"
 
24
#include "protocols/protocolmanager.h"
 
25
 
 
26
namespace app_vmapp {
 
27
 
 
28
        int luaapi_protocols_getConfig(lua_State *L) {
 
29
                LUA_INIT_PARAMS(params, L);
 
30
                LUA_READ_PARAM(params, uint32_t, _V_NUMERIC, protocolId, 0, 0, true);
 
31
                LUA_GET_PROTOCOL(pProtocol, protocolId, L);
 
32
                Variant stackInfo;
 
33
                pProtocol->GetStackStats(stackInfo);
 
34
                if (!PushVariant(L, stackInfo)) {
 
35
                        FATAL("Unable to push variant");
 
36
                        return 0;
 
37
                }
 
38
                return 1;
 
39
        }
 
40
 
 
41
        int luaapi_protocols_enqueueForDelete(lua_State *L) {
 
42
                LUA_INIT_PARAMS(params, L);
 
43
                LUA_READ_PARAM(params, uint32_t, _V_NUMERIC, protocolId, 0, 0, true);
 
44
                LUA_GET_PROTOCOL(pProtocol, protocolId, L);
 
45
                pProtocol->EnqueueForDelete();
 
46
                lua_pushboolean(L, true);
 
47
                return 1;
 
48
        }
 
49
 
 
50
        int luaapi_protocols_gracefullyEnqueueForDelete(lua_State *L) {
 
51
                LUA_INIT_PARAMS(params, L);
 
52
                LUA_READ_PARAM(params, uint32_t, _V_NUMERIC, protocolId, 0, 0, true);
 
53
                LUA_GET_PROTOCOL(pProtocol, protocolId, L);
 
54
                pProtocol->GracefullyEnqueueForDelete();
 
55
                lua_pushboolean(L, true);
 
56
                return 1;
 
57
        }
 
58
}
 
59
#endif  /* HAS_LUA */