Re: RFC 0.3: MPEG encoding and decoding V4L2/DVB API additions

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

 



On Thursday 22 February 2007 18:58, Oliver Endriss wrote:
> Hi,
>
> see below for a some comments.
>
> Hans Verkuil wrote:
> > RFC MPEG encoding and decoding V4L2/DVB API additions
> > Version 0.3
> > ...
> > MPEG Decoding commands
> > ----------------------
> >
> > In this section I will examine how to implement the decoding
> > functionality of the conexant cx23415 in terms of the DVB API, and
> > what, if any, additions to that API are needed to support it fully.
> >
> > 1) Start/Stop/Pause/Resume decoding
> >
> > After discussing this with Ralph it became clear that it was best
> > to add two new ioctls (as designed in the first version of this
> > RFC) since the existing VIDEO_PLAY/STOP/FREEZE/CONTINUE did not
> > provide the required functionality. The existing ioctls can still
> > be used, but only do the simple action. For more refined control
> > (and better support for future extensions) new VIDEO_COMMAND and
> > VIDEO_TRY_COMMAND ioctls are added. This ensures that existing apps
> > won't break, but that the cx23415 is still fully supported. Also
> > future extensions are much easier.
> >
> > #define VIDEO_CMD_PLAY        (0)
> > #define VIDEO_CMD_STOP        (1)
> > #define VIDEO_CMD_FREEZE      (2)
> > #define VIDEO_CMD_CONTINUE    (3)
> >
> > /* Flags for VIDEO_CMD_CONTINUE */
> > #define VIDEO_CMD_PAUSE_TO_BLACK     (1 << 0)
> >
> > /* Flags for VIDEO_CMD_STOP */
> > #define VIDEO_CMD_STOP_TO_BLACK      (1 << 0)
> >
> > /* Flags for VIDEO_CMD_PLAY */
> > #define VIDEO_CMD_PLAY_SPEED_MUTE_AUDIO   (1 << 0)
>
> Hm - is this really necessary?
> The application could simply use AUDIO_SET_MUTE instead.

I considered doing that as well, but decided against that. The reason is 
that AUDIO_SET_MUTE is a global setting: it mutes the audio, whether 
during normal speed playback or fast forward playback. This particular 
mute flag is directly related to the fast forward playback and decides 
whether you allow sound when playing fast forward or not. The hardware 
may not even give you a choice on this.

For the cx23415 there actually is no AUDIO_SET_MUTE functionality. Audio 
is always on for normal speed playback, it is always off for other 
speeds, except for 1.5 speed up or slow down. For those speeds you can 
select whether you want sound or not. Hence the reason for putting it 
with the speed command.

> > ...
> > 5) Audio mode selection
> >
> > The cx23415 allows automatic selection of the audio mode (stereo,
> > left, right, mono or swapped channels) for both a normal stereo
> > capture and a bilingual capture.
> >
> > The AUDIO_CHANNEL_SELECT ioctl comes close. If the
> > audio_channel_select_t enum was extended with AUDIO_MONO and
> > AUDIO_STEREO_SWAPPED and a AUDIO_BILINGUAL_CHANNEL_SELECT ioctl was
> > added, then this would fully implement this feature.
>
> How is AUDIO_BILINGUAL_CHANNEL_SELECT supposed to work?
> The av7110 driver uses AUDIO_MONO_LEFT/AUDIO_MONO_RIGHT to select the
> channel.

The cx23415 support autodetect: when the mpeg stream audio mode switches 
to bilingual it will use the bilingual audio mode. For normal stereo 
mpeg it will use the normal audio mode setting. The application can 
just set it once and it will all work automagically. Hardware that 
doesn't support this feature would typically not support this ioctl.

It's really an important feature for the cx23415 as there is no other 
method of choosing the audio mode for bilingual streams. But if you 
prefer other means of implementing this I'm open for suggestions. I 
considered reusing AUDIO_CHANNEL_SELECT and using bitmasks to pass the 
bilingual mode setting, but I always found that rather ugly.

Regards,

	Hans

_______________________________________________
linux-dvb mailing list
linux-dvb@xxxxxxxxxxx
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

[Index of Archives]     [Linux Media]     [Video 4 Linux]     [Asterisk]     [Samba]     [Xorg]     [Xfree86]     [Linux USB]

  Powered by Linux