internal BitstreamBufferInfo(PPError result, PPBitstreamBuffer bitstreamBuffer) { Result = result; Size = bitstreamBuffer.size; if (Size > 0) { var bufferMap = new byte[Size]; Marshal.Copy(bitstreamBuffer.buffer, bufferMap, 0, bufferMap.Length); Buffer = bufferMap; } else { Buffer = new byte[0]; } KeyFrame = bitstreamBuffer.key_frame == PPBool.True; BitstreamBuffer = bitstreamBuffer; }
protected void OnBitstreamBuffer(PPError result, PPBitstreamBuffer bitstreamBuffer) => HandleBitstreamBuffer?.Invoke(this, new BitstreamBufferInfo(result, bitstreamBuffer));
/** * Recycles a bitstream buffer back to the encoder. * * @param[in] video_encoder A <code>PP_Resource</code> identifying the video * encoder. * @param[in] bitstream_buffer A <code>PP_BitstreamBuffer</code> that is no * longer needed by the plugin. */ public static void RecycleBitstreamBuffer( PPResource video_encoder, PPBitstreamBuffer bitstream_buffer) { _RecycleBitstreamBuffer(video_encoder, bitstream_buffer); }
extern static void _RecycleBitstreamBuffer( PPResource video_encoder, PPBitstreamBuffer bitstream_buffer);
/** * Gets the next encoded bitstream buffer from the encoder. * * @param[in] video_encoder A <code>PP_Resource</code> identifying the video * encoder. * @param[out] bitstream_buffer A <code>PP_BitstreamBuffer</code> containing * encoded video data. * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon * completion. The plugin can call GetBitstreamBuffer from the callback in * order to continuously "pull" bitstream buffers from the encoder. * * @return An int32_t containing an error code from <code>pp_errors.h</code>. * Returns PP_ERROR_FAILED if Initialize() has not successfully completed. * Returns PP_ERROR_INPROGRESS if a prior call to GetBitstreamBuffer() has * not completed. */ public static int GetBitstreamBuffer(PPResource video_encoder, out PPBitstreamBuffer bitstream_buffer, PPCompletionCallback callback) { return(_GetBitstreamBuffer(video_encoder, out bitstream_buffer, callback)); }
extern static int _GetBitstreamBuffer( PPResource video_encoder, out PPBitstreamBuffer bitstream_buffer, PPCompletionCallback callback);