00001 #ifndef DVBTUNE_H 00002 #define DVBTUNE_H 00003 00004 00005 00006 00011 #include "condition.inc" 00012 #include "dvbtune.inc" 00013 #include "mutex.inc" 00014 #include "renderfarmclient.inc" 00015 #include "thread.h" 00016 #include "tunerserver.h" 00017 00018 00019 00020 00021 00022 00023 class DVBTune : public TunerServer 00024 { 00025 public: 00026 DVBTune(RenderFarmClientThread *client); 00027 ~DVBTune(); 00028 00029 void reset(); 00030 00031 int open_tuner(); 00032 int close_tuner(); 00033 int get_signal_strength(int *current_power, int *current_lock); 00034 int read_data(unsigned char *data, int size); 00035 00036 00037 00038 00039 int frontend_fd; 00040 int audio_fd; 00041 int video_fd; 00042 int dvr_fd; 00043 00044 Mutex *buffer_lock; 00045 unsigned char *buffer; 00046 int buffer_size; 00047 int buffer_allocated; 00048 DVBTuneThread *thread; 00049 DVBTuneStatus *status; 00050 int has_lock; 00051 }; 00052 00053 // Read asynchronously in case the network was too slow. 00054 // Turns out the status was the thing slowing it down. 00055 00056 class DVBTuneThread : public Thread 00057 { 00058 public: 00059 DVBTuneThread(DVBTune *server); 00060 ~DVBTuneThread(); 00061 void run(); 00062 DVBTune *server; 00063 unsigned char *temp; 00064 }; 00065 00066 // Need to get tuner status separately because it's real slow. 00067 00068 class DVBTuneStatus : public Thread 00069 { 00070 public: 00071 DVBTuneStatus(DVBTune *server); 00072 ~DVBTuneStatus(); 00073 void run(); 00074 DVBTune *server; 00075 }; 00076 00077 00078 00079 00080 00081 00082 00083 00084 00085 #endif
1.5.5