⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 demux.tex

📁 linux TV 源码
💻 TEX
📖 第 1 页 / 共 2 页
字号:
\devsec{DVB Demux Device}The DVB demux device controls the filters of the DVB hardware/software.It can be accessed through \texttt{/dev/adapter0/demux0}.Data types and and ioctl definitions can be accessed by including\texttt{linux/dvb/dmx.h} in your application.\devsubsec{Demux Data Types}\devsubsubsec{dmx\_output\_t}\label{dmxoutput}\begin{verbatim}typedef enum{        DMX_OUT_DECODER,        DMX_OUT_TAP,        DMX_OUT_TS_TAP} dmx_output_t;\end{verbatim}\noindent\texttt{DMX\_OUT\_TAP} delivers the stream output to the demux deviceon which the ioctl is called.\noindent\texttt{DMX\_OUT\_TS\_TAP} routes output to the logical DVR device\texttt{/dev/dvb/adapter0/dvr0}, which delivers a TS multiplexed fromall filters for which \texttt{DMX\_OUT\_TS\_TAP} was specified.\devsubsubsec{dmx\_input\_t}\label{dmxinput}\begin{verbatim}typedef enum{        DMX_IN_FRONTEND,        DMX_IN_DVR} dmx_input_t;\end{verbatim}\devsubsubsec{dmx\_pes\_type\_t}\label{dmxpestype}\begin{verbatim}typedef enum{        DMX_PES_AUDIO,        DMX_PES_VIDEO,        DMX_PES_TELETEXT,        DMX_PES_SUBTITLE,        DMX_PES_PCR,        DMX_PES_OTHER} dmx_pes_type_t;\end{verbatim}\devsubsubsec{dmx\_event\_t}\label{dmxeventt}\begin{verbatim}typedef enum{        DMX_SCRAMBLING_EV,        DMX_FRONTEND_EV} dmx_event_t;\end{verbatim}\devsubsubsec{dmx\_scrambling\_status\_t}\label{dmxscramblingstatus}\begin{verbatim}typedef enum{        DMX_SCRAMBLING_OFF,        DMX_SCRAMBLING_ON} dmx_scrambling_status_t;\end{verbatim}\devsubsubsec{struct dmx\_filter}\label{dmxfilter}\begin{verbatim}typedef struct dmx_filter{        uint8_t         filter[DMX_FILTER_SIZE];        uint8_t         mask[DMX_FILTER_SIZE];} dmx_filter_t;\end{verbatim}\devsubsubsec{struct dmx\_sct\_filter\_params}\label{dmxsctfilterparams}\begin{verbatim}struct dmx_sct_filter_params{        uint16_t            pid;        dmx_filter_t        filter;        uint32_t            timeout;        uint32_t            flags;#define DMX_CHECK_CRC       1#define DMX_ONESHOT         2#define DMX_IMMEDIATE_START 4};\end{verbatim}\devsubsubsec{struct dmx\_pes\_filter\_params}\label{dmxpesfilterparams}\begin{verbatim}struct dmx_pes_filter_params{        uint16_t            pid;        dmx_input_t         input;        dmx_output_t        output;        dmx_pes_type_t      pes_type;        uint32_t            flags;};\end{verbatim}\devsubsubsec{struct dmx\_event}\label{dmxevent}\begin{verbatim}struct dmx_event{        dmx_event_t          event;        time_t               timeStamp;        union        {                dmx_scrambling_status_t scrambling;        } u;};\end{verbatim}\devsubsubsec{struct dmx\_stc}\label{dmxstc}\begin{verbatim}struct dmx_stc {        unsigned int num;       /* input : which STC? 0..N */        unsigned int base;      /* output: divisor for stc to get 90 kHz clock */        uint64_t stc;           /* output: stc in 'base'*90 kHz units */};\end{verbatim}\clearpage\devsubsec{Demux Function Calls}\function{open()}{  int open(const char *deviceName, int flags);}{  This system call, used with a device name of /dev/dvb/adapter0/demux0,  allocates a new filter   and returns a handle which can be used for subsequent control of that   filter. This call has to be made for each filter to be used, i.e. every  returned file descriptor is a reference to a single filter.  /dev/dvb/adapter0/dvr0 is a logical device to be used for retrieving Transport   Streams for digital video recording. When reading from    this device a transport stream containing the packets from all PES  filters set in the corresponding demux device (/dev/dvb/adapter0/demux0)   having the output set to DMX\_OUT\_TS\_TAP.  A recorded Transport Stream   is replayed by writing to this device.%  This device can only be opened in read-write mode.  The significance of blocking or non-blocking mode is described in the  documentation for functions where there is a difference. It does not   affect the semantics of the open() call itself. A device opened in   blocking mode can later be put into non-blocking mode  (and vice versa) using the F\_SETFL command of the fcntl system call.  }{  const char *deviceName & Name of demux device.\\  int flags & A bit-wise OR of the following flags:\\            & \hspace{1em} O\_RDWR read/write access\\            & \hspace{1em} O\_NONBLOCK open in non-blocking mode \\            & \hspace{1em} (blocking mode is the default)\\  }{  ENODEV    & Device driver not loaded/available.\\  EINVAL    & Invalid argument.\\  EMFILE    & ``Too many open files'', i.e. no more filters available.\\  ENOMEM    & The driver failed to allocate enough memory.\\}\function{close()}{  int close(int fd);}{  This system call deactivates and deallocates a filter that was previously  allocated via the open() call.  }{  int fd & File descriptor returned by a previous call to open().\\  }{  EBADF & fd is not a valid open file descriptor.\\}\function{read()}{  size\_t read(int fd, void *buf, size\_t count);  }{  This system call returns filtered data, which might be section or PES   data. The filtered data is transferred from the driver's internal circular  buffer to buf. The maximum amount of data to be transferred is implied by  count.\\  When returning section data the driver always tries to return a complete   single section (even though buf would provide buffer space for more data).  If the size of the buffer is smaller than the section as much as possible  will be returned, and the remaining data will be provided in subsequent   calls.\\  The size of the internal buffer is 2 * 4096 bytes (the size of two maximum  sized sections) by default. The size of this buffer may be changed by 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -