mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-27 07:22:57 +02:00
add lua screenshot; possible parameters: osd and video=[false|true] and name=picname in /tmp dir
Origin commit data
------------------
Branch: ni/coolstream
Commit: b2dfb7e0ab
Author: Jacek Jendrzej <overx300@gmail.com>
Date: 2021-08-01 (Sun, 01 Aug 2021)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -4,4 +4,4 @@
|
|||||||
* to luainstance.h changes
|
* to luainstance.h changes
|
||||||
*/
|
*/
|
||||||
#define LUA_API_VERSION_MAJOR 1
|
#define LUA_API_VERSION_MAJOR 1
|
||||||
#define LUA_API_VERSION_MINOR 91
|
#define LUA_API_VERSION_MINOR 92
|
||||||
|
@@ -31,6 +31,7 @@
|
|||||||
#include <zapit/zapit.h>
|
#include <zapit/zapit.h>
|
||||||
#include <hardware/video.h>
|
#include <hardware/video.h>
|
||||||
#include <neutrino.h>
|
#include <neutrino.h>
|
||||||
|
#include <driver/screenshot.h>
|
||||||
|
|
||||||
#include "luainstance.h"
|
#include "luainstance.h"
|
||||||
#include "lua_video.h"
|
#include "lua_video.h"
|
||||||
@@ -70,6 +71,9 @@ void CLuaInstVideo::LuaVideoRegister(lua_State *L)
|
|||||||
{ "getNeutrinoMode", CLuaInstVideo::getNeutrinoMode },
|
{ "getNeutrinoMode", CLuaInstVideo::getNeutrinoMode },
|
||||||
{ "setSinglePlay", CLuaInstVideo::setSinglePlay },
|
{ "setSinglePlay", CLuaInstVideo::setSinglePlay },
|
||||||
{ "__gc", CLuaInstVideo::VideoDelete },
|
{ "__gc", CLuaInstVideo::VideoDelete },
|
||||||
|
#ifdef SCREENSHOT
|
||||||
|
{ "Screenshot", CLuaInstVideo::Screenshot },
|
||||||
|
#endif
|
||||||
{ NULL, NULL }
|
{ NULL, NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -351,6 +355,36 @@ int CLuaInstVideo::VideoDelete(lua_State *L)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef SCREENSHOT
|
||||||
|
int CLuaInstVideo::Screenshot(lua_State *L)
|
||||||
|
{
|
||||||
|
CLuaVideo *D = VideoCheckData(L, 1);
|
||||||
|
if (!D) return 0;
|
||||||
|
|
||||||
|
int numargs = lua_gettop(L);
|
||||||
|
if (numargs < 2) {
|
||||||
|
printf("CLuaInstVideo::%s: not enough arguments (%d, expected 1)\n", __func__, numargs-1);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool enableOSD = true;
|
||||||
|
bool enableVideo = true;
|
||||||
|
std::string filename = "screenshot";
|
||||||
|
tableLookup(L, "name", filename);
|
||||||
|
tableLookup(L, "osd", enableOSD);
|
||||||
|
tableLookup(L, "video", enableVideo);
|
||||||
|
CScreenShot * screenshot = new CScreenShot("/tmp/" + filename + ".png", (CScreenShot::screenshot_format_t)0 /*PNG*/);
|
||||||
|
if(screenshot){
|
||||||
|
screenshot->EnableOSD(enableOSD);
|
||||||
|
screenshot->EnableVideo(enableVideo);
|
||||||
|
if (!screenshot->StartSync()){
|
||||||
|
printf("CLuaInstVideo::%s: Error\n", __func__);
|
||||||
|
}
|
||||||
|
delete screenshot;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* --------------------------------------------------------------
|
/* --------------------------------------------------------------
|
||||||
deprecated functions
|
deprecated functions
|
||||||
|
@@ -65,7 +65,9 @@ class CLuaInstVideo
|
|||||||
static int getNeutrinoMode(lua_State *L);
|
static int getNeutrinoMode(lua_State *L);
|
||||||
static int setSinglePlay(lua_State *L);
|
static int setSinglePlay(lua_State *L);
|
||||||
static int VideoDelete(lua_State *L);
|
static int VideoDelete(lua_State *L);
|
||||||
|
#ifdef SCREENSHOT
|
||||||
|
static int Screenshot(lua_State *L);
|
||||||
|
#endif
|
||||||
static void videoFunctionDeprecated(lua_State *L, std::string oldFunc);
|
static void videoFunctionDeprecated(lua_State *L, std::string oldFunc);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user