summaryrefslogtreecommitdiff
path: root/src/decoder.cc
diff options
context:
space:
mode:
authordeva <deva>2005-07-28 15:31:18 +0000
committerdeva <deva>2005-07-28 15:31:18 +0000
commit9111e70794105f984df5b66bba81adc769bd5001 (patch)
tree7901a79eff5b948185374472fa72220bfd172b64 /src/decoder.cc
parentc1e99b4951bd5e376cfab14cb6870869e60b91a2 (diff)
*** empty log message ***
Diffstat (limited to 'src/decoder.cc')
-rw-r--r--src/decoder.cc22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/decoder.cc b/src/decoder.cc
index 26351fe..0655f61 100644
--- a/src/decoder.cc
+++ b/src/decoder.cc
@@ -34,12 +34,8 @@
*/
#include <config.h>
#ifdef USE_GUI
-/*
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <errno.h>
-*/
+
+#include "frame_stream.h"
#include "miav_config.h"
@@ -89,6 +85,8 @@ Decoder::~Decoder()
void Decoder::decode()
{
+ frame_stream *stream;
+
bool local_shoot;
int local_freeze;
bool local_record = false;
@@ -96,14 +94,22 @@ void Decoder::decode()
bool skip_frames = config->readInt("player_skip_frames");
- dv1394 dv_stream = dv1394(info); // Use default port and channel.
+ dv1394 dv1394_stream = dv1394(info); // Use default port and channel.
+ dvfile dvfile_stream = dvfile(info);
+ if(dv_stream.connect()) {
+ // Use the dv1394 stream for input.
+ stream = &dv1394_stream;
+ } else {
+ // Use the fallback dv filereader for input.
+ stream = &dvfile_stream;
+ }
while(*running) {
uint8_t *ptr;
SDL_Event user_event;
// Read a dvframe
- ptr = dv_stream.readFrame();
+ ptr = stream->readFrame();
if(!ptr) return; // No frame read. (Due to firewire error)
old_record = local_record;