go back with CM repo
libstagefright: Fix MPEG4 timestamp

MPEG4 timestamp needs to be stored with the classic Mac OS epoch not
the unix epoch. Header needs to be changed to version 1 to support
64-bit timestamp which is needed to represent the time.

Change-Id: Ie86c62349edaa96dd9c5c5cb8e2bdb89794ebb5f
libstagefright: Encoder state check before calling OMX_FreeBuffer
libstagefright: Secure o/p buffers only when i/p buffers are secure

ION allocation fails on o/p buffers when i/p buffers are not secure. Disabling
secure allocation of o/p buffers when i/p buffers are not secure.

(cherry picked from commit ea10201ece24a3c61b79202b93e440eddb624d65)

Change-Id: I329c8428d3e528f7d177a64b8605090357f34035
CRs-Fixed: 336727
libstagefright: Reset buffer size value with SurfaceTexture

- OMXCodec explicitly sets the decoder output buffer size using the
  native window perform API. (to accomodate extra-data)
- This size is reset only when the SurfaceTexture is destroyed.
- Unless reset, this size will be assumed for all output buffers
  if the SurfaceTexture is re-used.
CRs-Fixed: 337660

Change-Id: I28aed12ad02adeac61caffbb00e3082640a5f6d4
(cherry picked from commit 031e95469b897680670a2480e55be727d00bbd82)
libstagefright: State checks before calling OMX_FreeBuffer for multiaac decoder

-- For some of the isdbt clips port setting changed event is recevied
during middle of playback and omx client goes into error state which
is not handled properly.

-- Added state checks for multiaac decoder component based on OMX IL
specification before calling OMX_FreeBuffer

CRs-fixed: 336159
(cherry picked from commit f974af96cd47771bd68d8b10b400dd477df9c514)

Change-Id: I4f2c63b86bbfc82dd3186d4d30c40083a0a93a4c
libstagefright: Fix for playback error during multiple play and pause

- When H/W decoder is used, in pause state empty this buffer is
not called from drainInputBuffer which blocks sending input
buffers to the omx component.
- When all the input buffers are processed by the omx component,
it keeps waiting for the new input buffers after resume.
- As the input buffers are not sent after resume, omx component
do not sent output since it does not have any input buffers to
decode. This is resulting in timeout on the output port.
- Modified IL client to fill all the empty input buffers at omx
start in case of H/W decoder.

CRs-Fixed: 340761
(cherry picked from commit 1ecd319)

Change-Id: I530a4a91d91c01dd98fe6b818fe458dedb2ac9e0
libstagefright: Fix for CTS MediaRecorder test cases

The static keyword in a declaration of a local variable in an
mpeg4 writer function is causing the variable to be initialized
only the first time the function is called.

Because of this, the variable is not being re-initialized properly
when the function is called again on subsequent record attempts,
leading to a recording error.

This change removes the static keyword from the variable
declaration.

Change-Id: Ifb1348eb38377c844e2e024bface8c735271045c
CRs-Fixed: 346553
NuPlayer: Avoid scaning for source when in pause state

- Pause of video-only or audio-only playback fails to pause streaming
  download
- This is because Player keeps scaning for tracks\source even when
  the player is in pause state.
- In pause state source scan will be disabled.

CRs-Fixed: 340955
(cherry picked from commit 492d95339f30e3411499c961834560f453415fd0)

Change-Id: Ife8ad205067865293dad683b731438c605b73bdb

Conflicts:

	media/libmediaplayerservice/nuplayer/NuPlayer.cpp

Conflicts:

	media/libmediaplayerservice/nuplayer/NuPlayer.cpp
	media/libmediaplayerservice/nuplayer/NuPlayer.h
frameworks/base/nuplayer: Enable Smooth Streaming only for HLS

- Set enable flag based on source type in setDataSource
- Pass the meta data flag to ACodec in configureCodec call

CRs-Fixed: 347204

(cherry picked from commit 0a568164ae2ea758b4ac32ab06119b578d1424a3)

Change-Id: I8504122ec30858cf06b2edce1ff5cbbad7a830c3

Conflicts:

	media/libstagefright/ACodec.cpp

Conflicts:

	media/libstagefright/ACodec.cpp
webkit: Multi-context HTML5 video support

- Support multiple concurrent HTML5 video playback in inline mode
- Free HTML5 video media player when loading new page
- Omit seek when resuming playback from paused state
- Enable volume control for HTML5 media elements

Change-Id: Ie6706f4feea8410ec6cd440e146efbcbb0253260
webkit: Support multi-context HTML5 audio

Browser supports pages with multiple HTML5 audio elements but only one
audio source will have audio focus at any given time.

Focus will be given to the most recently started audio. Previously
playing audio will be paused.

Change-Id: I04fad7c919a2e45249d16bc282884a2cf3f375b5
webkit: Show last frame of streaming video when buffering.

HTML5 Video now detects buffering state during streaming
videos and communicate this status to the video player
so that video player can present recent frame of
video during buffering instead of a grey frame.

CRs-fixed: 329061
(cherry picked from commit 9fe3eab1191d9fa97621f2c7cdd28e4954720fcb)

Change-Id: I5a51226bc29ed2a5924d33947ebf558740c41b2c
Webkit: Fix callback notification upon end of video playback

Trigger onEnded callback only upon video playback completion.

CRs-fixed: 333027

(cherry picked from commit 9e603557ea5f0196a4b9633435891de09bb406a2)

Change-Id: Id089075831328296a92e4665583d316cfbbd2cfd
BrowserManagement

Opensource changes corresponding to BrowserManagement feature
Change-Id: Icae49df023c51e9ee8ecc823ffd854dbe2e8edcd
webkit: Support playing HTML5 video in fullscreen mode at once

Support entering fullscreen before video has started playing inline.
Support javascript call to play video while in fullscreen mode.

Change-Id: I4d11388790affc555b5420670a6783d8497b895b
CRs-fixed: 328354
BrowserManagement

Change-Id: I21421742d84fda418c18aeb21c29aef6f994c701
BrowserManagement: Unregister BatIntent on webview destroy
(cherry picked from commit eddab22475ce4afb9bb7a36a7f9ed1fef9c5631a)
BrowserManagement

BrowserManagement: Added small enhancements to an existing feature, to cover
more scenarios and some code cleanup for compactness

Change-Id: I631ac7208a5645feb103b73a1136a848a6fbc734
(cherry picked from commit 753e5b3467754ed70588194e1b8353fa89fa3381)
Support for runtime WOFF enablement

Change-Id: Ibedbdcae7bc14d21bdfcec63058525e5d19684bd
Add onVideoSizeChangedListener to HTML5VideoView

onVideoSizeChangedListener handles the corresponding event
to update size/duration of a video if they are unknown.
It is to support Media Player implementations where video
size is not known until playback starts.

Change-Id: I4cf9f8bd07b132a0f1a9039d88385b9b83ffde37

Conflicts:

	core/java/android/webkit/WebViewCore.java