| 1 | // Generated by gmmproc 2.50.1 -- DO NOT MODIFY! |
| 2 | #ifndef _GSTREAMERMM_MESSAGE_H |
| 3 | #define _GSTREAMERMM_MESSAGE_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/format.h> |
| 31 | #include <gstreamermm/clock.h> |
| 32 | #include <gstreamermm/query.h> |
| 33 | #include <gstreamermm/context.h> |
| 34 | #include <gstreamermm/toc.h> |
| 35 | |
| 36 | |
| 37 | namespace Gst |
| 38 | { |
| 39 | |
| 40 | template<typename T> |
| 41 | Glib::RefPtr<T> wrap_msg_derived(GstMessage* object, bool take_copy) |
| 42 | { |
| 43 | if(take_copy && object) |
| 44 | gst_message_ref(object); |
| 45 | |
| 46 | // See the comment at the top of this file, if you want to know why the cast works. |
| 47 | return Glib::RefPtr<T>(reinterpret_cast<T*>(object)); |
| 48 | } |
| 49 | |
| 50 | /** @addtogroup gstreamermmEnums gstreamermm Enums and Flags */ |
| 51 | |
| 52 | /** |
| 53 | * @var MessageType MESSAGE_UNKNOWN |
| 54 | * An undefined message. |
| 55 | * |
| 56 | * @var MessageType MESSAGE_EOS |
| 57 | * End-of-stream reached in a pipeline. The application will |
| 58 | * only receive this message in the PLAYING state and every time it sets a |
| 59 | * pipeline to PLAYING that is in the EOS state. The application can perform a |
| 60 | * flushing seek in the pipeline, which will undo the EOS state again. |
| 61 | * |
| 62 | * @var MessageType MESSAGE_ERROR |
| 63 | * An error occurred. When the application receives an error |
| 64 | * message it should stop playback of the pipeline and not assume that more |
| 65 | * data will be played. |
| 66 | * |
| 67 | * @var MessageType MESSAGE_WARNING |
| 68 | * A warning occurred. |
| 69 | * |
| 70 | * @var MessageType MESSAGE_INFO |
| 71 | * An info message occurred. |
| 72 | * |
| 73 | * @var MessageType MESSAGE_TAG |
| 74 | * A tag was found. |
| 75 | * |
| 76 | * @var MessageType MESSAGE_BUFFERING |
| 77 | * The pipeline is buffering. When the application |
| 78 | * receives a buffering message in the PLAYING state for a non-live pipeline it |
| 79 | * must PAUSE the pipeline until the buffering completes, when the percentage |
| 80 | * field in the message is 100%. For live pipelines, no action must be |
| 81 | * performed and the buffering percentage can be used to inform the user about |
| 82 | * the progress. |
| 83 | * |
| 84 | * @var MessageType MESSAGE_STATE_CHANGED |
| 85 | * A state change happened. |
| 86 | * |
| 87 | * @var MessageType MESSAGE_STATE_DIRTY |
| 88 | * An element changed state in a streaming thread. |
| 89 | * This message is deprecated. |
| 90 | * |
| 91 | * @var MessageType MESSAGE_STEP_DONE |
| 92 | * A stepping operation finished. |
| 93 | * |
| 94 | * @var MessageType MESSAGE_CLOCK_PROVIDE |
| 95 | * An element notifies its capability of providing |
| 96 | * a clock. This message is used internally and |
| 97 | * never forwarded to the application. |
| 98 | * |
| 99 | * @var MessageType MESSAGE_CLOCK_LOST |
| 100 | * The current clock as selected by the pipeline became |
| 101 | * unusable. The pipeline will select a new clock on |
| 102 | * the next PLAYING state change. The application |
| 103 | * should set the pipeline to PAUSED and back to |
| 104 | * PLAYING when this message is received. |
| 105 | * |
| 106 | * @var MessageType MESSAGE_NEW_CLOCK |
| 107 | * A new clock was selected in the pipeline. |
| 108 | * |
| 109 | * @var MessageType MESSAGE_STRUCTURE_CHANGE |
| 110 | * The structure of the pipeline changed. This |
| 111 | * message is used internally and never forwarded to the application. |
| 112 | * |
| 113 | * @var MessageType MESSAGE_STREAM_STATUS |
| 114 | * Status about a stream, emitted when it starts, |
| 115 | * stops, errors, etc.. |
| 116 | * |
| 117 | * @var MessageType MESSAGE_APPLICATION |
| 118 | * Message posted by the application, possibly |
| 119 | * via an application-specific element. |
| 120 | * |
| 121 | * @var MessageType MESSAGE_ELEMENT |
| 122 | * Element-specific message, see the specific element's |
| 123 | * documentation. |
| 124 | * |
| 125 | * @var MessageType MESSAGE_SEGMENT_START |
| 126 | * Pipeline started playback of a segment. This |
| 127 | * message is used internally and never forwarded to the application. |
| 128 | * |
| 129 | * @var MessageType MESSAGE_SEGMENT_DONE |
| 130 | * Pipeline completed playback of a segment. This |
| 131 | * message is forwarded to the application after all elements that posted |
| 132 | * @a GST_MESSAGE_SEGMENT_START posted a GST_MESSAGE_SEGMENT_DONE message. |
| 133 | * |
| 134 | * @var MessageType MESSAGE_DURATION_CHANGED |
| 135 | * The duration of a pipeline changed. The |
| 136 | * application can get the new duration with a duration query. |
| 137 | * |
| 138 | * @var MessageType MESSAGE_ASYNC_START |
| 139 | * Posted by elements when they start an ASYNC |
| 140 | * Gst::StateChange. This message is not forwarded to the application but is used |
| 141 | * internally. |
| 142 | * |
| 143 | * @var MessageType MESSAGE_ASYNC_DONE |
| 144 | * Posted by elements when they complete an ASYNC |
| 145 | * Gst::StateChange. The application will only receive this message from the toplevel |
| 146 | * pipeline. |
| 147 | * |
| 148 | * @var MessageType MESSAGE_LATENCY |
| 149 | * Posted by elements when their latency changes. The |
| 150 | * application should recalculate and distribute a new latency. |
| 151 | * |
| 152 | * @var MessageType MESSAGE_REQUEST_STATE |
| 153 | * Posted by elements when they want the pipeline to |
| 154 | * change state. This message is a suggestion to the application which can |
| 155 | * decide to perform the state change on (part of) the pipeline. |
| 156 | * |
| 157 | * @var MessageType MESSAGE_STEP_START |
| 158 | * A stepping operation was started. |
| 159 | * |
| 160 | * @var MessageType MESSAGE_QOS |
| 161 | * A buffer was dropped or an element changed its processing |
| 162 | * strategy for Quality of Service reasons. |
| 163 | * |
| 164 | * @var MessageType MESSAGE_PROGRESS |
| 165 | * A progress message. |
| 166 | * |
| 167 | * @var MessageType MESSAGE_TOC |
| 168 | * A new table of contents (TOC) was found or previously found TOC |
| 169 | * was updated. |
| 170 | * |
| 171 | * @var MessageType MESSAGE_RESET_TIME |
| 172 | * Message to request resetting the pipeline's |
| 173 | * running time from the pipeline. This is an internal message which |
| 174 | * applications will likely never receive. |
| 175 | * |
| 176 | * @var MessageType MESSAGE_STREAM_START |
| 177 | * Message indicating start of a new stream. Useful |
| 178 | * e.g. when using playbin in gapless playback mode, to get notified when |
| 179 | * the next title actually starts playing (which will be some time after |
| 180 | * the URI for the next title has been set). |
| 181 | * |
| 182 | * @var MessageType MESSAGE_NEED_CONTEXT |
| 183 | * Message indicating that an element wants a specific context (Since 1.2). |
| 184 | * |
| 185 | * @var MessageType MESSAGE_HAVE_CONTEXT |
| 186 | * Message indicating that an element created a context (Since 1.2). |
| 187 | * |
| 188 | * @var MessageType MESSAGE_EXTENDED |
| 189 | * Message is an extended message type (see below). |
| 190 | * These extended message IDs can't be used directly with mask-based API |
| 191 | * like Gst::Bus::poll() or Gst::Bus::timed_pop_filtered(), but you can still |
| 192 | * filter for GST_MESSAGE_EXTENDED and then check the result for the |
| 193 | * specific type. (Since 1.4). |
| 194 | * |
| 195 | * @var MessageType MESSAGE_DEVICE_ADDED |
| 196 | * Message indicating a Gst::Device was added to |
| 197 | * a Gst::DeviceProvider (Since 1.4). |
| 198 | * |
| 199 | * @var MessageType MESSAGE_DEVICE_REMOVED |
| 200 | * Message indicating a Gst::Device was removed |
| 201 | * from a Gst::DeviceProvider (Since 1.4). |
| 202 | * |
| 203 | * @var MessageType MESSAGE_ANY |
| 204 | * Mask for all of the above messages. |
| 205 | * |
| 206 | * @enum MessageType |
| 207 | * |
| 208 | * The different message types that are available. |
| 209 | * |
| 210 | * @ingroup gstreamermmEnums |
| 211 | * @par Bitwise operators: |
| 212 | * <tt>%MessageType operator|(MessageType, MessageType)</tt><br> |
| 213 | * <tt>%MessageType operator&(MessageType, MessageType)</tt><br> |
| 214 | * <tt>%MessageType operator^(MessageType, MessageType)</tt><br> |
| 215 | * <tt>%MessageType operator~(MessageType)</tt><br> |
| 216 | * <tt>%MessageType& operator|=(MessageType&, MessageType)</tt><br> |
| 217 | * <tt>%MessageType& operator&=(MessageType&, MessageType)</tt><br> |
| 218 | * <tt>%MessageType& operator^=(MessageType&, MessageType)</tt><br> |
| 219 | */ |
| 220 | enum MessageType |
| 221 | { |
| 222 | MESSAGE_UNKNOWN = 0x0, |
| 223 | MESSAGE_EOS = (1 << 0), |
| 224 | MESSAGE_ERROR = (1 << 1), |
| 225 | MESSAGE_WARNING = (1 << 2), |
| 226 | MESSAGE_INFO = (1 << 3), |
| 227 | MESSAGE_TAG = (1 << 4), |
| 228 | MESSAGE_BUFFERING = (1 << 5), |
| 229 | MESSAGE_STATE_CHANGED = (1 << 6), |
| 230 | MESSAGE_STATE_DIRTY = (1 << 7), |
| 231 | MESSAGE_STEP_DONE = (1 << 8), |
| 232 | MESSAGE_CLOCK_PROVIDE = (1 << 9), |
| 233 | MESSAGE_CLOCK_LOST = (1 << 10), |
| 234 | MESSAGE_NEW_CLOCK = (1 << 11), |
| 235 | MESSAGE_STRUCTURE_CHANGE = (1 << 12), |
| 236 | MESSAGE_STREAM_STATUS = (1 << 13), |
| 237 | MESSAGE_APPLICATION = (1 << 14), |
| 238 | MESSAGE_ELEMENT = (1 << 15), |
| 239 | MESSAGE_SEGMENT_START = (1 << 16), |
| 240 | MESSAGE_SEGMENT_DONE = (1 << 17), |
| 241 | MESSAGE_DURATION_CHANGED = (1 << 18), |
| 242 | MESSAGE_LATENCY = (1 << 19), |
| 243 | MESSAGE_ASYNC_START = (1 << 20), |
| 244 | MESSAGE_ASYNC_DONE = (1 << 21), |
| 245 | MESSAGE_REQUEST_STATE = (1 << 22), |
| 246 | MESSAGE_STEP_START = (1 << 23), |
| 247 | MESSAGE_QOS = (1 << 24), |
| 248 | MESSAGE_PROGRESS = (1 << 25), |
| 249 | MESSAGE_TOC = (1 << 26), |
| 250 | MESSAGE_RESET_TIME = (1 << 27), |
| 251 | MESSAGE_STREAM_START = (1 << 28), |
| 252 | MESSAGE_NEED_CONTEXT = (1 << 29), |
| 253 | MESSAGE_HAVE_CONTEXT = (1 << 30), |
| 254 | MESSAGE_EXTENDED = (1 << 31) |
| 255 | }; |
| 256 | |
| 257 | /** @ingroup gstreamermmEnums */ |
| 258 | inline MessageType operator|(MessageType lhs, MessageType rhs) |
| 259 | { return static_cast<MessageType>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs)); } |
| 260 | |
| 261 | /** @ingroup gstreamermmEnums */ |
| 262 | inline MessageType operator&(MessageType lhs, MessageType rhs) |
| 263 | { return static_cast<MessageType>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs)); } |
| 264 | |
| 265 | /** @ingroup gstreamermmEnums */ |
| 266 | inline MessageType operator^(MessageType lhs, MessageType rhs) |
| 267 | { return static_cast<MessageType>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs)); } |
| 268 | |
| 269 | /** @ingroup gstreamermmEnums */ |
| 270 | inline MessageType operator~(MessageType flags) |
| 271 | { return static_cast<MessageType>(~static_cast<unsigned>(flags)); } |
| 272 | |
| 273 | /** @ingroup gstreamermmEnums */ |
| 274 | inline MessageType& operator|=(MessageType& lhs, MessageType rhs) |
| 275 | { return (lhs = static_cast<MessageType>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs))); } |
| 276 | |
| 277 | /** @ingroup gstreamermmEnums */ |
| 278 | inline MessageType& operator&=(MessageType& lhs, MessageType rhs) |
| 279 | { return (lhs = static_cast<MessageType>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs))); } |
| 280 | |
| 281 | /** @ingroup gstreamermmEnums */ |
| 282 | inline MessageType& operator^=(MessageType& lhs, MessageType rhs) |
| 283 | { return (lhs = static_cast<MessageType>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs))); } |
| 284 | |
| 285 | } // namespace Gst |
| 286 | |
| 287 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 288 | namespace Glib |
| 289 | { |
| 290 | |
| 291 | template <> |
| 292 | class Value<Gst::MessageType> : public Glib::Value_Flags<Gst::MessageType> |
| 293 | { |
| 294 | public: |
| 295 | static GType value_type() G_GNUC_CONST; |
| 296 | }; |
| 297 | |
| 298 | } // namespace Glib |
| 299 | #endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 300 | |
| 301 | namespace Gst |
| 302 | { |
| 303 | |
| 304 | /** |
| 305 | * @var ProgressType PROGRESS_TYPE_START |
| 306 | * A new task started. |
| 307 | * |
| 308 | * @var ProgressType PROGRESS_TYPE_CONTINUE |
| 309 | * A task completed and a new one continues. |
| 310 | * |
| 311 | * @var ProgressType PROGRESS_TYPE_COMPLETE |
| 312 | * A task completed. |
| 313 | * |
| 314 | * @var ProgressType PROGRESS_TYPE_CANCELED |
| 315 | * A task was canceled. |
| 316 | * |
| 317 | * @var ProgressType PROGRESS_TYPE_ERROR |
| 318 | * A task caused an error. An error message is also |
| 319 | * posted on the bus. |
| 320 | * |
| 321 | * @enum ProgressType |
| 322 | * |
| 323 | * The type of a Gst::MESSAGE_PROGRESS. The progress messages inform the |
| 324 | * application of the status of asynchronous tasks. |
| 325 | * |
| 326 | * @ingroup gstreamermmEnums |
| 327 | */ |
| 328 | enum ProgressType |
| 329 | { |
| 330 | PROGRESS_TYPE_START, |
| 331 | PROGRESS_TYPE_CONTINUE, |
| 332 | PROGRESS_TYPE_COMPLETE, |
| 333 | PROGRESS_TYPE_CANCELED, |
| 334 | PROGRESS_TYPE_ERROR |
| 335 | }; |
| 336 | |
| 337 | } // namespace Gst |
| 338 | |
| 339 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 340 | namespace Glib |
| 341 | { |
| 342 | |
| 343 | template <> |
| 344 | class Value<Gst::ProgressType> : public Glib::Value_Enum<Gst::ProgressType> |
| 345 | { |
| 346 | public: |
| 347 | static GType value_type() G_GNUC_CONST; |
| 348 | }; |
| 349 | |
| 350 | } // namespace Glib |
| 351 | #endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 352 | |
| 353 | namespace Gst |
| 354 | { |
| 355 | |
| 356 | /** |
| 357 | * @var StructureChangeType STRUCTURE_CHANGE_TYPE_PAD_LINK |
| 358 | * Pad linking is starting or done. |
| 359 | * |
| 360 | * @var StructureChangeType STRUCTURE_CHANGE_TYPE_PAD_UNLINK |
| 361 | * Pad unlinking is starting or done. |
| 362 | * |
| 363 | * @enum StructureChangeType |
| 364 | * |
| 365 | * The type of a Gst::MESSAGE_STRUCTURE_CHANGE. |
| 366 | * |
| 367 | * @ingroup gstreamermmEnums |
| 368 | */ |
| 369 | enum StructureChangeType |
| 370 | { |
| 371 | STRUCTURE_CHANGE_TYPE_PAD_LINK, |
| 372 | STRUCTURE_CHANGE_TYPE_PAD_UNLINK |
| 373 | }; |
| 374 | |
| 375 | } // namespace Gst |
| 376 | |
| 377 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 378 | namespace Glib |
| 379 | { |
| 380 | |
| 381 | template <> |
| 382 | class Value<Gst::StructureChangeType> : public Glib::Value_Enum<Gst::StructureChangeType> |
| 383 | { |
| 384 | public: |
| 385 | static GType value_type() G_GNUC_CONST; |
| 386 | }; |
| 387 | |
| 388 | } // namespace Glib |
| 389 | #endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 390 | |
| 391 | namespace Gst |
| 392 | { |
| 393 | |
| 394 | /** |
| 395 | * @var StreamStatusType STREAM_STATUS_TYPE_CREATE |
| 396 | * A new thread need to be created. |
| 397 | * |
| 398 | * @var StreamStatusType STREAM_STATUS_TYPE_ENTER |
| 399 | * A thread entered its loop function. |
| 400 | * |
| 401 | * @var StreamStatusType STREAM_STATUS_TYPE_LEAVE |
| 402 | * A thread left its loop function. |
| 403 | * |
| 404 | * @var StreamStatusType STREAM_STATUS_TYPE_DESTROY |
| 405 | * A thread is destroyed. |
| 406 | * |
| 407 | * @var StreamStatusType STREAM_STATUS_TYPE_START |
| 408 | * A thread is started. |
| 409 | * |
| 410 | * @var StreamStatusType STREAM_STATUS_TYPE_PAUSE |
| 411 | * A thread is paused. |
| 412 | * |
| 413 | * @var StreamStatusType STREAM_STATUS_TYPE_STOP |
| 414 | * A thread is stopped. |
| 415 | * |
| 416 | * @enum StreamStatusType |
| 417 | * |
| 418 | * The type of a Gst::MESSAGE_STREAM_STATUS. The stream status messages inform the |
| 419 | * application of new streaming threads and their status. |
| 420 | * |
| 421 | * @ingroup gstreamermmEnums |
| 422 | */ |
| 423 | enum StreamStatusType |
| 424 | { |
| 425 | STREAM_STATUS_TYPE_CREATE = 0, |
| 426 | STREAM_STATUS_TYPE_ENTER = 1, |
| 427 | STREAM_STATUS_TYPE_LEAVE = 2, |
| 428 | STREAM_STATUS_TYPE_DESTROY = 3, |
| 429 | STREAM_STATUS_TYPE_START = 8, |
| 430 | STREAM_STATUS_TYPE_PAUSE = 9, |
| 431 | STREAM_STATUS_TYPE_STOP = 10 |
| 432 | }; |
| 433 | |
| 434 | } // namespace Gst |
| 435 | |
| 436 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 437 | namespace Glib |
| 438 | { |
| 439 | |
| 440 | template <> |
| 441 | class Value<Gst::StreamStatusType> : public Glib::Value_Enum<Gst::StreamStatusType> |
| 442 | { |
| 443 | public: |
| 444 | static GType value_type() G_GNUC_CONST; |
| 445 | }; |
| 446 | |
| 447 | } // namespace Glib |
| 448 | #endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 449 | |
| 450 | namespace Gst |
| 451 | { |
| 452 | |
| 453 | |
| 454 | namespace Enums |
| 455 | { |
| 456 | |
| 457 | /** Gets a printable name for the given message type. |
| 458 | * @param type The message type. |
| 459 | * @return The name of the message type. |
| 460 | */ |
| 461 | Glib::ustring get_name(MessageType type); |
| 462 | |
| 463 | /** Gets the unique quark for the given message type. |
| 464 | * @param type The message type. |
| 465 | * @return The quark associated with the message type. |
| 466 | */ |
| 467 | Glib::QueryQuark get_quark(MessageType type); |
| 468 | |
| 469 | } //namespace Enums |
| 470 | |
| 471 | class Element; |
| 472 | class Pad; |
| 473 | class Structure; |
| 474 | class TagList; |
| 475 | |
| 476 | /** A class that represents lightweight objects to signal the application of |
| 477 | * pipeline events. |
| 478 | * Messages are implemented as a subclass of Gst::MiniObject with a generic |
| 479 | * Gst::Structure as the content. This allows for writing custom messages |
| 480 | * without requiring an API change while allowing a wide range of different |
| 481 | * types of messages. |
| 482 | * |
| 483 | * Messages are posted by objects in the pipeline and are passed to the |
| 484 | * application using the Gst::Bus. |
| 485 | * |
| 486 | * The basic use pattern of posting a message on a Gst::Bus is as follows: |
| 487 | * @code |
| 488 | * bus->post(Gst::MessageEos::create(my_element)); |
| 489 | * @endcode |
| 490 | * |
| 491 | * Last reviewed on 2016-06-06 (1.8.0) |
| 492 | */ |
| 493 | class Message : public Gst::MiniObject |
| 494 | { |
| 495 | public: |
| 496 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 497 | using CppObjectType = Message; |
| 498 | using BaseObjectType = GstMessage; |
| 499 | #endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 500 | |
| 501 | |
| 502 | /** Increment the reference count for this object. |
| 503 | * You should never need to do this manually - use the object via a RefPtr instead. |
| 504 | */ |
| 505 | void reference() const; |
| 506 | |
| 507 | /** Decrement the reference count for this object. |
| 508 | * You should never need to do this manually - use the object via a RefPtr instead. |
| 509 | */ |
| 510 | void unreference() const; |
| 511 | |
| 512 | ///Provides access to the underlying C instance. |
| 513 | GstMessage* gobj(); |
| 514 | |
| 515 | ///Provides access to the underlying C instance. |
| 516 | const GstMessage* gobj() const; |
| 517 | |
| 518 | ///Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. |
| 519 | GstMessage* gobj_copy() const; |
| 520 | |
| 521 | Message() = delete; |
| 522 | |
| 523 | // noncopyable |
| 524 | Message(const Message&) = delete; |
| 525 | Message& operator=(const Message&) = delete; |
| 526 | |
| 527 | protected: |
| 528 | // Do not derive this. Gst::Message can neither be constructed nor deleted. |
| 529 | |
| 530 | void operator delete(void*, std::size_t); |
| 531 | |
| 532 | private: |
| 533 | |
| 534 | |
| 535 | public: |
| 536 | // A copy is taken so that the original is not freed by the wrapper. |
| 537 | |
| 538 | |
| 539 | /** Access the structure of the message. |
| 540 | * |
| 541 | * @return The structure of the message. The structure is |
| 542 | * still owned by the message, which means that you should not free it and |
| 543 | * that the pointer becomes invalid when you free the message. |
| 544 | * |
| 545 | * MT safe. |
| 546 | */ |
| 547 | Gst::Structure get_structure() const; |
| 548 | |
| 549 | /** Checks if a message is writable. If not, a writable copy is made and |
| 550 | * returned. |
| 551 | * @return A Gst::Message (possibly the same pointer) that is writable. |
| 552 | */ |
| 553 | Glib::RefPtr<Gst::Message> create_writable(); |
| 554 | |
| 555 | |
| 556 | /** Retrieve the sequence number of a message. |
| 557 | * |
| 558 | * Messages have ever-incrementing sequence numbers, which may also be set |
| 559 | * explicitly via gst_message_set_seqnum(). Sequence numbers are typically used |
| 560 | * to indicate that a message corresponds to some other set of messages or |
| 561 | * events, for example a SEGMENT_DONE message corresponding to a SEEK event. It |
| 562 | * is considered good practice to make this correspondence when possible, though |
| 563 | * it is not required. |
| 564 | * |
| 565 | * Note that events and messages share the same sequence number incrementor; |
| 566 | * two events or messages will never have the same sequence number unless |
| 567 | * that correspondence was made explicitly. |
| 568 | * |
| 569 | * @return The message's sequence number. |
| 570 | * |
| 571 | * MT safe. |
| 572 | */ |
| 573 | guint32 get_seqnum() const; |
| 574 | |
| 575 | /** Set the sequence number of a message. |
| 576 | * |
| 577 | * This function might be called by the creator of a message to indicate that |
| 578 | * the message relates to other messages or events. See gst_message_get_seqnum() |
| 579 | * for more information. |
| 580 | * |
| 581 | * MT safe. |
| 582 | * |
| 583 | * @param seqnum A sequence number. |
| 584 | */ |
| 585 | void set_seqnum(guint32 seqnum); |
| 586 | |
| 587 | /** Creates a copy of the message. Returns a copy of the message. |
| 588 | * |
| 589 | * @return A new copy of @a msg. |
| 590 | * |
| 591 | * MT safe. |
| 592 | */ |
| 593 | Glib::RefPtr<Gst::Message> copy() const; |
| 594 | |
| 595 | /** Get the GstMessageType of message. |
| 596 | */ |
| 597 | MessageType get_message_type() const; |
| 598 | |
| 599 | /** Get the timestamp of message. This is the timestamp when the message was |
| 600 | * created. |
| 601 | */ |
| 602 | Gst::ClockTime get_timestamp() const; |
| 603 | |
| 604 | /** Get the object that posted the message. |
| 605 | */ |
| 606 | Glib::RefPtr<Gst::Object> get_source(); |
| 607 | Glib::RefPtr<const Gst::Object> get_source() const; |
| 608 | |
| 609 | |
| 610 | /** Checks if @a message has the given @a name. This function is usually used to |
| 611 | * check the name of a custom message. |
| 612 | * |
| 613 | * @param name Name to check. |
| 614 | * @return <tt>true</tt> if @a name matches the name of the message structure. |
| 615 | */ |
| 616 | bool has_name(const Glib::ustring& name) const; |
| 617 | |
| 618 | |
| 619 | }; |
| 620 | |
| 621 | /** An end of stream message. |
| 622 | * See create() for more details. |
| 623 | */ |
| 624 | class MessageEos : public Message |
| 625 | { |
| 626 | public: |
| 627 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 628 | using CppObjectType = MessageEos; |
| 629 | using BaseObjectType = GstMessage; |
| 630 | #endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 631 | |
| 632 | private: |
| 633 | |
| 634 | public: |
| 635 | |
| 636 | |
| 637 | /** Create a new eos message. This message is generated and posted in |
| 638 | * the sink elements of a GstBin. The bin will only forward the EOS |
| 639 | * message to the application if all sinks have posted an EOS message. |
| 640 | * |
| 641 | * @param src The object originating the message. |
| 642 | * @return The new eos message. |
| 643 | * |
| 644 | * MT safe. |
| 645 | */ |
| 646 | static Glib::RefPtr<Gst::MessageEos> create(const Glib::RefPtr<Gst::Object>& src); |
| 647 | |
| 648 | |
| 649 | }; |
| 650 | |
| 651 | /** An error message. |
| 652 | * See create() for more details. |
| 653 | */ |
| 654 | class MessageError : public Message |
| 655 | { |
| 656 | public: |
| 657 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 658 | using CppObjectType = MessageError; |
| 659 | using BaseObjectType = GstMessage; |
| 660 | #endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 661 | |
| 662 | private: |
| 663 | |
| 664 | public: |
| 665 | |
| 666 | |
| 667 | /** Create a new error message. The message will copy @a error and |
| 668 | * @a debug. This message is posted by element when a fatal event |
| 669 | * occurred. The pipeline will probably (partially) stop. The application |
| 670 | * receiving this message should stop the pipeline. |
| 671 | * |
| 672 | * @param src The object originating the message. |
| 673 | * @param error The GError for this message. |
| 674 | * @param debug A debugging string. |
| 675 | * @return The new error message. |
| 676 | * |
| 677 | * MT safe. |
| 678 | */ |
| 679 | static Glib::RefPtr<Gst::MessageError> create(const Glib::RefPtr<Gst::Object>& src, const Glib::Error& error, const std::string& debug); |
| 680 | |
| 681 | /** Extracts the Glib::Error and debug string from the Gst::MessageError. |
| 682 | * |
| 683 | * MT safe. |
| 684 | * |
| 685 | * @param error Location for the Glib::Error. |
| 686 | * @param debug Location for the debug message. |
| 687 | */ |
| 688 | void parse(Glib::Error& error, std::string& debug) const; |
| 689 | |
| 690 | |
| 691 | /** Extracts and returns the Glib::Error from the Gst::MessageError. |
| 692 | * |
| 693 | * MT safe. |
| 694 | * |
| 695 | * @return The Glib::Error. |
| 696 | */ |
| 697 | Glib::Error parse_error() const; |
| 698 | |
| 699 | /** Extracts and returns the debug message from the Gst::MessageError. |
| 700 | * |
| 701 | * MT safe. |
| 702 | * |
| 703 | * @return The debug message. |
| 704 | */ |
| 705 | std::string parse_debug() const; |
| 706 | |
| 707 | |
| 708 | }; |
| 709 | |
| 710 | /** A warning message. |
| 711 | * See create() for more details. |
| 712 | */ |
| 713 | class MessageWarning : public Message |
| 714 | { |
| 715 | public: |
| 716 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 717 | using CppObjectType = MessageWarning; |
| 718 | using BaseObjectType = GstMessage; |
| 719 | #endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 720 | |
| 721 | private: |
| 722 | |
| 723 | public: |
| 724 | |
| 725 | |
| 726 | /** Create a new warning message. The message will make copies of @a error and |
| 727 | * @a debug. |
| 728 | * |
| 729 | * @param src The object originating the message. |
| 730 | * @param error The GError for this message. |
| 731 | * @param debug A debugging string. |
| 732 | * @return The new warning message. |
| 733 | * |
| 734 | * MT safe. |
| 735 | */ |
| 736 | static Glib::RefPtr<Gst::MessageWarning> create(const Glib::RefPtr<Gst::Object>& src, const Glib::Error& error, const std::string& debug); |
| 737 | |
| 738 | /** Extracts the Glib::Error and debug string from the Gst::MessageWarning. |
| 739 | * |
| 740 | * MT safe. |
| 741 | * |
| 742 | * @param error Location for the Glib::Error. |
| 743 | * @param debug Location for the debug message. |
| 744 | */ |
| 745 | void parse(Glib::Error& error, std::string& debug) const; |
| 746 | |
| 747 | |
| 748 | /** Extracts and returns the Glib::Error from the Gst::MessageWarning. |
| 749 | * |
| 750 | * MT safe. |
| 751 | * |
| 752 | * @return The Glib::Error. |
| 753 | */ |
| 754 | Glib::Error parse_error() const; |
| 755 | |
| 756 | /** Extracts and returns the debug message from the Gst::MessageWarning. |
| 757 | * |
| 758 | * MT safe. |
| 759 | * |
| 760 | * @return The debug message. |
| 761 | */ |
| 762 | std::string parse_debug() const; |
| 763 | |
| 764 | |
| 765 | }; |
| 766 | |
| 767 | /** An informational message. |
| 768 | * See create() for more details. |
| 769 | */ |
| 770 | class MessageInfo : public Message |
| 771 | { |
| 772 | public: |
| 773 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 774 | using CppObjectType = MessageInfo; |
| 775 | using BaseObjectType = GstMessage; |
| 776 | #endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 777 | |
| 778 | private: |
| 779 | |
| 780 | public: |
| 781 | |
| 782 | |
| 783 | /** Create a new info message. The message will make copies of @a error and |
| 784 | * @a debug. |
| 785 | * |
| 786 | * MT safe. |
| 787 | * |
| 788 | * @param src The object originating the message. |
| 789 | * @param error The GError for this message. |
| 790 | * @param debug A debugging string. |
| 791 | * @return The new info message. |
| 792 | */ |
| 793 | static Glib::RefPtr<Gst::MessageInfo> create(const Glib::RefPtr<Gst::Object>& src, const Glib::Error& error, const std::string& debug); |
| 794 | |
| 795 | /** Extracts the Glib::Error and debug string from the Gst::MessageInfo. |
| 796 | * |
| 797 | * MT safe. |
| 798 | * |
| 799 | * @param error Location for the Glib::Error. |
| 800 | * @param debug Location for the debug message. |
| 801 | */ |
| 802 | void parse(Glib::Error& error, std::string& debug) const; |
| 803 | |
| 804 | |
| 805 | /** Extracts and returns the Glib::Error from the Gst::MessageInfo. |
| 806 | * |
| 807 | * MT safe. |
| 808 | * |
| 809 | * @return The Glib::Error. |
| 810 | */ |
| 811 | Glib::Error parse_error() const; |
| 812 | |
| 813 | /** Extracts and returns the debug message from the Gst::MessageInfo. |
| 814 | * |
| 815 | * MT safe. |
| 816 | * |
| 817 | * @return The debug message. |
| 818 | */ |
| 819 | std::string parse_debug() const; |
| 820 | |
| 821 | |
| 822 | }; |
| 823 | |
| 824 | /** A tag message. |
| 825 | * See create() for more details. |
| 826 | */ |
| 827 | class MessageTag : public Message |
| 828 | { |
| 829 | public: |
| 830 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 831 | using CppObjectType = MessageTag; |
| 832 | using BaseObjectType = GstMessage; |
| 833 | #endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 834 | |
| 835 | private: |
| 836 | |
| 837 | public: |
| 838 | |
| 839 | |
| 840 | /** Create a new tag message. The message will take ownership of the tag list. |
| 841 | * The message is posted by elements that discovered a new taglist. |
| 842 | * |
| 843 | * @param src The object originating the message. |
| 844 | * @param taglist The tag list for the message. |
| 845 | * @return The new tag message. |
| 846 | * |
| 847 | * MT safe. |
| 848 | */ |
| 849 | static Glib::RefPtr<Gst::MessageTag> create(const Glib::RefPtr<Gst::Object>& src, const Gst::TagList& taglist); |
| 850 | |
| 851 | |
| 852 | /** Extracts and returns the Gst::TagList from the Gst::MessageTag. |
| 853 | * |
| 854 | * MT safe. |
| 855 | * |
| 856 | * @return A copy of the Gst::TagList. |
| 857 | */ |
| 858 | Gst::TagList parse_tag_list() const; |
| 859 | |
| 860 | |
| 861 | }; |
| 862 | |
| 863 | /** A buffering message. |
| 864 | * See create() for more details. |
| 865 | */ |
| 866 | class MessageBuffering : public Message |
| 867 | { |
| 868 | public: |
| 869 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 870 | using CppObjectType = MessageBuffering; |
| 871 | using BaseObjectType = GstMessage; |
| 872 | #endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 873 | |
| 874 | private: |
| 875 | |
| 876 | public: |
| 877 | |
| 878 | |
| 879 | /** Create a new buffering message. This message can be posted by an element that |
| 880 | * needs to buffer data before it can continue processing. @a percent should be a |
| 881 | * value between 0 and 100. A value of 100 means that the buffering completed. |
| 882 | * |
| 883 | * When @a percent is < 100 the application should PAUSE a PLAYING pipeline. When |
| 884 | * @a percent is 100, the application can set the pipeline (back) to PLAYING. |
| 885 | * The application must be prepared to receive BUFFERING messages in the |
| 886 | * PREROLLING state and may only set the pipeline to PLAYING after receiving a |
| 887 | * message with @a percent set to 100, which can happen after the pipeline |
| 888 | * completed prerolling. |
| 889 | * |
| 890 | * MT safe. |
| 891 | * |
| 892 | * @param src The object originating the message. |
| 893 | * @param percent The buffering percent. |
| 894 | * @return The new buffering message. |
| 895 | */ |
| 896 | static Glib::RefPtr<Gst::MessageBuffering> create(const Glib::RefPtr<Gst::Object>& src, int percent); |
| 897 | |
| 898 | /** Extracts and returns the buffering percent from the |
| 899 | * Gst::MessageBuffering. |
| 900 | * @return The percent as an integer. |
| 901 | */ |
| 902 | int parse_buffering() const; |
| 903 | |
| 904 | |
| 905 | /** Configures the buffering stats values in message. |
| 906 | * |
| 907 | * @param mode A buffering mode. |
| 908 | * @param avg_in The average input rate. |
| 909 | * @param avg_out The average output rate. |
| 910 | * @param buffering_left Amount of buffering time left in milliseconds. |
| 911 | * |
| 912 | * Since 0.10.20. |
| 913 | */ |
| 914 | void set_stats(BufferingMode mode, int avg_in, int avg_out, gint64 buffering_left); |
| 915 | |
| 916 | |
| 917 | /** Extracts the buffering stats values from message. |
| 918 | * |
| 919 | * @param mode Location for the buffering mode. |
| 920 | * @param avg_in Location for the average input rate. |
| 921 | * @param avg_out Location for the average output rate. |
| 922 | * @param buffering_left Location for the amount of buffering time left. |
| 923 | * |
| 924 | * Since 0.10.20. |
| 925 | */ |
| 926 | void parse_stats(BufferingMode& mode, int& avg_in, int& avg_out, gint64& buffering_left) const; |
| 927 | |
| 928 | |
| 929 | /** Extracts and returns the buffering mode from message. |
| 930 | * |
| 931 | * @return The buffering mode. |
| 932 | */ |
| 933 | BufferingMode parse_stats_buffering_mode() const; |
| 934 | |
| 935 | /** Extracts and returns the average input rate from message. |
| 936 | * |
| 937 | * @return The average input rate. |
| 938 | */ |
| 939 | int parse_stats_avg_in() const; |
| 940 | |
| 941 | /** Extracts and returns the average output rate from message. |
| 942 | * |
| 943 | * @return The average output rate. |
| 944 | */ |
| 945 | int parse_stats_avg_out() const; |
| 946 | |
| 947 | /** Extracts and returns the buffering time in milliseconds remaining from |
| 948 | * message. |
| 949 | * |
| 950 | * @return The buffering time remaining. |
| 951 | */ |
| 952 | gint64 parse_stats_buffering_left() const; |
| 953 | |
| 954 | |
| 955 | }; |
| 956 | |
| 957 | /** A state change message. |
| 958 | * See create() for more details. |
| 959 | */ |
| 960 | class MessageStateChanged : public Message |
| 961 | { |
| 962 | public: |
| 963 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 964 | using CppObjectType = MessageStateChanged; |
| 965 | using BaseObjectType = GstMessage; |
| 966 | #endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 967 | |
| 968 | private: |
| 969 | |
| 970 | public: |
| 971 | |
| 972 | |
| 973 | /** Create a state change message. This message is posted whenever an element |
| 974 | * changed its state. |
| 975 | * |
| 976 | * @param src The object originating the message. |
| 977 | * @param oldstate The previous state. |
| 978 | * @param newstate The new (current) state. |
| 979 | * @param pending The pending (target) state. |
| 980 | * @return The new state change message. |
| 981 | * |
| 982 | * MT safe. |
| 983 | */ |
| 984 | static Glib::RefPtr<Gst::MessageStateChanged> create(const Glib::RefPtr<Gst::Object>& src, State oldstate, State newstate, State pending); |
| 985 | |
| 986 | /** Extracts the old, new and pending states from the |
| 987 | * Gst::MessageStateChanged. |
| 988 | * |
| 989 | * MT safe. |
| 990 | * |
| 991 | * @param oldstate The previous state. |
| 992 | * @param newstate The new (current) state. |
| 993 | * @param pending The pending (target) state. |
| 994 | */ |
| 995 | void parse(State& oldstate, State& newstate, State& pending) const; |
| 996 | |
| 997 | |
| 998 | /** Extracts and returns the new state from the Gst::MessageStateChanged. |
| 999 | * |
| 1000 | * MT safe. |
| 1001 | * |
| 1002 | * @return The new (current) state. |
| 1003 | */ |
| 1004 | State parse_new_state() const; |
| 1005 | |
| 1006 | /** Extracts and returns the old state from the Gst::MessageStateChanged. |
| 1007 | * |
| 1008 | * MT safe. |
| 1009 | * |
| 1010 | * @return The old state. |
| 1011 | */ |
| 1012 | State parse_old_state() const; |
| 1013 | |
| 1014 | /** Extracts and returns the pending state from the Gst::MessageStateChanged. |
| 1015 | * |
| 1016 | * MT safe. |
| 1017 | * |
| 1018 | * @return The pending state. |
| 1019 | */ |
| 1020 | State parse_pending_state() const; |
| 1021 | |
| 1022 | |
| 1023 | }; |
| 1024 | |
| 1025 | /** A state dirty message. |
| 1026 | * See create() for more details. |
| 1027 | */ |
| 1028 | class MessageStateDirty : public Message |
| 1029 | { |
| 1030 | public: |
| 1031 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 1032 | using CppObjectType = MessageStateDirty; |
| 1033 | using BaseObjectType = GstMessage; |
| 1034 | #endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 1035 | |
| 1036 | private: |
| 1037 | |
| 1038 | public: |
| 1039 | |
| 1040 | |
| 1041 | /** Create a state dirty message. This message is posted whenever an element |
| 1042 | * changed its state asynchronously and is used internally to update the |
| 1043 | * states of container objects. |
| 1044 | * |
| 1045 | * @param src The object originating the message. |
| 1046 | * @return The new state dirty message. |
| 1047 | * |
| 1048 | * MT safe. |
| 1049 | */ |
| 1050 | static Glib::RefPtr<Gst::MessageStateDirty> create(const Glib::RefPtr<Gst::Object>& src); |
| 1051 | |
| 1052 | |
| 1053 | }; |
| 1054 | |
| 1055 | /** A step done message. |
| 1056 | * See create() for more details. |
| 1057 | */ |
| 1058 | class MessageStepDone : public Message |
| 1059 | { |
| 1060 | public: |
| 1061 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 1062 | using CppObjectType = MessageStepDone; |
| 1063 | using BaseObjectType = GstMessage; |
| 1064 | #endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 1065 | |
| 1066 | private: |
| 1067 | |
| 1068 | public: |
| 1069 | |
| 1070 | |
| 1071 | /** This message is posted by elements when they complete a part, when @a intermediate set |
| 1072 | * to <tt>true</tt>, or a complete step operation. |
| 1073 | * |
| 1074 | * @a duration will contain the amount of time (in GST_FORMAT_TIME) of the stepped |
| 1075 | * @a amount of media in format @a format. |
| 1076 | * |
| 1077 | * @param src The object originating the message. |
| 1078 | * @param format The format of @a amount. |
| 1079 | * @param amount The amount of stepped data. |
| 1080 | * @param rate The rate of the stepped amount. |
| 1081 | * @param flush Is this an flushing step. |
| 1082 | * @param intermediate Is this an intermediate step. |
| 1083 | * @param duration The duration of the data. |
| 1084 | * @param eos The step caused EOS. |
| 1085 | * @return The new step_done message. |
| 1086 | * |
| 1087 | * MT safe. |
| 1088 | */ |
| 1089 | static Glib::RefPtr<Gst::MessageStepDone> create(const Glib::RefPtr<Gst::Object>& src, Gst::Format format, guint64 amount, double rate, bool flush, bool intermediate, guint64 duration, bool eos); |
| 1090 | |
| 1091 | /** Extract the values of the step done message. |
| 1092 | * |
| 1093 | * MT safe. |
| 1094 | * |
| 1095 | * @param format Result location for the format. |
| 1096 | * @param amount Result location for the amount. |
| 1097 | * @param rate Result location for the rate. |
| 1098 | * @param flush Result location for the flush flag. |
| 1099 | * @param intermediate Result location for the intermediate flag. |
| 1100 | * @param duration Result location for the duration. |
| 1101 | * @param eos Result location for the EOS flag. |
| 1102 | * |
| 1103 | * Since 0.10.24. |
| 1104 | */ |
| 1105 | void parse(Gst::Format& format, guint64& amount, double& rate, bool& flush, |
| 1106 | bool& intermediate, guint64& duration, bool& eos) const; |
| 1107 | |
| 1108 | |
| 1109 | /** Extracts the duration of the step done message. |
| 1110 | * @return The duration. |
| 1111 | */ |
| 1112 | guint64 parse_duration() const; |
| 1113 | |
| 1114 | /** Extracts the format of the step done message. |
| 1115 | * @return The format. |
| 1116 | */ |
| 1117 | Gst::Format parse_format() const; |
| 1118 | |
| 1119 | /** Extracts the amount of the step done message. |
| 1120 | * @return The amount. |
| 1121 | */ |
| 1122 | guint64 parse_amount() const; |
| 1123 | |
| 1124 | /** Extracts the rate of the step done message. |
| 1125 | * @return The rate. |
| 1126 | */ |
| 1127 | double parse_rate() const; |
| 1128 | |
| 1129 | /** Extracts the flush flag of the step done message. |
| 1130 | * @return The flush flag. |
| 1131 | */ |
| 1132 | bool parse_flush() const; |
| 1133 | |
| 1134 | /** Extracts the intermediate flag of the step done message. |
| 1135 | * @return The intermediate flag. |
| 1136 | */ |
| 1137 | bool parse_intermediate() const; |
| 1138 | |
| 1139 | /** Extracts the eos flag of the step done message. |
| 1140 | * @return The eos flag. |
| 1141 | */ |
| 1142 | bool parse_eos() const; |
| 1143 | |
| 1144 | |
| 1145 | }; |
| 1146 | |
| 1147 | /** A clock provide message. |
| 1148 | * See create() for more details. |
| 1149 | */ |
| 1150 | class MessageClockProvide : public Message |
| 1151 | { |
| 1152 | public: |
| 1153 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 1154 | using CppObjectType = MessageClockProvide; |
| 1155 | using BaseObjectType = GstMessage; |
| 1156 | #endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 1157 | |
| 1158 | private: |
| 1159 | |
| 1160 | public: |
| 1161 | |
| 1162 | |
| 1163 | /** Create a clock provide message. This message is posted whenever an |
| 1164 | * element is ready to provide a clock or lost its ability to provide |
| 1165 | * a clock (maybe because it paused or became EOS). |
| 1166 | * |
| 1167 | * This message is mainly used internally to manage the clock |
| 1168 | * selection. |
| 1169 | * |
| 1170 | * @param src The object originating the message. |
| 1171 | * @param clock The clock it provides. |
| 1172 | * @param ready <tt>true</tt> if the sender can provide a clock. |
| 1173 | * @return The new provide clock message. |
| 1174 | * |
| 1175 | * MT safe. |
| 1176 | */ |
| 1177 | static Glib::RefPtr<Gst::MessageClockProvide> create(const Glib::RefPtr<Gst::Object>& src, const Glib::RefPtr<Gst::Clock>& clock, bool ready); |
| 1178 | |
| 1179 | /** Extracts the clock and ready flag from the Gst::MessageClockProvide. The |
| 1180 | * clock object returned remains valid until the message is freed. |
| 1181 | * |
| 1182 | * MT safe. |
| 1183 | * |
| 1184 | * @param clock Location in which to hold a clock object. |
| 1185 | * @param ready Location in which to hold the ready flag. |
| 1186 | */ |
| 1187 | void parse(Glib::RefPtr<Gst::Clock>& clock, bool& ready) const; |
| 1188 | |
| 1189 | |
| 1190 | /** Extracts and returns the clock from the Gst::MessageClockProvide. The |
| 1191 | * clock object returned remains valid until the message is freed. |
| 1192 | * |
| 1193 | * MT safe. |
| 1194 | * |
| 1195 | * @return The clock object of the message. |
| 1196 | */ |
| 1197 | Glib::RefPtr<Gst::Clock> parse_clock_provide(); |
| 1198 | |
| 1199 | /** Extracts and returns the clock from the Gst::MessageClockProvide. The |
| 1200 | * clock object returned remains valid until the message is freed. |
| 1201 | * |
| 1202 | * MT safe. |
| 1203 | * |
| 1204 | * @return The clock object of the message. |
| 1205 | */ |
| 1206 | Glib::RefPtr<const Gst::Clock> parse_clock_provide() const; |
| 1207 | |
| 1208 | /** Extracts and returns the ready flag from the Gst::MessageClockProvide. |
| 1209 | * |
| 1210 | * MT safe. |
| 1211 | * |
| 1212 | * @return The ready flag of the message. |
| 1213 | */ |
| 1214 | bool parse_ready() const; |
| 1215 | |
| 1216 | |
| 1217 | }; |
| 1218 | |
| 1219 | /** A clock lost message. |
| 1220 | * See create() for more details. |
| 1221 | */ |
| 1222 | class MessageClockLost : public Message |
| 1223 | { |
| 1224 | public: |
| 1225 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 1226 | using CppObjectType = MessageClockLost; |
| 1227 | using BaseObjectType = GstMessage; |
| 1228 | #endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 1229 | |
| 1230 | private: |
| 1231 | |
| 1232 | public: |
| 1233 | |
| 1234 | |
| 1235 | /** Create a clock lost message. This message is posted whenever the |
| 1236 | * clock is not valid anymore. |
| 1237 | * |
| 1238 | * If this message is posted by the pipeline, the pipeline will |
| 1239 | * select a new clock again when it goes to PLAYING. It might therefore |
| 1240 | * be needed to set the pipeline to PAUSED and PLAYING again. |
| 1241 | * |
| 1242 | * @param src The object originating the message. |
| 1243 | * @param clock The clock that was lost. |
| 1244 | * @return The new clock lost message. |
| 1245 | * |
| 1246 | * MT safe. |
| 1247 | */ |
| 1248 | static Glib::RefPtr<Gst::MessageClockLost> create(const Glib::RefPtr<Gst::Object>& src, const Glib::RefPtr<Gst::Clock>& clock); |
| 1249 | |
| 1250 | /** Extracts and returns the lost clock from the Gst::MessageClockLost. The |
| 1251 | * clock object returned remains valid until the message is freed. |
| 1252 | * |
| 1253 | * MT safe. |
| 1254 | * @return The lost clock. |
| 1255 | */ |
| 1256 | Glib::RefPtr<Gst::Clock> parse_clock_lost(); |
| 1257 | |
| 1258 | |
| 1259 | /** Extracts and returns the lost clock from the Gst::MessageClockLost. The |
| 1260 | * clock object returned remains valid until the message is freed. |
| 1261 | * |
| 1262 | * MT safe. |
| 1263 | * @return The lost clock. |
| 1264 | */ |
| 1265 | Glib::RefPtr<const Gst::Clock> parse_clock_lost() const; |
| 1266 | |
| 1267 | |
| 1268 | }; |
| 1269 | |
| 1270 | /** A new clock message. |
| 1271 | * See create() for more details. |
| 1272 | */ |
| 1273 | class MessageNewClock: public Message |
| 1274 | { |
| 1275 | public: |
| 1276 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 1277 | using CppObjectType = MessageNewClock; |
| 1278 | using BaseObjectType = GstMessage; |
| 1279 | #endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 1280 | |
| 1281 | private: |
| 1282 | |
| 1283 | public: |
| 1284 | |
| 1285 | |
| 1286 | /** Create a new clock message. This message is posted whenever the |
| 1287 | * pipeline selects a new clock for the pipeline. |
| 1288 | * |
| 1289 | * @param src The object originating the message. |
| 1290 | * @param clock The new selected clock. |
| 1291 | * @return The new new clock message. |
| 1292 | * |
| 1293 | * MT safe. |
| 1294 | */ |
| 1295 | static Glib::RefPtr<Gst::MessageNewClock> create(const Glib::RefPtr<Gst::Object>& src, const Glib::RefPtr<Gst::Clock>& clock); |
| 1296 | |
| 1297 | /** Extracts and returns the new clock from the Gst::MessageNewClock. The |
| 1298 | * clock object returned remains valid until the message is freed. |
| 1299 | * |
| 1300 | * MT safe. |
| 1301 | * |
| 1302 | * @return The selected new clock. |
| 1303 | */ |
| 1304 | Glib::RefPtr<Gst::Clock> parse_new_clock(); |
| 1305 | |
| 1306 | |
| 1307 | /** Extracts and returns the new clock from the Gst::MessageNewClock. The |
| 1308 | * clock object returned remains valid until the message is freed. |
| 1309 | * |
| 1310 | * MT safe. |
| 1311 | * |
| 1312 | * @return The selected new clock. |
| 1313 | */ |
| 1314 | Glib::RefPtr<const Gst::Clock> parse_new_clock() const; |
| 1315 | |
| 1316 | |
| 1317 | }; |
| 1318 | |
| 1319 | /** An application message. |
| 1320 | * See create() for more details. |
| 1321 | */ |
| 1322 | class MessageApplication : public Message |
| 1323 | { |
| 1324 | public: |
| 1325 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 1326 | using CppObjectType = MessageApplication; |
| 1327 | using BaseObjectType = GstMessage; |
| 1328 | #endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 1329 | |
| 1330 | private: |
| 1331 | |
| 1332 | public: |
| 1333 | |
| 1334 | |
| 1335 | /** Create a new application-typed message. GStreamer will never create these |
| 1336 | * messages; they are a gift from us to you. Enjoy. |
| 1337 | * |
| 1338 | * @param src The object originating the message. |
| 1339 | * @param structure The structure for the message. The message |
| 1340 | * will take ownership of the structure. |
| 1341 | * @return The new application message. |
| 1342 | * |
| 1343 | * MT safe. |
| 1344 | */ |
| 1345 | static Glib::RefPtr<Gst::MessageApplication> create(const Glib::RefPtr<Gst::Object>& src, Gst::Structure&& structure); |
| 1346 | |
| 1347 | /** Create a new application-typed message. GStreamer will never create these |
| 1348 | * messages; they are a gift from us to you. Enjoy. |
| 1349 | * |
| 1350 | * @param src The object originating the message. |
| 1351 | * @param structure The structure for the message. The message |
| 1352 | * will take ownership of the structure. |
| 1353 | * @return The new application message. |
| 1354 | * |
| 1355 | * MT safe. |
| 1356 | */ |
| 1357 | static Glib::RefPtr<Gst::MessageApplication> create(const Glib::RefPtr<Gst::Object>& src, const Gst::Structure& structure); |
| 1358 | |
| 1359 | |
| 1360 | }; |
| 1361 | |
| 1362 | /** An element specific message. |
| 1363 | * See create() for more details. |
| 1364 | */ |
| 1365 | class MessageElement : public Message |
| 1366 | { |
| 1367 | public: |
| 1368 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 1369 | using CppObjectType = MessageElement; |
| 1370 | using BaseObjectType = GstMessage; |
| 1371 | #endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 1372 | |
| 1373 | private: |
| 1374 | |
| 1375 | public: |
| 1376 | |
| 1377 | |
| 1378 | /** Create a new element-specific message. This is meant as a generic way of |
| 1379 | * allowing one-way communication from an element to an application, for example |
| 1380 | * "the firewire cable was unplugged". The format of the message should be |
| 1381 | * documented in the element's documentation. The structure field can be <tt>nullptr</tt>. |
| 1382 | * |
| 1383 | * @param src The object originating the message. |
| 1384 | * @param structure The structure for the |
| 1385 | * message. The message will take ownership of the structure. |
| 1386 | * @return The new element message. |
| 1387 | * |
| 1388 | * MT safe. |
| 1389 | */ |
| 1390 | static Glib::RefPtr<Gst::MessageElement> create(const Glib::RefPtr<Gst::Object>& src, Gst::Structure&& structure); |
| 1391 | |
| 1392 | /// A create() convenience overload. |
| 1393 | static Glib::RefPtr<Gst::MessageElement> create(const Glib::RefPtr<Gst::Object>& src); |
| 1394 | |
| 1395 | /** Create a new element-specific message. This is meant as a generic way of |
| 1396 | * allowing one-way communication from an element to an application, for example |
| 1397 | * "the firewire cable was unplugged". The format of the message should be |
| 1398 | * documented in the element's documentation. The structure field can be <tt>0</tt>. |
| 1399 | * |
| 1400 | * @param src The object originating the message. |
| 1401 | * @param structure The structure for the |
| 1402 | * message. The message will take ownership of the structure. |
| 1403 | * @return The new element message. |
| 1404 | * |
| 1405 | * MT safe. |
| 1406 | */ |
| 1407 | static Glib::RefPtr<Gst::MessageElement> create(const Glib::RefPtr<Gst::Object>& src, const Gst::Structure& structure); |
| 1408 | |
| 1409 | |
| 1410 | }; |
| 1411 | |
| 1412 | /** A custom message. |
| 1413 | * See create() for more details. |
| 1414 | */ |
| 1415 | class MessageCustom : public Message |
| 1416 | { |
| 1417 | public: |
| 1418 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 1419 | using CppObjectType = MessageCustom; |
| 1420 | using BaseObjectType = GstMessage; |
| 1421 | #endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 1422 | |
| 1423 | private: |
| 1424 | |
| 1425 | public: |
| 1426 | |
| 1427 | |
| 1428 | /** Create a new custom-typed message. This can be used for anything not |
| 1429 | * handled by other message-specific functions to pass a message to the |
| 1430 | * app. The structure field can be <tt>nullptr</tt>. |
| 1431 | * |
| 1432 | * @param type The Gst::MessageType to distinguish messages. |
| 1433 | * @param src The object originating the message. |
| 1434 | * @param structure The structure for the |
| 1435 | * message. The message will take ownership of the structure. |
| 1436 | * @return The new message. |
| 1437 | * |
| 1438 | * MT safe. |
| 1439 | */ |
| 1440 | static Glib::RefPtr<Gst::MessageCustom> create(MessageType type, const Glib::RefPtr<Gst::Object>& src, Gst::Structure& structure); |
| 1441 | |
| 1442 | /// A create() convenience overload. |
| 1443 | static Glib::RefPtr<Gst::MessageCustom> create(MessageType type, const Glib::RefPtr<Gst::Object>& src); |
| 1444 | |
| 1445 | |
| 1446 | }; |
| 1447 | |
| 1448 | /** A segment start message. |
| 1449 | * See create() for more details. |
| 1450 | */ |
| 1451 | class MessageSegmentStart : public Message |
| 1452 | { |
| 1453 | public: |
| 1454 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 1455 | using CppObjectType = MessageSegmentStart; |
| 1456 | using BaseObjectType = GstMessage; |
| 1457 | #endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 1458 | |
| 1459 | private: |
| 1460 | |
| 1461 | public: |
| 1462 | |
| 1463 | |
| 1464 | /** Create a new segment message. This message is posted by elements that |
| 1465 | * start playback of a segment as a result of a segment seek. This message |
| 1466 | * is not received by the application but is used for maintenance reasons in |
| 1467 | * container elements. |
| 1468 | * |
| 1469 | * @param src The object originating the message. |
| 1470 | * @param format The format of the position being played. |
| 1471 | * @param position The position of the segment being played. |
| 1472 | * @return The new segment start message. |
| 1473 | * |
| 1474 | * MT safe. |
| 1475 | */ |
| 1476 | static Glib::RefPtr<Gst::MessageSegmentStart> create(const Glib::RefPtr<Gst::Object>& src, Format format, gint64 position); |
| 1477 | |
| 1478 | /** Extracts the position and format from the segment start message. |
| 1479 | * |
| 1480 | * MT safe. |
| 1481 | * |
| 1482 | * @param format Result location for the format. |
| 1483 | * @param position Result location for the position. |
| 1484 | */ |
| 1485 | void parse(Format& format, gint64& position) const; |
| 1486 | |
| 1487 | |
| 1488 | /** Extracts and returns the position from the segment start message. |
| 1489 | * |
| 1490 | * MT safe. |
| 1491 | * |
| 1492 | * @return The position. |
| 1493 | */ |
| 1494 | gint64 parse_position() const; |
| 1495 | |
| 1496 | /** Extracts and returns the format from the segment start message. |
| 1497 | * |
| 1498 | * MT safe. |
| 1499 | * |
| 1500 | * @return The format. |
| 1501 | */ |
| 1502 | Format parse_format() const; |
| 1503 | |
| 1504 | |
| 1505 | }; |
| 1506 | |
| 1507 | /** A segment done message. |
| 1508 | * See create() for more details. |
| 1509 | */ |
| 1510 | class MessageSegmentDone : public Message |
| 1511 | { |
| 1512 | public: |
| 1513 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 1514 | using CppObjectType = MessageSegmentDone; |
| 1515 | using BaseObjectType = GstMessage; |
| 1516 | #endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 1517 | |
| 1518 | private: |
| 1519 | |
| 1520 | public: |
| 1521 | |
| 1522 | |
| 1523 | /** Create a new segment done message. This message is posted by elements that |
| 1524 | * finish playback of a segment as a result of a segment seek. This message |
| 1525 | * is received by the application after all elements that posted a segment_start |
| 1526 | * have posted the segment_done. |
| 1527 | * |
| 1528 | * @param src The object originating the message. |
| 1529 | * @param format The format of the position being done. |
| 1530 | * @param position The position of the segment being done. |
| 1531 | * @return The new segment done message. |
| 1532 | * |
| 1533 | * MT safe. |
| 1534 | */ |
| 1535 | static Glib::RefPtr<Gst::MessageSegmentDone> create(const Glib::RefPtr<Gst::Object>& src, Format format, gint64 position); |
| 1536 | |
| 1537 | /** Extracts the position and format from the segment done message. |
| 1538 | * |
| 1539 | * MT safe. |
| 1540 | * |
| 1541 | * @param format Result location for the format. |
| 1542 | * @param position Result location for the position. |
| 1543 | */ |
| 1544 | void parse(Format& format, gint64& position) const; |
| 1545 | |
| 1546 | |
| 1547 | /** Extracts and returns the position from the segment done message. |
| 1548 | * |
| 1549 | * MT safe. |
| 1550 | * |
| 1551 | * @return The position. |
| 1552 | */ |
| 1553 | gint64 parse_position() const; |
| 1554 | |
| 1555 | /** Extracts and returns the format from the segment done message. |
| 1556 | * |
| 1557 | * MT safe. |
| 1558 | * |
| 1559 | * @return The format. |
| 1560 | */ |
| 1561 | Format parse_format() const; |
| 1562 | |
| 1563 | |
| 1564 | }; |
| 1565 | |
| 1566 | /** A duration message. |
| 1567 | * See create() for more details. |
| 1568 | */ |
| 1569 | class MessageDurationChanged : public Message |
| 1570 | { |
| 1571 | public: |
| 1572 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 1573 | using CppObjectType = MessageDurationChanged; |
| 1574 | using BaseObjectType = GstMessage; |
| 1575 | #endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 1576 | |
| 1577 | private: |
| 1578 | |
| 1579 | public: |
| 1580 | |
| 1581 | |
| 1582 | /** Create a new duration changed message. This message is posted by elements |
| 1583 | * that know the duration of a stream when the duration changes. This message |
| 1584 | * is received by bins and is used to calculate the total duration of a |
| 1585 | * pipeline. Elements may post a duration message with a duration of |
| 1586 | * GST_CLOCK_TIME_NONE to indicate that the duration has changed and the |
| 1587 | * cached duration should be discarded. The new duration can then be |
| 1588 | * retrieved via a query. |
| 1589 | * |
| 1590 | * @param src The object originating the message. |
| 1591 | * @return The new duration-changed message. |
| 1592 | * |
| 1593 | * MT safe. |
| 1594 | */ |
| 1595 | static Glib::RefPtr<Gst::MessageDurationChanged> create(const Glib::RefPtr<Gst::Object>& src); |
| 1596 | |
| 1597 | |
| 1598 | }; |
| 1599 | |
| 1600 | /** A latency message. |
| 1601 | * See create() for more details. |
| 1602 | */ |
| 1603 | class MessageLatency : public Message |
| 1604 | { |
| 1605 | public: |
| 1606 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 1607 | using CppObjectType = MessageLatency; |
| 1608 | using BaseObjectType = GstMessage; |
| 1609 | #endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 1610 | |
| 1611 | private: |
| 1612 | |
| 1613 | public: |
| 1614 | |
| 1615 | |
| 1616 | /** This message can be posted by elements when their latency requirements have |
| 1617 | * changed. |
| 1618 | * |
| 1619 | * @param src The object originating the message. |
| 1620 | * @return The new latency message. |
| 1621 | * |
| 1622 | * MT safe. |
| 1623 | */ |
| 1624 | static Glib::RefPtr<Gst::MessageLatency> create(const Glib::RefPtr<Gst::Object>& src); |
| 1625 | |
| 1626 | |
| 1627 | }; |
| 1628 | |
| 1629 | /** An asynchronous start message. |
| 1630 | * See create() for more details. |
| 1631 | */ |
| 1632 | class MessageAsyncStart : public Message |
| 1633 | { |
| 1634 | public: |
| 1635 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 1636 | using CppObjectType = MessageAsyncStart; |
| 1637 | using BaseObjectType = GstMessage; |
| 1638 | #endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 1639 | |
| 1640 | private: |
| 1641 | |
| 1642 | public: |
| 1643 | |
| 1644 | |
| 1645 | /** This message is posted by elements when they start an ASYNC state change. |
| 1646 | * |
| 1647 | * @param src The object originating the message. |
| 1648 | * @return The new async_start message. |
| 1649 | * |
| 1650 | * MT safe. |
| 1651 | */ |
| 1652 | static Glib::RefPtr<Gst::MessageAsyncStart> create(const Glib::RefPtr<Gst::Object>& src); |
| 1653 | |
| 1654 | |
| 1655 | }; |
| 1656 | |
| 1657 | /** An asynchronous done message. |
| 1658 | * See create() for more details. |
| 1659 | */ |
| 1660 | class MessageAsyncDone : public Message |
| 1661 | { |
| 1662 | public: |
| 1663 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 1664 | using CppObjectType = MessageAsyncDone; |
| 1665 | using BaseObjectType = GstMessage; |
| 1666 | #endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 1667 | |
| 1668 | private: |
| 1669 | |
| 1670 | public: |
| 1671 | |
| 1672 | |
| 1673 | /** The message is posted when elements completed an ASYNC state change. |
| 1674 | * @a running_time contains the time of the desired running_time when this |
| 1675 | * elements goes to PLAYING. A value of Gst::CLOCK_TIME_NONE for @a running_time |
| 1676 | * means that the element has no clock interaction and thus doesn't care about |
| 1677 | * the running_time of the pipeline. |
| 1678 | * |
| 1679 | * @param src The object originating the message. |
| 1680 | * @param running_time The desired running_time. |
| 1681 | * @return The new async_done message. |
| 1682 | * |
| 1683 | * MT safe. |
| 1684 | */ |
| 1685 | static Glib::RefPtr<Gst::MessageAsyncDone> create(const Glib::RefPtr<Gst::Object>& src, Gst::ClockTime running_time); |
| 1686 | |
| 1687 | /** Extract the running_time from the async_done message. |
| 1688 | * |
| 1689 | * MT safe. |
| 1690 | * |
| 1691 | * @return The running time from the async_done message. |
| 1692 | */ |
| 1693 | Gst::ClockTime parse_running_time() const; |
| 1694 | |
| 1695 | |
| 1696 | }; |
| 1697 | |
| 1698 | /** A step start message. |
| 1699 | * See create() for more details. |
| 1700 | */ |
| 1701 | class MessageStepStart : public Message |
| 1702 | { |
| 1703 | public: |
| 1704 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 1705 | using CppObjectType = MessageStepStart; |
| 1706 | using BaseObjectType = GstMessage; |
| 1707 | #endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 1708 | |
| 1709 | private: |
| 1710 | |
| 1711 | public: |
| 1712 | |
| 1713 | |
| 1714 | /** This message is posted by elements when they accept or activate a new step |
| 1715 | * event for @a amount in @a format. |
| 1716 | * |
| 1717 | * @a active is set to <tt>false</tt> when the element accepted the new step event and has |
| 1718 | * queued it for execution in the streaming threads. |
| 1719 | * |
| 1720 | * @a active is set to <tt>true</tt> when the element has activated the step operation and |
| 1721 | * is now ready to start executing the step in the streaming thread. After this |
| 1722 | * message is emitted, the application can queue a new step operation in the |
| 1723 | * element. |
| 1724 | * |
| 1725 | * @param src The object originating the message. |
| 1726 | * @param active If the step is active or queued. |
| 1727 | * @param format The format of @a amount. |
| 1728 | * @param amount The amount of stepped data. |
| 1729 | * @param rate The rate of the stepped amount. |
| 1730 | * @param flush Is this an flushing step. |
| 1731 | * @param intermediate Is this an intermediate step. |
| 1732 | * @return The new step_start message. |
| 1733 | * |
| 1734 | * MT safe. |
| 1735 | */ |
| 1736 | static Glib::RefPtr<Gst::MessageStepStart> create(const Glib::RefPtr<Gst::Object>& src, bool active, Gst::Format format, guint64 amount, double rate, bool flush, bool intermediate); |
| 1737 | |
| 1738 | /** Extract the values of the step start message. |
| 1739 | * |
| 1740 | * MT safe. |
| 1741 | * |
| 1742 | * @param active Result location for the active flag. |
| 1743 | * @param format Result location for the format. |
| 1744 | * @param amount Result location for the amount. |
| 1745 | * @param rate Result location for the rate. |
| 1746 | * @param flush Result location for the flush flag. |
| 1747 | * @param intermediate Result location for the intermediate flag. |
| 1748 | * |
| 1749 | * Since 0.10.24. |
| 1750 | */ |
| 1751 | void parse(bool& active, Gst::Format& format, guint64& amount, double& rate, |
| 1752 | bool& flush, bool& intermediate) const; |
| 1753 | |
| 1754 | |
| 1755 | /** Extracts the amount of the step start message. |
| 1756 | * @return The amount. |
| 1757 | */ |
| 1758 | guint64 parse_amount() const; |
| 1759 | |
| 1760 | /** Extracts the active flag of the step start message. |
| 1761 | * @return The active flag. |
| 1762 | */ |
| 1763 | bool parse_active() const; |
| 1764 | |
| 1765 | /** Extracts the format of the step start message. |
| 1766 | * @return The format. |
| 1767 | */ |
| 1768 | Gst::Format parse_format() const; |
| 1769 | |
| 1770 | /** Extracts the rate of the step start message. |
| 1771 | * @return The rate. |
| 1772 | */ |
| 1773 | double parse_rate() const; |
| 1774 | |
| 1775 | /** Extracts the flush flag of the step start message. |
| 1776 | * @return The flush flag. |
| 1777 | */ |
| 1778 | bool parse_flush() const; |
| 1779 | |
| 1780 | /** Extracts the intermediate flag of the step start message. |
| 1781 | * @return The intermediate flag. |
| 1782 | */ |
| 1783 | bool parse_intermediate() const; |
| 1784 | |
| 1785 | |
| 1786 | }; |
| 1787 | |
| 1788 | /** A structure change message. |
| 1789 | * See create() for more details. |
| 1790 | */ |
| 1791 | class MessageStructureChange : public Message |
| 1792 | { |
| 1793 | public: |
| 1794 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 1795 | using CppObjectType = MessageStructureChange; |
| 1796 | using BaseObjectType = GstMessage; |
| 1797 | #endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 1798 | |
| 1799 | private: |
| 1800 | |
| 1801 | public: |
| 1802 | |
| 1803 | |
| 1804 | /** Create a new structure change message. This message is posted when the |
| 1805 | * structure of a pipeline is in the process of being changed, for example |
| 1806 | * when pads are linked or unlinked. |
| 1807 | * |
| 1808 | * @a src should be the sinkpad that unlinked or linked. |
| 1809 | * |
| 1810 | * @param src The object originating the message. |
| 1811 | * @param type The change type. |
| 1812 | * @param owner The owner element of @a src. |
| 1813 | * @param busy Whether the structure change is busy. |
| 1814 | * @return The new structure change message. |
| 1815 | * |
| 1816 | * MT safe. |
| 1817 | */ |
| 1818 | static Glib::RefPtr<Gst::MessageStructureChange> create(const Glib::RefPtr<Gst::Object>& src, Gst::StructureChangeType type, const Glib::RefPtr<Gst::Element>& owner, bool busy); |
| 1819 | |
| 1820 | /** Extracts the change type and completion status from the Gst::Message. |
| 1821 | * MT safe. |
| 1822 | * |
| 1823 | * @param type A reference to hold the change type. |
| 1824 | * @param owner The owner element of the message source. |
| 1825 | * @param busy A reference to hold whether the change is in progress or has |
| 1826 | * been completed. |
| 1827 | * |
| 1828 | * Since 0.10.22. |
| 1829 | */ |
| 1830 | void parse(Gst::StructureChangeType& type, |
| 1831 | Glib::RefPtr<Gst::Element>& owner, bool& busy) const; |
| 1832 | |
| 1833 | |
| 1834 | /** Extracts the change type from the Gs::tMessage. |
| 1835 | * MT safe. |
| 1836 | * |
| 1837 | * @return The change type. |
| 1838 | * |
| 1839 | * Since 0.10.22. |
| 1840 | */ |
| 1841 | Gst::StructureChangeType parse_type() const; |
| 1842 | |
| 1843 | /** Extracts the owner from the Gst::Message. |
| 1844 | * MT safe. |
| 1845 | * |
| 1846 | * @return The owner element of the message source. |
| 1847 | * |
| 1848 | * Since 0.10.22. |
| 1849 | */ |
| 1850 | Glib::RefPtr<Gst::Element> parse_owner() const; |
| 1851 | |
| 1852 | /** Extracts the completion status from the Gst::Message. |
| 1853 | * MT safe. |
| 1854 | * |
| 1855 | * @return whether the change is in progress or has been completed. |
| 1856 | * |
| 1857 | * Since 0.10.22. |
| 1858 | */ |
| 1859 | bool parse_busy() const; |
| 1860 | |
| 1861 | |
| 1862 | }; |
| 1863 | |
| 1864 | /** A request state message. |
| 1865 | * See create() for more details. |
| 1866 | */ |
| 1867 | class MessageRequestState : public Message |
| 1868 | { |
| 1869 | public: |
| 1870 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 1871 | using CppObjectType = MessageRequestState; |
| 1872 | using BaseObjectType = GstMessage; |
| 1873 | #endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 1874 | |
| 1875 | private: |
| 1876 | |
| 1877 | public: |
| 1878 | |
| 1879 | |
| 1880 | /** This message can be posted by elements when they want to have their state |
| 1881 | * changed. A typical use case would be an audio server that wants to pause the |
| 1882 | * pipeline because a higher priority stream is being played. |
| 1883 | * |
| 1884 | * @param src The object originating the message. |
| 1885 | * @param state The new requested state. |
| 1886 | * @return The new request state message. |
| 1887 | * |
| 1888 | * MT safe. |
| 1889 | */ |
| 1890 | static Glib::RefPtr<Gst::MessageRequestState> create(const Glib::RefPtr<Gst::Object>& src, Gst::State state); |
| 1891 | |
| 1892 | /** Extract the requested state from the request_state message. |
| 1893 | * @return The state. MT safe. |
| 1894 | * |
| 1895 | * Since 0.10.23. |
| 1896 | */ |
| 1897 | Gst::State parse_state() const; |
| 1898 | |
| 1899 | |
| 1900 | }; |
| 1901 | |
| 1902 | /** A stream status message. |
| 1903 | * See create() for more details. |
| 1904 | */ |
| 1905 | class MessageStreamStatus : public Message |
| 1906 | { |
| 1907 | public: |
| 1908 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 1909 | using CppObjectType = MessageStreamStatus; |
| 1910 | using BaseObjectType = GstMessage; |
| 1911 | #endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 1912 | |
| 1913 | private: |
| 1914 | |
| 1915 | public: |
| 1916 | |
| 1917 | |
| 1918 | /** Create a new stream status message. This message is posted when a streaming |
| 1919 | * thread is created/destroyed or when the state changed. |
| 1920 | * |
| 1921 | * @param src The object originating the message. |
| 1922 | * @param type The stream status type. |
| 1923 | * @param owner The owner element of @a src. |
| 1924 | * @return The new stream status message. |
| 1925 | * |
| 1926 | * MT safe. |
| 1927 | */ |
| 1928 | static Glib::RefPtr<Gst::MessageStreamStatus> create(const Glib::RefPtr<Gst::Object>& src, Gst::StreamStatusType type, const Glib::RefPtr<Gst::Element>& owner); |
| 1929 | |
| 1930 | /** Configures the object handling the streaming thread. This is usually a |
| 1931 | * Gst::Task object but other objects might be added in the future. |
| 1932 | * @param object The object controlling the streaming. |
| 1933 | * |
| 1934 | * Since 0.10.24. |
| 1935 | */ |
| 1936 | void set_object(const Glib::RefPtr<Gst::Object>& object); |
| 1937 | |
| 1938 | |
| 1939 | /** Extracts the object managing the streaming thread from message. |
| 1940 | * @return The object that manages the streaming thread. The actual object |
| 1941 | * is usually a Gst::Task but other types can be added in the future. The |
| 1942 | * object remains valid as long as the message is valid. |
| 1943 | */ |
| 1944 | Glib::RefPtr<Gst::Object> get_object() const; |
| 1945 | |
| 1946 | |
| 1947 | /** Extracts the stream status type and owner of the Gst::Message. The |
| 1948 | * returned owner remains valid for as long as the reference to the message |
| 1949 | * is valid. |
| 1950 | * |
| 1951 | * MT safe. |
| 1952 | * |
| 1953 | * @param type A reference to hold the status type. |
| 1954 | * @param owner A reference to hold the owner Gst::Element. |
| 1955 | * |
| 1956 | * Since 0.10.24. |
| 1957 | */ |
| 1958 | void parse(Gst::StreamStatusType& type, Glib::RefPtr<Gst::Element>& owner) const; |
| 1959 | |
| 1960 | |
| 1961 | /** Extracts the stream status type. |
| 1962 | * |
| 1963 | * MT safe. |
| 1964 | * |
| 1965 | * @return The stream status type. |
| 1966 | * |
| 1967 | * Since 0.10.24. |
| 1968 | */ |
| 1969 | Gst::StreamStatusType parse_type() const; |
| 1970 | |
| 1971 | /** Extracts the owner of the Gst::Message. The returned owner remains valid |
| 1972 | * for as long as the reference to the message is valid. |
| 1973 | * |
| 1974 | * MT safe. |
| 1975 | * |
| 1976 | * @return The owner Gst::Element. |
| 1977 | * |
| 1978 | * Since 0.10.24. |
| 1979 | */ |
| 1980 | Glib::RefPtr<Gst::Element> parse_owner() const; |
| 1981 | |
| 1982 | |
| 1983 | }; |
| 1984 | |
| 1985 | /** A qos message. |
| 1986 | * See create() for more details. |
| 1987 | */ |
| 1988 | class MessageQos : public Message |
| 1989 | { |
| 1990 | public: |
| 1991 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 1992 | using CppObjectType = MessageQos; |
| 1993 | using BaseObjectType = GstMessage; |
| 1994 | #endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 1995 | |
| 1996 | private: |
| 1997 | |
| 1998 | public: |
| 1999 | |
| 2000 | |
| 2001 | /** A QOS message is posted on the bus whenever an element decides to drop a |
| 2002 | * buffer because of QoS reasons or whenever it changes its processing strategy |
| 2003 | * because of QoS reasons (quality adjustments such as processing at lower |
| 2004 | * accuracy). |
| 2005 | * |
| 2006 | * This message can be posted by an element that performs synchronisation against the |
| 2007 | * clock (live) or it could be dropped by an element that performs QoS because of QOS |
| 2008 | * events received from a downstream element (!live). |
| 2009 | * |
| 2010 | * @a running_time, @a stream_time, @a timestamp, @a duration should be set to the |
| 2011 | * respective running-time, stream-time, timestamp and duration of the (dropped) |
| 2012 | * buffer that generated the QoS event. Values can be left to |
| 2013 | * GST_CLOCK_TIME_NONE when unknown. |
| 2014 | * |
| 2015 | * @param src The object originating the message. |
| 2016 | * @param live If the message was generated by a live element. |
| 2017 | * @param running_time The running time of the buffer that generated the message. |
| 2018 | * @param stream_time The stream time of the buffer that generated the message. |
| 2019 | * @param timestamp The timestamps of the buffer that generated the message. |
| 2020 | * @param duration The duration of the buffer that generated the message. |
| 2021 | * @return The new qos message. |
| 2022 | * |
| 2023 | * MT safe. |
| 2024 | */ |
| 2025 | static Glib::RefPtr<Gst::MessageQos> create(const Glib::RefPtr<Gst::Object>& src, bool live, guint64 running_time, guint64 stream_time, guint64 timestamp, guint64 duration); |
| 2026 | |
| 2027 | /** Set the QoS values that have been calculated/analysed from the QoS data. |
| 2028 | * |
| 2029 | * MT safe. |
| 2030 | * |
| 2031 | * @param jitter The difference of the running-time against the deadline. |
| 2032 | * @param proportion Long term prediction of the ideal rate relative to normal rate |
| 2033 | * to get optimal quality. |
| 2034 | * @param quality An element dependent integer value that specifies the current |
| 2035 | * quality level of the element. The default maximum quality is 1000000. |
| 2036 | */ |
| 2037 | void set_values(gint64 jitter, double proportion, gint quality); |
| 2038 | |
| 2039 | |
| 2040 | /** Set the QoS stats representing the history of the current continuous pipeline |
| 2041 | * playback period. |
| 2042 | * |
| 2043 | * When @a format is Gst::FORMAT_UNDEFINED both @a dropped and @a processed are |
| 2044 | * invalid. Values of -1 for either @a processed or @a dropped mean unknown values. |
| 2045 | * |
| 2046 | * MT safe. |
| 2047 | * |
| 2048 | * @param format Units of the @a processed and @a dropped fields. Video sinks and video |
| 2049 | * filters will use Gst::FORMAT_BUFFERS (frames). Audio sinks and audio filters |
| 2050 | * will likely use Gst::FORMAT_DEFAULT (samples). |
| 2051 | * @param processed Total number of units correctly processed since the last state |
| 2052 | * change to READY or a flushing operation. |
| 2053 | * @param dropped Total number of units dropped since the last state change to READY |
| 2054 | * or a flushing operation. |
| 2055 | */ |
| 2056 | void set_stats(Gst::Format format, guint64 processed, guint64 dropped); |
| 2057 | |
| 2058 | |
| 2059 | /** Extract the timestamps and live status from the QoS message. |
| 2060 | * |
| 2061 | * The returned values give the running_time, stream_time, timestamp and |
| 2062 | * duration of the dropped buffer. Values of Gst::CLOCK_TIME_NONE mean unknown |
| 2063 | * values. |
| 2064 | * |
| 2065 | * MT safe. |
| 2066 | * |
| 2067 | * @param live If the message was generated by a live element. |
| 2068 | * @param running_time The running time of the buffer that |
| 2069 | * generated the message. |
| 2070 | * @param stream_time The stream time of the buffer that |
| 2071 | * generated the message. |
| 2072 | * @param timestamp The timestamps of the buffer that |
| 2073 | * generated the message. |
| 2074 | * @param duration The duration of the buffer that |
| 2075 | * generated the message. |
| 2076 | */ |
| 2077 | void parse(bool& live, guint64& running_time, guint64& stream_time, |
| 2078 | guint64& timestamp, guint64& duration) const; |
| 2079 | |
| 2080 | |
| 2081 | /** Extract the QoS values that have been calculated/analysed from the QoS data. |
| 2082 | * @param jitter The difference of the running-time against |
| 2083 | * the deadline. |
| 2084 | * @param proportion Long term prediction of the ideal rate |
| 2085 | * relative to normal rate to get optimal quality. |
| 2086 | * @param quality An element dependent integer value that |
| 2087 | * specifies the current quality level of the element. The default |
| 2088 | * maximum quality is 1000000. |
| 2089 | * |
| 2090 | * MT safe. |
| 2091 | */ |
| 2092 | void parse_values(gint64& jitter, double& proportion, gint& quality) const; |
| 2093 | |
| 2094 | |
| 2095 | /** Extract the QoS stats representing the history of the current continuous |
| 2096 | * pipeline playback period. |
| 2097 | * |
| 2098 | * @param format Units of the 'processed' and 'dropped' fields. |
| 2099 | * Video sinks and video filters will use GST_FORMAT_BUFFERS (frames). |
| 2100 | * Audio sinks and audio filters will likely use GST_FORMAT_DEFAULT |
| 2101 | * (samples). |
| 2102 | * @param processed Total number of units correctly processed |
| 2103 | * since the last state change to READY or a flushing operation. |
| 2104 | * @param dropped Total number of units dropped since the last |
| 2105 | * state change to READY or a flushing operation. |
| 2106 | * |
| 2107 | * MT_safe. |
| 2108 | * |
| 2109 | * When @a format is Gst::FORMAT_UNDEFINED both @a dropped and @a processed are |
| 2110 | * invalid. Values of -1 for either @a processed or @a dropped mean unknown values. |
| 2111 | */ |
| 2112 | void parse_stats(Gst::Format& format, guint64& processed, guint64& dropped) const; |
| 2113 | |
| 2114 | |
| 2115 | }; |
| 2116 | |
| 2117 | /** A stream-start message. |
| 2118 | * See create() for more details. |
| 2119 | */ |
| 2120 | class MessageStreamStart : public Message |
| 2121 | { |
| 2122 | public: |
| 2123 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 2124 | using CppObjectType = MessageStreamStart; |
| 2125 | using BaseObjectType = GstMessage; |
| 2126 | #endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 2127 | |
| 2128 | private: |
| 2129 | |
| 2130 | public: |
| 2131 | |
| 2132 | |
| 2133 | /** Create a new stream_start message. This message is generated and posted in |
| 2134 | * the sink elements of a GstBin. The bin will only forward the STREAM_START |
| 2135 | * message to the application if all sinks have posted an STREAM_START message. |
| 2136 | * |
| 2137 | * @param src The object originating the message. |
| 2138 | * @return The new stream_start message. |
| 2139 | * |
| 2140 | * MT safe. |
| 2141 | */ |
| 2142 | static Glib::RefPtr<Gst::MessageStreamStart> create(const Glib::RefPtr<Gst::Object>& src); |
| 2143 | |
| 2144 | /** Sets the group id on the stream-start message. |
| 2145 | * |
| 2146 | * All streams that have the same group id are supposed to be played |
| 2147 | * together, i.e. all streams inside a container file should have the |
| 2148 | * same group id but different stream ids. The group id should change |
| 2149 | * each time the stream is started, resulting in different group ids |
| 2150 | * each time a file is played for example. |
| 2151 | * |
| 2152 | * MT safe. |
| 2153 | * |
| 2154 | * @param group_id The group id. |
| 2155 | */ |
| 2156 | void set_group_id(guint group_id); |
| 2157 | |
| 2158 | |
| 2159 | /** Extract the group from the STREAM_START message. |
| 2160 | * |
| 2161 | * MT safe |
| 2162 | * |
| 2163 | * @param group_id Result location for the group id. |
| 2164 | * |
| 2165 | * @return true if the message had a group id set, false otherwse. |
| 2166 | */ |
| 2167 | bool parse_group_id(guint& group_id) const; |
| 2168 | |
| 2169 | |
| 2170 | }; |
| 2171 | |
| 2172 | /** A have-context message. |
| 2173 | * See create() for more details. |
| 2174 | */ |
| 2175 | class MessageHaveContext : public Message |
| 2176 | { |
| 2177 | public: |
| 2178 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 2179 | using CppObjectType = MessageHaveContext; |
| 2180 | using BaseObjectType = GstMessage; |
| 2181 | #endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 2182 | |
| 2183 | private: |
| 2184 | |
| 2185 | public: |
| 2186 | |
| 2187 | |
| 2188 | /** This message is posted when an element has a new local Gst::Context. |
| 2189 | * |
| 2190 | * @param src The object originating the message. |
| 2191 | * @param context The context. |
| 2192 | * @return The new have-context message. |
| 2193 | * |
| 2194 | * MT safe. |
| 2195 | */ |
| 2196 | static Glib::RefPtr<Gst::MessageHaveContext> create(const Glib::RefPtr<Gst::Object>& src, const Glib::RefPtr<Gst::Context>& context); |
| 2197 | |
| 2198 | /** Extract the context from the HAVE_CONTEXT message. |
| 2199 | * |
| 2200 | * MT safe. |
| 2201 | * |
| 2202 | * @return context Result location for the context. |
| 2203 | */ |
| 2204 | Glib::RefPtr<Gst::Context> parse_have_context(); |
| 2205 | |
| 2206 | |
| 2207 | /** Extract the context from the HAVE_CONTEXT message. |
| 2208 | * |
| 2209 | * MT safe. |
| 2210 | * |
| 2211 | * @return context Result location for the context. |
| 2212 | */ |
| 2213 | Glib::RefPtr<const Gst::Context> parse_have_context() const; |
| 2214 | |
| 2215 | |
| 2216 | }; |
| 2217 | |
| 2218 | /** A need-context message. |
| 2219 | * See create() for more details. |
| 2220 | */ |
| 2221 | class MessageNeedContext : public Message |
| 2222 | { |
| 2223 | public: |
| 2224 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 2225 | using CppObjectType = MessageNeedContext; |
| 2226 | using BaseObjectType = GstMessage; |
| 2227 | #endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 2228 | |
| 2229 | private: |
| 2230 | |
| 2231 | public: |
| 2232 | |
| 2233 | |
| 2234 | /** This message is posted when an element needs a specific Gst::Context. |
| 2235 | * |
| 2236 | * @param src The object originating the message. |
| 2237 | * @param context_type The context type that is needed. |
| 2238 | * @return The new need-context message. |
| 2239 | * |
| 2240 | * MT safe. |
| 2241 | */ |
| 2242 | static Glib::RefPtr<Gst::MessageNeedContext> create(const Glib::RefPtr<Gst::Object>& src, const Glib::ustring& context_type); |
| 2243 | |
| 2244 | /** Parse a context type from an existing Gst::MESSAGE_NEED_CONTEXT message. |
| 2245 | * |
| 2246 | * @param context_type The context type. |
| 2247 | * |
| 2248 | * @return a bool indicating if the parsing succeeded. |
| 2249 | */ |
| 2250 | bool parse(Glib::ustring& context_type) const; |
| 2251 | |
| 2252 | |
| 2253 | }; |
| 2254 | |
| 2255 | /** A reset-time message. |
| 2256 | * See create() for more details. |
| 2257 | */ |
| 2258 | class MessageResetTime : public Message |
| 2259 | { |
| 2260 | public: |
| 2261 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 2262 | using CppObjectType = MessageResetTime; |
| 2263 | using BaseObjectType = GstMessage; |
| 2264 | #endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 2265 | |
| 2266 | private: |
| 2267 | |
| 2268 | public: |
| 2269 | |
| 2270 | |
| 2271 | /** This message is posted when the pipeline running-time should be reset to |
| 2272 | * @a running_time, like after a flushing seek. |
| 2273 | * |
| 2274 | * @param src The object originating the message. |
| 2275 | * @param running_time The requested running-time. |
| 2276 | * @return The new reset_time message. |
| 2277 | * |
| 2278 | * MT safe. |
| 2279 | */ |
| 2280 | static Glib::RefPtr<Gst::MessageResetTime> create(const Glib::RefPtr<Gst::Object>& src, Gst::ClockTime running_time); |
| 2281 | |
| 2282 | /** Extract the running-time from the RESET_TIME message. |
| 2283 | * |
| 2284 | * MT safe. |
| 2285 | * |
| 2286 | * @return Result location for the running_time. |
| 2287 | */ |
| 2288 | Gst::ClockTime parse_running_time() const; |
| 2289 | |
| 2290 | |
| 2291 | }; |
| 2292 | |
| 2293 | /** A toc message. |
| 2294 | * See create() for more details. |
| 2295 | */ |
| 2296 | class MessageToc : public Message |
| 2297 | { |
| 2298 | public: |
| 2299 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 2300 | using CppObjectType = MessageToc; |
| 2301 | using BaseObjectType = GstMessage; |
| 2302 | #endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 2303 | |
| 2304 | private: |
| 2305 | |
| 2306 | public: |
| 2307 | |
| 2308 | |
| 2309 | /** Create a new TOC message. The message is posted by elements |
| 2310 | * that discovered or updated a TOC. |
| 2311 | * |
| 2312 | * @param src The object originating the message. |
| 2313 | * @param toc Gst::Toc structure for the message. |
| 2314 | * @param updated Whether TOC was updated or not. |
| 2315 | * @return A new TOC message. |
| 2316 | * |
| 2317 | * MT safe. |
| 2318 | */ |
| 2319 | static Glib::RefPtr<Gst::MessageToc> create(const Glib::RefPtr<Gst::Object>& src, const Glib::RefPtr<Gst::Toc>& toc, bool updated); |
| 2320 | |
| 2321 | /** Extract the TOC from the Gst::Message. |
| 2322 | * |
| 2323 | * MT safe. |
| 2324 | * |
| 2325 | * @param toc Return location for the TOC. |
| 2326 | * @param updated Return location for the updated flag. |
| 2327 | */ |
| 2328 | void parse(Glib::RefPtr<Gst::Toc>& toc, bool& updated) const; |
| 2329 | |
| 2330 | |
| 2331 | }; |
| 2332 | |
| 2333 | /** A progress message. |
| 2334 | * See create() for more details. |
| 2335 | */ |
| 2336 | class MessageProgress : public Message |
| 2337 | { |
| 2338 | public: |
| 2339 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 2340 | using CppObjectType = MessageProgress; |
| 2341 | using BaseObjectType = GstMessage; |
| 2342 | #endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 2343 | |
| 2344 | private: |
| 2345 | |
| 2346 | public: |
| 2347 | |
| 2348 | |
| 2349 | /** Progress messages are posted by elements when they use an asynchronous task |
| 2350 | * to perform actions triggered by a state change. |
| 2351 | * |
| 2352 | * @a code contains a well defined string describing the action. |
| 2353 | * @a test should contain a user visible string detailing the current action. |
| 2354 | * |
| 2355 | * @param src The object originating the message. |
| 2356 | * @param type A Gst::ProgressType. |
| 2357 | * @param code A progress code. |
| 2358 | * @param text Free, user visible text describing the progress. |
| 2359 | * @return The new qos message. |
| 2360 | */ |
| 2361 | static Glib::RefPtr<Gst::MessageProgress> create(const Glib::RefPtr<Gst::Object>& src, Gst::ProgressType type, const Glib::ustring& code, const Glib::ustring& text); |
| 2362 | |
| 2363 | /** Parses the progress @a type, @a code and @a text. |
| 2364 | * |
| 2365 | * @param type A Gst::ProgressType. |
| 2366 | * @param code A code. |
| 2367 | * @param text A text. |
| 2368 | */ |
| 2369 | void parse(Gst::ProgressType& type, Glib::ustring& code, Glib::ustring& text) const; |
| 2370 | |
| 2371 | |
| 2372 | /** Extracts and returns the ProgressType from the Gst::MessageProgress. |
| 2373 | * |
| 2374 | * @return The ProgressType. |
| 2375 | */ |
| 2376 | Gst::ProgressType parse_type() const; |
| 2377 | |
| 2378 | /** Extracts and returns the code from the Gst::MessageProgress. |
| 2379 | * |
| 2380 | * @return The code. |
| 2381 | */ |
| 2382 | Glib::ustring parse_code() const; |
| 2383 | |
| 2384 | /** Extracts and returns the text from the Gst::MessageProgress. |
| 2385 | * |
| 2386 | * @return The text. |
| 2387 | */ |
| 2388 | Glib::ustring parse_text() const; |
| 2389 | |
| 2390 | |
| 2391 | }; |
| 2392 | |
| 2393 | } //namespace Gst |
| 2394 | |
| 2395 | |
| 2396 | namespace Glib |
| 2397 | { |
| 2398 | |
| 2399 | /** A Glib::wrap() method for this object. |
| 2400 | * |
| 2401 | * @param object The C instance. |
| 2402 | * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref. |
| 2403 | * @result A C++ instance that wraps this C instance. |
| 2404 | * |
| 2405 | * @relates Gst::Message |
| 2406 | */ |
| 2407 | Glib::RefPtr<Gst::Message> wrap(GstMessage* object, bool take_copy = false); |
| 2408 | |
| 2409 | } // namespace Glib |
| 2410 | |
| 2411 | |
| 2412 | #endif /* _GSTREAMERMM_MESSAGE_H */ |
| 2413 |