OSDN Git Service

android-x86/frameworks-av.git
12 years agoImplementation of a java media codec interface and associated tools.
Andreas Huber [Tue, 21 Feb 2012 19:47:18 +0000 (11:47 -0800)]
Implementation of a java media codec interface and associated tools.

Change-Id: I13e54062d4de584355c5d82bb027a68aeaf2923b

12 years agoMerge "Limit the amount of audio record data in each buffer"
James Dong [Tue, 21 Feb 2012 19:10:35 +0000 (11:10 -0800)]
Merge "Limit the amount of audio record data in each buffer"

12 years agoUpdate stagefright makefile after dropping support for JSC
Steve Block [Fri, 17 Feb 2012 17:45:42 +0000 (17:45 +0000)]
Update stagefright makefile after dropping support for JSC

Bug: 5495373
Change-Id: Ibb81196edd3a6eaa4999cf0e30a78368afb66360

12 years agoRemove bit fields to improve performance
Glenn Kasten [Fri, 27 Jan 2012 23:26:23 +0000 (15:26 -0800)]
Remove bit fields to improve performance

uint16_t enabled is (mostly) changed to bool in a separate CL

Change-Id: Ied9f8c034b2479cee9a8778cee7b8ff92ae75b7b

12 years agoMerge "Simplify code"
Glenn Kasten [Fri, 17 Feb 2012 17:40:43 +0000 (09:40 -0800)]
Merge "Simplify code"

12 years agoSimplify code
Glenn Kasten [Thu, 26 Jan 2012 18:53:32 +0000 (10:53 -0800)]
Simplify code

Use DefaultKeyedVector::valueFor to avoid extra test
Make local variables as local as possible
No double parentheses
No typedef for single use
No parentheses around indirect function call
No AudioFlinger:: prefix when not needed
Remove unnecessary casts
Remove block with only one line

Saves 128 bytes

Change-Id: I3a87430eeb01b81e7b81a1c38f6fdd3274ec48f3

12 years agoMerge "Put a bandaid on a segfault in timed audio track handling."
Mike Lockwood [Fri, 17 Feb 2012 17:20:43 +0000 (09:20 -0800)]
Merge "Put a bandaid on a segfault in timed audio track handling."

12 years agoPut a bandaid on a segfault in timed audio track handling.
John Grossman [Mon, 13 Feb 2012 01:51:21 +0000 (17:51 -0800)]
Put a bandaid on a segfault in timed audio track handling.

Add a bandaid to prevent a segfault which can occur while handling
timed audio buffers.  There is a deeper problem which should
eventually be addressed, but for now this fix should prevent any
crashing.

The deeper problem is as follows.

When the AudioFlinger mixer gets data to mix from an AudioTrack, it
ends up getting a structure filled out which points into an IMemory
region owned by the AudioTrack.  Unfortunately, this structure is not
holding a refcount on the IMemory which it points into.  If the
IMemory refcount hits 0 and the chunk of RAM is retuned to the binder
heap it came from, there can still be a Buffer object being held by
the AudioFlinger mixer which points into the region of memory which
was retuned to the binfer heap.  If AF reads from this buffer, it
could read corrupt data (if the region of memory gets handed back out
to a writer), or it could segfault (if the heap has been freed and the
pages unmapped).  Similar problems could happen if AF attempts to
write to the buffer, heap corruption in one case, segfaulting in the
other.

In the past, this has not been an issue for AF, because tracks
allocate a single IMemory (which serves as a ring buffer) and the
IMemory lives for as long as the track lives.  As an artifact of the
way the code came out, the mixer cannot be holding a Buffer structure
pointing into the IMemory which used to be owned by a track if the
track no longer exists.  Tracks cannot come into or out of existence
during a mix operation, which is the only thing which makes this safe.

TimedTracks work differently, however.  Timed tracks each allocate a
small binder heap, and then hand out IMemory instances  broken out of
this heap.  The heap lives as long as the track, so the worst which
could happen here is that a TimedTrack's IMemory gets returned to the
heap while there is still a buffer structure in flight pointing into
the memory region, then the region gets handed out again and
overwritten by new data causing the mixer to mix the wrong audio.  The
timing to cause this to happen is very difficult to encounter, and you
to generate the timing conditions required, you need to be in a pretty
bad failure state where audio is already breaking up and skipping, so
its unlikely that anyone would notice (which is why I'm band-aiding
the segfault and letting the deeper issue slide for now).

In general, however, it might be a good idea to revisit this buffering
design.  On principal, if someone is going to hold pointers into a
refcounted object, they should be holding a ref on the object at the
same time.  Failure to do this will usually lead to a situation where
there are corruption or segfault issues, or to a system where the
refcounted object's lifetime must be implicitly managed very carefully
in ways which are usually non-obvious and are easy to break by new
engineers on a project.

Change-Id: Ib391075395ed0ef46a03c37aa38a82d09e88abeb

12 years agoFixed possible heap corruption in EffectDesc
Glenn Kasten [Thu, 2 Feb 2012 22:04:37 +0000 (14:04 -0800)]
Fixed possible heap corruption in EffectDesc

"EffectDesc *effect = new EffectDesc(*effects[i]);" was relying on the
default copy constructor for EffectDesc, but the default copy constructor
does a member-by-member copy.  This works OK for mUuid, but a member
copy of mName and mParams shares pointers.  This could result in heap
corruption later on due to a double free.  Changed to add an explicit
copy constructor that does a deep copy of both mName and mParams.

A malloc() and strdup() were being freed by delete, but the correct
matching API for these is free().  Fortunately our current memory runtime
implementation ignores the difference. Changed to use free().

EffectDesc and InputSourceDesc member fields were being torn down by
the code that does delete.  Changed to do the tear-down in ~EffectDesc()
and ~InputSourceDesc().

Added constructor EffectDesc() with name and UUID parameters, rather
than having caller fill in the object after construction.

Made ~EffectDesc() and ~InputSourceDesc() non-virtual to save memory,
since they have no subclasses.

Change-Id: Ibb5cc2e6760d72e0c4cf537068ac4432c717bafd

12 years agoUpintegreate AAH TX and RX players from ICS_AAH
John Grossman [Thu, 9 Feb 2012 23:09:05 +0000 (15:09 -0800)]
Upintegreate AAH TX and RX players from ICS_AAH

Upintegrate the android at home TX and RX players developed in the
ICS_AAH branch.

Change-Id: I8247d3702e30d8b0e215b31a92675d8ab28dccbb
Signed-off-by: John Grossman <johngro@google.com>
12 years agoFix a segfault in AudioFlinger.
John Grossman [Thu, 9 Feb 2012 19:28:36 +0000 (11:28 -0800)]
Fix a segfault in AudioFlinger.

Check the string returned by a HAL's implementation of get_parameters
for NULL before attempting to make use of it.  That way, we won't
bring down the mediaserver because of a poorly written HAL.

Change-Id: Ic99d7b004520d7d6347842a681c0595e889b68ea
Signed-off-by: John Grossman <johngro@google.com>
12 years agoEnhance Visualizer behavior in the case of mediaserver death.
John Grossman [Wed, 11 Jan 2012 20:23:42 +0000 (12:23 -0800)]
Enhance Visualizer behavior in the case of mediaserver death.

Bring the Visualizer class into line with the SDK documentation by
returning ERROR_DEAD_OBJECT instead of ERROR_INVALID_OPERATION when
the Visualizer loses its binder connection to the mediaserver because
of a mediaserver restart.

Also add a new callback interface to allow clients to be
asynchronously notified in the case of server death.  Right now, the
interface definition and the registration method are flagged as hidden
pending API council review/approval.

See http://b/issue?id=5717519 for details.

Change-Id: Ic15856f27ed5a950a583ac11ca81f79bd7e9b1a0
Signed-off-by: John Grossman <johngro@google.com>
12 years agoUpintegrate Audio Flinger changes from ICS_AAH
John Grossman [Thu, 9 Feb 2012 00:37:41 +0000 (16:37 -0800)]
Upintegrate Audio Flinger changes from ICS_AAH

Bring in changes to audio flinger made to support timed audio tracks
and HW master volume control.

Change-Id: Ide52d48809bdbed13acf35fd59b24637e35064ae
Signed-off-by: John Grossman <johngro@google.com>
12 years agoUpintegrate the common_time service from ics-aah.
Mike J. Chen [Mon, 15 Aug 2011 18:59:47 +0000 (11:59 -0700)]
Upintegrate the common_time service from ics-aah.

Move the common_time service developed in the ics-aah branch back into
master.

The common_time service is a small service build to synchronize an
arbitrary timeline amongst peers on a local sub-net.  While running
and configured, the service will elect a master from the set of
available devices within the subnet, define a relationship between the
common_time timeline the local time timeline (provided by the local
time HAL), and then attempt to maintain synchronization between common
and local time by controlling the frequency of the local time clock
via the HAL, or by disciplining local time in the digital domain if
the local time HAL implementation does not support HW slewing.

On its own, the native common time service will do nothing until it is
configured.  The CommonTimeManagementService (running out of the
system server process) is responsible for implementing policy
regarding configuration and operation of the common_time service and
will be added in a subsequent CL.

Change-Id: I71292f9b9b1797665865689c4572c9d3a0552f64
Signed-off-by: John Grossman <johngro@google.com>
12 years agoLimit the amount of audio record data in each buffer
James Dong [Tue, 14 Feb 2012 22:58:20 +0000 (14:58 -0800)]
Limit the amount of audio record data in each buffer

o The size of each input buffer should be less than or equal to kMaxBufferSize
o related-to-bug: 5977032

Change-Id: I04343169aac3df56694aad4ba7967ec45337ad7e

12 years agoMerge "Fix races related to volume and mute"
Glenn Kasten [Tue, 14 Feb 2012 17:44:47 +0000 (09:44 -0800)]
Merge "Fix races related to volume and mute"

12 years agoMerge "Update comments"
Glenn Kasten [Tue, 14 Feb 2012 17:42:32 +0000 (09:42 -0800)]
Merge "Update comments"

12 years agoUpdate comments
Glenn Kasten [Thu, 19 Jan 2012 16:59:58 +0000 (08:59 -0800)]
Update comments

We no longer put the filename at start of file.

Change-Id: Ic435b159a23105681e3d4a6cb1ac097bc853302e

12 years agoMerge "Remove dead code AudioTrack::getLoop"
Glenn Kasten [Tue, 14 Feb 2012 17:09:03 +0000 (09:09 -0800)]
Merge "Remove dead code AudioTrack::getLoop"

12 years agoUse size_t and ssize_t with Vector
Glenn Kasten [Wed, 8 Feb 2012 22:04:28 +0000 (14:04 -0800)]
Use size_t and ssize_t with Vector

Use size_t with size() and ssize_t with indexOfKey().  Exception:
use ssize_t for backwards loops, and indices that are overloaded as a
marker or error code.

Change-Id: Ibf2a360af4539b72b09c818dda22ea2a0de92431

12 years agoAudioRecord and AudioTrack client tid
Glenn Kasten [Thu, 2 Feb 2012 18:56:47 +0000 (10:56 -0800)]
AudioRecord and AudioTrack client tid

Inform AudioFlinger of the tid of the callback thread.

Change-Id: I670df92dd06749b057238b48ed1094b13aab720b

12 years agoPlayback rate on MediaPlayer
Jean-Michel Trivi [Thu, 2 Feb 2012 17:06:31 +0000 (09:06 -0800)]
Playback rate on MediaPlayer

Add support for modifying the playback rate of a MediaPlayer
 by altering the sample rate of its AudioTrack.
The playback rate is expressed in permille, where 1000 is the
 playback at normal speed.

Change-Id: I981d060ab32f7bae7a767e82c60c88ae635dceed

12 years agoMerge "Fix audio preprocessing library wrapper"
Eric Laurent [Mon, 13 Feb 2012 20:27:27 +0000 (12:27 -0800)]
Merge "Fix audio preprocessing library wrapper"

12 years agoFactor out and speed up permission-checking code
Glenn Kasten [Mon, 6 Feb 2012 02:09:08 +0000 (18:09 -0800)]
Factor out and speed up permission-checking code

Use the caching permission check for dump to save IPC.

Cache getpid() to save kernel call for other permission checks.

The C runtime library getpid() can't cache due to a fork
race condition, but we know that mediaserver doesn't fork.

Don't construct String16 on the stack.

Change-Id: I6be6161dae5155d39ba6ed6228e7683e67be34ed

12 years agoMerge "Change the signature of method addTextSource() in AwesomePlayer"
James Dong [Sat, 11 Feb 2012 01:57:16 +0000 (17:57 -0800)]
Merge "Change the signature of method addTextSource() in AwesomePlayer"

12 years agomAudioHwDevs and related cleanup
Glenn Kasten [Thu, 2 Feb 2012 22:05:20 +0000 (14:05 -0800)]
mAudioHwDevs and related cleanup

Inline AudioFlinger::initCheck and remove unnecessary lock.

Remove redundant check of mAudioHwDevs.size().

No need to lock mHardwareLock for each device separately
during initialization.

Use size_t not int to loop through Vector, since size() returns size_t.

Add missing hardware lock for get_mic_mute() and get_input_buffer_size().

Add comments.

Change-Id: Iafae78ef78bbf65f703d99fcc27c2f4ff221aedc

12 years agoMerge "Simplify ThreadBase::exit() aka requestExitAndWait"
Glenn Kasten [Fri, 10 Feb 2012 23:32:16 +0000 (15:32 -0800)]
Merge "Simplify ThreadBase::exit() aka requestExitAndWait"

12 years agoMerge "Disable HQ resamplers for now until qualified"
Glenn Kasten [Fri, 10 Feb 2012 23:31:54 +0000 (15:31 -0800)]
Merge "Disable HQ resamplers for now until qualified"

12 years agoMerge "Move header declarations around for clarity"
Glenn Kasten [Fri, 10 Feb 2012 23:31:07 +0000 (15:31 -0800)]
Merge "Move header declarations around for clarity"

12 years agoMerge "Camel case readability & private disconnect(bool)"
Glenn Kasten [Fri, 10 Feb 2012 23:30:15 +0000 (15:30 -0800)]
Merge "Camel case readability & private disconnect(bool)"

12 years agoMerge "Remove aliasing"
Glenn Kasten [Fri, 10 Feb 2012 23:29:35 +0000 (15:29 -0800)]
Merge "Remove aliasing"

12 years agoMerge "Use mul from audioutils"
Glenn Kasten [Fri, 10 Feb 2012 23:28:57 +0000 (15:28 -0800)]
Merge "Use mul from audioutils"

12 years agoMerge "Mark fields const if only set in constructor"
Glenn Kasten [Fri, 10 Feb 2012 23:28:45 +0000 (15:28 -0800)]
Merge "Mark fields const if only set in constructor"

12 years agoSimplify ThreadBase::exit() aka requestExitAndWait
Glenn Kasten [Fri, 6 Jan 2012 16:39:38 +0000 (08:39 -0800)]
Simplify ThreadBase::exit() aka requestExitAndWait

We can remove mExiting and use Thread::exitPending() instead.

The local sp<> on "this" in exit() is not needed, since the caller must
also hold an sp<> in order to be calling us. (Unless it was using a raw
pointer, but that would be dangerous for other reasons.)

Add comment explaining the mLock in exit().

Change-Id: I319e5107533a1a7cdbd13c292685f3e2be60f6c4

12 years agoMerge "Move away from MediaDebug and use ADebug instead"
James Dong [Fri, 10 Feb 2012 22:17:06 +0000 (14:17 -0800)]
Merge "Move away from MediaDebug and use ADebug instead"

12 years agoFollow raw pointer and sp<> conventions
Glenn Kasten [Thu, 9 Feb 2012 01:47:58 +0000 (17:47 -0800)]
Follow raw pointer and sp<> conventions

Unconditional delete for raw pointers.
Use "if (sp != 0)" not "if (sp.get() != 0)" or "if (sp != NULL)".
Use "if (raw != NULL)" not "if (raw)".

Change-Id: I531a8da7c37149261ed2f34b862ec4896a4b785b

12 years agoMerge "No newline or space at end of ALOG format string"
Glenn Kasten [Fri, 10 Feb 2012 21:36:24 +0000 (13:36 -0800)]
Merge "No newline or space at end of ALOG format string"

12 years agoMerge "Move declaration of stream_type_t up earlier"
Glenn Kasten [Fri, 10 Feb 2012 21:33:31 +0000 (13:33 -0800)]
Merge "Move declaration of stream_type_t up earlier"

12 years agoMerge "Fix typos in ALOG for pid vs tid"
Glenn Kasten [Fri, 10 Feb 2012 21:33:02 +0000 (13:33 -0800)]
Merge "Fix typos in ALOG for pid vs tid"

12 years agoMerge "Rename type() to streamType()"
Glenn Kasten [Fri, 10 Feb 2012 21:30:24 +0000 (13:30 -0800)]
Merge "Rename type() to streamType()"

12 years agoMove away from MediaDebug and use ADebug instead
James Dong [Tue, 7 Feb 2012 07:46:37 +0000 (23:46 -0800)]
Move away from MediaDebug and use ADebug instead

Change-Id: I963a3b6f79a7292891973cbeeaf3378b38629f08

12 years agoDisable HQ resamplers for now until qualified
Glenn Kasten [Thu, 2 Feb 2012 22:01:58 +0000 (14:01 -0800)]
Disable HQ resamplers for now until qualified

This saves about 6500 bytes.

Change-Id: I87102fe561c95c19c9e615dea3de914f96639257

12 years agoChange the signature of method addTextSource() in AwesomePlayer
James Dong [Fri, 10 Feb 2012 01:32:57 +0000 (17:32 -0800)]
Change the signature of method addTextSource() in AwesomePlayer

o avoid a unnecessary copy constructor call

Change-Id: Ib598bbe42d42a835549e2d29502c6f196f859874

12 years agoMove header declarations around for clarity
Glenn Kasten [Thu, 26 Jan 2012 17:48:03 +0000 (09:48 -0800)]
Move header declarations around for clarity

Put IAudioFlinger methods in binder opcode order.
Move hardware call state closer to where it is used.
getMode() and btNrecIsOff() are private.

Change-Id: Ie50340b396c39c763f2b155cbc08da8a0d0f2424

12 years agoMark fields const if only set in constructor
Glenn Kasten [Mon, 30 Jan 2012 17:26:17 +0000 (09:26 -0800)]
Mark fields const if only set in constructor

Change-Id: Iacd06bb9efaf708cf965033be1f2297b58f7f75c

12 years agoRemove aliasing
Glenn Kasten [Thu, 2 Feb 2012 22:09:43 +0000 (14:09 -0800)]
Remove aliasing

Code was aliasing mBuffer as buffer, but continuing to use both buffer
and mBuffer after that point.  This was at best misleading, and at worst
could confuse the compiler into generating bad code.  There was no
performance advantage to the alias, in fact removing it saves 16 bytes.

Change-Id: I55023ddba465d9be82f66745b088d18af658ac60

12 years agoCamel case readability & private disconnect(bool)
Glenn Kasten [Fri, 3 Feb 2012 18:32:24 +0000 (10:32 -0800)]
Camel case readability & private disconnect(bool)

Change-Id: If66516ed2703e048c5e6ccc6cd431446a024f4a1

12 years agoUse mul from audioutils
Glenn Kasten [Thu, 9 Feb 2012 16:22:46 +0000 (08:22 -0800)]
Use mul from audioutils

I verified that the disassembled output is identical.

Change-Id: I34a76f0842ebc4aef2c923e079e38d0bc1f98b5c

12 years agoFix typos in ALOG for pid vs tid
Glenn Kasten [Fri, 3 Feb 2012 19:10:00 +0000 (11:10 -0800)]
Fix typos in ALOG for pid vs tid

Change-Id: I6dc70f137d0ff8a86427ab8882a81886e1de0782

12 years agoFinish up B frame support in MPEG4Writer
James Dong [Thu, 9 Feb 2012 19:53:57 +0000 (11:53 -0800)]
Finish up B frame support in MPEG4Writer

o optimize to reduce the size of the size of the ctts box
o change the type for the time offset field in ctts table entry from int32_t to uint32_t according to the mp4 file spec
o also moved away from MediaDebug and used ADebug instead.

o related-to-bug: 4232183

Change-Id: I19364303728da64359c63169eec7487508c1d0f8

12 years agoExperiment with seeking to closest frame instead of closest syncframe
Andreas Huber [Thu, 9 Feb 2012 17:55:45 +0000 (09:55 -0800)]
Experiment with seeking to closest frame instead of closest syncframe

Also supports SEEK_CLOSEST mode in the Matroska/Webm extractor.

Change-Id: I257771648dfe41392a4cf8932f625489dcb9f234

12 years agoNo newline or space at end of ALOG format string
Glenn Kasten [Fri, 27 Jan 2012 23:24:38 +0000 (15:24 -0800)]
No newline or space at end of ALOG format string

Change-Id: I0bef580cbc818cb7c87aea23919d26f1446cec32

12 years agoFix races related to volume and mute
Glenn Kasten [Mon, 9 Jan 2012 17:40:36 +0000 (09:40 -0800)]
Fix races related to volume and mute

Fix race conditions when setting master volume, master mute, stream
volume, stream mute for a playback thread, and when reading stream
volume of a playback thread.  Lock order is AudioFlinger, then thread.

Rename streamVolumeInternal to streamVolume_l, comment, and use it to
implement streamVolume().

Code size reduction:
 - Remove dead code: AudioFlinger::PlaybackThread::masterVolume, masterMute, streamMute.
 - Change return type of non-binder methods that always succeed from status_t to void.
 - Remove virtual from volume and mute methods that don't need it.

This change saves 228 bytes but decreases performance of binder operations
due to the added locks.

Change-Id: Iac75abc1f54784873a667d1981b2e08f8f31e5c9

12 years agoRemove dead code AudioTrack::getLoop
Glenn Kasten [Wed, 8 Feb 2012 22:12:12 +0000 (14:12 -0800)]
Remove dead code AudioTrack::getLoop

Change-Id: I868329c52f31bc20125f068500d8f892b4ec9796

12 years agoMove declaration of stream_type_t up earlier
Glenn Kasten [Wed, 8 Feb 2012 20:36:25 +0000 (12:36 -0800)]
Move declaration of stream_type_t up earlier

stream_type_t is used by AudioFlinger class, so it should be declared there.
This way we don't have to peek into PlaybackThread to get the declaration.

Change-Id: Ie08bab1604699214d1e8df2d48d3fbfbbc436e96

12 years agoRename type() to streamType()
Glenn Kasten [Wed, 8 Feb 2012 20:35:35 +0000 (12:35 -0800)]
Rename type() to streamType()

This avoids possible confusion with thread's type().
Also remove redundant cast "(audio_stream_type_t)".

Change-Id: I320b9177b6c267a102d215f002228bcf988c437a

12 years agoMerge "Enable B frame support in MPEG4Writer"
James Dong [Wed, 8 Feb 2012 18:42:35 +0000 (10:42 -0800)]
Merge "Enable B frame support in MPEG4Writer"

12 years agoCombine duplicate code & document wp<> in mClients
Glenn Kasten [Wed, 25 Jan 2012 22:28:29 +0000 (14:28 -0800)]
Combine duplicate code & document wp<> in mClients

Change-Id: Iea8cfe8e57563337fb2484a1246ef79d6ad3db18

12 years agoUse audio_io_handle_t consistently instead of int
Glenn Kasten [Tue, 17 Jan 2012 19:09:42 +0000 (11:09 -0800)]
Use audio_io_handle_t consistently instead of int

Other:
 - add a comment to nextUniqueId
 - made ThreadBase::mId const, since it is only assigned in constructor.

Change-Id: I4e8b7bec4e45badcde6274d574b8a9aabd046837

12 years agoSimplify destructors
Glenn Kasten [Wed, 25 Jan 2012 23:27:15 +0000 (15:27 -0800)]
Simplify destructors

Remove explicit clear() when the order doesn't matter.

Change-Id: I5931bc7ef5f681c7ce329aa9ec0a6e46d34a56c5

12 years agoEffect UUID inputs passed by pointer are const
Glenn Kasten [Mon, 30 Jan 2012 15:40:52 +0000 (07:40 -0800)]
Effect UUID inputs passed by pointer are const

Change-Id: I1f5c338bcb7368e3dd8cd5f804b2e6d9fbe087f8

12 years agoMerge "Use pid_t not int"
Glenn Kasten [Wed, 8 Feb 2012 16:40:28 +0000 (08:40 -0800)]
Merge "Use pid_t not int"

12 years agoMerge "Don't double destruct audio_track_cblk_t"
Glenn Kasten [Wed, 8 Feb 2012 16:40:15 +0000 (08:40 -0800)]
Merge "Don't double destruct audio_track_cblk_t"

12 years agoMerge "AudioFlinger methods const and inline"
Glenn Kasten [Wed, 8 Feb 2012 16:39:39 +0000 (08:39 -0800)]
Merge "AudioFlinger methods const and inline"

12 years agoMerge "Remove dead mutex in AudioTrack/AudioRecord thread"
Glenn Kasten [Wed, 8 Feb 2012 16:34:33 +0000 (08:34 -0800)]
Merge "Remove dead mutex in AudioTrack/AudioRecord thread"

12 years agoMerge "Use virtual destructors"
Glenn Kasten [Wed, 8 Feb 2012 16:33:41 +0000 (08:33 -0800)]
Merge "Use virtual destructors"

12 years agoMerge "Improve performance for sp<> on stack"
Glenn Kasten [Wed, 8 Feb 2012 15:45:15 +0000 (07:45 -0800)]
Merge "Improve performance for sp<> on stack"

12 years agoMerge "AudioTrack declare more methods const"
Glenn Kasten [Wed, 8 Feb 2012 15:42:40 +0000 (07:42 -0800)]
Merge "AudioTrack declare more methods const"

12 years agoMerge "Use 0 not NULL for sp<> and wp<>"
Glenn Kasten [Wed, 8 Feb 2012 15:41:44 +0000 (07:41 -0800)]
Merge "Use 0 not NULL for sp<> and wp<>"

12 years agoMerge "Use bool instead of int"
Glenn Kasten [Wed, 8 Feb 2012 15:40:23 +0000 (07:40 -0800)]
Merge "Use bool instead of int"

12 years agoMerge "Declare more IAudioFlinger methods const"
Glenn Kasten [Wed, 8 Feb 2012 15:39:27 +0000 (07:39 -0800)]
Merge "Declare more IAudioFlinger methods const"

12 years agoMerge "Remove dead code"
Glenn Kasten [Wed, 8 Feb 2012 15:38:42 +0000 (07:38 -0800)]
Merge "Remove dead code"

12 years agoEnable B frame support in MPEG4Writer
James Dong [Tue, 7 Feb 2012 07:46:37 +0000 (23:46 -0800)]
Enable B frame support in MPEG4Writer

This patch allows us to automatically detect whether ctts box is needed in MPEG4Writer.
MPEG4Writer uses ctts version 0 (non-negative offset value) store the composition time
offset on a needed basis.

Currently, the size of the ctts box is not optimized. Optimization will be addressed
in a subsequent patch.

o also changed the private method retrieveDecodingTime(bool) in OMXCodec
  to getDecodingTime()

o related-to-bug: 4232183

Change-Id: Ic6dc7b25ecd258c2506ca4b9c25156e922456e51

12 years agoMerge "MatroskaExtractor: to support MPEG4 and MP3 codec."
Andreas Huber [Tue, 7 Feb 2012 18:43:08 +0000 (10:43 -0800)]
Merge "MatroskaExtractor: to support MPEG4 and MP3 codec."

12 years agoFix audio preprocessing library wrapper
Eric Laurent [Mon, 6 Feb 2012 22:28:54 +0000 (14:28 -0800)]
Fix audio preprocessing library wrapper

Fixed bug in EFFECT_CMD_GET_CONFIG command handler in
webRTC audio processing library wrapper.

Change-Id: I1d2cefa00930e549607af8dc2cf27555da8d313f

12 years agoDon't call virtual function in destructor of SurfaceMediaSource
James Dong [Sat, 4 Feb 2012 14:19:50 +0000 (06:19 -0800)]
Don't call virtual function in destructor of SurfaceMediaSource

Change-Id: I3cbc2b1222335b61c814b5cdcfaefa495148b0ec

12 years agoMerge "Don't call virtual functions in the destructor for audio and camera source...
James Dong [Sat, 4 Feb 2012 13:54:53 +0000 (05:54 -0800)]
Merge "Don't call virtual functions in the destructor for audio and camera source classes"

12 years agoDon't double destruct audio_track_cblk_t
Glenn Kasten [Fri, 3 Feb 2012 18:24:48 +0000 (10:24 -0800)]
Don't double destruct audio_track_cblk_t

Fortunately audio_track_cblk_t doesn't have a destructor, but for clarity
remove the double destruction.

Also add warning not to add any virtuals to audio_track_cblk_t.

Change-Id: I70ebe1a70460c7002145b2cdf10f9f137396e6f3

12 years agoUse pid_t not int
Glenn Kasten [Fri, 3 Feb 2012 19:10:26 +0000 (11:10 -0800)]
Use pid_t not int

Change-Id: Iad1c2fd4152e94080ad8c65c13ddf4519fc2ed27

12 years agoRemove dead code
Glenn Kasten [Thu, 26 Jan 2012 17:50:01 +0000 (09:50 -0800)]
Remove dead code

mFormat is unused in resampler
mClientTid is unused
local variable pid is unused in dump

Change-Id: Ib156e38029366620bfeff2a13e73471867155a5b

12 years agoAudioTrack declare more methods const
Glenn Kasten [Wed, 4 Jan 2012 20:41:44 +0000 (12:41 -0800)]
AudioTrack declare more methods const

Change-Id: I4999e984460893961d0d8092cff17f3cf07d7214

12 years agoDeclare more IAudioFlinger methods const
Glenn Kasten [Fri, 27 Jan 2012 00:25:10 +0000 (16:25 -0800)]
Declare more IAudioFlinger methods const

This is just documentation, as C++ method const-ness doesn't mean anything
for a binder API.  Instead, here const means "no side effects".

Change-Id: Iaa9cd2fe477db10ae9a40cac4f79f0faa9b4e5e6

12 years agoMerge "Don't call virtual functions in destructors for the writer classes"
James Dong [Fri, 3 Feb 2012 23:37:40 +0000 (15:37 -0800)]
Merge "Don't call virtual functions in destructors for the writer classes"

12 years agoUse bool instead of int
Glenn Kasten [Fri, 27 Jan 2012 20:33:54 +0000 (12:33 -0800)]
Use bool instead of int

The .h is not modified to avoid increasing data size.

Change-Id: Ide4a821a5b16424ffa03471dfff98dc3e9b5f751

12 years agoAudioFlinger methods const and inline
Glenn Kasten [Thu, 2 Feb 2012 22:06:11 +0000 (14:06 -0800)]
AudioFlinger methods const and inline

This saves 1063 bytes and probably improves performance.

Change-Id: I11cf0dfd925fbaec75e3d1b806852a538eae5518

12 years agoUse virtual destructors
Glenn Kasten [Mon, 30 Jan 2012 22:54:39 +0000 (14:54 -0800)]
Use virtual destructors

It turns out to be just a comment, as all except AudioMixer are RefBase.

There are only a few performance-sensitive cases where it's worth thinking
about whether you need a virtual destructor, and the headache usually
outweighs the benefit.

Change-Id: I716292f9556ec17c29ce8c76ac8ae602cb496533

12 years agoMerge "Keep AACEncoder around for a bit longer to have more time fix issues related...
James Dong [Fri, 3 Feb 2012 19:29:59 +0000 (11:29 -0800)]
Merge "Keep AACEncoder around for a bit longer to have more time fix issues related to video editor engine"

12 years agoUse 0 not NULL for sp<> and wp<>
Glenn Kasten [Fri, 20 Jan 2012 21:44:40 +0000 (13:44 -0800)]
Use 0 not NULL for sp<> and wp<>

Change-Id: Id1f0c89acefaceed6cb9ca7c165fce895e46d85b

12 years agoKeep AACEncoder around for a bit longer to have more time fix issues related to video...
James Dong [Fri, 3 Feb 2012 19:03:56 +0000 (11:03 -0800)]
Keep AACEncoder around for a bit longer to have more time fix issues related to video editor engine

o this should be reverted after the problem is fixed.
o related-to-bug: 5947347

Change-Id: Iaec4b59d2c99c975e83f0588a813e9a4bfcb7ee2

12 years agoMerge "Use audio_in_acoustics_t consistently"
Glenn Kasten [Fri, 3 Feb 2012 16:31:01 +0000 (08:31 -0800)]
Merge "Use audio_in_acoustics_t consistently"

12 years agoMerge "Use ToneGenerator::tone_type consistently"
Glenn Kasten [Fri, 3 Feb 2012 16:00:52 +0000 (08:00 -0800)]
Merge "Use ToneGenerator::tone_type consistently"

12 years agoUse NULL not 0 for raw pointers
Glenn Kasten [Sat, 28 Jan 2012 00:47:15 +0000 (16:47 -0800)]
Use NULL not 0 for raw pointers

Use if (p != NULL) instead of if (ptr)

Change-Id: Iaec3413a59ccbf233c98fcd918cc7d70ac5da9fa

12 years agoMerge "For performance, return large objects by reference"
Glenn Kasten [Fri, 3 Feb 2012 15:46:42 +0000 (07:46 -0800)]
Merge "For performance, return large objects by reference"

12 years agoMerge "No need to check a wp<> for 0 before promote()"
Glenn Kasten [Fri, 3 Feb 2012 15:45:13 +0000 (07:45 -0800)]
Merge "No need to check a wp<> for 0 before promote()"

12 years agoConstructor initialization and const fields
Glenn Kasten [Wed, 25 Jan 2012 23:28:08 +0000 (15:28 -0800)]
Constructor initialization and const fields

In constructors, initialize member fields in the initialization list
rather than constructor body where possible.  This allows more fields
to be const, provided they are never modified.

Also initialize POD fields in constructor, unless it's obvious they
don't need to be initialized.  In that case, put a comment instead.

Remove explicit clear() in destructors on fields that are now const.

Give AudioSessionRef a default constructor, so it's immutable fields can
be marked const.

Add comment about ~TrackBase() trick.

Initialize fields in declaration order to make it easier to confirm that
all fields are set.

Move initialization of mHardwareStatus from onFirstRef() to constructor.

Use NULL not 0 to initialize raw pointers in initialization list.

Rename field mClient to mAudioFlingerClient, and getter from client()
to audioFlingerClient().

Change-Id: Ib36cf6ed32f3cd19003f40a5d84046eb4c122052

12 years agoMerge "Cleanup thread types"
Glenn Kasten [Fri, 3 Feb 2012 15:26:28 +0000 (07:26 -0800)]
Merge "Cleanup thread types"

12 years agoMerge "Make AudioTrack control block volume field private"
Glenn Kasten [Fri, 3 Feb 2012 15:18:06 +0000 (07:18 -0800)]
Merge "Make AudioTrack control block volume field private"

12 years agoDon't call virtual functions in the destructor for audio and camera source classes
James Dong [Fri, 3 Feb 2012 02:04:02 +0000 (18:04 -0800)]
Don't call virtual functions in the destructor for audio and camera source classes

Change-Id: Ia74ffc1c0cbd7971697f5e3c476e340ec5c7727a

12 years agoDon't call virtual functions in destructors for the writer classes
James Dong [Thu, 2 Feb 2012 23:07:52 +0000 (15:07 -0800)]
Don't call virtual functions in destructors for the writer classes

Have not found any concrete bugs related to these calls yet, but we should avoid
calling virtual functions in destructors, regardless.

Change-Id: I2d47b79d3fb2d29f418619bee83aa147d232a5d4

12 years agoMerge "Fix const sp<>& in parameter list and return value"
Glenn Kasten [Thu, 2 Feb 2012 21:31:23 +0000 (13:31 -0800)]
Merge "Fix const sp<>& in parameter list and return value"