mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-30 00:41:17 +02:00
- controlapi.cpp: make ScreenshotCGI() more configurable
This commit is contained in:
@@ -1829,11 +1829,17 @@ Die Pluginliste wird neu geladen.
|
||||
<div class="title1"><a name="screenshot"></a>42. Screenshot erstellen</div>
|
||||
<div class="URL">Handler: http://dbox/control/screenshot</div>
|
||||
<br>
|
||||
<b>Parameter:</b> keine<br>
|
||||
<b>R<EFBFBD>kgabe</b>: ok<br>
|
||||
<b>Parameter:</b> name=<dateiname>&osd=1|0&video=1|0<br><br>
|
||||
<b>R<EFBFBD>ckgabe</b>: ok<br>
|
||||
<br>
|
||||
Screenshot mit TV Bild und OSD wird erstellt und unter /tmp/screenshot.png abgelegt.
|
||||
Screenshot mit TV Bild und OSD wird erstellt und unter /tmp/<dateiname>.png abgelegt.
|
||||
<br>
|
||||
<div class="example">
|
||||
Beispiel:<br>
|
||||
<br>
|
||||
>>>http://dbox/control/screenshot?osd=0&video=1<br>
|
||||
ok<br>
|
||||
</div>
|
||||
</p>
|
||||
|
||||
|
||||
|
@@ -1463,10 +1463,23 @@ void CControlAPI::ReloadPluginsCGI(CyhookHandler *hh)
|
||||
|
||||
void CControlAPI::ScreenshotCGI(CyhookHandler *hh)
|
||||
{
|
||||
CScreenShot * sc = new CScreenShot("/tmp/screenshot.png", (CScreenShot::screenshot_format_t)0 /*PNG*/);
|
||||
sc->EnableOSD(true);
|
||||
bool enableOSD = true;
|
||||
bool enableVideo = true;
|
||||
std::string filename = "screenshot";
|
||||
|
||||
if(hh->ParamList["osd"] == "0")
|
||||
enableOSD = false;
|
||||
if(hh->ParamList["video"] == "0")
|
||||
enableVideo = false;
|
||||
if(hh->ParamList["name"] != "")
|
||||
filename = hh->ParamList["name"];
|
||||
|
||||
CScreenShot * sc = new CScreenShot("/tmp/" + filename + ".png", (CScreenShot::screenshot_format_t)0 /*PNG*/);
|
||||
sc->EnableOSD(enableOSD);
|
||||
sc->EnableVideo(enableVideo);
|
||||
sc->Start();
|
||||
hh->SendOk();
|
||||
|
||||
hh->SendOk(); // FIXME what if sc->Start() failed?
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user