6508 Commits

Author SHA1 Message Date
Ray Chen
872e7b7073 Fix b/5353417 Images downloaded from browser are showing incorrect details (Time is shown as dec 31 1969)
MediaScanner sets DATE_TAKEN with EXIF's datetime tag value. When this information is not available,
ExifInterface will simply return -1 which is accidentally used by MediaScanner.

Adding a check to avoid it so MediaProvider can calculate the date taken from last modified time instead.

Change-Id: I305b93a6c5602cbb9f97c3bbd384d358bda030c6
2012-03-27 23:37:41 +08:00
Jason Simmons
1f763f7c72 Do not call stop() on the MediaSource if it hasn't been started.
The MediaSource's destructor will take care of stopping the source.

Bug: 6232094
Change-Id: Iace6c11ded666e7ac7066aa9d493d1b644e4b92d
2012-03-26 19:12:37 -07:00
Colin Cross
0821013609 stagefright: compile without chromium for pdk builds
Change-Id: I7d85e04fb9f0caa8460a111ca6181bba6f6497ac
2012-03-26 12:24:52 -07:00
Andreas Huber
b3e2e24f78 Merge "Provisional support for secure decryption of media streams." 2012-03-26 11:43:06 -07:00
James Dong
61bf87428c Merge "Removed code related to simulator build in TimedEventQueue to get rid of the dependency on jni.h" 2012-03-26 11:41:21 -07:00
Eric Laurent
a561965842 Merge "fix visualizer inactivity detection" 2012-03-26 11:27:41 -07:00
Andreas Huber
9b8e496f4d Provisional support for secure decryption of media streams.
Change-Id: Ib3982a9c960bfdb0cb7e1b174440b141b194cfbe
2012-03-26 11:24:04 -07:00
Eric Laurent
383c4b3e63 Merge "reorganize SoundPool and JetPlayer code." 2012-03-26 11:23:49 -07:00
Colin Cross
56ca534e65 Merge changes Ib4d0e0c0,Iea8f4a23
* changes:
  libmedia: remove skia include
  stagefright: remove dependency on skia
2012-03-26 11:22:29 -07:00
James Dong
6e43c1b51b Removed code related to simulator build in TimedEventQueue to get rid of the dependency on jni.h
o related-to-bug: 6214141

Change-Id: I548d84a9888be884d3903dc9dea9235258792165
2012-03-26 11:18:35 -07:00
Eric Laurent
b460566388 fix visualizer inactivity detection
Current method implemented by the visualizer to detect that audioflinger has
stopped providing audio buffers does not work if the application
reads pcm captures too fast.

The fix consist in implementing a method based on real time measurement only.
One drawback is that the new method makes use of system calls that add some
overhead to the process and capture functions.

Change-Id: I53bd596b856f1cc7f0f47e08413af3335227100b
2012-03-26 11:05:25 -07:00
Eric Laurent
f5e1812549 reorganize SoundPool and JetPlayer code.
Reorganize SoundPool and JetPlayer code to be ready for the
creation of libmedia_native.

Split SoundPool between libsoundpool (JNI) and libmedia(sound pool implementation).
Remove dependencies on nativehelper/jni.h from JetPlayer.

Change-Id: I130c6014173b714329929dd82c5dfb70b757a610
2012-03-26 10:54:41 -07:00
Marco Nelissen
7061b5ffb3 Merge "Speed up playlist processing" 2012-03-26 07:36:41 -07:00
Glenn Kasten
39581f9248 Merge "IAudioFlinger::createTrack and openRecord flags" 2012-03-26 07:16:37 -07:00
Colin Cross
fe6ecdae58 libmedia: remove skia include
skia is not used in this file, remove the unnecessary include.

Change-Id: Ib4d0e0c0090c6b37ff8cfb816c0d8ba82a9638a4
2012-03-24 23:34:44 -07:00
James Dong
209cfdf4f6 Remove JNI in LOCAL_C_INCLUDE from non-JNI related Android.mk files.
o related-to-bug: 6214141

Change-Id: Ic88d1732b3e014af47532a0809e01f6086e8464d
2012-03-24 10:59:14 -07:00
James Dong
3b3a5b100b Merge "VideoEditorMain.h is moved to /frameworks/av/libvideoeditor and thus can be deleted." 2012-03-24 09:57:06 -07:00
James Dong
6e3bceef9c VideoEditorMain.h is moved to /frameworks/av/libvideoeditor and thus can be deleted.
o this is to resolve undesirable dependency of /frameworks/av/libvideoeditor on /frameworks/base/media/jni
o related-to-bug: 6214141

Change-Id: I62d08a7789ecb34d35cd22d2e6f68c3510c9bd90
2012-03-24 09:42:59 -07:00
Yu Shan Emily Lau
660b014daa Merge "Insert 2 seconds wait in each test case setup. This is the work around for the surface request race condition." 2012-03-23 18:53:18 -07:00
Yu Shan Emily Lau
003a756974 Insert 2 seconds wait in each test case setup.
This is the work around for the surface request race
condition.

Change-Id: Iaf8be12cfe4eb70d0a309ad875f38427181ac4b4
2012-03-23 17:58:49 -07:00
Marco Nelissen
c164faa831 Speed up playlist processing
The recent removal of the cache from MediaScanner (commit 58ef68905d67e356eb)
slowed down processing of playlists, in some cases significantly, due to every
line in a playlist prompting a query that looped over the entire audio table.

With this change, the query is only done once instead of for every line,
and the code starts iterating over the Cursor starting near the point of
the last match, instead of from the start. The latter is especially helpful
when the entire query result is too large to fit in a CursorWindow, since
it reduces the number of times that sqlite has to perform an offset query
under the hood to refil the window.

Change-Id: I9fea990b3b8c86571384de2122708fb7e809c355
2012-03-23 16:37:50 -07:00
Glenn Kasten
a945aad739 Merge "Revert "Split libmedia into libmedia and libmedia_native"" 2012-03-23 14:06:00 -07:00
Glenn Kasten
eb3be2d8c5 Revert "Split libmedia into libmedia and libmedia_native"
This reverts commit 0a3edd38df0743dcc7091bb7ebf29e7e7dadc7cb
2012-03-23 14:05:52 -07:00
John Grossman
0f6cb45002 LibAAH_RTP: Release TX Group on error.
Immedately release any TX group a player is holding upon entering the
error state.  Once in the error state, the only way out for a media
player it to be completely reset (destroying the player at the
tx_player level of things).  There is really no point in holding on to
a tx group once the player is in the error state.

Change-Id: If5442a32e012b5596789078b0790ed73fa842629
2012-03-23 11:24:32 -07:00
John Grossman
2b16bf6bdb LibAAH_RTP: Fix handling of PCM format changes.
When an audio decoder signals a format change, we were destroying our
renderer so that a new one could be created with the new format, but
we were not updating our internal format state variables with the new
format information.

This fixes issues with AAC audio with SBR extensions; in particular
content coming from Pandora.  Pandora audio is currently being
delivered as AAC-LC decoding to 22.05 KHz, but with an SBR layer which
gives 44.1 KHz.  Whether or not you are going to get 22.05 or 44.1
depends on if your decoder supports SBR ("High Efficiency" profile).
Stagefright does not parse the extension sample rate present in the
ESDS; instead it reports the sample rate of the base stream (22050 in
this case).  Its only when the decoder decides it can handle SBR that
you get a chance to discover that the content is actually 44.1,
information it delivers via a format change status code during read.

Signed-off-by: John Grossman <johngro@google.com>
Change-Id: I78fb89b4356004d7834629ccc82ca99c4cc7954a
2012-03-23 11:00:38 -07:00
Andreas Huber
6f64c90c84 Fix the file mimetype reported by the mpeg4 extractor.
Change-Id: I72474c17757dba5867f55b0e99e76e9e4e32ce7b
related-to-bug: 6217289
2012-03-23 08:39:04 -07:00
James Dong
798cda73e1 Change Android.mk file to use the new location after /frameworks/media/libvideoeditor source files are moved
o related-to-bug: 6214141

Change-Id: Ic9f07a8558e944237ccaba4f756fcab59f84e78f
2012-03-22 19:11:43 -07:00
Jason Noguchi
41d88d5f58 Adding camera zoom test to mediaframework stress suite.
Change-Id: I3ee72156f42cf189ff1d0bd469f83b938a6b87ff
2012-03-22 17:52:03 -07:00
Lei Zhang
6c798970cc Add batch volume adjust support to adjustMasterVolume() in AudioManager and
AudioService.

Change-Id: I09b1dfc93f14ca836e1ba2a400c00caed01fd541
2012-03-22 15:09:18 -07:00
RoboErik
24b082f87e Fix Audio ramping code
The audio ramping was being ignored and we were always adjusting
by the same amount.

Change-Id: Id4a6587fd488132816ae26776c0f798782470b1d
2012-03-22 15:09:12 -07:00
Andreas Huber
4355b001cb Merge "Use NuPlayer for media playback everywhere" 2012-03-22 14:00:53 -07:00
Andreas Huber
8686938aa5 Use NuPlayer for media playback everywhere
if media.stagefright.use-nuplayer is set to true.

Change-Id: Ibb217e7d7d5195b7feeea557554fe78e1585744c
2012-03-22 13:18:08 -07:00
John Grossman
6becc5a811 LibAAH_RTP: Fix an issue which crept in during code review.
Fix a mistake which came in as part of a merge conflict resolution
during code review of the recent unicast mode refactor of LibAAH_RTP.
Nop packet which were supposed to carry TS transformations for the
pause state accidentally got flagged as Flush operations.  The flush
packet successfully carried the TS transformation, but also had the
undesired side effect of constantly flushing the stream.

Change-Id: I4c6aa0043fc274a1d7e880ed1d19cf277f22194b
Signed-off-by: John Grossman <johngro@google.com>
2012-03-22 11:30:09 -07:00
Glenn Kasten
bf30911bf1 Merge "Remove enforceFrameCount" 2012-03-22 11:06:49 -07:00
Marco Nelissen
da9deca7ba Support gapless playback for mp3 and m4a
Gapless playback for appropriately tagged mp3 and m4a files.
Currently this is implemented in OMXCodec, which most players
use, but should be easy to support in other players as well by
using the SkipCutBuffer utility class.

Change-Id: I748c669adc1cfbe5ee9a7dea2fad945d48882551
2012-03-22 10:06:03 -07:00
Glenn Kasten
222dfc784e Merge "Split libmedia into libmedia and libmedia_native" 2012-03-22 07:14:27 -07:00
Glenn Kasten
0a3edd38df Split libmedia into libmedia and libmedia_native
This is still in the old location

Change-Id: Ic1be549b5b607cfd519cb4cecc581624510a4ee1
2012-03-21 15:45:29 -07:00
Glenn Kasten
2333a27ee5 Remove enforceFrameCount
It was only used to decide whether to issue a warning.
The warning was issued the first time track was created but
not at re-creation.  Now it is a verbose message every time,
not a warning since it happens all the time with key clicks on A2DP.

Change-Id: I9d39f53c0a7eb84b666e55b1b76ff830cf8f37ba
2012-03-21 15:41:02 -07:00
Marco Nelissen
3e6792232a Merge "Add MetaData::dumpToLog" 2012-03-21 15:12:44 -07:00
Marco Nelissen
d0a524fb59 Add MetaData::dumpToLog
Utility method for dumping the content of a MetaData object to the log.

Change-Id: I2d91b991e1d9fed2215e8995a73c2b1854205074
2012-03-21 15:00:27 -07:00
John Grossman
092bae63f1 LibAAH_RTP: Properly handle EOS conditions.
EOS was being treated as a flush operation which was causing problems.
In particular, the transmitter was delcaring that playback was
complete early (by the clock lead time of the system, which was 1
second in this case).  Also, the receiver was treating the EOS message
just like the flush message, immediately destroying the substreams
associated with the program without letting them play out first.

Change the transmitter to send the EOS message like it always does,
but have it wait until the media time of the last sample has arrived
before reporting playback complete to the app level of things.

On the receiver side of things, don't treat the EOS message like the
flush message.  Instead, have the EOS message simply put the substream
into EOS mode, allowing it to signal EOS to its decoder and shut off
the isAboutToUnderflow hack.

Change-Id: Ibe3ac01044373f83edb7a5f4b70478bd78c16d11
2012-03-21 14:01:47 -07:00
John Grossman
fa9ea48ddf LibAAH_RTP: Get rid of PipeEvent
Bionic/Android support eventfd, so there is really no reason to have
PipeEvent around any more.  This change gets rid of it in LibAAH_RTP
and replaces it with eventfds.

Change-Id: I841fcb71bf5015d521d7517c69f44eac0ea92278
Signed-off-by: John Grossman <johngro@google.com>
2012-03-21 12:12:31 -07:00
John Grossman
2921612dc8 LibAAH_RTP: Add unicast mode support to the RXPlayer
Add support for unicast mode to the AAH RXPlayer.  At the API level,
things should be pretty simple.  To use unicast mode, instead of
passing the multicast address and port in the data source URL, just
pass the unicast address and port of the transmitters command and
control port.  For example, instead of

aahRX://224.128.60.5:8867

one might instead pass

aahRX://192.168.63.5:55476

Change-Id: I7b40716983d7a91def86dcf40f093dda4255aae3
Signed-off-by: John Grossman <johngro@google.com>
2012-03-21 12:12:28 -07:00
John Grossman
06938878d3 LibAAH_RTP: Fix a stuttering audio bug.
Fix a bug discovered while working on adding unicast mode to the TX/RX
players.  Also some general cleanup/consolidation regarding timeout
code.

The bug went like this.  When a TX player had hit EOS, it would send
an EOS command payload to its receivers.  Later, when application
level code shutdown and cleaned up the player, it would send another.
In situations where there is massive packet loss, there is a chance
that not only did both of the EOS packets get dropped, but that they
never got filled in by the retry algorithm because the receiver gave
up on the RTP gap due to an aboutToUnderflow situation in at least one
of its active substreams.

When this happens, there are two major problems.  First, all of the
substreams associated with the TX player which has now gone away have
become effectively leaked.  They will only get cleaned up if the
entire RTP stream (the TX Group) goes away for 10 seconds or more, or
when the RX Player itself is reset by application level code or a
fatal error.  These substreams are holding decoder and renderer
resources which are probably in very short supply, which is a Bad
Thing.

Second, there is now at least one substream in the RX player which is
never going to receive another payload (its TX player source is gone),
but is still considered to be active by the rx player.  Assuming that
this substream's program was in the play state when the track ended,
there is now at least one substream which is always
"aboutToUnderflow".  From here on out, when the retry algorithm is
attempting to decide whether or not it has the time to attempt to fill
in a gap in the muxed RTP sequence, it always decides that it does not
have the time because of the orphaned substream which is stuck in its
about to underflow state.  This effectively means that the retry
algorithm is completely shut off until the rx player gets reset
somehow (something which does not happen during normal operation).
Since the environment had to be extremely lossy to trigger this chain
of events in the first place, and its probably no better now, your
playback is just going to be chock full of gaps which produces
horrible stuttering in the presentation stage of the system.

Two new failsafes have been introduced to keep the double EOS drop
from causing this.  First, a timeout has been introduced on the
substream level, in addition to the already existing RTP level
timeout.  If a substream fails to receive an activity for 10 seconds
(same timeout as the master RTP timeout), it will be automatically
flushed and purged.

Second, the nature of the master RTP timeout on the transmitter side
has been changed.  Instead of just sending an empty NOP command packet
to indicate that the main RTP stream is still alive, the transmitter
now sends a new time of command packet; the Active Program Update
packet.  This packet contains a list of all the active program ID
attached to this TX group.  Upon receiving one of these APU packets,
RX players reset the inactivity timers for all substreams which are
members of the programs listed in the packet, but they also
immediately purge any substreams associated with programs not present
in the APU.

Between the two of these, no matter how nasty and selective the packet
smashing gremlins in your system happen to be, substreams will always
eventually clean up and avoid getting stuck in a perma-stutter
situation.

Also in this CL:
+ Extract some common utility code into a utils.cpp file so that it
  can be shared across the library.
+ Stop using custom timeout logic in the RXPlayer.  Instead, use the
  common Timeout helper class in utils.cpp.

Signed-off-by: John Grossman <johngro@google.com>
Change-Id: I350869942074f2cae020f719c2911d9092ba8055
2012-03-21 12:10:41 -07:00
John Grossman
42a6382f1e LibAAH_RTP: Refactor TXGroup code, add unicast mode.
Significantly refactor the TXGroup code to allow transmit groups to
operate in a unicast fanout mode in addition to the traditional pure
multicast mode.  Important changes include...

+ Each transmit group active in the system now has its own socket to
  send and receive traffic on.  In the past, this socket was used to
  listen for retry requests from clients.  Now it is also used to
  listen for group membership reports (IGMPv3 style) from unicast
  clients.  Having an individual socket per transmit group allows
  unicast clients to join the group needing only the IP address and
  port of the transmitters socket, and not needing any additional
  "group id" to be sent to the client beforehand.
+ Setup for the transmitter is now slightly different.  As before, to
  setup for multicast mode, a user can call setRetransmitEndpoint
  passing an IPv4 multicast address and specific port to transmit to.
  It used to also be the case that a user could pass a specific
  unicast address and port to transmit to as well.  This is no longer
  allowed.  Instead, to operate in unicast mode, a user passes 0.0.0.0
  (IPADDR_ANY) as the IP address.  In addition, they need to pass
  either 0 for a port to create a new unicast mode TX group, or they
  need to pass a specific port to cause the player to attempt to use
  an existing unicast mode TX group.  The specific port should be the
  command and control port of the TX group which was bound to when the
  group was originally created.
+ A magic invoke was added to allow clients to fetch the command and
  control port on which a TX Player's TX Group is listening.

The API described above is most likely temporary and should eventually
be replaced with one where TX groups are formal top level objects with
their own independent interface and life-cycle management.

Signed-off-by: John Grossman <johngro@google.com>
Change-Id: Ib4e9737c10660d36c50f1825c9824fff5390b1c7
2012-03-21 12:02:37 -07:00
Marco Nelissen
ceb0909bc2 Merge "Parse gapless info from mp4 files" 2012-03-21 10:16:55 -07:00
John Grossman
79314de091 LibAAH_RTP: Change names to prepare for refactor.
Rename AAH_TXSender to AAH_TXGroup in preparation for refactoring to
support unicast retransmission.

Signed-off-by: John Grossman <johngro@google.com>
Change-Id: I3984db27d1c61c6155d5d7cb9c38eead421b9249
2012-03-21 09:52:04 -07:00
Marco Nelissen
eb473f3627 Parse gapless info from mp4 files
Change-Id: I4c83d4e12e996dc29708268e68a4bb74b368c6f3
2012-03-21 09:50:53 -07:00
Glenn Kasten
652e18d896 Merge "Update comments" 2012-03-21 07:24:21 -07:00
Glenn Kasten
32d72b2f53 Merge "Whitespace" 2012-03-21 07:22:40 -07:00