license header for review
[cinelerra_cv/ct.git] / cinelerra / devicedvbinput.h
blob0daf93454b804a4baefc3489c73901db865c4210
1 #ifndef DEVICEDVBINPUT_H
2 #define DEVICEDVBINPUT_H
4 #include "channel.inc"
5 #include "condition.inc"
6 #include "garbage.h"
7 #include "mwindow.inc"
8 #include "recordconfig.inc"
9 #include <stdint.h>
10 #include "thread.h"
13 // This is the common interface for the DVB recording devices.
14 // It handles the network connection to the DVB tuner.
17 class DeviceDVBInput : public GarbageObject
19 public:
20 DeviceDVBInput(MWindow *mwindow,
21 VideoInConfig *config);
22 ~DeviceDVBInput();
24 void reset();
26 int close();
27 int try_tuner();
28 int reopen_tuner();
29 int get_signal_strength(int channel, int tuner_id);
31 // Provides multiplexed data. Each caller needs its own demuxer.
32 // Returns the number of bytes read.
33 // Initial opening and channel changes are handled in here.
34 int read_stream(unsigned char *data, int size);
36 // Access the socket
37 int read_tuner(unsigned char *data, int size);
38 int write_tuner(unsigned char *data, int size);
39 int write_int64(int64_t value);
40 int64_t read_int64(int *error);
42 // Acquire the global DVB input thread
43 // by either referencing MWindow::dvb_input or creating a new one.
44 // Then try to connect to the tuner and begin streaming immediately.
45 // Return 0 if failure.
46 static DeviceDVBInput* get_input_thread(MWindow *mwindow);
47 // Release the global DVB input thread by either deleting it or decreasing
48 // the reference counter.
49 static void put_input_thread(MWindow *mwindow);
52 VideoInConfig *config;
53 int tuner_fd;
54 int want_signal;
55 Condition *signal_lock;
56 int lock_result;
57 int signal_result;
58 int channel_changed;
59 MWindow *mwindow;
60 Channel *channel;
66 #endif
69 // Local Variables:
70 // mode: C++
71 // c-file-style: "linux"
72 // End: