summaryrefslogtreecommitdiff
path: root/pages
diff options
context:
space:
mode:
Diffstat (limited to 'pages')
-rw-r--r--pages/Makefile3
-rw-r--r--pages/screenshot.ecpp24
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>