summaryrefslogtreecommitdiff
path: root/video.c
diff options
context:
space:
mode:
authorm.Rcu <>2012-01-24 22:40:06 +0100
committerJohns <johns98@gmx.net>2012-01-24 22:40:06 +0100
commit2dff69dc14ef8f59e8ae9e50dfa6b973d42f3369 (patch)
treeaf010f03e6a35d327b99462d6db892f8a207ec4d /video.c
parent5668fa22d2d62385b6901f957d2d47d3385aef91 (diff)
downloadvdr-plugin-softhddevice-2dff69dc14ef8f59e8ae9e50dfa6b973d42f3369.tar.gz
vdr-plugin-softhddevice-2dff69dc14ef8f59e8ae9e50dfa6b973d42f3369.tar.bz2
Add support for grab jpeg image.
Diffstat (limited to 'video.c')
-rw-r--r--video.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/video.c b/video.c
index 5e1d84a..02628e0 100644
--- a/video.c
+++ b/video.c
@@ -7739,7 +7739,7 @@ int64_t VideoGetClock(void)
///
/// Grab full screen image.
///
-uint8_t *VideoGrab(int *size, int *width, int *height)
+uint8_t *VideoGrab(int *size, int *width, int *height, int write_header)
{
Debug(3, "video: grab\n");
@@ -7771,9 +7771,11 @@ uint8_t *VideoGrab(int *size, int *width, int *height)
if (scale_height <= 0) {
scale_height = *height;
}
-
- n = snprintf(buf, sizeof(buf), "P6\n%d\n%d\n255\n", scale_width,
- scale_height);
+ n = 0;
+ if (write_header) {
+ n = snprintf(buf, sizeof(buf), "P6\n%d\n%d\n255\n", scale_width,
+ scale_height);
+ }
rgb = malloc(scale_width * scale_height * 3 + n);
if (!rgb) {
Error(_("video: out of memory\n"));