frameworks/base: Initial commit for working qcom OMX decoding

- Rename LOGE->ALOGE; LOGV->ALOGV
- Fix path to hardware/qcom/media/mm-core

Testing for H/W video decoding support.

Added QCOM-specific bits to cmds-stagefright.

We now have full 1080p hardware video acceleration!

frameworks/base/nuplayer: Fixes to enable HTTP live streaming

- Enable QCOM specifc color formats in ACodec
- Do not skip lines without /n, in M3U Parser
- Stop scanning sources until reset is handled in NuPlayer.

Change-Id: Ie7e902c0cd56e7aec17d0ac67d2869a7819770cd

Conflicts:

media/libstagefright/ACodec.cpp

frameworks/base/NuPlayer: Handle Seek from NuPlayer

- Seek was handled by the source by queuing discontinuity events
individually for each stream.With this approach renderer will
continue till discontinuity events are handled for each stream
- With the new approach seek is handled by the player -
- get the new seek time from source
- flush the source TS segments in LiveDataSource, access units
in TS Parser, decoders and renderer
- notify current position to driver
- LiveSession will not queue a discontinuity for seek.
- Add a mutex lock for connect & disconnect ChromiumHTTPDataSource
- Handle flush in ACodec - Idle to Executing & Loaded to Idle states

Change-Id: I8a741c2c665d3aca715734fc1fd1eeae33a6271b

Conflicts:

media/libmediaplayerservice/nuplayer/NuPlayer.cpp

frameworks/base/nuplayer: Support for dynamic port reconfig in HTTP Live

- BW switch is detected by the decoder by a port reconfig event
instead of a discontinuity event
- Handle port reconfig dyanamically in ACodec
Steps are - Flush - Get all buffers back - Disable - Enable
- Handle PID change in TS Parser - Set PID based on stream type

Change-Id: I5ff494084fffa218cafd3cd6db1197aad2233c4d

libstagefright: return proper color format on target basis.

Video preferred Color format is different for different targets.
Add a method to choose the preferred format for each target.

Change-Id: Iba28d5d6e2917792492b3b2e9d38396d468f3202

Conflicts:

media/libstagefright/ACodec.cpp

httplive/ACodec: Enable smooth streaming

- Use property to enable - hls.enable.smooth.streaming
- Set component in smooth streaming mode by doing a setParameter
with OMX extension for SS
- Handle Port Reconfig Info event from component
- Whenever resolution changes do update buffer geometry on
native window

Change-Id: I694d05fe7aba2482f50f31a6e80b646822f15b31

Conflicts:

media/libstagefright/ACodec.cpp

Conflicts:

	media/libstagefright/OMXCodec.cpp

Conflicts:

	media/libmediaplayerservice/nuplayer/NuPlayer.cpp
	media/libstagefright/ACodec.cpp
	media/libstagefright/OMXCodec.cpp
	media/libstagefright/httplive/LiveSession.cpp

Conflicts:

	include/media/stagefright/ACodec.h
	include/media/stagefright/ExtendedExtractorFuncs.h
	include/media/stagefright/MediaDefs.h
	include/media/stagefright/MetaData.h
	include/media/stagefright/OMXCodec.h
	include/media/stagefright/Utils.h
	media/libmediaplayerservice/nuplayer/NuPlayer.cpp
	media/libstagefright/ACodec.cpp
	media/libstagefright/Android.mk
	media/libstagefright/DataSource.cpp
	media/libstagefright/ExtendedExtractor.cpp
	media/libstagefright/MediaDefs.cpp
	media/libstagefright/OMXCodec.cpp
	media/libstagefright/colorconversion/Android.mk
	media/libstagefright/colorconversion/ColorConverter.cpp
	media/libstagefright/httplive/LiveSession.cpp
	media/libstagefright/include/ExtendedExtractor.h
	media/libstagefright/mpeg2ts/ATSParser.cpp
libstagefright: Fix path for mm-core to vendor/qcom
libstagefright: prevent trigger for stale events

- prevent event thread from running if response queue is empty which
  means there is no buffer with the driver

CRs-Fixed: 336970
(cherry picked from commit 690fb2d96a58b2341e49e3424d7e0efe7093aad7)

Change-Id: Ie86a900e77175b2786cfe10fc0c64457e9fc4bae
libstagefright: Flush ASM before closing the stream

- By calling pcm_prepare we can flush the driver and
  dsp so that playback close can issue an eos from kernel

Change-Id: Icb5249ff8c480405b4b8ac5ce5f995ed5d73bf0d
CRs-Fixed: 331532
(cherry picked from commit 8bdfa122ec7ff72f61ea01f932d96d94dc27f016)
libstagefright: Ensure pcm_prepare is called only when routing is
still active.

- LPAPlayer does Derouting, pcm_prepare and pcm_close during pause.
- pcm_prepare should not be called after derouting, as the driver
tries to prepare a session which is already derouted.
- This results in no backend errors in kernel for LPA Front end
session as the backend is already closed with derouting.
- Fix the issue by ensuring pcm_prepare is always called only
routing is still active.

Change-Id: I4b4eef7f9775b6141a5ec9a0eed82ca2f7a5c6d6
CRs-fixed: 341268
libstagefright: Add support in LPA for DSP timestamp.

Change-Id: Ie9525b0ab201b9de828a25ef1cd9731567f4610a
CRs-Fixed: 338065
(cherry picked from commit 2457cb32ec93a11e2a95d77557daaf6be0e1529a)
libstagefright: honor write done event during pause

Queue up completed buffers for decoding even if playback
is in paused state as there is concurrency between write
done and pause

CRs-Fixed: 340469
(cherry picked from commit c9116b67545c5d973c255fba55c031271d3c38a4)

Change-Id: Ifdc2cec4d92773ac279c02df7067bd95c32ca4a4
libstagefright: Fix A2DP seek to EOS issue in LPA

- In A2dp scenario, when seeked to EOS and 0 bytes returned by decoder,
  eos was not issued to the app. This resulted in no audio.
- Put the buffer back in the request queue in case of 0 decoded bytes
  and post an AudioEOS event to the app.

Change-Id: Icb2cc053d71d02c8adb90fc5be1922ea813331e9
CRs-Fixed: 339608
(cherry picked from commit cdcdc2e6c6967de31476b1ece3702b645989e1df)

Conflicts:

	media/libstagefright/LPAPlayerALSA.cpp
LPAPlayerALSA: Fix for acquire/release Wake-locks.

 -Requires a wake lock to ensure that 3s timer after playback runs
 in suspend mode to get into TCXO shutdown.
 -Add support for acquiring wake locks from mediaserver process
 -PowerService is used for acquiring/releasing wakelock

Change-Id: Icb21c319eee24aa38d56afcd8eddcb6315b74558
CRs-Fixed: 338542
libstagefright: Fix concurrency issue during A2DP switch.

- When A2DP is disconnected, Pause is issued by the app.
  Sometimes, pause happens concurrently with stop, resulting a
  stuck in write.
- Fix the issue by switching the sessions, when resuming the
  playback so that above concurrency is avoided.

CRs-Fixed: 338086
(cherry picked from commit 29c0c17f53b6c945605e91da9108eea958b17bea)

Change-Id: I7ee7a3ca0569006c404cb5cca885271b53476695
libstagefright: Fix for seek issue in mp3 streaming playback

-Issue: In LPA playback if seek is issued, the pcm driver
starts after a fill buffer and write is completed. If pause is
issued before the driver starts, audio pause fails and results
to a sudden jump in the playback or to an EOS at random

-Testscenario: Flush,immediately followed by Pause in LPA playback.

-Fix: Pause is handled when the pcm write is completed. This is
acheived by a conditional wait on the pcm write done.

CRs-Fixed: 331099
(cherry picked from commit 6ce15986ee7f2155044f79c505ebcd5a310a6c0d)

Change-Id: I605316bba2d964ba3d52f6a7cc42e7e390d92fdf
libstagefright: Fix A2DP seek to EOS issue in LPA

- In A2dp scenario, when seeked to EOS and 0 bytes returned by decoder,
  eos was not issued to the app. This resulted in no audio.
- Put the buffer back in the request queue in case of 0 decoded bytes
  and post an AudioEOS event to the app.

Change-Id: Icb2cc053d71d02c8adb90fc5be1922ea813331e9
CRs-Fixed: 339608
(cherry picked from commit cdcdc2e6c6967de31476b1ece3702b645989e1df)

Conflicts:

	media/libstagefright/LPAPlayerALSA.cpp

Conflicts:

	media/libstagefright/LPAPlayerALSA.cpp
libstagefright: Add wake lock support for LPAPlayerALSA

- LPAPlayerALSA now holds the wake lock while LPA playback is
  on going
- This allows external applications who do not hold wake lock
  to use LPA playback

CRs-Fixed: 342451
(cherry picked from commit 9621db1c1cf2092b1b51983c91434612c4cd8480)

Change-Id: I3ff8bbdc2535e29b3e0b94953d9ce6364b5c0782

Conflicts:

	media/libstagefright/LPAPlayerALSA.cpp
libstagefright: pause AudioStream when bt is disconnected.

Notify AudioPolicyManager that device is in paused state when
BT is disconnected

CRs-Fixed: 349091
(cherry picked from commit e2fd42a43f92696f917b74b23a1cce9ac276a707)

Change-Id: I5377f8568e1fccb11685ca0e718968eb1823d539
libstagefright: Decrease LPA buffer size to 256 kb

CRs-Fixed: 344793

Conflicts:

	media/libstagefright/LPAPlayerALSA.cpp

Change-Id: Ia9d13985dffa0473b3bdadc547eeb06b114b5a8b
libstagefright: Change thread priority for LPA threads

- Since A2DP behaves like a render thread, there is a need for it
  run at urgent audio priority.

(cherry picked from commit 3b81741adf7b743cfa72874f63bf561950c9cd22)

Change-Id: I9d7ee924766fef1ac77c47dc445d8d32a305d700
libstagefright: Update LPA Player to use ION

Create LPAPlayerION and LPAPlayerPMEM files to separate
memory allocation using ION and PMEM and change the
existing files accordingly.

CRs-fixed: 341467
(cherry picked from commit 63a2671e848d5f8bc9295706974d5c7bee7b2002)

Change-Id: Ife594fb9c36a98d4a3be47ae4140a9c82ec477f7
fix build errors
libstagefright: Crop the native window with display resolution

We provide the native window with the display width and height in
set_geometry.  On the surfaceflinger side, they assume that this is
aligned, which causes problems for HDMI.  Instead we'll now pass in the
aligned stride and slice in native_window_set_geometry, then specify
the desired display width and height and call native_window_set_crop.

CRs-fixed: 332778
Change-Id: Iecfe11ded743715ea2eabad4a3fddbc1b04b5005
(cherry picked from commit 51b550aa2f6049a71261e2a5a76ae8a1450cd96b)

Conflicts:

	media/libstagefright/ACodec.cpp
libstagefright:Fix for no audio in case of DASH

In ACodec FlushingOutputState, some times inputbuffers are
lost.Hence this issue.Deffered the inputbuffer processing
to proper state.

Change-Id: Ic052404c4d27e4826f83f274363d7a091ca8c6f9
(cherry picked from commit a5d61e659ce8a142bd3755515fa81e11b4f2ab77)