[linux-dvb] [PATCH] dvb-kernel-v4 demux.h

Johannes Stezenbach js at linuxtv.org
Wed Aug 31 14:41:56 CEST 2005


hunold at linuxtv.org wrote:
> Johannes Stezenbach writes:
> >On Wed, Aug 31, 2005 hunold at linuxtv.org wrote:
> 
> >>enum dvb_demux_pid_filter_packet_selection {
> >>	DVB_DEMUX_TS_PACKET       = (1 << 0), /*!< default: process the 
> >>	whole TS packet */
> >>	DVB_DEMUX_PAYLOAD_ONLY    = (1 << 1), /*!< only deliver the payload 
> >>	(ie. strip off the TS header) */
> >>	DVB_DEMUX_ADAPTATION_ONLY = (1 << 2), /*!< only deliver the TS 
> >>	header and any adaptation fields if present */
> >>}; 
> 
> >If these enums aren't flags, then why the hell do you make them
> >look like flags?
> 
> I don't want to make them look like flags. Flags can only be used for 
> saying on/off. This is not true for the stuff above, they are selections. 

Why then the (1 << x) assignments? That's misleading.

> What about putting *all* capabilities into a separate struct that can be 
> queried at once instead of a lot small capabilities that need to be queried 
> individually? 

That makes it hard to extend the API without breaking
binary compatibility. (We could add some "reserved" fields
like the v4l2 API has, but it's ugly.)

Johannes




More information about the linux-dvb mailing list