New experimental feature for saving live screenshot images, disabled until lib/driver updated

git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@2041 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
focus
2012-01-08 10:29:52 +00:00
parent 9c0924e80f
commit ef812396ca
3 changed files with 405 additions and 0 deletions

60
src/driver/screenshot.h Normal file
View File

@@ -0,0 +1,60 @@
/*
Neutrino-GUI - DBoxII-Project
Copyright (C) 2011 CoolStream International Ltd
License: GPLv2
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation;
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __screenshot_h_
#define __screenshot_h_
#include <OpenThreads/Thread>
class CScreenShot : public OpenThreads::Thread
{
public:
typedef enum {
FORMAT_PNG,
FORMAT_JPG
} screenshot_format_t;
private:
screenshot_format_t format;
std::string filename;
unsigned char * pixel_data;
int xres;
int yres;
FILE *fd;
bool GetData();
bool OpenFile();
bool SaveFile();
bool SavePng();
bool SaveJpg();
void run();
public:
CScreenShot(const std::string fname = "", screenshot_format_t fmt = CScreenShot::FORMAT_JPG);
~CScreenShot();
void MakeFileName(const t_channel_id channel_id);
bool Start();
bool StartSync();
};
#endif