# Gst::MessageDuration Class Reference

A duration message. More...

Inherits Gst::Message.

Collaboration diagram for Gst::MessageDuration:
[legend]

List of all members.

## Public Member Functions

| MessageDuration (GstMessage* castitem)
void | parse (Format& format, gint64& duration) const
| Extracts the duration and format from the duration message.
gint64 | parse () const
| Extracts and returns the duration from the duration message.
Format | parse_format () const
| Extracts and returns the format from the duration message.

## Static Public Member Functions

static Glib::RefPtr< Gst::Message > | create (const Glib::RefPtr< Gst::Object >& src, Format format, gint64 duration)
| Create a new duration message.

## Detailed Description

A duration message.

See create() for more details.

## Constructor & Destructor Documentation

Gst::MessageDuration::MessageDuration | ( | GstMessage * | castitem | ) | `[explicit]`

## Member Function Documentation

static Glib::RefPtr<Gst::Message> Gst::MessageDuration::create | ( | const Glib::RefPtr< Gst::Object >& | src,
|  | Format | format,
|  | gint64 | duration |
| ) |  |  | `[static]`

Create a new duration message.

This message is posted by elements that know the duration of a stream in a specific format. This message is received by bins and is used to calculate the total duration of a pipeline. Elements may post a duration message with a duration of Gst::CLOCK_TIME_NONE to indicate that the duration has changed and the cached duration should be discarded. The new duration can then be retrieved via a query.

Parameters:

  | src | The object originating the message.
  | format | The format of the duration.
  | duration | The new duration.

Returns:
  The new duration message. MT safe.

void Gst::MessageDuration::parse | ( | Format& | format,
|  | gint64 & | duration |
| ) |  |  | const

Extracts the duration and format from the duration message.

The duration might be Gst::CLOCK_TIME_NONE, which indicates that the duration has changed. Applications should always use a query to retrieve the duration of a pipeline.

MT safe.

Parameters:

  | format | Result location for the format.
  | duration | Result location for the duration.

gint64 Gst::MessageDuration::parse | ( |  | ) | const

Extracts and returns the duration from the duration message.

The duration might be Gst::CLOCK_TIME_NONE, which indicates that the duration has changed. Applications should always use a query to retrieve the duration of a pipeline.

MT safe.

Returns:
  The duration.

Format Gst::MessageDuration::parse_format | ( |  | ) | const

Extracts and returns the format from the duration message.

Applications should always use a query to retrieve the duration of a pipeline.

MT safe.

Returns:
  The format.

The documentation for this class was generated from the following file:

- gstreamermm/message.h