1. 05 Mar, 2015 1 commit
  2. 18 Dec, 2012 1 commit
    • Andy McFadden's avatar
      Rename ISurfaceTexture and SurfaceTexture · e21f91df
      Andy McFadden authored
      The C++ class names don't match what the classes do, so rename
      ISurfaceTexture to IGraphicBufferProducer, and SurfaceTexture to
      GLConsumer.
      
      Bug 7736700
      
      Change-Id: I54f19904e325518a3af8fe23c018d3c0bb6bd807
      e21f91df
  3. 08 May, 2012 1 commit
    • Jean-Michel Trivi's avatar
      Playback rate on OpenSL ES AudioPlayer playing from URI/FD · 91145ef1
      Jean-Michel Trivi authored
      Allow AudioPlayer to use the platform's 500-2000 range (in
        permille) of playback rate for audio when the data source
        is a URI or FD.
      Since play events for those players are simulated through
        monitoring the playback position, scale the time
        between updates so play events are delivered in content
        time, not presentation time (as defined in OpenSL ES
        specification, "positions do not scale with changes in
        playback rate").
      
      Bug 5898620
      
      Change-Id: Ib512caebd7f3983c9e845be62e48dfee8499e59c
      91145ef1
  4. 26 Feb, 2012 1 commit
  5. 06 Jan, 2012 1 commit
  6. 10 Nov, 2011 1 commit
    • Glenn Kasten's avatar
      Bug 5201321 recover from mediaserver crash · 51322282
      Glenn Kasten authored
      Add a media player death notifier to recover from media server crashes.
      Downgrade some logs.
      Destructors should be protected.
      
      Change-Id: I7774733bcb12fc7fbfe237bdbeffca1adde46e78
      51322282
  7. 07 Nov, 2011 1 commit
    • Glenn Kasten's avatar
      Comments · e2e8fa36
      Glenn Kasten authored
      Change-Id: I1592d1979ce5f5811ff5a47b4b60db93e8670313
      e2e8fa36
  8. 31 Oct, 2011 1 commit
  9. 27 Oct, 2011 1 commit
  10. 24 Oct, 2011 1 commit
  11. 17 Oct, 2011 1 commit
    • Glenn Kasten's avatar
      Fix race in getting duration · 1fa5c320
      Glenn Kasten authored
      mDuration is protected by mSettingsLock because it is accessed from both
      the ALooper thread and from the application thread, but only one of the
      two "set"s was using the lock, and the "get" was not using the lock.
      
      Also added some comments about the lock, and moved lock closer inside { }.
      
      Change-Id: I7c96186f31baaad1b941d934549cb50d4f82d0c8
      1fa5c320
  12. 13 Oct, 2011 1 commit
    • Glenn Kasten's avatar
      More logging of media events for debugging · 0384250c
      Glenn Kasten authored
      Do range-checking of MEDIA_BUFFERING_UPDATE parameters.
      
      The other new logs are LOGV so disabled by default.
      
      Don't forward empty MEDIA_SET_VIDEO_SIZE notifications, as
      mediaserver seems to send these even for audio-only tracks.
      
      Change-Id: I49063f83cec7bdfedb768b32f94735983755ebf2
      0384250c
  13. 11 Oct, 2011 1 commit
    • Glenn Kasten's avatar
      Multithread safety and code reduction · b4393ef4
      Glenn Kasten authored
      Remove unsafe GenericPlayer::getSampleRate().  getSampleRate() was not
      thread-safe as it accessed a member variable updated in the looper thread
      without a lock.  If getSampleRate() is ever needed again, the sample rate
      is available in the mPcmFormatValues array, which does have a lock.
      
      Replace member variables mChannelMask, mChannelCount, and mSampleRateHz
      by local variables for locality and performance.
      
      Change-Id: Ibf92ed090430153d748ded4d0b835e429df47eea
      b4393ef4
  14. 10 Oct, 2011 1 commit
    • Glenn Kasten's avatar
      Bug 5293383 ~StreamSourceAppProxy wasn't reached · a0fa47f7
      Glenn Kasten authored
      Fix bug where StreamSourceAppProxy destructor wasn't reached,
      which caused all sorts of other problems later on.  To see this,
      enable the logs StreamSourceAppProxy::~StreamSourceAppProxy and
      StreamPlayer::~StreamPlayer.  You'll see that StreamPlayer was destroyed,
      but not StreamSourceAppProxy.
      
      As StreamSourceAppProxy is child of StreamPlayer, make the reference
      from StreamSourceAppProxy to StreamPlayer a weak reference in case
      StreamSourceAppProxy's lifetime exceeds StreamPlayer.  It is not supposed
      to any more with this fix, but the wp<> provides extra safety.
      
      StreamPlayer preDestroy no longer bypasses the preDestroy in
      GenericMediaPlayer.
      
      Do a full disconnect in GenericMediaPlayer::preDestroy.
      
      Push decremented reference counts for strong pointer through binder
      to workaround binder's "optimization".
      
      Extra error-checking in setListener and setBuffers to verify
      that mediaserver is calling them correctly.
      
      Use mutex mLock consistently in StreamSourceAppProxy.
      
      Add an explicit StreamSourceAppProxy::disconnect to break
      a circular reference, and call it in StreamPlayer destructor.
      
      Make methods private: receivedCmd_l and receivedBuffer_l.
      
      Add explicit clear during preDestroy to give up references earlier.
      
      Warning: setDataSource(NULL) is not supported by NuPlayer yet,
      this depends on another change in frameworks/base, so it is
      commented out for now.
      
      Rename mPlayerPrepared to mPreparedPlayer to avoid confusion with the
      enum mPlayerPrepared.
      
      Change-Id: Ie5f554c206027d22204eb86edd15489c6281b512
      a0fa47f7
  15. 04 Oct, 2011 1 commit
    • Glenn Kasten's avatar
      Don't update prepare state more than once · 0d1c7e2c
      Glenn Kasten authored
      If a MEDIA_ERROR event is received during preparation, it indicates
      that prepare has completed unsuccessfully.  However, MEDIA_ERROR can
      also legitimately be sent after successful prepare. In that case, don't
      update the prepare state.
      
      Similarly, in the unlikely case that MEDIA_PREPARED is received after
      prepare has already completed successfully or unsuccessfully, ignore it.
      This probably indicates a buggy mediaserver, but we wouldn't want that
      to take down the client also.
      
      Change-Id: I2a92e98d13b70d1aa5ff6f440ad528f6896a2ead
      0d1c7e2c
  16. 29 Sep, 2011 2 commits
    • Glenn Kasten's avatar
      Remove dead code · c0a40f3e
      Glenn Kasten authored
      Change-Id: Ic68d4d7b942ef99120ad30ee3ef7ce48ff1d697a
      c0a40f3e
    • Glenn Kasten's avatar
      Bug 5385386 missing HEADATNEWPOS · a9f22e6f
      Glenn Kasten authored
      Workaround for mediaserver bug where it does not send MEDIA_SEEK_COMPLETE
      to the MediaPlayerNotifier after a discontinuity is processed.
      
      Instead, we simulate a seek complete event in this case.
      A short delay is applied to compensate for shared memory latency.
      
      A longer-term fix will be to have mediaserver send the event.
      
      Change-Id: Id0d01b842a145fa5762d44f03144741152f7b03f
      a9f22e6f
  17. 16 Sep, 2011 1 commit
    • Glenn Kasten's avatar
      Bug 5334969 MediaPlayerNotificationClient safety · 91ff087f
      Glenn Kasten authored
      Fixed race due to missing mutex around 2 updates to mPlayerPrepared.
      
      MediaPlayerNotificationClient had a raw reference to GenericMediaPlayer;
      if for some reason the binder thread out-lived the GenericMediaPlayer,
      then it might reference a destroyed object.  Made it a weak reference,
      and issue warning if the GenericMediaPlayer has been destroyed.
      This has similar effect as a callback protector.
      
      Minor related:
       - mHasVideo is read without mutex, safe since never changed but make it const
       - GenericMediaPlayer's reference to MediaPlayerNotificationClient is now const also
      
      Change-Id: I67b50e861a055c73fd490fb537a3d6d23d25c3d2
      91ff087f
  18. 24 Aug, 2011 2 commits
    • Glenn Kasten's avatar
      Bug 5193695 Fix crash after MediaPlayer destroyed · 485a038f
      Glenn Kasten authored
      The StreamSource callback thread was continuing to run after the
      MediaPlayer object was destroyed.  Fixed by adding a callback protector
      and a pre-destroy hook. GenericMediaPlayer::preDestroy now also
      calls MediaPlayer::stop just in case.
      
      Change-Id: I5bd771d4d1936f433d2a8c9959593782c96daed9
      Miscellaneous:
       - added an explicit destructor on CMediaPlayer::mAVPlayer for consistency
         (probably not a bug since there was a clear on it earlier)
       - updated comments for CallbackProtector
       - made some CallbackProtector fields private since no sub-classes yet
      485a038f
    • Glenn Kasten's avatar
      Bug 5153313 keep compatibility of local files URI · 833251ab
      Glenn Kasten authored
      Also fix a bug in decode from fd to PCM buffer queue, where
      we were closing the application's fd.
      
      Change-Id: I220cd1c242f2f5e240b4dd1b9e8d79c88878bdcd
      833251ab
  19. 13 Aug, 2011 1 commit
    • Glenn Kasten's avatar
      Bug 5161265 Recover from mediaserver process crash · 85edd878
      Glenn Kasten authored
      Use the utility method IMediaDeathNotifier::getMediaPlayerService()
      to get a reference to media player service.  It retries after errors,
      and keeps a single global per-process reference to the service rather
      than one per object.  If we still can't contact the media player service
      after retries, handle it like an unsuccessful prepare.
      
      Miscellaneous:
       - Remove unused field Parcel metadatafilter
      
      Change-Id: I451a64bd76b4a7f157774abe967448ec081f1014
      85edd878
  20. 09 Aug, 2011 1 commit
    • Glenn Kasten's avatar
      Bug 5126938 dependency for video sinks · 35ac702e
      Glenn Kasten authored
      Fixing bug 5126938 will involve configuring the video sink in two places:
      at the initial data locator when creating the MediaPlayer object, and
      then later in the IAndroidConfiguration interface.  This CL is preparation
      for that.
      
      Details:
       - Abstract out common code into android_Player_setNativeWindow.
       - Move the code for checking and initializing the video sink from an
         #ifdef ANDROID in the CMediaPlayer_Realize portable code to into
         platform-specific android_Player_realize.
       - Only set one of mSurface or mSurfaceTexture to non-NULL.
       - For methods which can't fail, replace the SLresult return value by void.
      
      Change-Id: Iec8fd91e1a6de45eb64241b35e3f7d7faf63d727
      35ac702e
  21. 04 Aug, 2011 1 commit
    • Glenn Kasten's avatar
      Bug 5903270 play interface, events, markers, etc. · 5933f3d5
      Glenn Kasten authored
      As the media framework does not directly support marker and periodic
      callbacks, we use a retriggerable one-shot timer at application level
      to emulate this.  This has the advantage of being faster, but is also
      less accurate than if it were in the framework.
      
      Details:
       - Get position is now synchronous and (mostly) lock-free
       - Fix regression in SL_PLAYEVENT_HEADATMARKER and SL_PLAYEVENTHEADATNEWPOS
       - Fix SMP races in GetPlayState, GetCallbackEventsMask, GetMarkerPosition,
         GetPositionUpdatePeriod
       - AudioSfDecoder was not updating mPositionMsec when getPositionUsec failed
       - Updating attributes is relatively expensive, so only do it when a significant change
          in SetMarkerPosition, ClearMarkerPosition, SetPositionUpdatePeriod
       - Error on unknown message type in onMessageReceived
       - Delete an obsolete FIXME
       - "Clearing" a marker is now equivalent to disabling the marker event,
         and the default marker position is cleared.
       - use Android time units and types (int32_t, ANDROID_UNKNOWN_TIME, etc.) where appropriate
         instead of SLmillisecond and SL_TIME_UNKNOWN
      
      Change-Id: Ib78bafa20d883b8d927364769663837389b6ea1d
      5933f3d5
  22. 03 Aug, 2011 1 commit
  23. 01 Aug, 2011 1 commit
    • Glenn Kasten's avatar
      Bug 5080320 MediaPlayer volume · 99b92775
      Glenn Kasten authored
      Details:
       - re-factor volume-related code yet again
       - remove dead variables mAmplFromVolLevel, mAmplFromStereoPos, mDirectLevel
       - add placeholders for kEventPrefetchFillLevelUpdate and kEventPrefetchStatusChange
      
      Known issues:
       - MPEG-2 TS doesn't yet implement the ability to query channel count, so default to stereo
      
      Change-Id: Ic0f2297b267dc3d380755e8d314e1d5f0f659d7c
      99b92775
  24. 28 Jul, 2011 3 commits
  25. 25 Jul, 2011 1 commit
  26. 21 Jul, 2011 2 commits
  27. 20 Jul, 2011 1 commit
  28. 19 Jul, 2011 1 commit
  29. 12 Jul, 2011 1 commit
  30. 10 Jul, 2011 1 commit
    • Jean-Michel Trivi's avatar
      Implement GetPosition for players playing from a URI/FD · 4b0e0b28
      Jean-Michel Trivi authored
      AudioPlayer (OpenSL ES) and MediaPlayer (OpenMAX AL) that play
       media from a URI or FD are implemented on top of an Android
       MediaPlayer. This CL implements requesting the current position
       from the underlying MediaPlayer object inside the event loop.
       At this stage, GetPosition cannot be called from inside a
       callback as the callback is made on the same thread that will
       process the asynchronous part of the GetPosition implementation.
      Add test app for GetPosition.
      
      Change-Id: Ife768bc40e37fc60cc19f6ba84bbe6cb06cc6590
      4b0e0b28
  31. 13 Apr, 2011 3 commits
    • Gloria Wang's avatar
      - Add another parameter in notify() to be able to send timed text sample · 2f6d462d
      Gloria Wang authored
      through listener during video playback.
      For feature request 800939.
      
      Change-Id: I14aa18d2f803163a62c05f9e6bd990518c58cd3f
      2f6d462d
    • Jean-Michel Trivi's avatar
      Fix stuttering at beginning of playback · 7ef5526a
      Jean-Michel Trivi authored
      When an AudioPlayer is created, its playstate is set to STOPPED
       three times. A stop command is translated into a pause + seek(0).
       When a seek is underway, any new seek command was postponed. So
       when playback would start after a first seek(0), the other seeks
       would be executed, causing the stutterring.
      This CL verifies that, when seeking to a certain time, any new
       seek command to the same point in time received while seeking
       is ignored.
      It also correct the update of mStateFlags, which should be done
       BEFORE the command is issued to the player, in case the seek
       complete notification happens syncronously with the seek command.
      
      This CL does NOT fix why a newly created player sees its playstate
       updated to STOPPED three times in a test app like slesTest_playUri
       before playback starts.
      
      Change-Id: Ic7627678735f559b911ea3c5a0e1e00d7d7534d2
      7ef5526a
    • Glenn Kasten's avatar
      Fix various bugs found with unit tests · e31a69fc
      Glenn Kasten authored
      ISeek::SetLoop was returning undefined status.
      Khronos Bug 7614 - sizeof(long) != 32 bits on x86_64.
      Fix bug in IID hashing due to the above.
      Fix bug in GenericMediaPlayer::onLoop; was using mPlayer without checking for NULL.
      Fix wrong API level in tests/sandbox/object.c.
      Decrease log level from I to V in MediaPlayerNotificationClient::notify
          and GenericPlayer::~GenericPlayer.
      Fix memory leak in tests/sandbox/engine.c.
      Comment out overly verbose log in tests/sandbox/streamSource/slesTestPlayStream.cpp.
      
      Change-Id: I322fa9e19ee95ea1e18870a20f6a3c03b8f21208
      e31a69fc
  32. 11 Apr, 2011 1 commit
    • Jean-Michel Trivi's avatar
      Use reference to sp on GenericPlayer · 36b700a8
      Jean-Michel Trivi authored
      When an object like GenericPlayer is stored in CAudioPlayer or
       CMediaPlayer by a sp, don't use a pointer to GenericPlayer when
       the object is passed as a function parameter, but rather use
       a reference to the sp that maintains it.
      
      Change-Id: I49ff219618ac4b657deb43cfffb65f0e0dd6d58d
      36b700a8
  33. 05 Apr, 2011 1 commit
    • Jean-Michel Trivi's avatar
      Move support for SL URI and FD playback under GenericPlayer class · 4ee246c5
      Jean-Michel Trivi authored
      The SfPlayer class was implementing URI and FD decode and playback
       in the application process. This CL removes this class entirely
       and moves its functionality under the GenericPlayer class. This
       means that the playback of URIs and FDs is now implemented through
       an android::MediaPlayer object running in the media service.
      
      The SfPlayer header had many StageFright and system includes, which
       are now moved to the relevant files where they are required,
       instead of automagically coming from sles_allinclusive.h.
      
      Note that this CL breaks support for the following OpenSL ES features
      due to missing Android MediaPlayer features:
       SLPlayItf.GetPosition
                 HEADATMARKER
                 HEADATNEWPOSITION
       SLVolumeItf.EnableStereoPosition
                 SetStereoPosition
       SLMuteSoloItf
       SLPlaybackRateItf
      
       Support for those features will be reintegrated in subsequent CLs.
      
      Change-Id: I8d7f6ea006eb7b876ef1ca1909d74b4517335850
      4ee246c5