new splash/about bg images
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / dvbtune.h
1
2 /*
3  * CINELERRA
4  * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  *
20  */
21
22 #ifndef DVBTUNE_H
23 #define DVBTUNE_H
24
25
26
27
28 /**
29  * Interface for digital tuners using DVB.
30  **/
31
32 #include "condition.inc"
33 #include "dvbtune.inc"
34 #include "mutex.inc"
35 #include "renderfarmclient.inc"
36 #include "thread.h"
37 #include "tunerserver.h"
38
39
40
41
42
43
44 class DVBTune : public TunerServer
45 {
46 public:
47         DVBTune(RenderFarmClientThread *client);
48         ~DVBTune();
49
50         void reset();
51
52         int open_tuner();
53         int close_tuner();
54         int get_signal_strength(int *current_power, int *current_lock);
55         int read_data(unsigned char *data, int size);
56
57
58
59
60         int frontend_fd;
61         int audio_fd;
62         int video_fd;
63         int dvr_fd;
64
65         Mutex *buffer_lock;
66         unsigned char *buffer;
67         int buffer_size;
68         int buffer_allocated;
69         DVBTuneThread *thread;
70         DVBTuneStatus *status;
71         int has_lock;
72 };
73
74 // Read asynchronously in case the network was too slow.
75 // Turns out the status was the thing slowing it down.
76
77 class DVBTuneThread : public Thread
78 {
79 public:
80         DVBTuneThread(DVBTune *server);
81         ~DVBTuneThread();
82         void run();
83         DVBTune *server;
84         unsigned char *temp;
85 };
86
87 // Need to get tuner status separately because it's real slow.
88
89 class DVBTuneStatus : public Thread
90 {
91 public:
92         DVBTuneStatus(DVBTune *server);
93         ~DVBTuneStatus();
94         void run();
95         DVBTune *server;
96 };
97
98
99
100
101
102
103
104
105
106 #endif