| 1 | // Generated by gmmproc 2.50.1 -- DO NOT MODIFY! |
| 2 | #ifndef _GSTREAMERMM_TOC_H |
| 3 | #define _GSTREAMERMM_TOC_H |
| 4 | |
| 5 | |
| 6 | #include <glibmm/ustring.h> |
| 7 | #include <sigc++/sigc++.h> |
| 8 | |
| 9 | /* gstreamermm - a C++ wrapper for gstreamer |
| 10 | * |
| 11 | * Copyright 2008-2016 The gstreamermm Development Team |
| 12 | * |
| 13 | * This library is free software; you can redistribute it and/or |
| 14 | * modify it under the terms of the GNU Lesser General Public |
| 15 | * License as published by the Free Software Foundation; either |
| 16 | * version 2.1 of the License, or (at your option) any later version. |
| 17 | * |
| 18 | * This library is distributed in the hope that it will be useful, |
| 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 21 | * Lesser General Public License for more details. |
| 22 | * |
| 23 | * You should have received a copy of the GNU Lesser General Public |
| 24 | * License along with this library; if not, write to the Free |
| 25 | * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
| 26 | */ |
| 27 | |
| 28 | #include <gst/gst.h> |
| 29 | #include <gstreamermm/miniobject.h> |
| 30 | #include <gstreamermm/taglist.h> |
| 31 | |
| 32 | |
| 33 | namespace Gst |
| 34 | { |
| 35 | class TocEntry; |
| 36 | |
| 37 | /** @addtogroup gstreamermmEnums gstreamermm Enums and Flags */ |
| 38 | |
| 39 | /** |
| 40 | * @var TocScope TOC_SCOPE_GLOBAL |
| 41 | * Global TOC representing all selectable options |
| 42 | * (this is what applications are usually interested in). |
| 43 | * |
| 44 | * @var TocScope TOC_SCOPE_CURRENT |
| 45 | * TOC for the currently active/selected stream |
| 46 | * (this is a TOC representing the current stream from start to EOS, |
| 47 | * and is what a TOC writer / muxer is usually interested in; it will |
| 48 | * usually be a subset of the global TOC, e.g. just the chapters of |
| 49 | * the current title, or the chapters selected for playback from the |
| 50 | * current title). |
| 51 | * |
| 52 | * @enum TocScope |
| 53 | * |
| 54 | * The scope of a TOC. |
| 55 | * |
| 56 | * @ingroup gstreamermmEnums |
| 57 | */ |
| 58 | enum TocScope |
| 59 | { |
| 60 | TOC_SCOPE_GLOBAL = 1, |
| 61 | TOC_SCOPE_CURRENT |
| 62 | }; |
| 63 | |
| 64 | } // namespace Gst |
| 65 | |
| 66 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 67 | namespace Glib |
| 68 | { |
| 69 | |
| 70 | template <> |
| 71 | class Value<Gst::TocScope> : public Glib::Value_Enum<Gst::TocScope> |
| 72 | { |
| 73 | public: |
| 74 | static GType value_type() G_GNUC_CONST; |
| 75 | }; |
| 76 | |
| 77 | } // namespace Glib |
| 78 | #endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 79 | |
| 80 | namespace Gst |
| 81 | { |
| 82 | |
| 83 | /** |
| 84 | * @var TocEntryType TOC_ENTRY_TYPE_ANGLE |
| 85 | * Entry is an angle (i.e.\ an alternative). |
| 86 | * |
| 87 | * @var TocEntryType TOC_ENTRY_TYPE_VERSION |
| 88 | * Entry is a version (i.e. alternative). |
| 89 | * |
| 90 | * @var TocEntryType TOC_ENTRY_TYPE_EDITION |
| 91 | * Entry is an edition (i.e. alternative). |
| 92 | * |
| 93 | * @var TocEntryType TOC_ENTRY_TYPE_INVALID |
| 94 | * Invalid entry type value. |
| 95 | * |
| 96 | * @var TocEntryType TOC_ENTRY_TYPE_TITLE |
| 97 | * Entry is a title (i.e. a part of a sequence). |
| 98 | * |
| 99 | * @var TocEntryType TOC_ENTRY_TYPE_TRACK |
| 100 | * Entry is a track (i.e. a part of a sequence). |
| 101 | * |
| 102 | * @var TocEntryType TOC_ENTRY_TYPE_CHAPTER |
| 103 | * Entry is a chapter (i.e. a part of a sequence). |
| 104 | * |
| 105 | * @enum TocEntryType |
| 106 | * |
| 107 | * The different types of TOC entries (see Gst::TocEntry). |
| 108 | * |
| 109 | * There are two types of TOC entries: alternatives or parts in a sequence. |
| 110 | * |
| 111 | * @ingroup gstreamermmEnums |
| 112 | */ |
| 113 | enum TocEntryType |
| 114 | { |
| 115 | TOC_ENTRY_TYPE_ANGLE = -3, |
| 116 | TOC_ENTRY_TYPE_VERSION, |
| 117 | TOC_ENTRY_TYPE_EDITION, |
| 118 | TOC_ENTRY_TYPE_INVALID, |
| 119 | TOC_ENTRY_TYPE_TITLE, |
| 120 | TOC_ENTRY_TYPE_TRACK, |
| 121 | TOC_ENTRY_TYPE_CHAPTER |
| 122 | }; |
| 123 | |
| 124 | } // namespace Gst |
| 125 | |
| 126 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 127 | namespace Glib |
| 128 | { |
| 129 | |
| 130 | template <> |
| 131 | class Value<Gst::TocEntryType> : public Glib::Value_Enum<Gst::TocEntryType> |
| 132 | { |
| 133 | public: |
| 134 | static GType value_type() G_GNUC_CONST; |
| 135 | }; |
| 136 | |
| 137 | } // namespace Glib |
| 138 | #endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 139 | |
| 140 | namespace Gst |
| 141 | { |
| 142 | |
| 143 | /** |
| 144 | * @var TocLoopType TOC_LOOP_NONE |
| 145 | * Single forward playback. |
| 146 | * |
| 147 | * @var TocLoopType TOC_LOOP_FORWARD |
| 148 | * Repeat forward. |
| 149 | * |
| 150 | * @var TocLoopType TOC_LOOP_REVERSE |
| 151 | * Repeat backward. |
| 152 | * |
| 153 | * @var TocLoopType TOC_LOOP_PING_PONG |
| 154 | * Repeat forward and backward. |
| 155 | * |
| 156 | * @enum TocLoopType |
| 157 | * |
| 158 | * How a Gst::TocEntry should be repeated. By default, entries are played a |
| 159 | * single time. |
| 160 | * |
| 161 | * @ingroup gstreamermmEnums |
| 162 | */ |
| 163 | enum TocLoopType |
| 164 | { |
| 165 | TOC_LOOP_NONE, |
| 166 | TOC_LOOP_FORWARD, |
| 167 | TOC_LOOP_REVERSE, |
| 168 | TOC_LOOP_PING_PONG |
| 169 | }; |
| 170 | |
| 171 | } // namespace Gst |
| 172 | |
| 173 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 174 | namespace Glib |
| 175 | { |
| 176 | |
| 177 | template <> |
| 178 | class Value<Gst::TocLoopType> : public Glib::Value_Enum<Gst::TocLoopType> |
| 179 | { |
| 180 | public: |
| 181 | static GType value_type() G_GNUC_CONST; |
| 182 | }; |
| 183 | |
| 184 | } // namespace Glib |
| 185 | #endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 186 | |
| 187 | namespace Gst |
| 188 | { |
| 189 | |
| 190 | |
| 191 | /** Gst::Toc lets you to inform other elements in pipeline or application that playing |
| 192 | * source has some kind of table of contents (TOC). These may be chapters, editions, |
| 193 | * angles or other types. For example: DVD chapters, Matroska chapters or cue sheet |
| 194 | * TOC. Such TOC will be useful for applications to display instead of just a |
| 195 | * playlist. |
| 196 | * |
| 197 | * Using TOC is very easy. Firstly, create Gst::Toc structure which represents root |
| 198 | * contents of the source. You can also attach TOC-specific tags to it. Then fill |
| 199 | * it with Gst::TocEntry entries by appending them to the Gst::Toc using |
| 200 | * append_entry(), and appending subentries to a Gst::TocEntry using |
| 201 | * append_sub_entry(). |
| 202 | * |
| 203 | * Note that root level of the TOC can contain only either editions or chapters. You |
| 204 | * should not mix them together at the same level. Otherwise you will get serialization |
| 205 | * /deserialization errors. Make sure that no one of the entries has negative start and |
| 206 | * stop values. |
| 207 | * |
| 208 | * Use Gst::EventToc class to create TOC event, and parse_toc() to |
| 209 | * parse received TOC event. Use Gst::EventTocSelect to create a new TOC select event, |
| 210 | * and parse_toc_select() to parse received TOC select event. The same rule for |
| 211 | * the messages: MessageToc to create new TOC message, and |
| 212 | * parse() to parse received TOC message. |
| 213 | * |
| 214 | * TOCs can have global scope or current scope. Global scope TOCs contain |
| 215 | * all entries that can possibly be selected using a toc select event, and |
| 216 | * are what an application is usually interested in. TOCs with current scope |
| 217 | * only contain the parts of the TOC relevant to the currently selected/playing |
| 218 | * stream; the current scope TOC is used by downstream elements such as muxers |
| 219 | * to write correct TOC entries when transcoding files, for example. When |
| 220 | * playing a DVD, the global TOC would contain a hierarchy of all titles, |
| 221 | * chapters and angles, for example, while the current TOC would only contain |
| 222 | * the chapters for the currently playing title if playback of a specific |
| 223 | * title was requested. |
| 224 | * |
| 225 | * Applications and plugins should not rely on TOCs having a certain kind of |
| 226 | * structure, but should allow for different alternatives. For example, a |
| 227 | * simple CUE sheet embedded in a file may be presented as a flat list of |
| 228 | * track entries, or could have a top-level edition node (or some other |
| 229 | * alternative type entry) with track entries underneath that node; or even |
| 230 | * multiple top-level edition nodes (or some other alternative type entries) |
| 231 | * each with track entries underneath, in case the source file has extracted |
| 232 | * a track listing from different sources). |
| 233 | */ |
| 234 | class Toc : public MiniObject |
| 235 | { |
| 236 | public: |
| 237 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 238 | using CppObjectType = Toc; |
| 239 | using BaseObjectType = GstToc; |
| 240 | #endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 241 | |
| 242 | |
| 243 | /** Increment the reference count for this object. |
| 244 | * You should never need to do this manually - use the object via a RefPtr instead. |
| 245 | */ |
| 246 | void reference() const; |
| 247 | |
| 248 | /** Decrement the reference count for this object. |
| 249 | * You should never need to do this manually - use the object via a RefPtr instead. |
| 250 | */ |
| 251 | void unreference() const; |
| 252 | |
| 253 | ///Provides access to the underlying C instance. |
| 254 | GstToc* gobj(); |
| 255 | |
| 256 | ///Provides access to the underlying C instance. |
| 257 | const GstToc* gobj() const; |
| 258 | |
| 259 | ///Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. |
| 260 | GstToc* gobj_copy() const; |
| 261 | |
| 262 | Toc() = delete; |
| 263 | |
| 264 | // noncopyable |
| 265 | Toc(const Toc&) = delete; |
| 266 | Toc& operator=(const Toc&) = delete; |
| 267 | |
| 268 | protected: |
| 269 | // Do not derive this. Gst::Toc can neither be constructed nor deleted. |
| 270 | |
| 271 | void operator delete(void*, std::size_t); |
| 272 | |
| 273 | private: |
| 274 | |
| 275 | public: |
| 276 | |
| 277 | /** Appends the Gst::TocEntry @a entry to @a toc. |
| 278 | * |
| 279 | * @param entry A Gst::TocEntry. |
| 280 | */ |
| 281 | void append_entry(Glib::RefPtr<Gst::TocEntry> entry); |
| 282 | |
| 283 | void dump(); |
| 284 | |
| 285 | void dump() const; |
| 286 | |
| 287 | |
| 288 | /** Set a Gst::TagList with tags for the complete @a toc. |
| 289 | * |
| 290 | * @param tags A Gst::TagList or <tt>nullptr</tt>. |
| 291 | */ |
| 292 | void set_tags(const Gst::TagList& tags); |
| 293 | |
| 294 | |
| 295 | /** Gets the tags for @a toc. |
| 296 | * |
| 297 | * @return A Gst::TagList for @a entry. |
| 298 | */ |
| 299 | Gst::TagList get_tags() const; |
| 300 | |
| 301 | |
| 302 | /** @return Scope of @a toc. |
| 303 | */ |
| 304 | Gst::TocScope get_scope() const; |
| 305 | |
| 306 | /** Find Gst::TocEntry with given @a uid in the @a toc. |
| 307 | * |
| 308 | * @param uid UID to find Gst::TocEntry with. |
| 309 | * @return Gst::TocEntry with specified |
| 310 | * @a uid from the @a toc, or <tt>nullptr</tt> if not found. |
| 311 | */ |
| 312 | Glib::RefPtr<Gst::TocEntry> find_entry(const Glib::ustring& uid) const; |
| 313 | |
| 314 | |
| 315 | }; |
| 316 | |
| 317 | class TocEntry : public MiniObject |
| 318 | { |
| 319 | public: |
| 320 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 321 | using CppObjectType = TocEntry; |
| 322 | using BaseObjectType = GstTocEntry; |
| 323 | #endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 324 | |
| 325 | |
| 326 | /** Increment the reference count for this object. |
| 327 | * You should never need to do this manually - use the object via a RefPtr instead. |
| 328 | */ |
| 329 | void reference() const; |
| 330 | |
| 331 | /** Decrement the reference count for this object. |
| 332 | * You should never need to do this manually - use the object via a RefPtr instead. |
| 333 | */ |
| 334 | void unreference() const; |
| 335 | |
| 336 | ///Provides access to the underlying C instance. |
| 337 | GstTocEntry* gobj(); |
| 338 | |
| 339 | ///Provides access to the underlying C instance. |
| 340 | const GstTocEntry* gobj() const; |
| 341 | |
| 342 | ///Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. |
| 343 | GstTocEntry* gobj_copy() const; |
| 344 | |
| 345 | TocEntry() = delete; |
| 346 | |
| 347 | // noncopyable |
| 348 | TocEntry(const TocEntry&) = delete; |
| 349 | TocEntry& operator=(const TocEntry&) = delete; |
| 350 | |
| 351 | protected: |
| 352 | // Do not derive this. Gst::TocEntry can neither be constructed nor deleted. |
| 353 | |
| 354 | void operator delete(void*, std::size_t); |
| 355 | |
| 356 | private: |
| 357 | |
| 358 | public: |
| 359 | |
| 360 | /** @return @a entry's entry type. |
| 361 | */ |
| 362 | TocEntryType get_entry_type(); |
| 363 | |
| 364 | /** Gets the UID of @a entry. |
| 365 | * |
| 366 | * @return The UID of @a entry. |
| 367 | */ |
| 368 | Glib::ustring get_uid(); |
| 369 | |
| 370 | /** Appends the Gst::TocEntry @a entry to @a entry. |
| 371 | * |
| 372 | * @param entry A Gst::TocEntry. |
| 373 | */ |
| 374 | void append_sub_entry(Glib::RefPtr<Gst::TocEntry> entry); |
| 375 | |
| 376 | |
| 377 | /** @return <tt>true</tt> if @a entry's type is an alternative type, otherwise <tt>false</tt>. |
| 378 | */ |
| 379 | bool is_alternative(); |
| 380 | |
| 381 | /** @return <tt>true</tt> if @a entry's type is an alternative type, otherwise <tt>false</tt>. |
| 382 | */ |
| 383 | bool is_alternative() const; |
| 384 | |
| 385 | |
| 386 | /** @return <tt>true</tt> if @a entry's type is a sequence type, otherwise <tt>false</tt>. |
| 387 | */ |
| 388 | bool is_sequence(); |
| 389 | |
| 390 | /** @return <tt>true</tt> if @a entry's type is a sequence type, otherwise <tt>false</tt>. |
| 391 | */ |
| 392 | bool is_sequence() const; |
| 393 | |
| 394 | |
| 395 | /** Gets the parent Gst::TocEntry of @a entry. |
| 396 | * |
| 397 | * @return The parent Gst::TocEntry of @a entry. |
| 398 | */ |
| 399 | Glib::RefPtr<Gst::TocEntry> get_parent(); |
| 400 | |
| 401 | /** Set @a start and @a stop values for the @a entry. |
| 402 | * |
| 403 | * @param start Start value to set. |
| 404 | * @param stop Stop value to set. |
| 405 | */ |
| 406 | void set_start_stop_times(gint64 start, gint64 stop); |
| 407 | |
| 408 | |
| 409 | /** Get @a start and @a stop values from the @a entry and write them into appropriate |
| 410 | * storages. |
| 411 | * |
| 412 | * @param start The storage for the start value, leave |
| 413 | * <tt>nullptr</tt> if not need. |
| 414 | * @param stop The storage for the stop value, leave |
| 415 | * <tt>nullptr</tt> if not need. |
| 416 | * @return <tt>true</tt> if all non-<tt>nullptr</tt> storage pointers were filled with appropriate |
| 417 | * values, <tt>false</tt> otherwise. |
| 418 | */ |
| 419 | bool get_start_stop_times(gint64& start, gint64& stop); |
| 420 | |
| 421 | /** Get @a start and @a stop values from the @a entry and write them into appropriate |
| 422 | * storages. |
| 423 | * |
| 424 | * @param start The storage for the start value, leave |
| 425 | * <tt>nullptr</tt> if not need. |
| 426 | * @param stop The storage for the stop value, leave |
| 427 | * <tt>nullptr</tt> if not need. |
| 428 | * @return <tt>true</tt> if all non-<tt>nullptr</tt> storage pointers were filled with appropriate |
| 429 | * values, <tt>false</tt> otherwise. |
| 430 | */ |
| 431 | bool get_start_stop_times(gint64& start, gint64& stop) const; |
| 432 | |
| 433 | |
| 434 | /** Get @a loop_type and @a repeat_count values from the @a entry and write them into |
| 435 | * appropriate storages. Loops are e.g. used by sampled instruments. GStreamer |
| 436 | * is not automatically applying the loop. The application can process this |
| 437 | * meta data and use it e.g. to send a seek-event to loop a section. |
| 438 | * |
| 439 | * @param loop_type The storage for the loop_type |
| 440 | * value, leave <tt>nullptr</tt> if not need. |
| 441 | * @param repeat_count The storage for the repeat_count |
| 442 | * value, leave <tt>nullptr</tt> if not need. |
| 443 | * @return <tt>true</tt> if all non-<tt>nullptr</tt> storage pointers were filled with appropriate |
| 444 | * values, <tt>false</tt> otherwise. |
| 445 | */ |
| 446 | bool get_loop(Gst::TocLoopType& loop_type, gint& repeat_count) const; |
| 447 | |
| 448 | /** Set @a loop_type and @a repeat_count values for the @a entry. |
| 449 | * |
| 450 | * @param loop_type Loop_type value to set. |
| 451 | * @param repeat_count Repeat_count value to set. |
| 452 | */ |
| 453 | void set_loop(Gst::TocLoopType loop_type, gint repeat_count); |
| 454 | |
| 455 | |
| 456 | /** Gets the parent Gst::Toc of @a entry. |
| 457 | * |
| 458 | * @return The parent Gst::Toc of @a entry. |
| 459 | */ |
| 460 | Glib::RefPtr<Gst::Toc> get_toc() const; |
| 461 | |
| 462 | |
| 463 | }; |
| 464 | |
| 465 | |
| 466 | } |
| 467 | |
| 468 | |
| 469 | namespace Glib |
| 470 | { |
| 471 | |
| 472 | /** A Glib::wrap() method for this object. |
| 473 | * |
| 474 | * @param object The C instance. |
| 475 | * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref. |
| 476 | * @result A C++ instance that wraps this C instance. |
| 477 | * |
| 478 | * @relates Gst::Toc |
| 479 | */ |
| 480 | Glib::RefPtr<Gst::Toc> wrap(GstToc* object, bool take_copy = false); |
| 481 | |
| 482 | } // namespace Glib |
| 483 | |
| 484 | |
| 485 | namespace Glib |
| 486 | { |
| 487 | |
| 488 | /** A Glib::wrap() method for this object. |
| 489 | * |
| 490 | * @param object The C instance. |
| 491 | * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref. |
| 492 | * @result A C++ instance that wraps this C instance. |
| 493 | * |
| 494 | * @relates Gst::TocEntry |
| 495 | */ |
| 496 | Glib::RefPtr<Gst::TocEntry> wrap(GstTocEntry* object, bool take_copy = false); |
| 497 | |
| 498 | } // namespace Glib |
| 499 | |
| 500 | |
| 501 | #endif /* _GSTREAMERMM_TOC_H */ |
| 502 |