Skip to content

Commit

Permalink
shrecord: add "Preview off" config file option
Browse files Browse the repository at this point in the history
  • Loading branch information
kfish committed Apr 19, 2010
1 parent 1100bba commit c623985
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 3 deletions.
15 changes: 15 additions & 0 deletions doc/admin-guide.txt
Expand Up @@ -158,3 +158,18 @@ http://ecovec:3000/video0/cif.264

The same control files that are used for shcodecs-record can be used - the
output filename is simply ignored.

To disable the on-screen preview, set "Preview off" in one of the SHRecord
stanzas, eg:

-----
Listen 3000

<SHRecord>
Path "/video0/cif.264"
CtlFile "/usr/share/shcodecs-record/k264-v4l2-cif-stream.ctl"
Preview off
</SHRecord>
-----


19 changes: 16 additions & 3 deletions src/shrecord.c
Expand Up @@ -29,6 +29,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <stropts.h>
#include <stdarg.h>
#include <fcntl.h>
Expand Down Expand Up @@ -385,8 +386,6 @@ void * shrecord_main (void * data)
if (pvt->nr_encoders == 0)
return NULL;

pvt->do_preview = 1;

pvt->output_frames = 0;
pvt->rotate_cap = SHVEU_NO_ROT;

Expand Down Expand Up @@ -641,9 +640,11 @@ shrecord_resource (char * path, char * ctlfile)
list_t *
shrecord_resources (Dictionary * config)
{
struct private_data *pvt = &pvt_data;
list_t * l;
const char * path;
const char * ctlfile;
const char * preview;

l = list_new();

Expand All @@ -653,13 +654,25 @@ shrecord_resources (Dictionary * config)
if (path && ctlfile)
l = list_append (l, shrecord_resource (path, ctlfile));

if ((preview = dictionary_lookup (config, "Preview")) != NULL) {
if (!strncasecmp (preview, "on", 2))
pvt->do_preview=1;
else if (!strncasecmp (preview, "off", 3))
pvt->do_preview=0;
}

return l;
}

int
shrecord_init (void)
{
memset (&pvt_data, 0, sizeof (pvt_data));
struct private_data *pvt = &pvt_data;

memset (pvt, 0, sizeof (pvt_data));

/* Set preview on by default, allow to turn off by setting "Preview off" */
pvt->do_preview = 1;

return 0;
}

0 comments on commit c623985

Please sign in to comment.