[vlc-devel] Opus RTP raw audio decoder plugin patch

Yupeng Chang changyp6 at gmail.com
Fri Nov 29 12:11:02 CET 2013


Hi Ilkka,

Thanks for your advice.

I did a little dig on the opus.c decoder, and I found the only thing this
decoder needs, to decode Opus raw data, is an OggOpus header.
And there is a function opus_write_header in opus_header.c, which can make
one OggOpus header for me, so I just added one header to make it work.

The attached files are the new patches, which can enable Opus RTP stream
and enable Opus raw data decoding with minimum changes.

Please help to review again.
Thanks very much!

Yupeng Chang
Nov-29-2013


On 28 November 2013 20:48, Ilkka Ollakka <ileoo at videolan.org> wrote:

>
> Hi,
>
> Thanks for the new patch.
>
> Why not use multistream api (OggOpus uses it) ? I don't have clear idea
> how they differ (than that basic decoder seems to output S16N and
> multistream can output FL32). Maybe someone more into Opus can clarify
> this?
>
> On Thu, Nov 28, 2013 at 08:24:11PM +0800, Yupeng Chang wrote:
> > From 49da1c8c17b763cf71ee65e1b9f925ccc4e7b79f Mon Sep 17 00:00:00 2001
> > From: Yupeng Chang <ypchang at ambarella.com>
> > Date: Thu, 28 Nov 2013 20:19:17 +0800
> > Subject: [PATCH 2/2] codec: Add Opus raw decoding.
>
> > +    written = opus_decode(p_sys->p_raw_dec,
> > +                          data, size,
> > +                          (opus_int16*)p_aout_buffer->p_buffer,
> > +                          buf_size / nb_channels, 0) * nb_channels * 2;
> > +
> > +    p_aout_buffer->i_nb_samples = nb_samples;
> > +    p_aout_buffer->i_pts = date_Get( &p_sys->end_date );
> > +    p_aout_buffer->i_length = written;
>
> I think it would be clearer if you would do the multiplication when you
> set i_lenght, not directly to opus_decode return value.
>
> --
> Ilkka Ollakka
> Everybody is somebody else's weirdo.
>                 -- Dykstra
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20131129/3b9692fa/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-access-Enable-Opus-RTP.patch
Type: text/x-patch
Size: 1221 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20131129/3b9692fa/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-codec-Enable-Opus-raw-data-decoding.patch
Type: text/x-patch
Size: 2027 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20131129/3b9692fa/attachment-0001.bin>


More information about the vlc-devel mailing list