Struct gstreamer::TagSetter[]

pub struct TagSetter(_, _);

Element interface that allows setting of media metadata.

Elements that support changing a stream's metadata will implement this interface. Examples of such elements are 'vorbisenc', 'theoraenc' and 'id3v2mux'.

If you just want to retrieve metadata in your application then all you need to do is watch for tag messages on your pipeline's bus. This interface is only for setting metadata, not for extracting it. To set tags from the application, find tagsetter elements and set tags using e.g. TagSetter::merge_tags or TagSetter::add_tags. Also consider setting the TagMergeMode that is used for tag events that arrive at the tagsetter element (default mode is to keep existing tags). The application should do that before the element goes to State::Paused.

Elements implementing the TagSetter interface often have to merge any tags received from upstream and the tags set by the application via the interface. This can be done like this:

GstTagMergeMode merge_mode;
const GstTagList *application_tags;
const GstTagList *event_tags;
GstTagSetter *tagsetter;
GstTagList *result;

tagsetter = GST_TAG_SETTER (element);

merge_mode = gst_tag_setter_get_tag_merge_mode (tagsetter);
application_tags = gst_tag_setter_get_tag_list (tagsetter);
event_tags = (const GstTagList *) element->event_tags;

GST_LOG_OBJECT (tagsetter, "merging tags, merge mode = %d", merge_mode);
GST_LOG_OBJECT (tagsetter, "event tags: %" GST_PTR_FORMAT, event_tags);
GST_LOG_OBJECT (tagsetter, "set   tags: %" GST_PTR_FORMAT, application_tags);

result = gst_tag_list_merge (application_tags, event_tags, merge_mode);

GST_LOG_OBJECT (tagsetter, "final tags: %" GST_PTR_FORMAT, result);

Implements

TagSetterExt, ElementExt, GstObjectExt, glib::object::ObjectExt

Trait Implementations

impl Clone for TagSetter

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Hash for TagSetter

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

impl Ord for TagSetter

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

impl StaticType for TagSetter

Returns the type identifier of Self.

impl<T: IsA<Object>> PartialEq<T> for TagSetter

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Eq for TagSetter

impl<T: IsA<Object>> PartialOrd<T> for TagSetter

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl Debug for TagSetter

Formats the value using the given formatter. Read more

impl IsA<Element> for TagSetter

impl IsA<Object> for TagSetter

impl IsA<Object> for TagSetter

impl Send for TagSetter
[src]

impl Sync for TagSetter
[src]