1 /*
2  * This file is part of gtkD.
3  *
4  * gtkD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 3
7  * of the License, or (at your option) any later version, with
8  * some exceptions, please read the COPYING file.
9  *
10  * gtkD is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with gtkD; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19 
20 // generated automatically - do not change
21 // find conversion definition on APILookup.txt
22 // implement new conversion functionalities on the wrap.utils pakage
23 
24 
25 module gstreamer.TagSetterIF;
26 
27 private import glib.Str;
28 private import gobject.ObjectG;
29 private import gobject.Value;
30 private import gstreamer.TagList;
31 private import gstreamerc.gstreamer;
32 public  import gstreamerc.gstreamertypes;
33 
34 
35 /**
36  * Element interface that allows setting of media metadata.
37  * 
38  * Elements that support changing a stream's metadata will implement this
39  * interface. Examples of such elements are 'vorbisenc', 'theoraenc' and
40  * 'id3v2mux'.
41  * 
42  * If you just want to retrieve metadata in your application then all you
43  * need to do is watch for tag messages on your pipeline's bus. This
44  * interface is only for setting metadata, not for extracting it. To set tags
45  * from the application, find tagsetter elements and set tags using e.g.
46  * gst_tag_setter_merge_tags() or gst_tag_setter_add_tags(). Also consider
47  * setting the #GstTagMergeMode that is used for tag events that arrive at the
48  * tagsetter element (default mode is to keep existing tags).
49  * The application should do that before the element goes to %GST_STATE_PAUSED.
50  * 
51  * Elements implementing the #GstTagSetter interface often have to merge
52  * any tags received from upstream and the tags set by the application via
53  * the interface. This can be done like this:
54  * 
55  * |[<!-- language="C" -->
56  * GstTagMergeMode merge_mode;
57  * const GstTagList *application_tags;
58  * const GstTagList *event_tags;
59  * GstTagSetter *tagsetter;
60  * GstTagList *result;
61  * 
62  * tagsetter = GST_TAG_SETTER (element);
63  * 
64  * merge_mode = gst_tag_setter_get_tag_merge_mode (tagsetter);
65  * application_tags = gst_tag_setter_get_tag_list (tagsetter);
66  * event_tags = (const GstTagList *) element->event_tags;
67  * 
68  * GST_LOG_OBJECT (tagsetter, "merging tags, merge mode = %d", merge_mode);
69  * GST_LOG_OBJECT (tagsetter, "event tags: %" GST_PTR_FORMAT, event_tags);
70  * GST_LOG_OBJECT (tagsetter, "set   tags: %" GST_PTR_FORMAT, application_tags);
71  * 
72  * result = gst_tag_list_merge (application_tags, event_tags, merge_mode);
73  * 
74  * GST_LOG_OBJECT (tagsetter, "final tags: %" GST_PTR_FORMAT, result);
75  * ]|
76  */
77 public interface TagSetterIF{
78 	/** Get the main Gtk struct */
79 	public GstTagSetter* getTagSetterStruct(bool transferOwnership = false);
80 
81 	/** the main Gtk struct as a void* */
82 	protected void* getStruct();
83 
84 
85 	/**
86 	 * Adds the given tag / value pairs on the setter using the given merge mode.
87 	 * The list must be terminated with %NULL.
88 	 *
89 	 * Params:
90 	 *     mode = the mode to use
91 	 *     tag = tag to set
92 	 *     varArgs = tag / value pairs to set
93 	 */
94 	public void addTagValist(GstTagMergeMode mode, string tag, void* varArgs);
95 
96 	/**
97 	 * Adds the given tag / GValue pairs on the setter using the given merge mode.
98 	 * The list must be terminated with %NULL.
99 	 *
100 	 * Params:
101 	 *     mode = the mode to use
102 	 *     tag = tag to set
103 	 *     varArgs = tag / GValue pairs to set
104 	 */
105 	public void addTagValistValues(GstTagMergeMode mode, string tag, void* varArgs);
106 
107 	/**
108 	 * Adds the given tag / GValue pair on the setter using the given merge mode.
109 	 *
110 	 * Params:
111 	 *     mode = the mode to use
112 	 *     tag = tag to set
113 	 *     value = GValue to set for the tag
114 	 */
115 	public void addTagValue(GstTagMergeMode mode, string tag, Value value);
116 
117 	/**
118 	 * Returns the current list of tags the setter uses.  The list should not be
119 	 * modified or freed.
120 	 *
121 	 * This function is not thread-safe.
122 	 *
123 	 * Returns: a current snapshot of the
124 	 *     taglist used in the setter or %NULL if none is used.
125 	 */
126 	public TagList getTagList();
127 
128 	/**
129 	 * Queries the mode by which tags inside the setter are overwritten by tags
130 	 * from events
131 	 *
132 	 * Returns: the merge mode used inside the element.
133 	 */
134 	public GstTagMergeMode getTagMergeMode();
135 
136 	/**
137 	 * Merges the given list into the setter's list using the given mode.
138 	 *
139 	 * Params:
140 	 *     list = a tag list to merge from
141 	 *     mode = the mode to merge with
142 	 */
143 	public void mergeTags(TagList list, GstTagMergeMode mode);
144 
145 	/**
146 	 * Reset the internal taglist. Elements should call this from within the
147 	 * state-change handler.
148 	 */
149 	public void resetTags();
150 
151 	/**
152 	 * Sets the given merge mode that is used for adding tags from events to tags
153 	 * specified by this interface. The default is #GST_TAG_MERGE_KEEP, which keeps
154 	 * the tags set with this interface and discards tags from events.
155 	 *
156 	 * Params:
157 	 *     mode = The mode with which tags are added
158 	 */
159 	public void setTagMergeMode(GstTagMergeMode mode);
160 }