summaryrefslogtreecommitdiffstats
path: root/media/libmediaplayerservice/MediaPlayerService.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Make frameworks/av 64-bit compatibleKévin PETIT2014-02-111-1/+1
| | | | | | | | | | | | Contains the necessary changes to make frameworks/av build and work on a 64-bit machine. Signed-off-by: Craig Barber <craig.barber@arm.com> Signed-off-by: Kévin PETIT <kevin.petit@arm.com> Signed-off-by: Ashok Bhat <ashok.bhat@arm.com> Signed-off-by: Marcus Oakland <marcus.oakland@arm.com> Change-Id: I725feaae50ed8eee25ca2c947cf15aee1f395c43
* update offloaded audio track sampling rateEric Laurent2013-12-171-0/+14
| | | | | | | | AudioPlayer must read the sampling rate from offloaded audio sinks whenever a new time position is computed as the decoder can update the sampling rate on the fly. Change-Id: I997e5248cfd4017aeceb4e11689324ded2a5bc88
* Assign blame for playback wakelocks.Marco Nelissen2013-10-251-7/+12
| | | | | | | | | | | Set a work source for the playback wakelock, so that playback is counted against the requesting app instead of the media server. Cherrypicked from master. b/9464621 Change-Id: I7329f88a288a95a582a78005a1c3d16a5a611e31
* soundpool: allocate shared memory heap by clientEric Laurent2013-09-241-22/+27
| | | | | | | | | | | | | | | | | | | | | | | Current SoundPool implementation allocates the shared memory heap containing decoded PCM samples in mediaserver process. When mediaserver process crashes, the shared memory heaps allocated by AudioCache cannot be mapped anymore in the new instance of mediaserver. This causes a silent failure to end playback of new sounds because AudioFlinger believes the new AudioTracks are opened in streaming mode and not static mode: it sees a NULL shared memory pointer when the track is created. The fix consists in allocating the memory heap in the client process. Thus the heap is not lost when mediaserver restarts. The global memory usage is the same as this is shared memory. Also added a way to detect that a shared memory is passed when the track is created but cannot be mapped on mediaserver side. Also fix a crash in SoundPool when ALOGV is enabled. Bug: 10894793. Change-Id: Ice6c66ec3b2a409d75dc903a508b6c6fbfb2e8a7
* Fix hangMarco Nelissen2013-09-161-1/+1
| | | | | | | Specify that the surface is controlled by the app, to avoid a hang. b/10531761 Change-Id: Idccc2c73aa3d368d8e7fbdc071ce36e2382efea4
* libmediaplayerservice: offload playback supportRichard Fitzgerald2013-07-261-82/+202
| | | | | | | | | | | | | | | | | | Main change is to how recycled tracks are used for gapless playback. If we are playing offloaded tracks that can't be recycled we don't open a new offloaded output until we have closed the previous one. This is because offloaded tracks are a limited resource so we don't want to spuriously create unnecessary instances. If the tracks cannot be recycled this means that the formats are incompatible and so the hardware most likely will also be unable to use the existing output channel for the new track. If we already have the maximum number of hardware offload channels open (which could be only one) then creation of the next output would fail if we attempted it while the previous output was still open. Change-Id: I4f5958074e7ffd2e17108157fee86329506730ea Signed-off-by: Eric Laurent <elaurent@google.com>
* am 903871da: am 83790fcc: am bdf33c98: Merge "Fix compilation warning: ↵Glenn Kasten2013-06-281-1/+1
|\ | | | | | | | | | | | | incorrect format specifier for type \'ssize_t\'." * commit '903871da7a7c71b8718133e60e2f0835837b5f3f': Fix compilation warning: incorrect format specifier for type 'ssize_t'.
| * am bdf33c98: Merge "Fix compilation warning: incorrect format specifier for ↵Glenn Kasten2013-06-281-1/+1
| |\ | | | | | | | | | | | | | | | | | | type \'ssize_t\'." * commit 'bdf33c98912090176183d3e9b9a9217dbbdca6da': Fix compilation warning: incorrect format specifier for type 'ssize_t'.
| | * Fix compilation warning: incorrect format specifier for type 'ssize_t'.Scott Fan2013-06-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | warning: format '%ld' expects argument of type 'long int', but argument 7 has type 'ssize_t {aka int}' [-Wformat] Change-Id: I823835a26320a3abb82f8dff9fbe82e5132e7556 Signed-off-by: Scott Fan <fancp2007@gmail.com>
| | * Merge "fix a race condition of MediaPlayerServce::Client::mClient"Andreas Huber2013-04-241-1/+1
| | |\
| | * | Remove legacy code and APIs in wifi display related code.Andreas Huber2012-09-211-25/+0
| | | | | | | | | | | | | | | | Change-Id: Ia010e7a00534f9356b3247369d0ffd65591d91aa
| | * | HDCP module binderizedAndreas Huber2012-09-191-0/+5
| | | | | | | | | | | | | | | | Change-Id: I866768b1e3f3b232f1934a35b65f66befc12f3f6
| | * | Add a permission for controlling wifi display.Jeff Brown2012-09-071-0/+9
| | | | | | | | | | | | | | | | Change-Id: I321b6c1a0223e0c3d5df04fde7a13ab91c08c7bc
| | * | Add a small hook to support gapless in AAH.John Grossman2012-09-061-5/+12
| | | | | | | | | | | | | | | | Change-Id: Ie07eca6b45142bdd83412ee0e38d732a4c355630
| | * | Update remote display API.Jeff Brown2012-09-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Renamed disconnect() to dispose() to emphasize the fact that this method is intended to clean up the IRemoteDisplay completely, not just temporarily disconnect the current client (which might be useful someday). Other minor tweaks. Change-Id: I1209639eb0cd8af09c724206642d7e52aab48257
| | * | Expose an IRemoteDisplay to trigger wifi display connections setup and feedback.Andreas Huber2012-09-051-12/+3
| | | | | | | | | | | | | | | | Change-Id: I7602cda0e38073c9f0e63fa4de238ca0d4b4ce8e
| | * | Implement remote display service stubs.Jeff Brown2012-09-051-0/+8
| | | | | | | | | | | | | | | | Change-Id: I582ed000026bba6d116db8304e15a3c52f8a9a01
| | * | Only run the wifi display RTSP server on demand, and only on the wifi directAndreas Huber2012-08-301-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | interface. Change-Id: I7d3c44cb79cd40e73499f2d7ccf35c69b628e6d7
| | * | Initial checkin of support for acting as a wifi display sourceAndreas Huber2012-08-291-0/+23
| | | | | | | | | | | | | | | | Change-Id: I08f17efa0c7d007e17408feb7d4fbef0a19f531a
* | | | Public API changes for audio offload support.Richard Fitzgerald2013-06-271-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NOTE: this does _not_ include all private member variables added to classes as part of offload support. Only public/protected functions and stubs functions/variables needed to make the changes buildable. - isOffloadSupported() added to audio policy service A stub implementation is required to build, this always returns false - setParameters() added to IAudioTrack A stub implementation is required to build, this always returns INVALID_OPERATION - CBlk flag for stream end - Change AudioSystem::getRenderPosition() to take an audio_output_t so caller can specify which output to query - Add AudioSystem::isOffloadSupported() This is fully implemented down to the AudioFlinger function AudioPolicyServer::isOffloadSupported() which is just a stub that always returns false. - Add EVENT_STREAM_END to AudioTrack interface. STREAM_END is used to signal when the hardware has actually finished playing all the data it was sent. - Add event type enumeration to media player interface AudioSink callbacks so that the same callback can be used to handle multiple types of event. For offloaded tracks we also have to handle STREAM_END and TEAR_DOWN events - Pass audio_offload_info_t to various functions used for opening outputs, tracks and audio players. This passes additional information about the compressed stream down to the HAL when using offload. For publicly-available APIs this is an optional parameter (for some of the internal and low-level APIs around the HAL interface it is mandatory) - Add getParameters() and setParameters() API to AudioTrack Currently dummy implementations. - Change AudioPlayer contructor so that it takes a set of bitflags defining what options are required. This replaces the original bool which only specified whether to use deep buffering. - Changes to StageFright class definition related to handling tearing-down of an offloaded track when we need to switch back to software decode - Define new StageFright utility functions used for offloaded tracks Currently dummy implementations. - AudioFlinger changes to use extended audio_config_t. Fills in audio_offload_info_t member if this info is passed in when opening an output. - libvideoeditor changes required to add the new event type parameter to AudioSink callback functions - libmediaplayerservice changes required to add the new event type parameter to AudioSink callback functions Change-Id: I3ab41138aa1083d81fe83b886a9b1021ec7320f1 Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com> Signed-off-by: Eric Laurent <elaurent@google.com>
* | | | Use sp<AudioTrack> instead of raw AudioTrack *Glenn Kasten2013-06-031-22/+15
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change prepares for the new implementation of AudioTrack client, which will require clients to use only sp<AudioTrack>, not raw AudioTrack *. A raw delete will cause a race condition during AudioTrack destruction. AudioTrack was made a RefBase by commit b68a91a70bc8d0d18e7404e14443d4e4020b3635 on 2011/11/15, when it was needed by OpenSL ES (for the callback protector). At that time, the only other client that was also converted from AudioTrack * to sp<AudioTrack> was android.media.AudioTrack JNI in project frameworks/base (file android_media_AudioTrack.cpp). Details: * Use .clear() instead of delete followed by = NULL. * ALOG %p need .get(). * sp<> don't need to be listed in constructor initializer, if initially 0. * Use == 0 for sp<> vs == NULL for raw pointers. * Use if (sp != 0) instead of if (raw). Change-Id: Ic7cad25795d6e862e112abdc227b6d33afdfce17
* | | am b7319a7e: Update HTTP proxy configuration for all media playback inside ↵Andreas Huber2013-06-031-0/+6
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | stagefright. * commit 'b7319a7eb0a06ef4fd3a0c9157ee63e637ad7aa1': Update HTTP proxy configuration for all media playback inside stagefright.
| * | | Update HTTP proxy configuration for all media playback inside stagefright.Andreas Huber2013-05-311-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Ie0dd00045aba668d8b49da73224e7a7c9c04f69b related-to-bug: 8873723 (cherry picked from commit 2704965b8a1ff3b7450ff58ccecf86d8ec688c40)
* | | | am 628a8c0e: Merge "fix a race condition of MediaPlayerServce::Client::mClient"Andreas Huber2013-04-241-1/+1
|\ \ \ \ | |/ / / |/| | | | | | | | | | | * commit '628a8c0ed91531468f5c615fea8745f63cc812aa': fix a race condition of MediaPlayerServce::Client::mClient
| * | | Merge "fix a race condition of MediaPlayerServce::Client::mClient"Andreas Huber2013-04-241-1/+1
| |\ \ \ | | | |/ | | |/|
| | * | fix a race condition of MediaPlayerServce::Client::mClientbeanz2012-11-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | there will be race condition between mClient.clear in MediaPlayerServce::Client::disconnect method and c=client->mClient in in MediaPlayerServce::Client::notify method Change-Id: I767294c4cb864c08e9c0e9f23d6d304a39016205 Signed-off-by: beanz <beanz@marvell.com>
* | | | Implementing MediaDrm APIsJeff Tinker2013-03-131-0/+5
| | | | | | | | | | | | | | | | Change-Id: I9ff8eeb7d0c383b5c0c68cd54eb54ce7d2d22fe6
* | | | Refactoring: Rename SurfaceTextureClient to SurfaceMathias Agopian2013-02-151-2/+2
| | | | | | | | | | | | | | | | Change-Id: I4e8a8b20914cb64edc37abe68233fbc9f2b5d830
* | | | Plumbing to reflect minor changes in the HDCP module API that allow forAndreas Huber2013-01-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | support of _decryption_ modules in addition to what we already supported. Change-Id: Ic37b87dc170ba8def3817991d25df798f21e950b
* | | | Merge "Remove unnecessary parameter"Glenn Kasten2012-12-211-3/+6
|\ \ \ \
| * | | | Remove unnecessary parameterGlenn Kasten2012-12-181-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Just get the parameter on server side Change-Id: I433a63104dbb257e0d862be2ab61847cb36d1c15
* | | | | Rename ISurfaceTexture and SurfaceTextureAndy McFadden2012-12-181-8/+8
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The C++ class names don't match what the classes do, so rename ISurfaceTexture to IGraphicBufferProducer, and SurfaceTexture to GLConsumer. Bug 7736700 Change-Id: I64520a55f8c09fe6215382ea361c539a9940cba5
* | | | Use size_t for frame countsGlenn Kasten2012-11-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Also fix typo: bufferCount should be frameCount. Change-Id: Ibed539504db75ef99dc21c8ff1bf2987122063a5
* | | | Use uint32_t for sample rateGlenn Kasten2012-11-141-1/+1
|/ / / | | | | | | | | | Change-Id: Ie240b48fb54b08359f69ecd4e5f8bda3d15cbe80
* | | Remove legacy code and APIs in wifi display related code.Andreas Huber2012-09-211-25/+0
| | | | | | | | | | | | Change-Id: Ia010e7a00534f9356b3247369d0ffd65591d91aa
* | | HDCP module binderizedAndreas Huber2012-09-191-0/+5
| | | | | | | | | | | | Change-Id: I866768b1e3f3b232f1934a35b65f66befc12f3f6
* | | Add a permission for controlling wifi display.Jeff Brown2012-09-071-0/+9
| | | | | | | | | | | | Change-Id: I321b6c1a0223e0c3d5df04fde7a13ab91c08c7bc
* | | Add a small hook to support gapless in AAH.John Grossman2012-09-061-5/+12
| | | | | | | | | | | | Change-Id: Ie07eca6b45142bdd83412ee0e38d732a4c355630
* | | Update remote display API.Jeff Brown2012-09-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Renamed disconnect() to dispose() to emphasize the fact that this method is intended to clean up the IRemoteDisplay completely, not just temporarily disconnect the current client (which might be useful someday). Other minor tweaks. Change-Id: I1209639eb0cd8af09c724206642d7e52aab48257
* | | Expose an IRemoteDisplay to trigger wifi display connections setup and feedback.Andreas Huber2012-09-051-12/+3
| | | | | | | | | | | | Change-Id: I7602cda0e38073c9f0e63fa4de238ca0d4b4ce8e
* | | Implement remote display service stubs.Jeff Brown2012-09-051-0/+8
| | | | | | | | | | | | Change-Id: I582ed000026bba6d116db8304e15a3c52f8a9a01
* | | Only run the wifi display RTSP server on demand, and only on the wifi directAndreas Huber2012-08-301-4/+10
| | | | | | | | | | | | | | | | | | interface. Change-Id: I7d3c44cb79cd40e73499f2d7ccf35c69b628e6d7
* | | Initial checkin of support for acting as a wifi display sourceAndreas Huber2012-08-291-0/+23
| |/ |/| | | | | Change-Id: I08f17efa0c7d007e17408feb7d4fbef0a19f531a
* | Fixed a potential/rare race condtion in MediaPlayerService::Client::notify() ↵James Dong2012-08-261-2/+10
| | | | | | | | | | | | | | | | | | | | | | method o The mClient could be disconnected before the notify message is sent out. Use a local reference could help resolve this issue. o related-to-bug: 6782035 Change-Id: Ia2047bd7f2666100fed83c6e5417a3bf2e20cd2c
* | Add a missing NULL check.John Grossman2012-08-231-1/+2
| | | | | | | | | | | | | | | | | | Don't crash if its time to start the next media player in a media player chain, but the current player's client has a NULL mAudioOutput, as is the case when the low level player implements MediaPlayerHWInterface. Change-Id: If555da3a46960cbee91ff26e5b1fd05e52c8ef28
* | Add the ability to dynamicaly register MediaPlayer types.John Grossman2012-08-131-204/+37
|/ | | | | | | | | | | | Add the ability to dynamically register low level MediaPlayer factories which will be probed at setDataSource time to determine the proper MediaPlayerBase to instantiate. This change is in preparation for moving libaah_rtp out of frameworks/base and into phantasm platform directory. Change-Id: Icf8904db3ab9e3c85df6e780d5546d9988cb9076 Signed-off-by: John Grossman <johngro@google.com>
* Fix gapless for deep buffersMarco Nelissen2012-06-111-0/+1
| | | | | | | Forward current flags to next output. b/6645676 Change-Id: I584f7a67472d99cbd6bc38f3fe84763331d115d1
* Fix gapless playbackMarco Nelissen2012-06-111-38/+47
| | | | | | | | | | | | On some devices the actual framecount per buffer of an AudioTrack will be different than what was requested, which prevented the track from being reused. Now we create a new AudioTrack with the requested parameters, and then compare it to the track we already have. If they match, we throw away the new track and reuse the existing one. b/6644559 Change-Id: Id3e8c4460436f52e59b98ecaeb01c94f02877c1d
* Use new sd card mount point for dumpsysMarco Nelissen2012-05-071-2/+2
| | | | | | b/6455962 Change-Id: I5c9f8c16c50587b25cafab03c48662e63855868e
* Add support for deep audio buffersEric Laurent2012-04-201-6/+13
| | | | | | | | | | Allow AudioSink to use deep audio buffering when the source is audio only and its duration is more than a certain threshold. This helps improve battery life but implies higher audio latency. Change-Id: Ie79915b61c370292f05aabda9779356570e03cbb