From 84e9873f846478476487d5cd2587e5879a0be8ea Mon Sep 17 00:00:00 2001 From: deva Date: Thu, 28 Jul 2005 16:31:18 +0000 Subject: *** empty log message *** --- src/dvfile.cc | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'src/dvfile.cc') diff --git a/src/dvfile.cc b/src/dvfile.cc index ef1db71..a0dccf3 100644 --- a/src/dvfile.cc +++ b/src/dvfile.cc @@ -27,3 +27,33 @@ #include "config.h" #include "dvfile.h" +#include "dv.h" + +#include + +dvfile::dvfile(Info* i) +{ + info = i; + fp = fopen(TEST_MOVIE, "r"); +} + +dvfile::~dvfile() +{ + fclose(fp); +} + +unsigned char *dvfile::readFrame() +{ + struct timespec ts; + unsigned char *frame = new unsigned char[DVPACKAGE_SIZE]; + + ts.tv_sec = 0; + ts.tv_nsec = 1000000000L / 25L; // 1/25s + nanosleep(&ts, NULL); + + while(fread(frame, DVPACKAGE_SIZE, 1, fp) == 0) { + fseek(fp, 0L, SEEK_SET); + } + + return frame; +} -- cgit v1.2.3