frameworks/media: Fix aliasing violations

Change-Id: I0c3ad4d935abe6cf6df222f7d70381d868f15fe8
Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>

av: Fix aliasing violations in AudioFlinger

Change-Id: Iec37ad0c2e30f34d72f8bf63c6c1aeceba0e3d50
Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>

downmix: Fix aliasing violation

Change-Id: I1907da54e9ec40c9afe56c488a974d5286b787e4
Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>

EffectVisualizer: Fix aliasing violations

Change-Id: I35532464df41a64ed920c34ad4bc1054cf6324b2
Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>

frameworks/av: Fix build in ISO C++ 11 mode

Fix build in ISO C++ 11 mode: constructs that are being interpreted as
new string literals and const vs. constexpr

Change-Id: Ibdf4867da37b819b1a499180edcf7ad480b6b9de
Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>

av: More ISO C++ 11 fixes

Change-Id: I84bfab66d561cb0ded6e312b8cfe02e5fe2a182f
Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>

av: Fix build in ISO C++11 mode

Change-Id: I461d8ce5b24afedee245a6441b600df286c76b63
Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>

av: Fix compile errors

Don't use memcpy() on areas that may overlap
Fix aliasing violation

Change-Id: Icd54cf12c2485a3d2789d1fb75c3a8a964c4163f
Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>
camera: Ignore CAF_RESTART callbacks

 * Ignore these callbacks which are sent by Samsung camera drivers, as
   they can cause a deadlock in normal operation.

Change-Id: Iae59eb0d3050751c1a4d372c80d430a8ba957252
libstagefright: Add support to seek to zero

- Add CAN_SEEK_TO_ZERO flag in MediaExtractor to allow
  seek to zero, when previous button is pressed, for clip
  that can't be seeked.

Change-Id: Ic2761cc5bac2403ee1339da77ad02fde942a3437
Fix potential NULL pointer deference in ToneGenerator destructor

Initial members in ToneGenerator so destructor can free
allocation properly.

Change-Id: I4a686084af48f99d2eefc33e56e3239846d3d34f
libstagefright: Check for duration > 0 to avoid DivideByZero crash

- duration = 0 can cause divide by zero and for this clip duration
  is indiacted as 0.
- check for duration > 0 rather than duration >= 0

Change-Id: I58ccacbf7ede892dff9626715162ea7b1f2ddbc6
CRs-Fixed: 451855
libstagefright: Fix incorrectness nPortIndex value for QueryCodec
                The query index is wrong, it will make a death loop in
my ME722 when get resource thumbnail for MPEG4 video.

Change-Id: I64532156e762b847a8eae59560fb828549c29519
MediaScanner: Ignore dirs with .noscanandnomtp

Completely ignore directories with .noscanandnomtp files
in them. Placing a .nomedia file will still scan a
directory but exclude it from the media database. This
is so the file may still be presented for MTP purposes.

Placing .noscanandnomtp completely prevents the scan,
which saves considerable processing power and battery
life on systems with numerous media files, but prevents
them from being seen over MTP.

Change-Id: Ibff2a9f2525255a2ac34132eeee36734962fbdd7
Fix overflow of rand in ARTPConnection

without this fix, (rand()*1000)/RAND_MAX is mainly 0.

Change-Id: I48ae940a7b6974b197d81732774c9dcea107bcf1
Signed-off-by: Yajun Zeng <beanz@marvell.com>
fix a race condition of MediaPlayerServce::Client::mClient

there will be race condition between mClient.clear in MediaPlayerServce::Client::disconnect method
and c=client->mClient in in MediaPlayerServce::Client::notify method

Change-Id: I767294c4cb864c08e9c0e9f23d6d304a39016205
Signed-off-by: beanz <beanz@marvell.com>
Fixed the wrong timestamps issue about camera recording

On emulator, the camera video recording crashes randomly.
It's caused by wrong timestamp when encoding the video frame.
The element of the vector is erased before accessing it.
Therefore, when reading the timestamp from the element,
the memory of the element has been changed.

Change-Id: I9750417fbb9dc4697ccae1e78e286b23925d3764

Signed-off-by: Panfeng Chang <panfengx.chang@intel.com>
Signed-off-by: Jun Tian <jun.j.tian@intel.com>
Fix for crash if no content in DESCRIBE response

If DESCRIBE response is received with status 200 but no content,
MyHandler will still set content data for session description
parsing. This will cause NULL Pointer crash.
This fix checks whether DESCRIBE response has content before
parsing session description.

Change-Id: I114ae6fd54ce804e61718f62618ca9008425a433
Prevent invalid frame durations

Prevent frame duration from being negative when
exporting movie studio project

Change-Id: I459fb243650c777c2b59d1094acc88c3a944bd81
Avoid invalid memory access when using extractMetadata()

BpMediaMetadataRetriever::extractMetadata() returns a string
which is returned by readCString() function of the reply parcel object.
However, the parcel object is destroyed at the end of the
extractMetadata() function, and so the returned pointer is invalid.
This patch fixes this problem by storing the metadata string value.

Change-Id: I2a2ccba78246175b2845a237679d6cebe881e83b
Signed-off-by: Sangkyu Lee <sk82.lee@lge.com>
SoftAMR: Signal the right frame format

The correct enum for the format used is OMX_AUDIO_AMRFrameFormatFSF,
which is the same as is used in amrnb/enc/SoftAMRNBEncoder.cpp,
amrwbenc/SoftAMRWBEncoder.cpp and in OMXCodec and ACodec.

The OMX_AUDIO_AMRFrameFormatConformance enum refers to an odd file
format only used for conformance tests, not used in the wild.

Change-Id: Idc395fc1d4969e33453522d6ec6526876438c526
SoftVorbis: Set the right encoding in the port definition

Previously, it set the encoding type to AAC, which is just a typo.

Change-Id: I2dcae1f579e9feb0b35b6f5d334028c534275042
Revert "frameworks/media: Fix aliasing violations"

This reverts commit e44ad446710c299ac5a436c003d551e75c041b7c.
frameworks/media: Fix aliasing violations

Change-Id: I0c3ad4d935abe6cf6df222f7d70381d868f15fe8
Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>
av: Fix aliasing violations in AudioFlinger

Change-Id: Iec37ad0c2e30f34d72f8bf63c6c1aeceba0e3d50
Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>
downmix: Fix aliasing violation

Change-Id: I1907da54e9ec40c9afe56c488a974d5286b787e4
Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>
EffectVisualizer: Fix aliasing violations

Change-Id: I35532464df41a64ed920c34ad4bc1054cf6324b2
Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>