libstagefright: Initial commit for video

Change-Id: I6586f3d29524ba031d8c814abdfbb47bb7e5bfda

Conflicts:

	include/media/stagefright/OMXCodec.h
	media/libstagefright/OMXCodec.cpp

ifdef for QCOM_HARDWARE by drewis
libstagefright: qcom add board specific cflags

Change-Id: I67a80c66c358dc74774836d5a4c3eaaa7b4c210a
libstagefright: Framework changes for video bringup

 -Modified the makefile to define the correct macros depending on the target.
 -Added changes to select the proper video output color format for each target using
the macros defined in the makefile.
 -Modified the thumbnail generation logic to select HW decoders for supported targets.

Change-Id: Ia034fb025c116a79937e70101e93fcc478898e8a

Conflicts:

	media/libstagefright/Android.mk

ifdef QCOM_HARDWARE
libstagefright: we do not yet support these formats

revert when this is merged from CAF
commit 6d21eb4c8d798a1e10e71b79fcbe39ac68d2fc71
frameworks/base: Enabling mmparser for AVI, ASF, QCP, AAC formats

Change-Id: I21dc6d5c5cd7c289733918354ff49ddbb381ed57
provider: api: hide IS_RESTRICTED

revert this if it breaks facebook

Change-Id: Ida3f383dd40ae5e1c3b7a5d89228ed9bf493c6de
Add LegacyUsbDeviceManager::setCurrentFunction method.

Method implementation is the same as UsbDeviceManager::setCurrentFunction.
The override is required to use LegacyUsbDeviceManager's mHandler, as
UsbDeviceManager's mHandler is an uninitialized private field.

Change-Id: I9ffece5247c17de77fa799e1f6c9b439ebd074db
SurfaceFlinger: Set the buffer size in the GraphicBufferAlloc

When setting the buffer size, store the required size, and allocate
the buffer of the required size in GraphicBufferAlloc, instead of
SurfaceTexture. We do this because SurfaceTexture does not always
run in the server process space. GraphicBufferAlloc always runs in the
server process.

Change-Id: I53661d8a9a27f9974837f2ed2fe13facf8dd8d9c
Remove opaque check in GLRenderer when preparing dirty region.

Since preserved swap is enabled, we need to clear the color buffer
when the scissor rect is prepared for a new process. This prevents
garbage to be present from the previous process in the color buffer

Change-Id: I72b7154c52affecfd6bf50889062b1769042d5d9
CRs-Fixed: 320345
binder: add support for Ion

Add classes to allocate from the Ion memory manager.
binder: Get rid of old flag

MAP_LOCKED_MAP_POPULATE is an outdated flag that is not used
anymore. Get rid of this flag in MemoryHeapIon
SurfaceFlinger: Fix surfaceflinger crash when showing screen update

With selecting 'show screen update' option under Setting/Developer
options, there's crash in getYUVBufferCount() in Hwcomposer.cpp.
This occurs because the handles of hwc_layer_list have invalid
values that are passed from HWComposer:createWorkList().
Initialized hwc_layer_list after it is allocated.
Support triple application buffers

This change modifies surfaceflinger to use 3 application buffers
by default for performance improvement.

Change-Id: Ia3b1354f1b5d23f8237d73d1761436dd05ab004a

Conflicts:

	services/surfaceflinger/Android.mk
Surfaceflinger: Compose UI in S3D format

The new member of LayerBase takes care of identifying layer for 3d
composition. When 3D composition is required the Layer takes care
of drawing in 3D format

Change-Id: I55c99a3cb612c6dd7a22d346a5b9a88c056c835d
SurfaceFlinger: Return error on invalid buffer creation

When a buffer is re-allocated on reconfiguration, return NULL
if there is an error in re-allocation.

Also, remove warnings during compilation.

Change-Id: Ie01bfcfbb469a106ef99bf1725376e2753206708
CRs-Fixed: 337660
SurfaceFlinger: Skip composition when rotation is not completed

When rotating, each layer's buffer is already changed to
new orientation before SurfaceFlinger gets the signal from
Window Manager. If the orientations of all the buffers are
changed to new orientation, then that's fine. But, sometimes,
only one buffer is changed and others remain the same.
In this case, skip composition.

Change-Id: I850fe8ee6d806e21833e6811f95878fcfb6f7c40
CRs-fixed: 338034
SurfaceFlinger: Prevent screencap command from failure

For secure windows, screen capture fails, and the screencap command
falls back to reading from the framebuffer directly.

Instead, draw a black screen on the framebuffer object if there is a
secure session, so that secure layers cannot be captured.

Change-Id: Ic14ee3f119f622b41f1af3861237204805fb3ca2
CRs-Fixed: 338570
SurfaceFlinger: notify HWC when layer is in asynchronous mode

When the layer is in asynchronous mode the HWC may choose a
different composition method.

CRs-Fixed: 335498
Change-Id: Ifa4658338e98e80e9a673bdf10ae388f0ad3ae9f
libRS: Correct the screen freezing issue

This fixes a timing issue where it could calculate a delay of 0
(indicating wait forever) when it has no pending commands to actually
execute. In such cases, it should just break out of the playback loop.
This also fixes a small issue with returning whether or not to redraw.
(Provided by Stephen Hines <srhines@google.com>)

CRs-Fixed: 330352

Change-Id: If3c880e1546105279d286ae76cc41e8b8f193ec1
SurfaceTextureClient: Add support for external only usage flags.

Add support for GRALLOC_USAGE_EXTERNAL_ONLY and
GRALLOC_USAGE_EXTERNAL_BLOCK to be set as a part of usage flags.
These flags if present will be cached by SurfaceTextureClient.
Incoming usage flags will be ORed with these, if present.

(cherry picked from commit dcbd475319bae2f5d0613bf62d8324169e6ab79d)

Change-Id: I366f6a664805e8944663600dc3b1f82530275873
Surfaceflinger: Modify setFormat() API to set 3D format.

setFormat() API is modified to accept 3D formats from applications.
This change is required for 3D game usecase so each layer can be
marked as 3D and can be sent to overlay for rendering.

Change-Id: I9266d9ab367c5eccb8fb182f3f517234415a9897