Class MediaCodec
Definition
- Namespace:
- Tizen.Multimedia.MediaCodec
- Assembly:
- Tizen.Multimedia.MediaCodec.dll
- API Level:
- 3
- Feature:
- http://tizen.org/feature/multimedia.media_codec
Provides a means to encode and decode the video and the audio data.
C#Copypublic class MediaCodec : IDisposable
- Inheritance
-
System.ObjectMediaCodec
- Implements
-
System.IDisposable
Constructors
Declaration
C#Copypublic MediaCodec()
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | The required feature is not supported. |
API Level: 3
Feature: http://tizen.org/feature/multimedia.media_codec
Properties
Declaration
C#Copypublic static IEnumerable<MediaFormatAudioMimeType> SupportedAudioCodecs { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<MediaFormatAudioMimeType> |
API Level: 3
Declaration
C#Copypublic static IEnumerable<MediaFormatVideoMimeType> SupportedVideoCodecs { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<MediaFormatVideoMimeType> |
API Level: 3
Methods
Declaration
C#Copypublic void Configure(MediaFormat format, bool encoder, MediaCodecTypes codecType)
Parameters
Type | Name | Description |
---|---|---|
MediaFormat | format | The MediaFormat for properties of media data to decode or encode. |
Boolean | encoder | The value indicating whether the codec works as an encoder or a decoder. |
MediaCodecTypes | codecType | The value indicating whether the codec uses hardware acceleration. |
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | The required feature is not supported. |
System.ArgumentNullException |
|
System.ArgumentException |
|
System.NotSupportedException | The mime type of the format is not supported. |
API Level: 3
Feature: http://tizen.org/feature/multimedia.media_codec
Declaration
C#Copypublic void Dispose()
API Level: 3
Declaration
C#Copyprotected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
Boolean | disposing | true to release both managed and unmanaged resources; false to release only unmanaged resources. |
API Level: 3
Declaration
C#Copyprotected void Finalize()
Declaration
C#Copypublic void FlushBuffers()
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | The required feature is not supported. |
API Level: 3
Feature: http://tizen.org/feature/multimedia.media_codec
GetCodecType(Boolean, MediaFormatAudioMimeType)
Retrieves supported codec types for the specified params.
Declaration
C#Copypublic MediaCodecTypes GetCodecType(bool encoder, MediaFormatAudioMimeType type)
Parameters
Type | Name | Description |
---|---|---|
Boolean | encoder | The value indicating encoder or decoder. |
MediaFormatAudioMimeType | type | The mime type to query. |
Returns
Type | Description |
---|---|
MediaCodecTypes | The values indicating which codec types are supported on the current device. |
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | The required feature is not supported. |
System.ArgumentException |
|
API Level: 3
Feature: http://tizen.org/feature/multimedia.media_codec
GetCodecType(Boolean, MediaFormatVideoMimeType)
Retrieves supported codec types for the specified params.
Declaration
C#Copypublic MediaCodecTypes GetCodecType(bool encoder, MediaFormatVideoMimeType type)
Parameters
Type | Name | Description |
---|---|---|
Boolean | encoder | The value indicating encoder or decoder. |
MediaFormatVideoMimeType | type | The mime type to query. |
Returns
Type | Description |
---|---|
MediaCodecTypes | The values indicating which codec types are supported on the current device. |
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | The required feature is not supported. |
System.ArgumentException |
|
API Level: 3
Feature: http://tizen.org/feature/multimedia.media_codec
Declaration
C#Copypublic void Prepare()
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | The required feature is not supported. |
System.InvalidOperationException | The codec is not configured yet. |
API Level: 3
Feature: http://tizen.org/feature/multimedia.media_codec
Declaration
C#Copypublic void ProcessInput(MediaPacket packet)
Parameters
Type | Name | Description |
---|---|---|
MediaPacket | packet | The packet to be encoded or decoded. |
Remarks
Any attempts to modify the packet will fail until the InputProcessed event for the packet is invoked.
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | The required feature is not supported. |
System.ArgumentNullException |
|
System.InvalidOperationException | The current codec is not prepared yet. |
API Level: 3
Feature: http://tizen.org/feature/multimedia.media_codec
Declaration
C#Copypublic void Unprepare()
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | The required feature is not supported. |
API Level: 3
Feature: http://tizen.org/feature/multimedia.media_codec
Events
Declaration
C#Copypublic event EventHandler<BufferStatusChangedEventArgs> BufferStatusChanged
Event Type
Type | Description |
---|---|
System.EventHandler<BufferStatusChangedEventArgs> |
API Level: 3
Declaration
C#Copypublic event EventHandler<EventArgs> EosReached
Event Type
Type | Description |
---|---|
System.EventHandler<EventArgs> |
API Level: 3
Declaration
C#Copypublic event EventHandler<MediaCodecErrorOccurredEventArgs> ErrorOccurred
Event Type
Type | Description |
---|---|
System.EventHandler<MediaCodecErrorOccurredEventArgs> |
API Level: 3
Declaration
C#Copypublic event EventHandler<InputProcessedEventArgs> InputProcessed
Event Type
Type | Description |
---|---|
System.EventHandler<InputProcessedEventArgs> |
API Level: 3
Declaration
C#Copypublic event EventHandler<OutputAvailableEventArgs> OutputAvailable
Event Type
Type | Description |
---|---|
System.EventHandler<OutputAvailableEventArgs> |
Remarks
The output packet needs to be disposed after it is used to clean up unmanaged resources.