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

iec61883input.h

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

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