libstagefright: Add interlaced video support

Stagefright waits for the Index Settings changed event to be propagated
to it from the component. If interlaced, appropriate flags are given to
the native window.

Change-Id: I240c5139232c6905c3de7632885736147d5f70b1
(cherry picked from commit ce070db0c8d491218adb9a8386116d39909813e9)

Conflicts:

	media/libstagefright/OMXCodec.cpp

Signed-off-by: Andrew Sutherland <dr3wsuth3rland@gmail.com>
libstagefright: Fix for crash during playback of unsupported clip

-Crash in media server observed during playback of unsupported clip
-The OMX_EventError not handled properly in SF IL client leading
to crash as i/p buffers and o/p buffers are not freed.
-Shutting down the i/p and o/p ports when OMX_EventError is
received with state OMX_ErrorInvalidState. In error state,
free i/p and o/p buffers on receiving empty buffer done and
fill buffer done messages.

Change-Id: I6d2b7b659b5f424b9fc5d668e47f2a9d51b49314
CRs-Fixed: 331572

Conflicts:

	media/libstagefright/OMXCodec.cpp

Signed-off-by: Andrew Sutherland <dr3wsuth3rland@gmail.com>
libstagefright: State checks before calling OMX_FreeBuffer

- Add state checks based on OMX IL specification before
  calling OMX_FreeBuffer

CRs-Fixed: 332651
(cherry picked from commit 1e141b3eb230dcfa2b1befe8456637a81d83cb36)

Change-Id: I9fbca2938ba40affbb72d464a443902f004f2ae7
libstagefright: Fix crash during 3D Video playback

The crash was observed while handling extra data in FTB.
This was due to improper assignment of buffer handle to
pBuffer. This assignement is corrected in OMX component
and hence CHECK_EQ for buffer handle in OMX nodeInstance
is removed.

Change-Id: Ib1eb206a201f2e23aec2137b64b93bcb0fc2d221
CRs-Fixed: 328535
libstagefright: Add support for High Frame Rate Encoding

Based on kkeyhfr key value from meta data, add support in OMXCodec and
MPEG4Writer for HFR mode

Change-Id: I2fe0780865bd01451bf8e77acf028b498c1c9f28

Conflicts:

	media/libmediaplayerservice/StagefrightRecorder.cpp
	media/libstagefright/OMXCodec.cpp

Signed-off-by: Andrew Sutherland <dr3wsuth3rland@gmail.com>
libstagefright: Set high frame rate encoding flag to 0 by default

- Set the hfr flag to be 0 by default
- Do not crash if the meta contains no value for kKeyHFR

CRs-Fixed: 332372
(cherry picked from commit 6712b25b7e600cf29e2940fa61ec5bacf4f1c879)

Change-Id: Ie6cfa21f3df2114dee335b70412f1239cf6376ec

Conflicts:

	media/libstagefright/OMXCodec.cpp
libmediaplayerservice: Enable b-frame recording

- put back setupMPEG4EncodeParmaters call.
- Set nBFrames field to 1 for index OMX_IndexParamVideoMpeg4 and OMX_IndexParamVideoAVC
  depending on the recording profile.
- setprop encoder.video.profile depending on the format
- for H.264, set to one of base, main, high
- for MPEG4, set to one of simple, asp

Change-Id: I7b7647da76390a1adca62d7ef2c8d92365c79e01

Conflicts:

	media/libmediaplayerservice/StagefrightRecorder.cpp
libstagefright: Enable metadata mode recording

- Metada mode video recording is enabled by default.
- use setprop debug.camcorder.disablemeta 1 to disable metadata mode recording.

Change-Id: If994c468c3e24ae03b14462f2311504c3d957426

Conflicts:

	media/libmediaplayerservice/StagefrightRecorder.cpp
	media/libstagefright/OMXCodec.cpp
Revert "libmediaplayerservice.so hack to allow camcorder to load with current setup"

This reverts commit 3e3b9d41e4b000d1401ee56b39c47a7bf0296481.