It is also necessary to send the SPS\PPS along with the keyframe, in addition to the AVCSequenceHeader
Now all players do not freeze and change resolution anywhere in the stream!
Tested: PotPlayer, MPC (hard accel\soft), Chrome, Forefox, FFplay (also with h264_qsv decoder)
See
https://github.com/begeekmyfriend/yasea/issues/832
The buffer address is forced to be aligned by allocateDirect method in
ByteBuffer so the valid data may not be stored from the first byte of the
buffer witch is still returned by the array method in ByteBuffer. So we need
to substitute allocate method for allocate direct method when fetching the
image from the camera.
Signed-off-by: begeekmyfriend <begeekmyfriend@gmail.com>
Assume there always be single slice for each video frame when sps and
pps are found. That would promote efficiency on some low-end devices.
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
Some devices produce unstandard H.264 slice without startcode. So we
ignore the annexb exception processing since it does not matter for
streaming.
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>