Show / Hide Table of Contents

Class AVDictionary

Represents a managed wrapper around FFmpeg's AVDictionary structure.

Inheritance
object
AVDictionary
Implements
IDictionary<string, string>
ICollection<KeyValuePair<string, string>>
IEnumerable<KeyValuePair<string, string>>
IEnumerable
IDisposable
IAVPointer<_AVDictionary>
Inherited Members
object.GetType()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: FFmpeg.Collections
Assembly: FFmpeg.dll
Syntax
public sealed class AVDictionary : IDictionary<string, string>, ICollection<KeyValuePair<string, string>>, IEnumerable<KeyValuePair<string, string>>, IEnumerable, IDisposable, IAVPointer<_AVDictionary>
Remarks

This class implements IDictionary<TKey, TValue> and provides managed access to FFmpeg metadata dictionaries.

Constructors

View Source

AVDictionary(bool, bool)

Initializes a new empty AVDictionary.

Declaration
public AVDictionary(bool ignoreCase = true, bool ignoreSuffix = false)
Parameters
Type Name Description
bool ignoreCase

If set to true, the dictionary will ignore case when comparing keys.

bool ignoreSuffix

If set to true, the dictionary will ignore suffixes when comparing keys.

View Source

AVDictionary(IEnumerable<KeyValuePair<string, string>>, bool, bool)

Initializes a new AVDictionary containing the specified key/value pairs.

Declaration
public AVDictionary(IEnumerable<KeyValuePair<string, string>> dict, bool ignoreCase = true, bool ignoreSuffix = false)
Parameters
Type Name Description
IEnumerable<KeyValuePair<string, string>> dict

The key/value pairs used to initialize the dictionary.

bool ignoreCase

true to perform case-insensitive key lookups; otherwise, false.

bool ignoreSuffix

true to ignore suffixes during key comparisons; otherwise, false.

Properties

View Source

Count

Gets the number of key-value pairs contained in the dictionary.

Declaration
public int Count { get; }
Property Value
Type Description
int
View Source

IsReadOnly

Gets a value indicating whether the dictionary is read-only.

Declaration
public bool IsReadOnly { get; }
Property Value
Type Description
bool
View Source

this[string]

Gets or sets the value associated with the specified key.

Declaration
public string this[string key] { get; set; }
Parameters
Type Name Description
string key

The key whose value to get or set.

Property Value
Type Description
string

The value associated with the specified key.

Exceptions
Type Condition
KeyNotFoundException

Thrown when the key is not found.

View Source

Keys

Gets a collection containing the keys in the dictionary.

Declaration
public ICollection<string> Keys { get; }
Property Value
Type Description
ICollection<string>
View Source

Values

Gets a collection containing the values in the dictionary.

Declaration
public ICollection<string> Values { get; }
Property Value
Type Description
ICollection<string>

Methods

View Source

Add(KeyValuePair<string, string>)

Adds the specified key-value pair to the dictionary.

Declaration
public void Add(KeyValuePair<string, string> item)
Parameters
Type Name Description
KeyValuePair<string, string> item

The key-value pair to add.

View Source

Add(string, string)

Adds the specified key and value to the dictionary.

Declaration
public void Add(string key, string value)
Parameters
Type Name Description
string key

The key of the element to add.

string value

The value of the element to add.

Exceptions
Type Condition
ArgumentNullException

Thrown when the key is null.

ArgumentException

Thrown when an element with the same key already exists in the dictionary.

View Source

AppendText(string, string)

Appends the specified text to the value associated with the specified key. If the key does not exist, a new entry is created.

Declaration
public void AppendText(string key, string value)
Parameters
Type Name Description
string key

The key of the element to add.

string value

The value to append to the existing value.

Exceptions
Type Condition
ArgumentNullException

Thrown when the key is null.

View Source

Clear()

Removes all key/value pairs from the dictionary.

Declaration
public void Clear()
View Source

Contains(KeyValuePair<string, string>)

Determines whether the dictionary contains a specific key-value pair.

Declaration
public bool Contains(KeyValuePair<string, string> item)
Parameters
Type Name Description
KeyValuePair<string, string> item

The key-value pair to locate in the dictionary.

Returns
Type Description
bool

true if the key-value pair is found; otherwise, false.

View Source

ContainsKey(string)

Determines whether the dictionary contains a specific key.

Declaration
public bool ContainsKey(string key)
Parameters
Type Name Description
string key

The key to locate in the dictionary.

Returns
Type Description
bool

true if the dictionary contains an element with the specified key; otherwise, false.

View Source

CopyTo(KeyValuePair<string, string>[], int)

Declaration
public void CopyTo(KeyValuePair<string, string>[] array, int arrayIndex)
Parameters
Type Name Description
KeyValuePair<string, string>[] array
int arrayIndex
Exceptions
Type Condition
ArgumentNullException

array is null.

ArgumentOutOfRangeException

arrayIndex is negative.

ArgumentException

The destination array is too small.

View Source

Dispose()

Releases the unmanaged FFmpeg dictionary associated with this instance.

Declaration
public void Dispose()
Remarks

After this method has been called, the dictionary should no longer be used.

View Source

~AVDictionary()

Declaration
protected ~AVDictionary()
View Source

GetEnumerator()

Returns an enumerator that iterates through the dictionary.

Declaration
public IEnumerator<KeyValuePair<string, string>> GetEnumerator()
Returns
Type Description
IEnumerator<KeyValuePair<string, string>>

An enumerator for the dictionary.

View Source

Remove(KeyValuePair<string, string>)

Removes the specified key-value pair from the dictionary.

Declaration
public bool Remove(KeyValuePair<string, string> item)
Parameters
Type Name Description
KeyValuePair<string, string> item

The key-value pair to remove.

Returns
Type Description
bool

true if the key-value pair is successfully found and removed; otherwise, false.

View Source

Remove(string)

Removes the value with the specified key from the dictionary.

Declaration
public bool Remove(string key)
Parameters
Type Name Description
string key

The key of the element to remove.

Returns
Type Description
bool

true if the element is successfully found and removed; otherwise, false.

View Source

ToString()

Returns a string representation of the dictionary.

Declaration
public override string ToString()
Returns
Type Description
string

A colon-separated list of key/value pairs in the form key=value:key2=value2.

Overrides
object.ToString()
View Source

TryGetValue(string, out string)

Gets the value associated with the specified key.

Declaration
public bool TryGetValue(string key, out string value)
Parameters
Type Name Description
string key

The key whose value to get.

string value

When this method returns, contains the value associated with key if the key was found; otherwise, Empty.

Returns
Type Description
bool

true if the dictionary contains an element with the specified key; otherwise, false.

Implements

IDictionary<TKey, TValue>
ICollection<T>
IEnumerable<T>
IEnumerable
IDisposable
IAVPointer<T>
  • View Source
In this article
Back to top Generated by DocFX