Skip to content

Commit 2563439

Browse files
committed
add snapshot saving
1 parent 6839636 commit 2563439

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

Makefile

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
CFLAGS+=-DSTANDALONE -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -DTARGET_POSIX -D_LINUX -fPIC -DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -U_FORTIFY_SOURCE -Wall -g -DHAVE_LIBOPENMAX=2 -DOMX -DOMX_SKIP64BIT -ftree-vectorize -pipe -DUSE_EXTERNAL_OMX -DHAVE_LIBBCM_HOST -DUSE_EXTERNAL_LIBBCM_HOST -DUSE_VCHIQ_ARM -Wno-psabi -O2
22

3-
LIBS=-lbrcmGLESv2 -lbrcmEGL -lopenmaxil -lbcm_host -lvcos -lvchiq_arm -lpthread -lavahi-common -lavahi-client -lfreetype -lmpg123 -lfaad -la52 -Llibs/ilclient -Llibs/vgfont
3+
LIBS=-lbrcmGLESv2 -lbrcmEGL -lopenmaxil -lbcm_host -lvcos -lvchiq_arm -lpthread -lavahi-common -lavahi-client -lfreetype -lmpg123 -lfaad -la52 -Llibs/ilclient -Llibs/vgfont
44

55
# The following can be overridden with a command argument (e.g. with building in OpenELEC)
66
LDFLAGS=-L/opt/vc/lib
77
INCLUDES=-I/opt/vc/include/ -I/opt/vc/include/interface/vcos/pthreads -I/usr/include/freetype2 -I/usr/include/arm-linux-gnueabi -I/usr/local/include
88

9-
OBJS=vcodec_mpeg2.o vcodec_omx.o sha1.o htsp.o vo_pi.o codec.o audioplay.o acodec_mpeg.o acodec_aac.o acodec_a52.o channels.o events.o avahi.o osd.o tiresias_pcfont.o avl.o omx_utils.o
9+
OBJS=vcodec_mpeg2.o vcodec_omx.o sha1.o htsp.o vo_pi.o codec.o audioplay.o acodec_mpeg.o acodec_aac.o acodec_a52.o channels.o events.o avahi.o osd.o snapshot.o tiresias_pcfont.o avl.o omx_utils.o
1010

1111
TARGETS=pidvbip flvtoh264
1212

@@ -30,6 +30,8 @@ mpeg2test: mpeg2test.c vo_pi.o libmpeg2/libmpeg2.a
3030
pidvbip: pidvbip.c libmpeg2/libmpeg2.a libs/vgfont/libvgfont.a libs/ilclient/libilclient.a $(OBJS)
3131
$(CC) $(INCLUDES) $(CFLAGS) $(LDFLAGS) -o pidvbip pidvbip.c $(OBJS) libmpeg2/libmpeg2.a libs/ilclient/libilclient.a libs/vgfont/libvgfont.a $(LIBS)
3232

33+
snapshot.o: snapshot.c snapshot.h
34+
$(CC) $(INCLUDES) $(CFLAGS) -c -o snapshot.o snapshot.c
3335
vo_pi.o: vo_pi.c vo_pi.h
3436
$(CC) $(INCLUDES) $(CFLAGS) -c -o vo_pi.o vo_pi.c
3537

pidvbip.c

+5-4
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
4646
#include "osd.h"
4747
#include "avahi.h"
4848
#include "cec.h"
49+
#include "snapshot.h"
4950

5051
struct codecs_t {
5152
struct codec_t vcodec; // Video
@@ -360,16 +361,14 @@ int read_config(char* configfile,struct htsp_t *htsp)
360361

361362
if (read != -1) {
362363
htsp->host = malloc(1024);
363-
int res = sscanf(line,"%s %d",htsp->host,&htsp->port);
364-
fprintf(stderr,"read %s %d",htsp->host,htsp->port);
364+
sscanf(line,"%s %d",htsp->host,&htsp->port);
365365
}
366366

367367
read = getline(&line, &len, fp);
368368
if (read != -1) {
369369
htsp->user = malloc(1024);
370370
htsp->password = malloc(1024);
371-
int res = sscanf(line,"%s %s",htsp->user,htsp->password);
372-
fprintf(stderr,"read %s %s",htsp->user,htsp->password);
371+
sscanf(line,"%s %s",htsp->user,htsp->password);
373372
}
374373
fclose(fp);
375374
return 0;
@@ -800,6 +799,8 @@ int main(int argc, char* argv[])
800799
htsp_send_skip(&htsp,30); // +30 seconds
801800
break;
802801

802+
case 's':
803+
save_snapshot();
803804
break;
804805

805806
default:

0 commit comments

Comments
 (0)