public void writeSampleData(int trackIndex,ByteBuffer byteBuf,MediaCodec.BufferInfo bufferInfo) throws Exception {
  if (bufferInfo.offset > 0) {
    Log.w(TAG,String.format("encoded frame %dB, offset=%d pts=%dms",bufferInfo.size,bufferInfo.offset,bufferInfo.presentationTimeUs / 1000));
  }
  if (VIDEO_TRACK == trackIndex) {
    flv.writeVideoSample(byteBuf,bufferInfo);
  }
 else {
    flv.writeAudioSample(byteBuf,bufferInfo);
  }
}

public void writeSampleData ( int trackIndex , ByteBuffer byteBuf , MediaCodec . BufferInfo bufferInfo ) throws Exception { if ( bufferInfo . offset > 0 ) { Log . w ( TAG , String . format ( "encoded frame %dB, offset=%d pts=%dms" , bufferInfo . size , bufferInfo . offset , bufferInfo . presentationTimeUs / 1000 ) ) ; } if ( VIDEO_TRACK == trackIndex ) { flv . writeVideoSample ( byteBuf , bufferInfo ) ; } else { flv . writeAudioSample ( byteBuf , bufferInfo ) ; } }
send the annexb frame to srs over http flv .
