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
ifdef "stagefright: Enable GraphicBuffer usage to decoder before querying formats"

Breaks video playback on galaxysmtd

I/OMXCodec(  151): [OMX.SEC.AVC.Decoder] AVC profile = 66 (Baseline), level = 30
I/OMXCodec(  151): [OMX.SEC.AVC.Decoder] video dimensions are 640 x 352
W/GraphicBufferAllocator(  148): alloc(640, 352, 19, 00002930, ...) failed -22 (Invalid argument)
E/        (  148): GraphicBufferAlloc::createGraphicBuffer(w=640, h=352) failed (Invalid argument), handle=0x0
E/BufferQueue(  148): [SurfaceView] dequeueBuffer: SurfaceComposer::createGraphicBuffer failed
E/OMXCodec(  151): dequeueBuffer failed: Invalid argument (22)
E/OMXCodec(  151): [OMX.SEC.AVC.Decoder] Allocate Buffer failed - error = -22
E/AwesomePlayer(  151): failed to start video source
E/MediaPlayer( 2023): error (1, -22)
E/MediaPlayer( 2023): Error (1,-22)
D/VideoView( 2023): Error: 1,-22

Change-Id: I9977dcf9fc50936038808ed06bcd85b07efd7bd8
audio: Added lock during closing of direct output

- Lock is missing when direct output is closed in
  closeOutput_nonvirtual. As mDirectAudioTracks is
  being modified in this function, we need a lock
  here to avoid synchronization issues when it is
  accessed from other methods in AudioFlinger
- Fix is protect direct audio track specific block
  with mLock

Change-Id: I88f489c3bbe21ecb198bd836c05b0bfa5826d3c6
CRs-fixed: 611654
Introduce AUDIO_LEGACY_HACK to extend support for legacy devices

this is a dirty hack but does what it should.

if we build for legacy device, eg LG Optimus Black P970, we have to use
the ICS_AUDIO_BLOBS flag to get audio.

but if we add it, we get build breakages and if we remove it, we dont have
audio at all.

this hack allows us to set the AUDIO_LEGACY_HACK flag in the BoardConfig and
prevents build breakages.

as i am unsure if every device needs that, i couldnt wrap it around the
ICS_AUDIO_BLOBS flag, thus this new flag is added.

Change-Id: Id545a684fcdc0508f4135eb7a722a9b617595532
Introduce CAMERA_LEGACY_HACK to extend support for legacy devices

same typo of patch like AUDIO_LEGACY_HACK
fixes build breakage on p970 with the following flags set
-DICS_CAMERA_BLOB -DOMAP_ICS_CAMERA

if we remove these flags, it builds fine but we have no camera as well

Change-Id: Ie91a5059153ace383d8f2a7f1539cb77861dce05
screenrecord: Add audio support

Adds audio recording to the screenrecord system. Note that
while recording, the audio is muted from the device output,
and that the audio volume is controlled separately (so make
sure to turn up your volume if you hear nothing).
Audio from the microphone can also be recorded by adding
--microphone to the command line.

Change-Id: I97dfcaf3d93b786c5466e1f4215549e3d015bcf0
screenrecord: Enable SUBMIX_IN as well and cleanup on exit

While on Nexus 5/Nexus 7 (AOSP QCOM audio), trying to turn on
SUBMIX_IN fails and is not needed, it is required on Find 5
and N1 (CAF QCOM audio), or otherwise SUBMIX_OUT won't turn
on.
We also now release the audio routing as it wouldn't revive
the audio speakers otherwise.

Change-Id: I0f80a232304733e0b0a834b188b8cfa5b88915f3
[2/3] av: Audio Themes Support

On the Java side, Android has support for both a
Video Record Start sound, and a different Video
Record Stop sound. However, this part here only
supports one video recording sound.
We added support for RECORDING_STOP sound (by default,
the same as RECORDING).

Change-Id: Iaebddd8ebf8b21633e802589a4a6175492df8f29