MythTV  master
Macros | Functions | Variables
dvbchannel.cpp File Reference
#include <fcntl.h>
#include <unistd.h>
#include <sys/poll.h>
#include <sys/select.h>
#include <sys/time.h>
#include <sys/types.h>
#include "mythconfig.h"
#include "mythdb.h"
#include "cardutil.h"
#include "channelutil.h"
#include "dvbtypes.h"
#include "dvbchannel.h"
#include "dvbcam.h"
#include "tv_rec.h"
Include dependency graph for dvbchannel.cpp:

Go to the source code of this file.

Macros

#define ENOTSUPP   524
 
#define LOC   QString("DVBChan[%1](%2): ").arg(m_inputid).arg(DVBChannel::GetDevice())
 

Functions

static void drain_dvb_events (int fd)
 Reads all the events off the queue, so we can use select in wait_for_backend(int,int). More...
 
static bool wait_for_backend (int fd, int timeout_ms)
 Waits for backend to get tune message. More...
 
static struct dvb_frontend_parameters dtvmultiplex_to_dvbparams (DTVTunerType, const DTVMultiplex &, int intermediate_freq, bool can_fec_auto)
 
static DTVMultiplex dvbparams_to_dtvmultiplex (DTVTunerType, const dvb_frontend_parameters &)
 
static struct dtv_properties * dtvmultiplex_to_dtvproperties (DTVTunerType tuner_type, const DTVMultiplex &tuning, int intermediate_freq, bool can_fec_auto, bool do_tune=true)
 

Variables

int64_t concurrent_tunings_delay = 1000
 

Macro Definition Documentation

◆ ENOTSUPP

#define ENOTSUPP   524

Definition at line 54 of file dvbchannel.cpp.

◆ LOC

#define LOC   QString("DVBChan[%1](%2): ").arg(m_inputid).arg(DVBChannel::GetDevice())

Definition at line 68 of file dvbchannel.cpp.

Function Documentation

◆ drain_dvb_events()

static void drain_dvb_events ( int  fd)
static

Reads all the events off the queue, so we can use select in wait_for_backend(int,int).

Definition at line 1404 of file dvbchannel.cpp.

Referenced by DVBChannel::Tune().

◆ wait_for_backend()

static bool wait_for_backend ( int  fd,
int  timeout_ms 
)
static

Waits for backend to get tune message.

With linux 2.6.12 or later this should block until the backend is tuned to the proper frequency.

With earlier kernels sleeping for timeout_ms may save us.

Waiting for DVB events has been tried, but this fails with several DVB cards. They either don't send the required events or delete them from the event queue before we can read the event.

Using a FE_GET_FRONTEND has also been tried, but returns the old data until a 2 sec timeout elapses on at least one DVB card.

We do not block until we have a lock, the signal monitor does that.

Parameters
fdfrontend file descriptor
timeout_mstimeout before FE_READ_STATUS in milliseconds

Definition at line 1438 of file dvbchannel.cpp.

Referenced by DVBChannel::Tune().

◆ dtvmultiplex_to_dvbparams()

static struct dvb_frontend_parameters dtvmultiplex_to_dvbparams ( DTVTunerType  tuner_type,
const DTVMultiplex tuning,
int  intermediate_freq,
bool  can_fec_auto 
)
static

Definition at line 1477 of file dvbchannel.cpp.

Referenced by DVBChannel::Tune().

◆ dvbparams_to_dtvmultiplex()

static DTVMultiplex dvbparams_to_dtvmultiplex ( DTVTunerType  tuner_type,
const dvb_frontend_parameters &  params 
)
static

Definition at line 1542 of file dvbchannel.cpp.

Referenced by DVBChannel::ProbeTuningParams().

◆ dtvmultiplex_to_dtvproperties()

static struct dtv_properties* dtvmultiplex_to_dtvproperties ( DTVTunerType  tuner_type,
const DTVMultiplex tuning,
int  intermediate_freq,
bool  can_fec_auto,
bool  do_tune = true 
)
static

Definition at line 523 of file dvbchannel.cpp.

Referenced by DVBChannel::Tune().

Variable Documentation

◆ concurrent_tunings_delay

int64_t concurrent_tunings_delay = 1000

Definition at line 65 of file dvbchannel.cpp.

Referenced by DVBChannel::Tune().