summaryrefslogtreecommitdiff
path: root/src/dvfile.cc
diff options
context:
space:
mode:
authordeva <deva>2005-07-28 16:31:18 +0000
committerdeva <deva>2005-07-28 16:31:18 +0000
commit84e9873f846478476487d5cd2587e5879a0be8ea (patch)
tree4873d2a87c07714ebd8653b5b09981355633572f /src/dvfile.cc
parent9111e70794105f984df5b66bba81adc769bd5001 (diff)
*** empty log message ***
Diffstat (limited to 'src/dvfile.cc')
-rw-r--r--src/dvfile.cc30
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;
+}