Struct AVDictionary_ref
Represents a managed reference to an FFmpeg AVDictionary.
Implements
Inherited Members
Namespace: FFmpeg.Collections
Assembly: FFmpeg.dll
Syntax
public struct AVDictionary_ref : IDictionary<string, string>, ICollection<KeyValuePair<string, string>>, IEnumerable<KeyValuePair<string, string>>, IEnumerable, IReference<AVDictionary>, IAVPointer<_AVDictionary>
Remarks
Unlike AVDictionary, this type does not own the underlying
dictionary. It provides direct access to an existing
AVDictionary owned by another FFmpeg structure.
Properties
View SourceCount
Gets the number of key-value pairs contained in the dictionary.
Declaration
public readonly int Count { get; }
Property Value
| Type | Description |
|---|---|
| int |
IsReadOnly
Gets a value indicating whether the dictionary is read-only.
Declaration
public readonly bool IsReadOnly { get; }
Property Value
| Type | Description |
|---|---|
| bool |
this[string]
Gets or sets the value associated with the specified key.
Declaration
public readonly 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 in the dictionary. |
Keys
Gets a collection containing the keys in the dictionary.
Declaration
public readonly ICollection<string> Keys { get; }
Property Value
| Type | Description |
|---|---|
| ICollection<string> |
Values
Gets a collection containing the values in the dictionary.
Declaration
public readonly ICollection<string> Values { get; }
Property Value
| Type | Description |
|---|---|
| ICollection<string> |
Methods
View SourceAdd(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. |
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. |
AppendText(string, string)
Appends the specified value to the existing value under the specified key. If the key doesn't exist, it is added.
Declaration
public readonly 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. |
AsMultiDictionary()
Returns the dictionary as a multi dictionary. FFmpeg.Collections.AVDictionaryFlags.IgnoreSuffix is not supported for AVMultiDictionary_ref.
Declaration
public readonly AVMultiDictionary_ref AsMultiDictionary()
Returns
| Type | Description |
|---|---|
| AVMultiDictionary_ref | An AVMultiDictionary_ref object representing the dictionary. |
Clear()
Removes all keys and values from the dictionary.
Declaration
public void Clear()
Contains(KeyValuePair<string, string>)
Determines whether the dictionary contains a specific key-value pair.
Declaration
public readonly 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 |
ContainsKey(string)
Determines whether the dictionary contains a specific key.
Declaration
public readonly 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. |
CopyFrom(IDictionary<string, string>)
Copies all key/value pairs from the specified dictionary into the referenced dictionary.
Declaration
public void CopyFrom(IDictionary<string, string> dic)
Parameters
| Type | Name | Description |
|---|---|---|
| IDictionary<string, string> | dic | The dictionary whose entries should be copied. |
Remarks
Existing keys are overwritten.
CopyTo(KeyValuePair<string, string>[], int)
Copies the elements of the dictionary to an array, starting at a particular array index.
Declaration
public readonly void CopyTo(KeyValuePair<string, string>[] array, int arrayIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| KeyValuePair<string, string>[] | array | The one-dimensional array that is the destination of the elements copied from the dictionary. |
| int | arrayIndex | The zero-based index in the array at which copying begins. |
GetEnumerator()
Returns an enumerator that iterates through the dictionary.
Declaration
public readonly IEnumerator<KeyValuePair<string, string>> GetEnumerator()
Returns
| Type | Description |
|---|---|
| IEnumerator<KeyValuePair<string, string>> | An enumerator for the dictionary. |
GetReferencedObject()
Creates an independent copy of the referenced dictionary.
Declaration
public readonly AVDictionary? GetReferencedObject()
Returns
| Type | Description |
|---|---|
| AVDictionary | A new AVDictionary containing the same entries as the referenced dictionary, or null if no dictionary is referenced. |
Remarks
Since FFmpeg dictionaries are not reference counted, this method performs a deep copy rather than returning another reference.
Init(IDictionary<string, string>)
Replaces the contents of the referenced dictionary with the specified metadata.
Declaration
public void Init(IDictionary<string, string> metadata)
Parameters
| Type | Name | Description |
|---|---|---|
| IDictionary<string, string> | metadata | The metadata to copy into the referenced dictionary. |
Remarks
Existing entries are removed before the new entries are copied.
Specialized copy operations are used when
metadata is an
AVDictionary or
AVDictionary_ref.
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. |
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. |
SetReferencedObject(AVDictionary?)
Replaces the referenced dictionary with a copy of the specified dictionary.
Declaration
public void SetReferencedObject(AVDictionary? dict)
Parameters
| Type | Name | Description |
|---|---|---|
| AVDictionary | dict | The dictionary to set as the referenced object, or null to free the current dictionary. |
ToString()
Returns a string representation of the dictionary.
Declaration
public override readonly string ToString()
Returns
| Type | Description |
|---|---|
| string | A colon-separated list of key/value pairs in the form
|
Overrides
View SourceTryGetValue(string, out string)
Gets the value associated with the specified key.
Declaration
public readonly 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, the value associated with the specified key, if the key is found; otherwise, the default value for the value type. |
Returns
| Type | Description |
|---|---|
| bool | true if the dictionary contains an element with the specified key; otherwise, false. |