6332 Commits

Author SHA1 Message Date
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
James Dong
abcc868f3a Merge "Handling end times of subtitles." 2012-03-20 18:53:29 -07:00
Insun Kang
56aeeb8d7a Handling end times of subtitles.
Change-Id: Ic19ec8980d0a2bf9f265d375cd56e638a2460af8
2012-03-21 10:44:04 +09:00
Marco Nelissen
dd5bd2981d Merge "Move COM tag parsing to constructor" 2012-03-20 10:08:52 -07:00
Marco Nelissen
7306a388cb Move COM tag parsing to constructor
Change-Id: Icfcf05655ca98ccccad4f94834770c2f4098a764
2012-03-20 09:48:02 -07:00
Marco Nelissen
54fa725483 Merge "Parse mp3 encoder padding/delay" 2012-03-20 09:15:05 -07:00
Marco Nelissen
2ed77701f9 Parse mp3 encoder padding/delay
Get the mp3 encoder padding and delay from a XING frame or iTunSMPB tag.

Change-Id: Icde598c8857d7e7c187a718f478ee9799d6a1b8a
2012-03-20 08:46:11 -07:00
Wu-cheng Li
485932f6af Merge "Do not set camera preview display if the surface is null." 2012-03-19 19:25:56 -07:00
Glenn Kasten
f743e1f6ab Whitespace
Fix indentation, and add blank lines in key places for clarity

Change-Id: I57a0a8142394f83203161aa9b8aa9276abf3ed7c
2012-03-19 17:53:33 -07:00
Glenn Kasten
4d3f82e8d9 Merge "Add libmedia_native" 2012-03-19 16:21:04 -07:00
Glenn Kasten
76b6c0c1f5 Update comments
Change-Id: I327663a020670d0a72ff57bd0b682e2ce0528650
2012-03-19 14:12:01 -07:00
Glenn Kasten
84569cc4e1 IAudioFlinger::createTrack and openRecord flags
createTrack and openRecord don't need the "old" flags parameter,
which was either audio_policy_output_t or audio_in_acoustics_t
shifted left by 16 bits.  But they do need "new" flags, which
are defined by the application use case.  Initially, the only
application use case flag is timed output, but others are planned.

For output, the audio_policy_output_t flags are passed to
AudioSystem::getOutput, which returns an audio_io_handle_t, and that
handle is then passed to createTrack. So createTrack doesn't need the
old flags parameter.

For input, the audio_in_acoustics_t flags are passed to
AudioSystem::getInput, which returns an audio_io_handle_t, and that
handle is then passed to openRecord. So openRecord doesn't need the
old flags parameter.

Change-Id: I18a9870911846cca69d420c19fe6a9face2fe8c4
2012-03-19 09:04:23 -07:00
Glenn Kasten
f6b8f7b34f Merge "audio_channel_in/out_mask_from_count" 2012-03-19 07:31:58 -07:00
Wu-cheng Li
c59d1a8f0c Do not set camera preview display if the surface is null.
MediaRecorder.setPreviewDisplay() is not required if applications
use MediaRecorder.setCamera(). Besides, this causes a problem when
apps use Camera.setPreviewTexture. Camera service thinks the
surface texture from Camera.setPreviewTexture and the surface from
MediaRecorder.setPreviewDisplay are different.

bug:5988937

Change-Id: Ia345705b6679ef349db6e354feaa3cc0fe8bcd8c
2012-03-19 13:54:15 +08:00
Eric Laurent
eaa08d3515 am 2a0d685e: Merge "MediaPlayerService: fix AudioSink latency" into ics-mr1
* commit '2a0d685ed62ff7a5e5a40be0748860c092165984':
  MediaPlayerService: fix AudioSink latency
2012-03-16 17:26:24 -07:00
Eric Laurent
b388138ff2 resolved conflicts for merge of 3fe7ee65 to ics-mr1-plus-aosp
Change-Id: Ia7e1cd869779e9f512e840b768f5b43992c8a122
2012-03-16 17:19:25 -07:00
Eric Laurent
c182e36c8c am 2a0d685e: Merge "MediaPlayerService: fix AudioSink latency" into ics-mr1
* commit '2a0d685ed62ff7a5e5a40be0748860c092165984':
  MediaPlayerService: fix AudioSink latency
2012-03-16 15:01:44 -07:00
Eric Laurent
0615baffd3 am 3fe7ee65: Merge "AudioTrack: relax check on minimum buffer size" into ics-mr1
* commit '3fe7ee651db0aae9485ead227c89db1e24b9e245':
  AudioTrack: relax check on minimum buffer size
2012-03-16 15:01:42 -07:00
Andreas Huber
4108fbc299 Merge "ACodec is a little more aggressive in its error checking now." 2012-03-16 13:15:53 -07:00
Eric Laurent
dc63f3fe40 MediaPlayerService: fix AudioSink latency
The AudioSink latency is currently cached when the associated AudioTrack
is created. However, the AudioTrack latency can change if the AudioTrack is moved
from one output stream to another.
The AudioPlayer must also periodically update its view of the latency
as it is needed to compensate the real audio time used for A/V sync.

This fixes an A/V sync problem seen when switching A2DP on and off while
playing a video.

Change-Id: I28b24049ca114e1af3e24791dcc900f463536ba4

Conflicts:

	media/libmediaplayerservice/MediaPlayerService.cpp
2012-03-16 12:25:31 -07:00
Eric Laurent
0df689495a AudioTrack: relax check on minimum buffer size
Current AudioTrack implementation enforces that the requested audio
buffer size is at least corresponding the audio latency.
This requirement is too strong and leads to problems with current
stagefright and AudioSink implementations when playing over output
streams with long latency.

Ultimately, the AudioSink design should be changed to specify a minimum
buffer size in time or frames units but not in buffer count units.

Change-Id: I8ba603956f92ac49143a8249572665aa548f2f0f

Conflicts:

	media/libmedia/AudioTrack.cpp
2012-03-16 12:22:07 -07:00
Andreas Huber
ad3e7e2233 ACodec is a little more aggressive in its error checking now.
Update components to do the right thing.

Change-Id: Ibfbad3f53effc16368cca4a0e978d01d54d08a1d
2012-03-16 12:00:18 -07:00
Glenn Kasten
ae75f994cc Add libmedia_native
Change-Id: Ib8cff8abd73723b793f08da99ad59549f219e0e7
2012-03-16 11:51:30 -07:00
Andreas Huber
996598bf30 Merge "Remove obsolete software codec header files and amr encoders." 2012-03-16 11:38:38 -07:00
Andreas Huber
949a0640d4 Remove obsolete software codec header files and amr encoders.
Change-Id: Ifbdf252ee312c9cb5ab29498f1e06dae8f23faf7
2012-03-16 11:01:11 -07:00
Marco Nelissen
2833eaf03a Merge "Skip XING/VBRI frame when decoding" 2012-03-16 10:11:13 -07:00