Fix crash in MyHandler when sockets are not set.

-When going quickly in and out of the video view during an rtsp
streaming session, a race condition occurs and MyHandler tries to
connect to a socket that has been reset. To avoid this,
checks are added.
- If there are errors during setupTrack 1, it is no use
setting up track 2. It will cause new errors.
- No assert for socket connect since there is a normal
status check already.

Change-Id: Ie06221d6c0d78ce0449f76c782ed5120fa646bfd
Uninitialized pointer can cause crash.

mpAudioTrack should be initialized in any case.
If getOutputSamplingRate returns ERROR, this won't be initialized.
As a result, deleting this field in dtor can cause crash.

Change-Id: I950d353361b19635302339dac35752a2514d2d80
Signed-off-by: You Kim <you.kim72@gmail.com>
avcenc: Prepend startcodes to output buffers

This makes the encoder output data that is similar to what
actual HW encoders output. This form is also what is expected
by virtually every other component - the only exception
seems to be stagefright's MPEG4Writer which happens to work
with this format.

This also makes the encoder's output work in other decoders
when passing through directly. If feeding the encoded data
straight through to a decoder (such as in the EncodeDecodeTest
CTS test), the output from OMX.google.h264.encoder cannot be
decoded by e.g. OMX.Nvidia.h264.decode on a Nexus 7 or
OMX.SEC.avc.dec on a Galaxy S3.

Change-Id: I6e16433a4a66936e3080723c8233681f53bd55e5
Fixed data offset at parsing IPMP Descriptors

MPEG4Extractor::parseDrmSINF() miscalculated data offset in parsing
IPMP Descriptors. This commit makes it to take in 2 bytes which is
the size of IPMPS_Type field.

Change-Id: I42cbb6793af9d9b2f14dbfdd7a616096002793f9
Fix SIGABRT when playing mp4 file

If the track duration was shorter than the segment duration, the calculated
encoder padding would be negative, resulting in a crash.
b/11823061
https://code.google.com/p/android/issues/detail?id=62610

Change-Id: I3989ad88caea38d212b61355c15aec13382c6116
Merge "Fix crash in MyHandler when sockets are not set." into pac-4.4
Merge "Uninitialized pointer can cause crash." into pac-4.4
Merge "avcenc: Prepend startcodes to output buffers" into pac-4.4
Merge "Fixed data offset at parsing IPMP Descriptors" into pac-4.4
Merge "Fix SIGABRT when playing mp4 file" into pac-4.4