diff options
author | deva <deva> | 2005-07-28 16:31:18 +0000 |
---|---|---|
committer | deva <deva> | 2005-07-28 16:31:18 +0000 |
commit | 84e9873f846478476487d5cd2587e5879a0be8ea (patch) | |
tree | 4873d2a87c07714ebd8653b5b09981355633572f /src/dvfile.cc | |
parent | 9111e70794105f984df5b66bba81adc769bd5001 (diff) |
*** empty log message ***
Diffstat (limited to 'src/dvfile.cc')
-rw-r--r-- | src/dvfile.cc | 30 |
1 files changed, 30 insertions, 0 deletions
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 <time.h> + +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; +} |