libstagefright: Enable HFR feature for video recording

- Enable HFR related calls to set HFR mode in stagefright and
  libmediaplayerservice
- Perform HFR scaling with mp4 timescale parameter instead of
  recalculating timestamps

Change-Id: Ie30637093d91ed7f5a41c5137c3ff45e1370a906

libstagefright: HSR: Check if HSR enabled, use HFR value for HSR

- HSR is high speed recording hint from camera app, if this is set
  use frame rate set in HFR as normal encoder frame rate.
- HSR hint also indicates that this is not HFR feature and treat
  this encoding as normal encoding

Change-Id: Ifff59cd8ed88efca230fd34e46325a11728e8c86

libmedia: Adding HFR entry in MediaProfiles.cpp

-- Adding HFR entries for max HFR mode, max HFR width & max HFR height
   in MediaProfiles.cpp

CRs-Fixed: 589983
Change-Id: Iafcc1be4124879a029a2e4b8aded35150d0c120b

libstagefright: Use hw encoder for video recording

Use hw encoder for video recording based on the platform.

CRs-Fixed: 576174
Change-Id: I5d14d2fabb8d39fe940fa25c88b90252bfd07bc0

libstagefright: Fixed typo in target name

Target name was wrong which was causing this flag to be not set thereby
software codecs were also being used

Change-Id: I3f3a0de4eda0fef2f2f26579645a4a06a1ecddaf
CRs-Fixed: 582977

stagefright: Correct total duration of HFR clips

HFR leverages the mp4 track timescale parameter which is not
considered when calculating total clip duration. This makes tracks
report the correct duration so that total clip duration is computed
correctly.

Change-Id: I8ff556913317eea15030f9f6920cefa560133872

libstagefright: Cleanup HFR cruft

Change-Id: I67d43cd2e14f33e2915afd61b590c32d7c97a9c6

Conflicts:
	media/libstagefright/ExtendedUtils.cpp
	media/libstagefright/include/ExtendedUtils.h
stagefright: Disable HSR for now

 * Depends on updated media repo, we're not quite ready.

Change-Id: I76e6577e771de09617a8831e7fe3d1d525ee8fd8
media_profiles: the HFR parameters don't need to be mandatory

Change-Id: I5e2d32f3be31f2ef82c314088d032105e6c8a5f8
libstagefright: Add NULL check for mHFRRatio

Commit 12fa017cb "libstagefright: Enable HFR feature for video recording"
is not yet fully implemented. Camera recording will fail because timeScale
is not calculated properly. Add a simple NULL check to fix.

Change-Id: Ieea78efb43645f57615309a91508092433bc34b3
stagefright: OMXCodec: free allocated port-buffers if init fails

If an error is encountered while allocating port buffers, init
would fail and buffers already allocated would not be freed.
Move OMXCodec to ERROR state and explicitly stop omx component,
hence forcing free-ing up of allocated buffers.
Also defer setting port-status to ENABLED only after having
moved the component to IDLE and add graphicBuffer to port-
buffers-list only if setBuffer is successful.

Change-Id: I54ffb2a299376bf1716473e94948c36648d24b92
CRs-Fixed: 610702

Conflicts:
	media/libstagefright/OMXCodec.cpp
ACodec: Add video codec fallback logic

- Check while onAllocate if codec is capable of handling video
  resolution. If not fallback\retry other capable components in the
  list

Change-Id: I3203275be23651dbd9ad7a7397526ac601a3350a