2133 Commits

Author SHA1 Message Date
Andreas Huber
0dc6403f3c Just in case we're behind a NAT router/firewall, attempt to poke holes into it for future incoming RTP/RTCP packets to pass through.
Change-Id: Idd47968d4027f357222f19f15eecfd70fdec3282
related-to-bug: 3073813
2010-10-11 11:30:30 -07:00
Andreas Huber
0c46b69f61 RTSP seeking is now asynchronous, MediaPlayer is not notified that the seek is complete until it actually is. Ignore seek requests on live streams.
Change-Id: Ie61230cd60dd6c682baf72529100369ad6291189
related-to-bug: 3073955
2010-10-08 15:25:19 -07:00
Andreas Huber
38285db197 Refactor some more h.264 utility code out into avc_utils. Work around a hardware decoder issue by making sure the first access unit submitted to a decoder at startup or after seek is an IDR.
Change-Id: I61936601e55df7e4c23a8c13087579a4f85bd6e6
2010-10-08 12:06:27 -07:00
Andreas Huber
f72dd0190e Merge "Disable 10secs forward/backward seeking for rtsp as seek is a very expensive operation there. Decouple the 10sec forward/backward button functionality from seekbar functionality." into gingerbread 2010-10-08 11:16:07 -07:00
Andreas Huber
b9bf545774 Merge "Respect the cropping rectangle when extracting the video dimensions from the sequence parameter set of H.264 streams." into gingerbread 2010-10-08 10:59:52 -07:00
Andreas Huber
6934207ac3 Respect the cropping rectangle when extracting the video dimensions from the sequence parameter set of H.264 streams.
Change-Id: Id7f21d5ab8533b4e17ceaa8619a39c27f0306150
2010-10-08 10:38:39 -07:00
Andreas Huber
10b9b3f3fe Disable 10secs forward/backward seeking for rtsp as seek is a very expensive operation there. Decouple the 10sec forward/backward button functionality from seekbar functionality.
Change-Id: I016e79b688774f8ee91ac53216197b5fb9cb41b2
related-to-bug: 3073955
2010-10-08 10:16:24 -07:00
James Dong
6dcdfdb42a Merge "Name the writer threads" into gingerbread 2010-10-08 10:06:22 -07:00
Andreas Huber
c5912acc04 Merge "Disable the access unit timeout temporarily while a seek operation is in progress." into gingerbread 2010-10-08 10:01:37 -07:00
Andreas Huber
e51e80990e Disable the access unit timeout temporarily while a seek operation is in progress.
Change-Id: I116cb76342aae4168f34ebae49ecb2301702a0ea
related-to-bug: 3073955
2010-10-08 09:04:25 -07:00
Eric Laurent
b37fcbfd7f Merge "Added getter for session Id to AudioSink" into gingerbread 2010-10-08 08:28:08 -07:00
James Dong
c67acb2b28 Name the writer threads
Change-Id: I51461c3800ac5850e21ff398e80eb20b562264b3
2010-10-07 20:20:59 -07:00
Eric Laurent
b3bdf3f008 Added getter for session Id to AudioSink
Added a method to expose the audio session id at AudioSink interface
so that the AudioPlayer in stagefright can retrieve it.

Also:
- Fixed audio effect send level not being initialized in mediaplayer.
- Fixed compilation error when LOGV is enabled in mediaplayer JNI

Change-Id: I4bb55454fd63d646e0e677692d737c4843fb05fb
2010-10-07 18:23:03 -07:00
Andreas Huber
3418835893 Increase scratch buffers sizes in mp3 software decoder, this integrates a PV master/opensource patch.
Change-Id: I5a637f1b380e44c94040ec507843d58a1f5a9b61
related-to-bug: 3065605
2010-10-07 16:52:42 -07:00
Andreas Huber
4c19bf9833 Work to support switching transport streams mid-stream and signalling discontinuities to the decoder.
Change-Id: I7150e5e7342e1117c524856b204aadcb763e06ed
related-to-bug: 2368598
2010-10-07 11:41:43 -07:00
Andreas Huber
1e19416383 On this particular device the hardware video decoder spits out buffers that don't actually contain our video data, so we cannot use them to restore the video frame after suspend/resume.
Change-Id: I1b8fe68c1766299844fe84ebbff49cb8b3e4cc7c
related-to-bug: 3070094
2010-10-07 09:19:25 -07:00
Andreas Huber
c743f4506f Make sure to call AudioTrack::stop() instead of AudioTrack::pause() after submitting all samples to AudioTrack to make sure those remaining samples are actually played out.
Change-Id: Id574a0203efcb5e565f1b0fe77869fc33b9a9d56
2010-10-05 13:53:39 -07:00
Jeff Brown
79a3981e38 Fix Looper leaks in MediaRecorderStressTest.
The test was failing periodically due to too many files being open.
This change attempts to resolve the problem on the theory that
signaling pipe file descriptors are being leaked due to the large
number of Looper instances created during the test run.

However, it's still possible there are other leaks elsewhere.

Change-Id: I71f9f12d21605c47c9217c72c51e6c768142ce10
2010-10-04 21:01:29 -07:00
James Dong
6a9e39ac55 Fixed an issue where the reserved free space in the file writer was larger than intended
The problem was that even though user does not explicitly request the max file size
limit via MediaRecorder.setMaxFileSize(), the file writer sets an implicit file
size limit if 32-bit file offset is used on user's behalf. The reserved free space
is estimated based on the file size, if the file size limit is set by the user.

The fix is to add an extra bool to tell the difference between an
explit requested file size and an implicit file limit and use that
to set the estimated moov box size accordingly.

Change-Id: I731aca6c7833aa764ed7b905edb77721577471b3
2010-10-04 16:54:59 -07:00
James Dong
b99f0c7eae Merge "Resilent media time stamp adjustment" into gingerbread 2010-10-04 15:35:40 -07:00
James Dong
acee8e7131 Resilent media time stamp adjustment
Change-Id: I13ab87c05f26bb11a3cc9bf8559f98e6ea0752db
2010-10-04 15:11:19 -07:00
Andreas Huber
05f6787b88 Make sure to finish the preparation phase even EOS occurs before we consider the cache to be completely filled up.
Change-Id: I29143e357fb6ea7b860636100e010f2ea7436798
related-to-bug: 3037389
2010-10-04 11:36:39 -07:00
Andreas Huber
1913c1aeab Don't retrieve metadata unless necessary for ogg-vorbis ringtone auto-looping.
Change-Id: Iaf5880bb3376f9cbf22aefe198878eaf6f3f08c7
related-to-bug: 3037389
2010-10-04 11:09:31 -07:00
James Dong
6c609b6a60 Merge "Turn off media time adjustment by default" into gingerbread 2010-10-01 17:27:51 -07:00
James Dong
9160e4aa2a Turn off media time adjustment by default
Change-Id: I1f8021d605d0fd896e0639607a84e3f7c459612e
2010-10-01 17:14:23 -07:00
Andreas Huber
e619a9da44 Merge "Start playing live streams from the start, no the middle..." into gingerbread 2010-10-01 11:35:17 -07:00
Andreas Huber
a424f7c628 Start playing live streams from the start, no the middle...
Change-Id: Ie01ba1250b51155cb1fb32fc3340189a16c01476
related-to-bug: 2368598
2010-10-01 11:28:44 -07:00
Andreas Huber
21d28a2a13 Remove development-only code.
Change-Id: Ic2ca0efb631eb779ca157fb01b02aa19a1222c06
related-to-bug: 2368598
2010-10-01 11:19:26 -07:00
Andreas Huber
b72c7e36a2 Squashed commit of the following:
commit 46744c7697f29aec71aed8de3c95ce035c284d97
Author: Andreas Huber <andih@google.com>
Date:   Thu Sep 30 16:44:57 2010 -0700

    better separation of access units

    Change-Id: I5a9e2138aed341f0bcf22cfe368a15ca5ea5a73c

commit d34952ac0feb1ae722ff65824d7353335502219b
Author: Andreas Huber <andih@google.com>
Date:   Thu Sep 30 15:35:01 2010 -0700

    Support for ES packets that do not start on PES packet boundaries.

    Change-Id: I2cf012833948eddfb20b16a1901206cf22ce71e4
    related-to-bug: 2368598

Change-Id: Ib9329bd6bb7149b5a6e2483788a96b1b158952fc
2010-10-01 10:51:41 -07:00
Eric Laurent
4712baab81 Issue 3032913: improve AudioTrack recovery time
This issue showed that when an AudioTrack underruns during a too long period
of time and is therefore disabled by audioflinger mixer, it takes an additional
delay of up to 3 seconds to recover.
This fix adds a simple mechanism to recover immediately when the client application
is ready to write data again in the AudioTrack buffer

Also throttle warnings on record overflows

Change-Id: I8b2c71578dd134b9e60a15ee4d91b70f3799cb3d
2010-09-30 17:21:23 -07:00
Chia-chi Yeh
d6877fa497 Merge "AMRNB: use Frame_Type_3GPP defined in frame_type_3gpp.h instead." into gingerbread 2010-09-28 21:11:27 -07:00
Chia-chi Yeh
081833d791 AMRNB: use Frame_Type_3GPP defined in frame_type_3gpp.h instead.
This allows gsmamr_enc.h and gsmamr_dec.h to be included in the same
file without conflict definition.

Change-Id: I1c8dac235c122735ba14a1af2fda48c0f8d9f87b
2010-09-29 12:00:18 +08:00
Eric Laurent
4fd3ecc1f0 Fix several audio effects problems.
Fixed the following issues in LVM effect bundle wrapper:
- memory leaks in EffectCreate() in case effect creation fails at various stages
- Added saturation when accumulating to output buffer
- Fixed problems with enabled effects count when an effect is released while enabled
- Do not allocate temporary buffer for accumulation each time process() is called

Fixed the following issues in effects framework (AudioFlinger)
- Release effect synchronously in the library when deleted from effect chain
- Do not call the effect process function if no tracks are present in the same
audio session

Change-Id: Ifbd80a163415cfb3c0a337c12082853ea45d9c91
2010-09-28 14:23:39 -07:00
Andreas Huber
88a995edcf Merge "Properly flush the AudioTrack/AudioSink on a seek request and make sure that both the mp3 decoder and aac software decoders start fresh after a seek without any dependency on previously decoded content." into gingerbread 2010-09-28 13:23:26 -07:00
Andreas Huber
ad3fcfe845 Properly flush the AudioTrack/AudioSink on a seek request and make sure that both the mp3 decoder and aac software decoders start fresh after a seek without any dependency on previously decoded content.
Change-Id: I4909fdf19518dbabb6c340e2a31b50dfe6c5b067
related-to-bug: 3029947
2010-09-28 13:13:38 -07:00
Andreas Huber
be04506195 Merge "Instead of constantly polling the AudioPlayer to see if it reached EOS or finished seeking, initiate the notification from the AudioPlayer when the event happens." into gingerbread 2010-09-28 12:02:35 -07:00
Andreas Huber
2b359ed5b5 Instead of constantly polling the AudioPlayer to see if it reached EOS or finished seeking, initiate the notification from the AudioPlayer when the event happens.
Change-Id: I43875b6adaf96d4e982ef3dfc3d6c8f7034ac51d
related-to-bug: 3036592
2010-09-28 11:56:39 -07:00
Andreas Huber
4769f57948 Merge "Vorbis files may have more samples encoded that should be used, i.e. we have to trim samples at the end of the stream. This is crucial for proper looping of some audio files." into gingerbread 2010-09-28 11:46:41 -07:00
Andreas Huber
3a9cc8cef4 Merge "Squashed commit of the following:" into gingerbread 2010-09-28 11:27:33 -07:00
Andreas Huber
38ae220bb7 Vorbis files may have more samples encoded that should be used, i.e. we have to trim samples at the end of the stream. This is crucial for proper looping of some audio files.
related-to-bug: 3036592
Change-Id: Ib142b171c829ed74156c0281d9d4543fcc96c802
2010-09-28 11:26:03 -07:00
Dave Sparks
124a346c7a Fix media.player dumpsys to output open/mapped files correctly. Bug 2866669.
The dump function whitelists several directories as filters to the output.
The mount point changed for SD card in Froyo, and we started filtering files
that were open on the SD card. This fix changes the filter for the SD card,
and adds the directory for data files as well.

Change-Id: I61b67c3d11d93dbd530e8b3566000e79bc037137
2010-09-27 17:04:05 -07:00
Andreas Huber
c751eccad3 Squashed commit of the following:
commit 29a4d3effb05a2e074cb0693316ab1977baeb0b6
Author: Andreas Huber <andih@google.com>
Date:   Mon Sep 27 12:01:32 2010 -0700

    Fully working implementation of MPEG2TSWriter (for AAC and AVC sources).

    Change-Id: I8a32a47565b647bf6c078c520e39565e08ea0d84

commit f4dec4c3899f3be393508e180d6c07e249d3335e
Author: Andreas Huber <andih@google.com>
Date:   Mon Sep 27 10:36:31 2010 -0700

    More reliable identification of MPEG2 transport streams. Don't keep scanning forever in case the stream does not have both audio and video tracks.

    Change-Id: Icc5b4e8be145b2805e8776559546a6818342aea7

commit 4fe3cc942f9b3d3cf54138b828c41214aa916dd2
Author: Andreas Huber <andih@google.com>
Date:   Mon Sep 27 08:23:39 2010 -0700

    test code

    Change-Id: I16560a17661407d06497f99ff88230724bb898af

commit 64d988b24f49f179a90fa677be11c823959e734b
Author: Andreas Huber <andih@google.com>
Date:   Thu Sep 23 14:42:52 2010 -0700

    First shot at supporting writing to an MPEG2 transport stream.

    Change-Id: Ie537939a99fa3ddc0c7661c47c18277584817c74

Change-Id: If78fd034af8f6e8ceac8dbeff96d5ecb3f6b96dc
2010-09-27 12:04:43 -07:00
James Dong
bf47092e1e Merge "Fix track duration calculation if the start timestamp is non-zero" into gingerbread 2010-09-27 10:08:52 -07:00
James Dong
dacebe62c6 Fix track duration calculation if the start timestamp is non-zero
o Updated the comments in the patch
o Added some additional checks on the timestamp

Change-Id: I8ad81eb6bfe358c1db5245cbb52efc905cdc234c
2010-09-27 10:02:15 -07:00
Andreas Huber
abaabb2c79 Merge "Support other kinds of HTTP redirect in NuHTTPDataSource" into gingerbread 2010-09-27 09:20:58 -07:00
Andreas Huber
ab2116c351 Support other kinds of HTTP redirect in NuHTTPDataSource
Change-Id: I3268a94cfb48cee9caa8914804d7907ff91d8a8e
related-to-bug: 3037686
2010-09-27 09:16:44 -07:00
Eric Laurent
4d3fb50782 Fix error in AudioEffect command status reporting.
AudioEffect::command() should not interpret the status
returned in pReplyData unless the command is ENABLE or
DISABLE.

Also fixed:
- bug in Visualizer::getWAveForm() status reporting.
- wrong initialization value for capture buffer in visualizer engine.

Change-Id: I60fb0011f9dba96ee74661dec1e8ef441edcaf35
2010-09-24 15:24:54 -07:00
Eric Laurent
2fb43ef8c0 fix problem in AudioEffect JNI setup.
There is a problem in AudioEffect and Visualizer native_setup() methods
that causes a crash in the application after the mediaserver process
has crashed and restarted.
The problem is that the native AudioEffect/Visualizer constructor is
called while the JNI is in critical state after calling
GetPrimitiveArrayCritical(). As the mediaserver process just restarted, the
first call to AudioSystem will cause the binder IAudioflinger interface to
be reteived and a callback send to AudioSystem JNI to clear the mediaserver
error state. This will call env->FindClass() and crash due to the JNI being
in critical state.

Also fixed a similar problem in AudioTrack JNI

Change-Id: I4a9026a3e26c7f78d9b4b4bec1aac90fbee2ab62
2010-09-24 13:18:14 -07:00
Andreas Huber
7b2ed5d7d6 Merge "Depending on our preference to write 2-byte or 4-byte NALs, patch the codec specific data 'avcC' accordingly." into gingerbread 2010-09-23 14:16:48 -07:00
Andreas Huber
e7635933b6 Depending on our preference to write 2-byte or 4-byte NALs, patch the codec specific data 'avcC' accordingly.
Change-Id: I1423923fafbcac6911218277e2bbfa068e49dcc6
2010-09-23 14:08:32 -07:00