media: squash CM commits

mm-video:vidc: Add the handling of MPEG-2 extension and user data.

Handling of extension and user data returned by core is added
to user space code. Now extension and user data is appended to
YUV data along with other extra data and passed to client.

Change-Id: I6735263633d1cd224ce332fb7801b08511676922
(cherry picked from commit 5b126aeb3ab33e635090bef8254025590197da32)

mm-core: Add MPEG-2 extension and user data types.

With this commit, OMX_ExtraDataMP2ExtnData and
OMX_ExtraDataMP2UserData eTypes are added to support
MPEG-2 extra data types.

Change-Id: Iffd6e216d9f6fdf30f6a99410c353a37bbe14dc7
(cherry picked from commit 051cdcaae9d3d69440b2bc5053b0c11e4486a60a)

Conflicts:

	mm-core/inc/OMX_QCOMExtns.h
(cherry picked from commit 63d30d6c955068efc11a1a77b91aba4b927a56b4)

mm-video: vidc: Add PAR value extradata support for H264.

Core gives aspect ratio information for H264 in a shared
memory register. This change will fetch the value of the
aspect ratio from the designated register and append this
information to the frame_info extradata which can be used
by the client.

Change-Id: I8f7f29a4f70cb99049d8238101326f86b5901a6f
(cherry picked from commit 428f393430cd4d0cec771cd12e0abf3f2a637f85)
(cherry picked from commit abec80d1348940972dd6307f3e03beaba9198260)

mm-video: vidc: Add support for MPEG-2 sample aspect ratio.

ISDB-T client requires sample aspect ratio (SAR) and it
depends on the sequence display extension and display
aspect ratio (DAR). This change calculates the SAR
values as required by the client.

Change-Id: Ib7e3d1cfb8aff3a9e33048197a95b1d266ed3658

Conflicts:

	mm-video/vidc/vdec/src/omx_vdec.cpp
(cherry picked from commit 5bf5f6cff2e5674f4f4b2bb721fb4b89bbcc92c0)

mm-video: Add support for display aspect ratio info.

This change adds support for sending display aspect
ratio information as part of frame info extradata
to the client.

Change-Id: I60a20faffe2f58b5720670373625b3299f9ed1fc
(cherry picked from commit 3914b4dba71fa9ba1d30a069051d2de062abe804)

Conflicts:

	mm-video/vidc/vdec/test/omx_vdec_test.cpp

mm-core: Add support for display aspect ratio info.

This change adds support for sending display aspect
ratio information to the client from video component.

Change-Id: I2d56ef92046572e1aaf334ec8ecdc3f959617434
(cherry picked from commit 456643d21db5eb2655b8015db4ca27e20062b686)
(cherry picked from commit 855e84347ea307aff74447f9e26c86624928f5d3)

mm_video: vidc: Align input buffer size for vdec.

1080p video core needs scratch space in the input buffers.
This change will reduce the input buffer size exposed to client
by scratch buffer requirements of video core.

Change-Id: I56fde759a1c715cb204f5779114f2694f13eb6f7
CRs-Fixed: 366808
(cherry picked from commit b316d6fb49a05634aab369b796bc0d6ef9cee4ba)
(cherry picked from commit 0fb4a5fcd15f6326cd488098ca3325788e883e27)

mm-video: Fix for debug log messages support

Enabling/Disabling debug log messages is controlled
by Android.mk file.
This change fixes the redundancy of the code which was
creating some issues for this support. Now the logs
can be enabled/disabled using Android.mk

Change-Id: I4d4990a112ae494eec133d21ff1127c39878d5f4
CRs-Fixed: 440739

Initial 8x55 mr1 bring up

Change-Id: Ib2830754cd82ed201d51aa457f1b633b7cfabd4c

mm-video:vdec: Video decoder bring-up on 8x55 target

- Set TILE color format for index zero on video port format
- Add ION memory support for video decoder.

Change-Id: Ifef1a15ec7089702c7644fd0e7c1463f81035fc7

mm-core: initial video bring-up on 8x55 target

This change is needed to pick qcom video h/w libraries
for 8x55 target.

Change-Id: Ie6af7da5c30e27c796b2c6827d30682227b825d9

mm-video:venc: Add required ION Heap ID for video encoder buffers

- Allocate video encoder buffers from ION_CAMERA_HEAP_ID memory
  for 8x55 target.

Change-Id: If9d4d4d484d53bffe41940a04adf589d7d1a9ebe

mm-video: Use CM standard qcom naming

Change-Id: I8edc62bb4acaaad604588c135e30dfa7c7854fe5

vidc: Align ion buffer length before allocating it

Align buffer legnth to the required alignment before
allocating it to resolve mmap issue for ion memory
allocations on kernel 3.0 version.

Change-Id: I0acbcdab6afe1e946d257b9a0aeb103d9074e87d

Revert "mm-video:vidc: Add the handling of MPEG-2 extension and user data."

This reverts commit 76c7c96da722bd62c125a144eed0ec26e5985966.

Reason: breaks build (VDEC_EXTRADATA_EXT_DATA and
VDEC_EXTRADATA_EXT_DATA not present in kernel headers)

Change-Id: I52e6fb447dc5a4893de36784049d5063245ff24d

media: allow msm8660 into repo

Change-Id: I1713a946e94202b10fab68652903f4a5af1f4587

mm-core: Add QC specific MetaData and MediaDefs

- to integrate extened extractor with existing framework
  new QC specific MetaData and MediaDefs are required.
- create new files to avoid changing stock MetaData and
  MediaDefs file

Change-Id: If32e182337fa4be8b039367729ffa6cecefd8115

DivxDrmDecrypt: Export the header\include file

- Export DivXDrmDecrypt.h which is needed by mm-parser
  for generating libDivxDrm
- libDixDrm is needed to play encrypted divx DRM
  content

Change-Id: I99b04f1a53c82166ca8d33b33528f1df23949d44
(cherry picked from commit 0c7cee4259b58ea43cb38b3e1d11fb8279b46c36)

mm-core: Adds support for encryption type request.

Adds support for encryption type request.

CRs-Fixed: 396778
Change-Id: I980754aa33af705e79d2051fd6fea988318c8505
(cherry picked from commit 0f0ec3a40d765901044327d21e7ee6d243e37e41)

mm-core: remove duplicate color format enum

 - duplicate definition of OMX_QCOM_COLOR_FormatYVU420SemiPlanar
   exists in OMX_IVCommon.h

Change-Id: I42afb2768c1b600ba6e2ba17267254f5d8c4b7de

mm-video: port heap mask change to ion.

Change-Id: Ifcb1316b5c26d5a1d2d490d177140057b3e93e16

mm-video: set ION_SECURE to flags instead of heap_mask during
ion alloc.

Without this change secure playback will fail.

Change-Id: I13dc44113a6752a9198346725e9b5155414446d5

mm-video: Change kernel headers search path

Compilation is failing as user space component is
using kernel header from bionic which is not up-to-date.
Make changes to the make file to include kernel header
from kernel obj of the target out folder.

Change-Id: I1444c55f90999fb332e206a8229aff9eda215b8c

mm-video:vidc: Add the handling of MPEG-2 extension and user data.

Handling of extension and user data returned by core is added
to user space code. Now extension and user data is appended to
YUV data along with other extra data and passed to client.

Change-Id: I6735263633d1cd224ce332fb7801b08511676922
(cherry picked from commit 5b126aeb3ab33e635090bef8254025590197da32)

mm-core: Add MPEG-2 extension and user data types.

With this commit, OMX_ExtraDataMP2ExtnData and
OMX_ExtraDataMP2UserData eTypes are added to support
MPEG-2 extra data types.

Change-Id: Iffd6e216d9f6fdf30f6a99410c353a37bbe14dc7
(cherry picked from commit 051cdcaae9d3d69440b2bc5053b0c11e4486a60a)

Conflicts:

	mm-core/inc/OMX_QCOMExtns.h
(cherry picked from commit 63d30d6c955068efc11a1a77b91aba4b927a56b4)

mm-video: vidc: Add PAR value extradata support for H264.

Core gives aspect ratio information for H264 in a shared
memory register. This change will fetch the value of the
aspect ratio from the designated register and append this
information to the frame_info extradata which can be used
by the client.

Change-Id: I8f7f29a4f70cb99049d8238101326f86b5901a6f
(cherry picked from commit 428f393430cd4d0cec771cd12e0abf3f2a637f85)
(cherry picked from commit abec80d1348940972dd6307f3e03beaba9198260)

mm-video: vidc: Add support for MPEG-2 sample aspect ratio.

ISDB-T client requires sample aspect ratio (SAR) and it
depends on the sequence display extension and display
aspect ratio (DAR). This change calculates the SAR
values as required by the client.

Change-Id: Ib7e3d1cfb8aff3a9e33048197a95b1d266ed3658

Conflicts:

	mm-video/vidc/vdec/src/omx_vdec.cpp
(cherry picked from commit 5bf5f6cff2e5674f4f4b2bb721fb4b89bbcc92c0)

mm-video: Add support for display aspect ratio info.

This change adds support for sending display aspect
ratio information as part of frame info extradata
to the client.

Change-Id: I60a20faffe2f58b5720670373625b3299f9ed1fc
(cherry picked from commit 3914b4dba71fa9ba1d30a069051d2de062abe804)

Conflicts:

	mm-video/vidc/vdec/test/omx_vdec_test.cpp

mm-core: Add support for display aspect ratio info.

This change adds support for sending display aspect
ratio information to the client from video component.

Change-Id: I2d56ef92046572e1aaf334ec8ecdc3f959617434
(cherry picked from commit 456643d21db5eb2655b8015db4ca27e20062b686)
(cherry picked from commit 855e84347ea307aff74447f9e26c86624928f5d3)

mm_video: vidc: Align input buffer size for vdec.

1080p video core needs scratch space in the input buffers.
This change will reduce the input buffer size exposed to client
by scratch buffer requirements of video core.

Change-Id: I56fde759a1c715cb204f5779114f2694f13eb6f7
CRs-Fixed: 366808
(cherry picked from commit b316d6fb49a05634aab369b796bc0d6ef9cee4ba)
(cherry picked from commit 0fb4a5fcd15f6326cd488098ca3325788e883e27)

mm-video: Fix for debug log messages support

Enabling/Disabling debug log messages is controlled
by Android.mk file.
This change fixes the redundancy of the code which was
creating some issues for this support. Now the logs
can be enabled/disabled using Android.mk

Change-Id: I4d4990a112ae494eec133d21ff1127c39878d5f4
CRs-Fixed: 440739

mm-video: msm_fb_unset and msm_fb_play should be followed by pan update.

- If pan update not called, Video buffers are getting dropped in MDP.
- MSMFB_OVERLAY_PLAY and MSMFB_OVERLAY_UNSET should be followed
  by FBIOPAN_DISPLAY.

Change-Id: Ib572d09ec5ea8524ac05581ec1d70df090b4478b
CRs-Fixed: 440176 415430

mm-core: Add kKeySmoothStreaming

Change-Id: I93036781cab1d81d8e22a626d61348b71203380b

dashplayer: Add new player for supporting DASH

Change-Id: I23386f49298323cbf0aecddb7fee2016a2ec16f3

vidc: Amend output timestamp check condition

The output timestamp need to be checked after
the timestamp reorder operation is completed,
not before the reordering. This change will
amend the check condition accordingly.

Change-Id: Id6fbf714d485e5ecd1847ddaa4d2fa84fa211e28
CRs-fixed: 441917

qcmediaplayer: Add qcmediaplayer for supporting DASH

Change-Id: I3431b91116504f22a1f53743983657954e80b43c

dashplayer: add text track support

Change-Id: If4612dfca426efbbd9fb1b8afecbc077c3aed753

audio: add support for amrwb/amrwb_plus

Change-Id: Ic167fd8fc2af9517642ae4061e8740760007cf0d

mm-video: vidc: Try to open secure video decoder again.

Try to open secure video decoder again if first
open fails.

Change-Id: I244970d3d804688b1c57635c1f6c2965f8ee4735
CRs-Fixed: 444078

mm-video: vidc: Broadcasts intent for the start and end of secure playback.

- Broadcasts intent for start and end of secure playback so that other
  services (Wifi-Display) can find out whether secure or non-secure session
  is going on.

Change-Id: Id69042bc449cae29a1dd309c9bfb477c3b005541
CRs-Fixed: 444078

mm-video: Build video test programs with 'debug' tag

Video test programs should be made available only in
'userdebug' and 'eng' builds but not in 'user' builds.

Change-Id: I58d12f42ad9843278ed2849bc4bb636b80aed583
CRs-fixed: 416069

mm-core: Add registry table for mpeg2 secure playback

During mpeg2 secure playback, the client calls the
OMX_GetHandle method which locates the component
specified by the component name,
OMX.qcom.video.decoder.mpeg2.secure,and loads that
component into the memory.
This change adds the registry table for the above
component name

Change-Id: Ibdaa46c46f858904959c3a1b4cfc53ec9ee85373

mm-video:vdec: Separate meta buffers support in secure mode

Extradata is appended at the end of the output buffer
in the normal scenario. But in case of secure playback,
we can not parse the input and output buffers,
therefore extradata support is unavailable in this case.
This change adds the extradata support in case of secure
playback. For secure playback, extradata is now dumped
in the separate meta buffers which are allocated from
ION_CP_MFC_HEAP_ID that enables HLOS to read and parse it.

Change-Id: I292a15abccfab666d5d319c629e2f9268b7ce5f4

Conflicts:

	mm-video/vidc/vdec/src/omx_vdec.cpp

vidc: venc: Disable slice mode for unsupported settings

The video hardware does not support slice size less than
1900 bits in BITS mode multi slice settings, so disable
slice mode in case of unsupported multi slice settings.

Change-Id: Iffbbb7c182b74c9de7f08db0dcade12783b8fbda
CRs-fixed: 442639

Revert "mm-video:vdec: Separate meta buffers support in secure mode"

Handling extradata for secure mode should be enabled for specific
targets and should be merged after corresponding TZ changes.

mm-video: Fix API for getting supported profile and level

In get_supported_profile_level_for_1080p() function, if a
query for codecs such as vc1, divx, divx4, etc. is made,
it does not return an error message, instead it returns
OMX_ErrorNone which results in an infinite loop at the
function caller's side. Thus omx component deinit never
happens and causes ANR.
With this Fix, appropriate error message is sent to the
caller.

Change-Id: I128645bbdfec952973824d88a995ab0218246fa6
CRs-fixed: 422083

mm-core: Add key for HFR encoding

Change-Id: I0aa6978eaad25418260114fdad94d3294a0205c7

Update copyright to The Linux Foundation

Change-Id: I1f956c6c43d9dd77583ba9f78e8e419865f16a9b

mm-video: Fix component_init() failed use cases

Video playback is failed if component_init() fails before
message and async threads were created due to thread_join()
function being called with out checking whether the threads
were created. This commit will add check conditions to
verify whether threads were created before calling
thread_join() functions.
This commit also moves the video driver closing function
from comopnent_deinit() to destructor() after thread_join()
functions as video driver needs to be closed after messsage
and async threads were exited.

Change-Id: Iffd56a0b6685ef08feae610f226fe9b81382b542
CRs-fixed: 425160

Conflicts:

	mm-video/vidc/vdec/inc/omx_vdec.h
	mm-video/vidc/vdec/src/omx_vdec.cpp

mm-video: vdec: Separate meta buffers support in secure mode

Extradata is appended at the end of the output buffer
in the normal scenario. But in case of secure playback,
we can not parse the input and output buffers,
therefore extradata support is unavailable in this case.
This change adds the extradata support in case of secure
playback. For secure playback, extradata is now dumped
in the separate meta buffers which are allocated from
ION_CP_MFC_HEAP_ID that enables HLOS to read and parse it.

Change-Id: Iba95f31d576c955068e8e12ae7745652c4b6d69f

Remove dependency on kernel headers

Change-Id: Id3be2558895eaea77e0477c21689945b3a07d9a9

Add ifdefs for target-specific and optional features

 * Detect support for secure metadata
 * Use normal ION API by default, enable with NEW_ION_API.

Change-Id: I2271c6427fa140f368e0374bf253071e320e760e

vdec: Add ifdefs to featurize extended user metadata

 * Mako does not have support for this currently.

Change-Id: I026e3a15f79e3013a58c68ad1f0a406b51165cbf

Add back check for msm7x30 that got lost in merge

Change-Id: Ia77806f67ee96de9f75bc0a2df4c90e85424291b

mm-video: venc: always align buffer before ion_map_iommu

Align buffer even if video dimensions are not multiple of 16. Video
encoder memory allocator allocates aligned memory in
venc_allocate_recon_buffers and pmem_allocate which will be mismatched
on multiple of 16 dimension video.

Change-Id: Ib88dd37a2526dffa5287b4153d5d7bc8b366d0f2

mm-video: vdec: Remove genlock calls from userspace

With MR1 release, the use of genlock is deprecated.
Therefore, it should not be used anymore.

CRs-fixed: 447716
Change-Id: I89b0131d5e50380debbbfca6b54e1abd355d98a8

mm-core: Add support for Smooth streaming for secure mode playback.

   - This change will add the extension index required for
   - Smooth Streaming for both secure and non secure mode video playback.

Change-Id: I351b5c68702fc2dd83d50801b9bee7f8744c31b6
CRs-Fixed: 451786

mm-video: vidc: Add support for Smooth streaming for secure mode playback.

    -When secure playback enabled, extra data parsing can't be done to
      find new resolution.
    -This change will add the extension index required for
      Smooth Streaming for both secure and non secure mode video playback.

Change-Id: I65be81b9593879466d0398ff593e4b806db5f940
CRs-Fixed: 451786

mm-video: venc: Add NV21 color format support

- This change adds NV21 color format for encoder
  input port.
- Included kernel headers from kernel obj of the
  target out folder.

Change-Id: Icfdb6c5e58d8d80610750985196eef5ad901ac1f
CRs-fixed: 448511

mm-video: Fix coverity errors

Fix for Out-of-bounds access(ARRAY_VS_SINGLETON) errors.
These might have currupted or misinterpreted adjacent
memory locations.

Change-Id: I216c765da91d5c2c5ee96b8f1ab9e3bfd158c862
CRs-fixed: 443336
Revert "mm-video: use only IOMMU heap for non-secure playback"

This reverts commit a370c157f9ab6a5d4576820acd09dd4239879ffa.

Conflicts:
	mm-video/vidc/vdec/src/omx_vdec.cpp
media: Compensate for alternate display variant

 * Set correct path if CAF display driver is in use

Change-Id: I15e172029ab9bc8df0258a4e22e365a16c8fc263

Conflicts:
	mm-video/vidc/vdec/Android.mk
	mm-video/vidc/venc/Android.mk