libstagefright: Fix video encode I-frame interval setting

The i-frame interval setting is not configured properly when
b-frames are enabled.

Fixes the calculation for the i-frame interval setting when
b-frames are enabled.

CRs-Fixed: 348669
(cherry picked from commit 3fed07eac060215748b67e9d641f84bd684e6a2b)

Change-Id: Idbbeb1df638635336dd54dc2fe227d06a367ea79
Revert "Avoid video buffers filling and flushing in SEEK state."

This reverts commit fb5e9a00c86cfe6f6162769f3ee4277e42a5d976.

While seeking a video in paused state OR if a video is paused, suspended and then
resumed,videobuffer is NULL. In such case, videoBuffer check stops posting
video events and frame update is not happening.Removed the check to allow
posting of video events in such usecases.

CRs-Fixed: 343940
(cherry picked from commit be7905d58e71c10825206092a62617732d9fb5b9)

Change-Id: I586722c233cbe9bcd09bb6259d6e01ab80f1b83e
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
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
Set Software AAC Decoder as default for RTSP based Streaming

Changes to use only Software AAC Decoder whenever we try RTSP
based streaming.

CRs-fixed: 347441
(cherry picked from commit 4f756ac1429dfa90b45af739782eba56fac35c03)

Change-Id: Ic514ebe985739b783a528ccac3ea0c915896402f

Conflicts:

	media/libmediaplayerservice/nuplayer/NuPlayer.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
Feature permissions for Proteus device api framework

Change-Id: Id3bb12a1ff8af5df0eb960c780accd8f625d9345
BrowserManagement

Opensource changes corresponding to BrowserManagement feature
Change-Id: Icae49df023c51e9ee8ecc823ffd854dbe2e8edcd
Porting missing changes for Feature permissions for Proteus device api framework

Change-Id: Id3bb12a1ff8af5df0eb960c780accd8f625d9345
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
AudioManager: Handle KEYCODE_VOLUME_MUTE [#5]
httplive: Buffer size & bandwidth switch enhancements for fetchFile

- Adds size estimation for chunked ts files so that buffer sizes are
  more accurate and fewer calls to memcpy are needed
- Fixes case where even files with size returned by the server caused
  a memcpy
- Increases minimum buffer increment and allows exponential buffer
  growth by a factor of 50% to reduce memcpy calls
- Splits the readAt call in fetchFile so that the bandwidth can be
  checked during download
- Adapts the incremental buffer read size to the current network
  conditions
- Returns a notification that triggers the download of a lower
  quality file if the bandwidth drops by enough. Will only begin
  downloading a lower quality file if it will save time and thus
  minimize any apparent media freeze while buffering.

(cherry picked from commit 3298013f4aedfb0729069debfdeed2f8531fb710)

Change-Id: I7fc514e4689fb466cd40cc490df8f8c3da009494
CRs-Fixed: 329809

Conflicts:

	media/libstagefright/httplive/LiveSession.cpp
frameworks/base/httplive: Update meta data after seek

- Add a API in AnotherPacketSource to update meta data
- Update meta data in ATSParser & AnotherPacketSource after seek
- Add a new discontinity type for HLS seek, and set it for seek
- Separate seek changes in NuPlayer specific to HTTP Live
- In LiveSession when a playlist sequence number is not found
  after moving to new playlist start with first sequence number
  instead of last.

CRs-Fixed: 337549

Change-Id: I7dedec3664d2bb8a78e16f0df944feaf22bb32a6
(cherry picked from commit aabe7bcdf9276b00e47af81e00a5ce9f178b9463)

Conflicts:

	media/libstagefright/httplive/LiveSession.cpp