Struct AVMultiDictionary_ref
Represents a managed reference to an FFmpeg AVDictionary that
supports multiple values for the same key.
Implements
Inherited Members
Namespace: FFmpeg.Collections
Assembly: FFmpeg.dll
Syntax
public struct AVMultiDictionary_ref : ILookup<string, string>, IEnumerable<IGrouping<string, string>>, IEnumerable, IReference<AVMultiDictionary>, IAVPointer<_AVDictionary>
Remarks
Unlike AVMultiDictionary, this type does not own the
underlying dictionary. It provides direct access to an existing
FFmpeg AVDictionary.
Properties
View SourceCount
Gets the total number of key/value pairs contained in the dictionary.
Declaration
public readonly int Count { get; }
Property Value
| Type | Description |
|---|---|
| int |
Remarks
Multiple entries having the same key are counted individually.
this[string]
Gets an enumerable sequence containing all values associated with the specified key.
Declaration
public readonly IEnumerable<string> this[string key] { get; }
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The key whose values to get. |
Property Value
| Type | Description |
|---|---|
| IEnumerable<string> | An enumerable collection of values associated with the specified key. |
Methods
View SourceAdd(string, string)
Adds a key/value pair to the dictionary.
Declaration
public readonly 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. |
Remarks
Existing values are preserved. If the key already exists, the new value is added as an additional entry.
AsAVDictionary()
Returns a view of the referenced dictionary as an AVDictionary_ref.
Declaration
public readonly AVDictionary_ref AsAVDictionary()
Returns
| Type | Description |
|---|---|
| AVDictionary_ref |
Remarks
Since AVDictionary_ref does not support duplicate keys, retrieving a value through the returned reference returns only the first matching entry for each key.
Clear()
Clears all key/value pairs from the dictionary.
Declaration
public readonly void Clear()
Contains(string)
Determines whether the dictionary contains the specified key.
Declaration
public readonly bool Contains(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. |
GetEnumerator()
Returns an enumerator that iterates through the dictionary.
Declaration
public readonly IEnumerator<IGrouping<string, string>> GetEnumerator()
Returns
| Type | Description |
|---|---|
| IEnumerator<IGrouping<string, string>> | An enumerator that can be used to iterate through the dictionary. |
GetReferencedObject()
Creates an independent copy of the referenced dictionary.
Declaration
public readonly AVMultiDictionary? GetReferencedObject()
Returns
| Type | Description |
|---|---|
| AVMultiDictionary | A new AVMultiDictionary containing the same entries, or null if no dictionary is referenced. |
Remarks
Since FFmpeg dictionaries are not reference counted, this method performs a deep copy.
RemoveAll(string)
Removes all values associated with the specified key.
Declaration
public readonly bool RemoveAll(string key)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The key whose values to remove. |
Returns
| Type | Description |
|---|---|
| bool |
Remarks
All entries having the specified key are removed.
RemoveFirst(string)
Removes the first value associated with the specified key.
Declaration
public readonly bool RemoveFirst(string key)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The key whose first value to remove. |
Returns
| Type | Description |
|---|---|
| bool |
Remarks
If multiple values exist for the specified key, only the first matching entry is removed.
SetReferencedObject(AVMultiDictionary?)
Replaces the referenced dictionary with a copy of the specified dictionary.
Declaration
public void SetReferencedObject(AVMultiDictionary? obj)
Parameters
| Type | Name | Description |
|---|---|---|
| AVMultiDictionary | obj | The dictionary to copy, or null to free the referenced dictionary. |
ToString()
Represents a managed wrapper around FFmpeg's AVDictionary that
supports multiple values for the same key.
Declaration
public override readonly string ToString()
Returns
| Type | Description |
|---|---|
| string |
Overrides
Remarks
Unlike AVDictionary, this class allows duplicate keys by storing multiple entries with the same key.