diff options
author | Sascha Volkenandt <sascha (at) akv-soft (dot) de> | 2007-01-04 15:30:39 +0000 |
---|---|---|
committer | Sascha Volkenandt <sascha (at) akv-soft (dot) de> | 2007-01-04 15:30:39 +0000 |
commit | c5a3d10682655b4eed3839cf26729821b70948d6 (patch) | |
tree | 3cc27cf2b0b3065f603dd063c9adc2361513d7fd | |
parent | 64eaee28c243214e654c60b06a27212e8dcb5c02 (diff) | |
download | vdr-plugin-live-c5a3d10682655b4eed3839cf26729821b70948d6.tar.gz vdr-plugin-live-c5a3d10682655b4eed3839cf26729821b70948d6.tar.bz2 |
- added screenshot page, which delivers a grabbed image from the primary device as jpeg
-rw-r--r-- | pages/Makefile | 3 | ||||
-rw-r--r-- | pages/screenshot.ecpp | 24 |
2 files changed, 26 insertions, 1 deletions
diff --git a/pages/Makefile b/pages/Makefile index 1e91fb6..9024106 100644 --- a/pages/Makefile +++ b/pages/Makefile @@ -15,7 +15,8 @@ VDRDIR ?= ../../../.. ### The object files (add further files here): -OBJS = menu.o event_widget.o channels.o schedule.o whats_on_now.o whats_on_next.o timers.o +OBJS = menu.o event_widget.o channels.o schedule.o whats_on_now.o whats_on_next.o timers.o \ + screenshot.o ### Default rules: diff --git a/pages/screenshot.ecpp b/pages/screenshot.ecpp new file mode 100644 index 0000000..feafaab --- /dev/null +++ b/pages/screenshot.ecpp @@ -0,0 +1,24 @@ +<%pre> +#include <iostream> +#include <vdr/device.h> +using namespace std; +</%pre> +<%args> +int quality = 80; +int width = 320; +int height = 240; +</%args> +<%cpp> + reply.setContentType("image/jpg"); + + cDevice* device = cDevice::PrimaryDevice(); + if ( device == 0 ) + return DECLINED; + + int size; + uchar* image = device->GrabImage( size, true, quality, width, height ); + if ( image == 0 ) + return DECLINED; + + reply.out().write( reinterpret_cast< char* >( image ), size ); +</%cpp> |