diff options
| author | m.Rcu <> | 2012-01-24 22:40:06 +0100 |
|---|---|---|
| committer | Johns <johns98@gmx.net> | 2012-01-24 22:40:06 +0100 |
| commit | 2dff69dc14ef8f59e8ae9e50dfa6b973d42f3369 (patch) | |
| tree | af010f03e6a35d327b99462d6db892f8a207ec4d /video.c | |
| parent | 5668fa22d2d62385b6901f957d2d47d3385aef91 (diff) | |
| download | vdr-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.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -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")); |
