[libavg-devel] More audio thoughts

Nick Hebner hebnern at gmail.com
Mon Mar 31 00:31:09 CEST 2008


On Sun, Mar 30, 2008 at 1:10 PM, Ulrich von Zadow <uzadow at libavg.de> wrote:

> Hi,
>
> I've done some more work on the audio branch today:
>
> - Some files have moved to a new src/audio/ directory. This removes a
>   circular dependency that would have prevented stand-alone audio tests
>   in the src/video directory.
> - Made AudioSource into a pure interface IAudioSource because otherwise
>   offsetof() will probably break at some point in the video node
>   (multiple inheritance and offsetof() don't play well together).
>
> Then: I'd propose to split FFMpegDecoder into two classes,
> FFMpegVideoDecoder and FFMpegAudioDecoder. Right now, audio decoding is
> happening in the SDL audio thread, if I read the code correctly. This
> change would make it possible to have audio and video decoding in two
> completely separate threads. It would also allow the creation of an
> FFMpegAudioDecoder without an FFMpegVideoDecoder.
>
> Actually (thinking aloud here), the two would have to share the same
> AVFormatContext, so there needs to be something like a generic
> FFMpegDecoder in addition to the Video and Audio decoders that is
> responsible for the generic parts of open() and close() and for the
> creation of the audio and video decoders...
>

In addition to the AVFormatContext sharing, there is stream time sharing
used for synching the audio and video streams during playback. This could be
moved into the generic FFMpegDecoder, and accomplished on top of the
FFMpegAudioDecoder and FFMpegVideoDecoder. Because there is some generic
ffmpeg initialization that must occur for either decoder, the
FFMpegAudioDecoder and FFMpegVideoDecoder would not be usable stand-alone
right?

>
> Also, there are several conflicting naming conventions around with
> regards to audio samples, so I'd like to propose a clear libavg-specific
> convention:
>
>   Audio Sample: The smallest unit of sound. Only one channel.
>   Audio Frame: Several samples, all meant to be played back at the same
>       time. (A stereo frame contains two samples).
>   Audio Buffer: A collection of audio frames.
>
> This isn't the mpeg convention, but it's what DirectSound uses.
> Alternatively, what would a good name for a collection of samples with
> the same timestamp be?


Well technically, only samples within a single frame share the same
timestamp. Different frames are played back at different times. In ffmpeg
timestamps are associated with packets.

>
>
> Cheers,
>
>   Uli
>
> --
> Any technology distinguishable from magic is insufficiently advanced.
>
> Ulrich von Zadow | +49-172-7872715
> Jabber: cocacoder at jabber.berlin.ccc.de
> Skype: uzadow
>
> _______________________________________________
> libavg-devel mailing list
> libavg-devel at datenhain.de
> https://mail.datenhain.de/mailman/listinfo/libavg-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.datenhain.de/pipermail/libavg-devel/attachments/20080330/7ec4e511/attachment.htm 


More information about the libavg-devel mailing list