gstreamermm  1.10.0
Public Types | Public Member Functions | List of all members
Gst::ResourceError Class Reference

The GStreamer resource GError type. More...

#include <gstreamermm/error.h>

Inherits Error.

Public Types

enum  Code {
  FAILED = 1,
  TOO_LAZY,
  NOT_FOUND,
  BUSY,
  OPEN_READ,
  OPEN_WRITE,
  OPEN_READ_WRITE,
  CLOSE,
  READ,
  WRITE,
  SEEK,
  SYNC,
  SETTINGS,
  NO_SPACE_LEFT,
  NOT_AUTHORIZED,
  NUM_ERRORS
}
 Resource errors are for any resource used by an element: memory, files, network connections, process space, ... More...
 

Public Member Functions

 ResourceError (Code error_code, const Glib::ustring& error_message)
 
 ResourceError (GError* gobject)
 
Code code () const
 

Detailed Description

The GStreamer resource GError type.

GStreamer elements can throw non-fatal warnings and fatal errors. Higher-level elements and applications can programatically filter the ones they are interested in or can recover from, and have a default handler handle the rest of them. Both warnings and fatal errors are treated similarly.

Resource errors are for any resource used by an element: memory, files, network connections, process space, ... They're typically used by source and sink elements.

Elements do not have the context required to decide what to do with errors. As such, they should only inform about errors, and stop their processing. In short, an element doesn't know what it is being used for.

It is the application or compound element using the given element that has more context about the use of the element. Errors can be received by listening to the Gst::Bus of the element/pipeline for Gst::Message objects with the type Gst::MESSAGE_ERROR or Gst::MESSAGE_WARNING. The thrown errors should be inspected, and filtered if appropriate.

An application is expected to, by default, present the user with a dialog box (or an equivalent) showing the error message. The dialog should also allow a way to get at the additional debug information, so the user can provide bug reporting information.

A compound element is expected to forward errors by default higher up the hierarchy; this is done by default in the same way as for other types of Gst::Message.

When applications or compound elements trigger errors that they can recover from, they can filter out these errors and take appropriate action. For example, an application that gets an error from xvimagesink that indicates all XVideo ports are taken, the application can attempt to use another sink instead.

Member Enumeration Documentation

◆ Code

Resource errors are for any resource used by an element: memory, files, network connections, process space, ...

They're typically used by source and sink elements.

Enumerator
FAILED 

A general error which doesn't fit in any other category.

Make sure you add a custom message to the error call.

TOO_LAZY 

Do not use this except as a placeholder for deciding where to go while developing code.

NOT_FOUND 

Used when the resource could not be found.

BUSY 

Used when resource is busy.

OPEN_READ 

Used when resource fails to open for reading.

OPEN_WRITE 

Used when resource fails to open for writing.

OPEN_READ_WRITE 

Used when resource cannot be opened for both reading and writing, or either (but unspecified which).

CLOSE 

Used when the resource can't be closed.

READ 

Used when the resource can't be read from.

WRITE 

Used when the resource can't be written to.

SEEK 

Used when a seek on the resource fails.

SYNC 

Used when a synchronize on the resource fails.

SETTINGS 

Used when settings can't be manipulated on.

NO_SPACE_LEFT 

Used when the resource has no space left.

NOT_AUTHORIZED 

Used when the resource can't be opened due to missing authorization.

(Since 1.2.4).

NUM_ERRORS 

The number of resource error types.

Constructor & Destructor Documentation

◆ ResourceError() [1/2]

Gst::ResourceError::ResourceError ( Code  error_code,
const Glib::ustring &  error_message 
)

◆ ResourceError() [2/2]

Gst::ResourceError::ResourceError ( GError *  gobject)
explicit

Member Function Documentation

◆ code()

Code Gst::ResourceError::code ( ) const