stagefright: Fix the input channel count

Change-Id: Ib59e0c9d4ed319a1c23177dcb54dc82d32eb8992
libstagefright: Don't invoke FFMPEG for MP3

Change-Id: Ia30d25d1a994328827f14a286661cd2e1eaa1181
Merge branch 'kk4.4' of https://github.com/SlimRoms/frameworks_av into kk4.4
mediaplayerservice: Untangle legacy callback function

Change-Id: Ie0e3c02a9446a5898ae56453d40a144202de40e3
Fix aac decoder flush

b/8543366

Change-Id: I746ffed6289486b802a2292bfc492ea6c780ed0b
Can't play AAC file with ID3 tag.

When the file is scanned, the ID3 tag is found to have a
footer at the end of audio data. And getAdtsFrameLength
return zero after reading the footer. As a result, the
duration and mInitCheck are not set. The current change
considers the data till footer and sets the duration based
on no. of frames read till the footer/corrupt frame.

Change-Id: Ie8f898435f0d4ca31fdd355146c4db7b37c0b988
Signed-off-by: Arulselvan M <arulselvan.m@intel.com>
Signed-off-by: Jin Wei <wei.a.jin@intel.com>
audio:mute duration at the beginning of the recording

-Sometimes shutter sound is getting recorded because
 current kAutoRampStartUs is not sufficient to mute the
 shutter sound

-Fix is to increase the kAutoRampStartUs to 500ms.

Change-Id: Id37b48c4bb7b5c903ef502f933eaff7be0ea566c
CRs-Fixed: 636491
HLS: getDuration should return -1 for live streams

According to the MediaPlayer API documentation -1 should
be returned if the duration is not available. But for HLS 0
is returned. Change this.

Change-Id: Ib7704a94ac8dc104ceed4da4491f0d03cb8f4560
Stop thread before deleting object reference

If setPeriodicCapture is called Visualizer will start a thread
and do periodic callbacks. When native_finalize is called the
reference to the class is deleted. If a callback happens after
this the reference is no longer valid and when used from the
callback method the vm crashes. With this patch the thread will
be terminated before deleting the reference.

Change-Id: I30f331437ddad05f8d52c244cdbecb1859a0abd2
Disconnect the mediaplayer when reset

When the mediaplayer is reset the strong pointer to the
media service client is destroyed and the client should
deconstruct. However this could take some time and if a new
client is connected before the old client is disconnected
there could be problems. By assuring that the client disconnects
these problems can be avoided.

Change-Id: I5d2cf6d22860aa616b14397b1f523ddc35197b83
Audio streaming error when playing a stream that contains "end of file".

Although EOS is being posted upon receipt of BYE message from RTSP
server, still it didn't reach the media framework and application.
This happens because the Nuplayer::Renderer::onDrainAudioQueue() funtion
returns false after mAudioSink->getPosition() call , and the EOS message
present in mAudioQueue was lost.The mAudioSink->getPosition() returns
NO_INIT as mAudioSink->open() is not yet called,
hence no audio track exists in MediaPlayerService::AudioOutput.

Change-Id: I905e8f3af87dc778952eeef3904c4e2a6a75ca7a
Signed-off-by: Arulselvan M <arulselvan.m@intel.com>
Signed-off-by: Jin Wei <wei.a.jin@intel.com>
Add support for MPEG audio elementary streams in HLS

In the new KitKat HLS solution support for elementary
audio streams was added. According to a comment both AAC
and MPEG audio should be supported, but only AAC is
actually implemented. When streaming an MPEG audio stream
the whole phone would freeze. This commit implements support
for MPEG audio as well.

Change-Id: I083961599d5316b76da9fe47c8561d34569a456d