Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[linux-dvb] demux.h version trouble



Hi,

Felix Domke writes:
 > if i look at the demux.h on the linuxtv.org webserver
 > (http://www.linuxtv.org/developer/dvb_api/demux.h), i notice that the
 > "current version" (according to http://www.linuxtv.org/developer/dvb.xml) is
 > "$Id: demux.h,v 1.4 2000/09/06 18:09:59 rjkm Exp $", but it doesn't contain
 > the set_type-stuff like "$Id: demux.h,v 1.3 2000/11/17 16:28:51 cvs Exp $"
 > from the siemens-0.8.1-driver (compare version numbers, contents and dates -
 > i'm confused :).
 > 
 > also the set_type-stuff isn't documentated in the API-specs available
 > online.
 > 
 > what did i overlook?

Nothing, I am a little behind in documentation ...
but there are comments in the include file (see below).

The reason for introducing it is that I wanted a way to make the
implementation of the demux device hardware independent and working
with more than one card.

For this I also needed a call to tell the driver somehow which PIDs to 
send to the decoder. The kernel data API did not provide such a call.
So, I either invent another layer where the driver has to register and
which the demux device can use or I add a call to the data API.

I also wanted to be able to specify if I want the raw TS packets or just
the payload (e.g. the PES stream). For this I could have introduced
PES filters which were also planned by Nokia but are not yet specified.
But then I still would need an extra call for selecting the PIDs for
the decoder. Instead, I put both features in one call:

        int (*set_type) (struct dmx_ts_feed_s* feed, 
			 int type, 
			 dmx_ts_pes_t pes_type);

where type is one of:

#define TS_PACKET       1   /* send TS packets (188 bytes) to callback (default) */ 
#define	TS_PAYLOAD_ONLY 2   /* in case TS_PACKET is set, only send the TS
			       payload (<=184 bytes per packet) to callback */
#define TS_DECODER      4   /* send stream to built-in decoder (if present) */


and pes_type one of:

/* PES type for filters which write to built-in decoder */
/* these should be kept identical to the types in dmx.h */

typedef enum
{
        DMX_TS_PES_AUDIO,   /* also send packets to audio decoder (if it exists) */
	DMX_TS_PES_VIDEO,   /* ... */
	DMX_TS_PES_TELETEXT,
	DMX_TS_PES_SUBTITLE,
	DMX_TS_PES_PCR,
	DMX_TS_PES_OTHER,
} dmx_ts_pes_t;


So, if you want a TS filter which only sends its data (which is e.g. 
video data) to the decoder, you just call:

feed->set_type(feed, TS_DECODER, DMX_TS_PES_VIDEO);

after having allocated but not yet started the filter.
The call should of course fail if another filter (maybe even one on a
different demux, if your hardware supports more than one) already is
used for video decoding.
Furthermore, if you do not use set_type(), the TS filter will behave
just as before. You do not have to use it, only for the extra 
functionalities.

I don't know if this approach is better compared to having PES filters
+ a call just for the MPEG decoders PIDs. 
Comments, complaints and discussion are welcome!!


Just as a warning, I also plan to put some of the hardware independent
features of the other device into the dvbdev module.
At the moment the dvbdev just forwards all calls to the registered DVB
device. Many general functions could already be provided at this
level, also the complete demux device. This would involve introducing 
some more low level calls to the DVB drivers which they would have to 
provide to dvbdev. But this would not change anything at the user API 
level.


Ralph


--- 
Info:
To unsubscribe send a mail to listar@linuxtv.org with "unsubscribe linux-dvb" as subject.



Home | Main Index | Thread Index