TSDuck v3.40-3963
MPEG Transport Stream Toolkit
|
The DirectShow sink filter (Windows-specific). More...
#include <tsSinkFilter.h>
Public Member Functions | |
SinkFilter (Report &report) | |
Constructor. | |
virtual | ~SinkFilter () |
Destructor. | |
void | Abort () |
Abort a blocked Read() operation. | |
void | Flush () |
Discard and release all pending media samples. | |
SinkPin * | GetPin () |
Get the unique input pin. | |
size_t | Read (void *buffer, size_t buffer_size, cn::milliseconds timeout=cn::milliseconds::zero()) |
Read data from transport stream. | |
void | SetMaxMessages (size_t maxMessages) |
Set the max number of media samples in the queue between the graph thread and the application thread. | |
The DirectShow sink filter (Windows-specific).
This class implements a DirectShow filter.
DirectShow is a very complicated infrastructure on Windows to support various media processing. BDA (Broadcast Device Architecture) is the generic device driver interface which links "broadcast devices" like DVB receivers to DirectShow. DirectShow is consequently the only generic way to interact with any type of DVB receiver hardware, provided that the hardware vendor supplies BDA-compatible drivers for the device.
The "sink filter" is intended to be used after a DirectShow capture filter, as provided by the hardware vendor. We call it a "sink" filter because it has one input pin (for MPEG-2 TS) but no output pin. The TS "samples" are read asynchronously by the application. This filter acts as an adapter between the push model of DirectShow and the pull model of tsp, the transport stream processor.
This module contains several classes:
The SinkPin accepts only MPEG-2 transport streams:
ts::SinkFilter::SinkFilter | ( | Report & | report | ) |
Constructor.
[in,out] | report | Where to report errors. |
SinkPin * ts::SinkFilter::GetPin | ( | ) |
Get the unique input pin.
void ts::SinkFilter::SetMaxMessages | ( | size_t | maxMessages | ) |
Set the max number of media samples in the queue between the graph thread and the application thread.
Must be called when the graph is stopped or paused.
[in] | maxMessages | Max number of media samples in the queue between the graph thread and the application thread. |
size_t ts::SinkFilter::Read | ( | void * | buffer, |
size_t | buffer_size, | ||
cn::milliseconds | timeout = cn::milliseconds::zero() |
||
) |
Read data from transport stream.
[out] | buffer | Address of returned TS packet buffer. |
[in] | buffer_size | Size in bytes of the buffer. |
[in] | timeout | Read timeout in milliseconds. Ignored if zero or negative. If timeout is positive and no packet has been read within this timeout, return zero. |
void ts::SinkFilter::Abort | ( | ) |
Abort a blocked Read() operation.
Can be called from any thread.