[vlc-devel] [PATCH 25/41] Add KAI audio output module for OS/2

KO Myung-Hun komh78 at gmail.com
Sat Oct 15 17:21:41 CEST 2011



Rémi Denis-Courmont wrote:
> Le lundi 10 octobre 2011 14:44:04 KO Myung-Hun, vous avez écrit :
>> diff --git a/configure.ac b/configure.ac
>> index f7322b2..d4b6245 100644
>> --- a/configure.ac
>> +++ b/configure.ac
>> @@ -3582,6 +3582,20 @@ dnl
>>  PKG_ENABLE_MODULES_VLC([SAMPLERATE], [], [samplerate], [Resampler with
>> libsamplerate], [auto])
>>
>>  dnl
>> +dnl  OS/2 KAI plugin
>> +dnl
>> +AC_ARG_ENABLE(kai,
>> +  [  --enable-kai   OS/2 KAI audio module (default enabled on OS/2)])
> 
> Default value can be set as the forth parameter of AC_ARG_ENABLE.
> 

Ok.

> Is "kai.h" is part of the standard eComStation SDK? Then you might as well 
> just enable the plugin in modules/audio_output/Modules.am with 'if HAVE_OS2', 
> like we do for OSS, ALSA and PulseAudio already.
> 

kai.h is from a third party library.

>> +if test "${enable_kai}" != "no" &&
>> +  (test "${SYS}" = "os2" || test "${enable_kai}" = "yes")
> 
> Please use AS_IF() in new code.
> 

Fixed.

>> +then
>> +  AC_CHECK_HEADERS(kai.h,
>> +    [ VLC_ADD_PLUGIN([kai])
>> +      VLC_ADD_LDFLAGS([kai],[-lkai])
> 
> In new code, I prefer to store flags in Modules.am.
> 

Maybe fixed.

>> --- /dev/null
>> +++ b/modules/audio_output/kai.c
>> ***/ +struct aout_sys_t
>> +{
>> +    aout_packet_t   packet;
> 
> aout_packet_t is mostly intended for legacy audio outputs that nobody cared to 
> adapt to the new API. You can use it, but it's not recommended.
> 

Where can I find the docs for the new APIs ?

Anyway, I want to use this now.

>> +static const char *const ppsz_kai_audio_device[] = {
>> +    "auto", "dart", "uniaud" };
>> +static const char *const ppsz_kai_audio_device_text[] = {
>> +    N_("Auto"), N_("DART"), N_("UNIAUD") };
> 
> I am afraid our translators will not understand what DART and UNIAUD are 
> supposed to mean.
> 

I think there is no need to translate them.

>> +    psz_mode = var_CreateGetString( p_aout, "kai-audio-device" );
>> +
>> +    i_kai_mode = KAIM_AUTO;
>> +    if( strcmp( psz_mode, "dart" ) == 0 )
> 
> Beware. psz_mode may be NULL.
> 

Ok. Fixed.

>> +    i_nb_channels = aout_FormatNbChannels( &p_aout->format );
>> +    if ( i_nb_channels > 2 )
>> +    {
>> +        /* KAI doesn't support more than two channels. */
>> +        i_nb_channels = 2;
>> +        p_aout->format.i_physical_channels
>> +            = AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT;
>> +    }

...

>> +
>> +    ks_wanted.usDeviceIndex   = 0;
>> +    ks_wanted.ulType          = KAIT_PLAY;
>> +    ks_wanted.ulBitsPerSample = BPS_16;
>> +    ks_wanted.ulSamplingRate  = p_aout->format.i_rate;
> 
> Hmm? Does KAI really accept any arbitrary sample rate?
> 

Depending on a driver. But, it can accept any arbitrary sample rate,
virtually.

>> +    ks_wanted.ulDataFormat    = MCI_WAVE_FORMAT_PCM;
>> +    ks_wanted.ulChannels      = i_nb_channels;
> 
> Same questions for channel numbers.
> 

As you see above, i_nb_channels is limited up to 2.

>> +/*************************************************************************
>> **** + * Play: play a sound samples buffer
>> +
>> **************************************************************************
>> ***/ +static void Play (audio_output_t *p_aout, block_t *block)
>> +{
>> +    aout_sys_t *p_sys = p_aout->sys;
>> +
>> +    kaiPlay( p_sys->hkai );
>> +
>> +    aout_PacketPlay( p_aout, block );
>> +}
> 
> It's really weird that you call both KAI and aout_Packet here. But I probably 
> don't understand.
> 

kaiPlay() kicks off a play back thread for the first time. Any later
calls have no effect.


-- 
KO Myung-Hun

Using Mozilla SeaMonkey 2.0.14
Under OS/2 Warp 4 for Korean with FixPak #15
On AMD ThunderBird 1GHz with 512 MB RAM

Korean OS/2 User Community : http://www.ecomstation.co.kr

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0022-Add-KAI-audio-output-module-for-OS-2.patch
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20111016/55544bc5/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0023-Add-UI-for-KAI.patch
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20111016/55544bc5/attachment-0001.ksh>


More information about the vlc-devel mailing list