#region IDisposable-support
private bool _isDisposed = false;
+ /// <summary>
+ /// Releases the resources used by the <see cref="MediaCodec"/> object.
+ /// </summary>
+ /// <param name="disposing">
+ /// true to release both managed and unmanaged resources; false to release only unmanaged resources.
+ /// </param>
protected virtual void Dispose(bool disposing)
{
if (!_isDisposed)
Dispose(false);
}
+ /// <summary>
+ /// Releases all resources used by the <see cref="MediaCodec"/> object.
+ /// </summary>
public void Dispose()
{
Dispose(true);
/// Adds the packet to the internal queue of the codec.
/// </summary>
/// <param name="packet">The packet to be encoded or decoded.</param>
- /// <exception cref="ArgumentNullException"><paramref="packet"/> is null.</exception>
+ /// <exception cref="ArgumentNullException"><paramref name="packet"/> is null.</exception>
/// <exception cref="InvalidOperationException">The current codec is not prepared yet.</exception>
/// <remarks>Any attempts to modify the packet will fail until the <see cref="InputProcessed"/> event for the packet is invoked.</remarks>
public void ProcessInput(MediaPacket packet)
/// <param name="encoder">The value indicating encoder or decoder.</param>
/// <param name="type">The mime type to query.</param>
/// <returns>The values indicating which codec types are supported on the current device.</returns>
- /// <exception cref="ArgumentException"><paramref="type"/> is invalid.</exception>
+ /// <exception cref="ArgumentException"><paramref name="type"/> is invalid.</exception>
public MediaCodecTypes GetCodecType(bool encoder, MediaFormatVideoMimeType type)
{
ValidateNotDisposed();
/// <param name="encoder">The value indicating encoder or decoder.</param>
/// <param name="type">The mime type to query.</param>
/// <returns>The values indicating which codec types are supported on the current device.</returns>
- /// <exception cref="ArgumentException"><paramref="type"/> is invalid.</exception>
+ /// <exception cref="ArgumentException"><paramref name="type"/> is invalid.</exception>
public MediaCodecTypes GetCodecType(bool encoder, MediaFormatAudioMimeType type)
{
ValidateNotDisposed();
OverflowInBuffer = CodecDefinedBase | 0x0d,
}
+ /// <summary>
+ /// Specifies the errors of <see cref="MediaCodec"/>.
+ /// </summary>
+ /// <seealso cref="MediaCodec.ErrorOccurred"/>
public enum MediaCodecError
{
+ /// <summary>
+ /// The format is not supported.
+ /// </summary>
NotSupportedFormat = MediaCodecErrorCode.NotSupportedFormat,
+
+ /// <summary>
+ /// An internal error.
+ /// </summary>
InternalError = MediaCodecErrorCode.Internal,
+
+ /// <summary>
+ /// Not enough storage.
+ /// </summary>
OutOfStorage = MediaCodecErrorCode.OutOfStorage,
+
+ /// <summary>
+ /// The stream is invalid.
+ /// </summary>
InvalidStream = MediaCodecErrorCode.InvalidStream,
}
}