Show / Hide Table of Contents

Struct CodecDescription

Represents a codec descriptor with various properties.

This struct is a readonly wrapper around an FFmpeg.AutoGen._AVCodecDescriptor pointer, providing a way to access codec descriptor properties in a safe manner.

Implements
IEquatable<CodecDescription>
Inherited Members
object.GetType()
object.Equals(object, object)
object.ReferenceEquals(object, object)
Namespace: FFmpeg.Codecs
Assembly: FFmpeg.dll
Syntax
public readonly struct CodecDescription : IEquatable<CodecDescription>

Properties

View Source

Id

Gets the codec ID, which is a value from the CodecID enumeration.

Declaration
public CodecID Id { get; }
Property Value
Type Description
CodecID

The codec ID for this codec descriptor.

View Source

LongName

Gets the more descriptive name for this codec.

This name provides additional details about the codec and may be null if not available.

Declaration
public string? LongName { get; }
Property Value
Type Description
string

The more descriptive name of the codec, or null if not available.

View Source

MimeTypes

Gets the MIME types associated with the codec.

This property returns an array of MIME types that are associated with the codec. If no MIME types are available, it returns an empty array. The first item in the array is always the preferred MIME type if available.

Declaration
public string[] MimeTypes { get; }
Property Value
Type Description
string[]

An array of MIME types associated with the codec, or an empty array if none are available.

View Source

Name

Gets the name of the codec.

This name is non-empty and unique for each codec descriptor. It is intended for identification purposes.

Declaration
public string Name { get; }
Property Value
Type Description
string

The name of the codec.

View Source

Profiles

Gets the array of profiles recognized for this codec.

This property returns a read-only collection of profiles associated with the codec. Profiles provide additional information about codec capabilities and configurations. If no profiles are available, it returns an empty collection.

Declaration
public ReadOnlyCollection<Profile> Profiles { get; }
Property Value
Type Description
ReadOnlyCollection<Profile>

A ReadOnlyCollection<T> containing the profiles recognized for this codec, or an empty collection if none are available.

View Source

Properties

Gets the codec properties, which is a combination of flags from the CodecProperties enumeration.

Declaration
public CodecProperties Properties { get; }
Property Value
Type Description
CodecProperties

The properties of the codec, represented as a bit field combining various flags.

View Source

Type

Gets the media type of the codec, which is a value from the MediaType enumeration.

Declaration
public MediaType Type { get; }
Property Value
Type Description
MediaType

The media type for this codec descriptor.

Methods

View Source

Equals(CodecDescription)

Determines whether the specified CodecDescription is equal to the current CodecDescription.

Declaration
public bool Equals(CodecDescription other)
Parameters
Type Name Description
CodecDescription other

The CodecDescription to compare with the current instance.

Returns
Type Description
bool

true if the specified CodecDescription is equal to the current instance; otherwise, false.

View Source

Equals(object?)

Determines whether the specified object is equal to the current CodecDescription.

Declaration
public override bool Equals(object? obj)
Parameters
Type Name Description
object obj

The object to compare with the current CodecDescription.

Returns
Type Description
bool

true if the specified object is equal to the current CodecDescription; otherwise, false.

Overrides
ValueType.Equals(object)
View Source

GetAllCodecDescriptors()

Retrieves an array of all available codec descriptors.

This method iterates through all codec descriptors registered with FFmpeg and collects them into an array.

Declaration
public static CodecDescription[] GetAllCodecDescriptors()
Returns
Type Description
CodecDescription[]

An array of CodecDescription instances representing all available codec descriptors.

View Source

GetCodecDescriptor(Codec)

Retrieves a CodecDescription for the specified Codec.

Declaration
public static CodecDescription GetCodecDescriptor(Codec codec)
Parameters
Type Name Description
Codec codec

The codec to get the descriptor for.

Returns
Type Description
CodecDescription

A CodecDescription instance representing the codec descriptor.

Exceptions
Type Condition
ArgumentException

Thrown if the codec does not correspond to a valid codec descriptor.

View Source

GetCodecDescriptor(CodecID)

Retrieves a CodecDescription for the specified codec ID.

Declaration
public static CodecDescription GetCodecDescriptor(CodecID codecID)
Parameters
Type Name Description
CodecID codecID

The codec ID to get the descriptor for.

Returns
Type Description
CodecDescription

A CodecDescription instance representing the codec descriptor.

Exceptions
Type Condition
ArgumentException

Thrown if the codecID does not correspond to a valid codec descriptor.

View Source

GetCodecDescriptor(string)

Retrieves a CodecDescription for the specified codec name.

Declaration
public static CodecDescription GetCodecDescriptor(string name)
Parameters
Type Name Description
string name

The name of the codec to get the descriptor for.

Returns
Type Description
CodecDescription

A CodecDescription instance representing the codec descriptor.

Exceptions
Type Condition
ArgumentException

Thrown if the name does not correspond to a valid codec descriptor.

View Source

GetHashCode()

Serves as a hash function for the CodecDescription type.

Declaration
public override int GetHashCode()
Returns
Type Description
int

A hash code for the current CodecDescription.

Overrides
ValueType.GetHashCode()
View Source

ToString()

Returns a string representation of the CodecDescription.

Declaration
public override string ToString()
Returns
Type Description
string

The long name of the codec descriptor, providing a more descriptive name for the codec.

Overrides
ValueType.ToString()
View Source

TryGetCodecDescriptor(Codec, out CodecDescription)

Attempts to retrieve a CodecDescription for the specified Codec.

Declaration
public static bool TryGetCodecDescriptor(Codec codec, out CodecDescription descriptor)
Parameters
Type Name Description
Codec codec

The codec to get the descriptor for.

CodecDescription descriptor

When this method returns, contains the CodecDescription instance if the codec was valid.

Returns
Type Description
bool

true if the descriptor was successfully retrieved; otherwise, false.

View Source

TryGetCodecDescriptor(CodecID, out CodecDescription)

Attempts to retrieve a CodecDescription for the specified codec ID.

Declaration
public static bool TryGetCodecDescriptor(CodecID codecID, out CodecDescription descriptor)
Parameters
Type Name Description
CodecID codecID

The codec ID to get the descriptor for.

CodecDescription descriptor

When this method returns, contains the CodecDescription instance if the codec ID was valid.

Returns
Type Description
bool

true if the descriptor was successfully retrieved; otherwise, false.

View Source

TryGetCodecDescriptor(string, out CodecDescription)

Attempts to retrieve a CodecDescription for the specified codec name.

Declaration
public static bool TryGetCodecDescriptor(string name, out CodecDescription descriptor)
Parameters
Type Name Description
string name

The name of the codec to get the descriptor for.

CodecDescription descriptor

When this method returns, contains the CodecDescription instance if the name was valid.

Returns
Type Description
bool

true if the descriptor was successfully retrieved; otherwise, false.

Operators

View Source

operator ==(CodecDescription, CodecDescription)

Determines whether two CodecDescription instances are equal.

Declaration
public static bool operator ==(CodecDescription left, CodecDescription right)
Parameters
Type Name Description
CodecDescription left

The first CodecDescription instance.

CodecDescription right

The second CodecDescription instance.

Returns
Type Description
bool

true if the two instances are equal; otherwise, false.

View Source

operator !=(CodecDescription, CodecDescription)

Determines whether two CodecDescription instances are not equal.

Declaration
public static bool operator !=(CodecDescription left, CodecDescription right)
Parameters
Type Name Description
CodecDescription left

The first CodecDescription instance.

CodecDescription right

The second CodecDescription instance.

Returns
Type Description
bool

true if the two instances are not equal; otherwise, false.

Implements

IEquatable<T>
  • View Source
In this article
Back to top Generated by DocFX