Please find my comments inlined...

Thanks and regards,
-Lakshman



On Thu, Jul 29, 2010 at 12:19 AM, Daniel Charles <dcharl...@gmail.com>wrote:

> Hi,
>
> On Wed, Jul 28, 2010 at 7:49 AM, Lakshman <lakshma...@gmail.com> wrote:
> > Hello,
> >
> > There are two interfaces, MediaPlayerInterface and
> >  MediaPlayerHWInterface.....both are derived from MediaPlayerBase class.
> If
> > you wanna use AudioFlinger software mixer than you have to
> > use MediaPlayerInterface(As per google, don't have much knowledge on
> mixer
> > front). In setDataSource function we are creating AudioOutput,
> >  if (!p->hardwareOutput()) {
> >             mAudioOutput = new AudioOutput();
> >
> >  static_cast<MediaPlayerInterface*>(p.get())->setAudioSink(mAudioOutput);
> >         }
>
> So, AudioSink will be used for MediaPlayInterface, in this case how
> would you handle a port reconfiguration in the AudioPlayer class?  A
> port reconfiguration, in my case, happens when an AAC contains SBR
> information.
>
> So far, what I'm doing is closing, opening, and staring the AudioSink
> with the new parameters, i.e. samplerate and it behaves as I expect.
>
> Although, I'm not sure this is the correct way to handle this as I
> would want to push this change to gerrit.  I'm also wondering why this
> event is not handled yet.
> [Lakshman] once you get INFO_FORMAT_CHANGED message from OMXCodec to
> AudioPlayer...you close and reopen AudioSink...As per google guys...this is
> not in their use case it seems....
>


> > There is a check in AudioPlayer start() function to decide whether to use
> > AudioSink (if it's already created) or create a new AudioTrack for
> rendering
> > Audio.....mAudioSink->open() creates a new
> AudioTrack(mediaPlayerInterface)
> > and configures the audio driver, ....Just by creating AudioTrack in
> > AudioPlayer, I think you can render the Audio but I don't know abt
> > internals...I'm just using MediaPlayerInterface.
>
> I have forced AudioSink to be Null in AwesomePlayer's
> AwesomePlayer::play_l() as follows:
>
> if (mAudioSink != NULL) {
>                mAudioPlayer = new AudioPlayer(NULL);
>
> This, for experimental purposes, will do the same as you're doing and
> it also works fine since AudioTrack has the setSampleRate method and
> it works as I expect too.
>
> Then, when creating AudioTrack it will be registered with
> AudioFlinger, so in both cases, software and hardware outputs will use
> AudioFlinger.  I know this information from AudioTrack.h class
> definition.
>
> I would prefer, in my case, to use AudioTrack since calling
> setSampleRate looks cleaner than what I can do with AudioSink.
> [Lakshman] The callback functions registered for fetching data is different
> from AudioSink and AudioTrack....on INFO_FORMAT_CHANGED message if you are
> trying to use AudioTrack setSampleRate() to re-configure audio driver with
> new sampleRate ...It doesn't work.
> If you create a new AudioTrack ...you are registering a new call back
> function....you have two call back functions AudioSink callback and
> AudioTrack ....does creating a new AudioTrack overwrites AudioSink call back
> function....on Audio event which one is triggered???




> I may submit the patch to gerrit and see comments from the google engineer.
>
> Thanks.
>
> --
> Daniel.
>
>
>
> >
> > Thanks and regards,
> > -Lakshman
> >
> >
> >
> >
> >
> >
> > On Wed, Jul 28, 2010 at 5:56 AM, Daniel Charles <dcharl...@gmail.com>
> wrote:
> >>
> >> Hi all,
> >>
> >> I'm interested on learning the difference between using AudioTrack and
> >> AudioSink within Stagefreight's AudioPlayer class. I have seen that
> >> inside AudioPlayer AudioTrack is used as long as AudioSink was not
> >> created.  AudioSink gets created only when MediaPlayerService creates
> >> a player and it has not a HardwareOutput.
> >>
> >> How could I use AudioTrack instead of AudioSink?  Which is the
> >> difference between these two.  AFAIU, both are connected to
> >> audioflinger somehow.
> >>
> >> I appreciate any hint on this.
> >>
> >> Thanks.
> >>
> >> --
> >> Daniel.
> >>
> >> --
> >> unsubscribe: 
> >> android-porting+unsubscr...@googlegroups.com<android-porting%2bunsubscr...@googlegroups.com>
> >> website: http://groups.google.com/group/android-porting
> >
> >
>

-- 
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: http://groups.google.com/group/android-porting

Reply via email to