[vlc-devel] Access to decompressed audio

Sergey Vlasov sergey.vlsv at gmail.com
Mon Jan 10 16:49:06 CET 2011


Hello,

I'm trying to write a media player with a custom UI, some functionality of
it may end up in upstream later.

First of all I would like to implement a progress bar widget similar to
http://soundcloud.com/. For that I need an access to
**<http://www.google.com/url?sa=t&source=web&cd=1&ved=0CBYQFjAA&url=http%3A%2F%2Fwiki.videolan.org%2FLibVLC_SampleCode_Qt&ei=YiUrTbj1OpKR4Abhu4DQCQ&usg=AFQjCNHtDP819pJwRWLcjbrrZLWeTskCSg&sig2=MP7feyw7MhLGu1KJcNxgLQ>raw
decompressed audio data. I started with "LibVLC SampleCode Qt".
Investigating VLC sources and various examples I ended up with this:

    ...
    libvlc_media_player_play (_mp);

    vlc_object_hold(_vlcinstance->p_libvlc_int);
    vlc_object_t *vlc_obj = (vlc_object_t *) _vlcinstance->p_libvlc_int;

    aout_instance_t *p_aout = (aout_instance_t *)vlc_obj;
    aout_buffer_t *p_buffer;

    vlc_mutex_lock(&p_aout->output_fifo_lock);
    p_buffer = aout_FifoPop( p_aout, &p_aout->output.fifo);
    vlc_mutex_unlock(&p_aout->output_fifo_lock);

    if (p_buffer != NULL)
        printf("Buffer size: %d\n", (unsigned int)p_buffer->i_buffer);
    else
        printf("Failed to access audio\n");
    ...

I can never get p_buffer valid. What do I do wrong?

--
Sergey
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20110110/27322339/attachment.html>


More information about the vlc-devel mailing list