Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

device1394input.h

Go to the documentation of this file.
00001 #ifndef DEVICE1394INPUT_H
00002 #define DEVICE1394INPUT_H
00003 
00004 
00005 
00006 #ifdef HAVE_FIREWIRE
00007 
00008 #include "condition.inc"
00009 #include "libdv.h"
00010 #include "dv1394.h"
00011 #include "mutex.inc"
00012 #include <libraw1394/raw1394.h>
00013 #include "thread.h"
00014 #include "vframe.inc"
00015 
00016 // Common 1394 input for audio and video
00017 
00018 // Extracts video and audio from the single DV stream
00019 class Device1394Input : public Thread
00020 {
00021 public:
00022         Device1394Input();
00023         ~Device1394Input();
00024 
00025         int open(int port,
00026                 int channel,
00027                 int length,
00028                 int channels,
00029                 int samplerate,
00030                 int bits,
00031                 int w,
00032                 int h);
00033         void run();
00034         void increment_counter(int *counter);
00035         void decrement_counter(int *counter);
00036 
00037 // Read a video frame with timed blocking
00038 
00039         int read_video(VFrame *data);
00040 
00041 
00042 // Read audio with timed blocking
00043 
00044         int read_audio(char *data, int samples);
00045 
00046 // Storage of all frames
00047         char **buffer;
00048         int *buffer_valid;
00049         int buffer_size;
00050         int total_buffers;
00051         int current_inbuffer;
00052 
00053 // For extracting audio
00054         dv_t *decoder;
00055 
00056 // Storage of audio data
00057         char *audio_buffer;
00058         int audio_samples;
00059 
00060 // number of next video buffer to read
00061         int current_outbuffer;
00062         unsigned char *input_buffer;
00063 
00064         Mutex *buffer_lock;
00065         Condition *video_lock;
00066         Condition *audio_lock;
00067         int done;
00068 
00069         int fd;
00070         int channel;
00071         int length;
00072         int channels;
00073         int samplerate;
00074         int bits;
00075         int w;
00076         int h;
00077         int is_pal;
00078 };
00079 
00080 
00081 
00082 
00083 
00084 #endif
00085 
00086 
00087 
00088 #endif

Generated on Sun Jan 8 13:38:53 2006 for Cinelerra-svn by  doxygen 1.4.4