1 #ifndef DEVICEDVBINPUT_H
2 #define DEVICEDVBINPUT_H
5 #include "condition.inc"
8 #include "recordconfig.inc"
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
20 DeviceDVBInput(MWindow
*mwindow
,
21 VideoInConfig
*config
);
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
);
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
;
55 Condition
*signal_lock
;
71 // c-file-style: "linux"