Android Decode raw h264 stream with MediaCodec
问题 I have troubles with decoding and drawing raw h264 data with MediaCodec on the TextureView. I recieve the raw data in byte arrays, each of the array is NAL unit (starts with 0x00 0x00 0x00 0x01 ), also there are SPS and PPS NAL units in constant intervals. When new data arrives, I'm putting it into LinkedBlockingQueue : public void pushData(byte[] videoBuffer) { dataQueue.add(videoBuffer); if (!decoderConfigured) { // we did not receive first SPS NAL unit, we want to throw away all data until