StagefrightRecorder: correct the flow of resuming or stopping from pause

1. resume from pause: start the writer first, to avoid frames dropped by
writer due to writer is not started, which caused mosaic frames.

2. stop from pause:  don't start writer, just start encoders and sources,
to avoid unwanted frames are written into clips when stopping in
paused state.

3. recover the pause(dropping frames) in MPEG4Writer.

Change-Id: I4f8f275bce6ac7bc3d4f31f372cc86b362b6c587
CRs-Fixed: 695750 695745
Fix bad checks that causes crash when streaming H.263 content.

Remove checks that causes crash for rtsp streamed h.263 content
with certain values in the RTP payload header:
Remove zero check for the five reserved bits in the payload header.
According to RFC 4629 these bits MUST be ignored by receivers.
Remove zero-check for the VRC (Video Redundancy Coding) bit,
skip packet instead.
Remove zero-check for the PLEN bits (extra picture header),
skip packet instead.
Remove zero-check for the PEBIT bits (extra picture header),
skip packet instead.
Remove corresponding zero check for the four resreved bits in the
AMR payload header. According to RFC 4867 these bits MUST be
ignored by receivers.

Change-Id: I7fc21d69a19d23da24f9267623c338d415ef1387
libstagefright: fix issues in AH263Assembler

- if the received rtp packet belongs to the current
  candidate access unit but arrived later, this packet
  still needs to be inserted into this access unit before
  submitting it. Otherwise this incomplete unit would be
  sent to the decoder and cause some potential errors.

- move the functionality for checking the malformed packet
  and calculating the offset of the payload header to one
  function.

Crs-Fixed: 694476
Change-Id: Ie66524ac4b130c443c12bfb007593e5eb4a24019
frameworks/av: miscellaneous fixes

fixes for the following issues reported by KW

5978, 8879, 8880, 8881, 8882, 8883, 8889, 8890,
8892, 8893, 9200, 9201, 10210, 11223, 11224, 18001,
83677, 84525, 5897

Change-Id: I9bb98a07af97cbfc746b21738dfce7cd9e128c94