Information about the streams
Decoding of multimedia streams

## Functions

BGAV_PUBLIC const gavl_audio_format_t * | bgav_get_audio_format (bgav_t *bgav, int stream)
| Get the format of an audio stream of the current track.
BGAV_PUBLIC const gavl_audio_format_t * | bgav_get_audio_format_t (bgav_t *bgav, int track, int stream)
| Get the format of an audio stream.
BGAV_PUBLIC const gavl_video_format_t * | bgav_get_video_format (bgav_t *bgav, int stream)
| Get the format of a video stream.
BGAV_PUBLIC const gavl_video_format_t * | bgav_get_video_format_t (bgav_t *bgav, int t, int stream)
| Get the format of a video stream.
BGAV_PUBLIC const gavl_video_format_t * | bgav_get_overlay_format (bgav_t *bgav, int stream)
| Get the format of an overlay stream.
BGAV_PUBLIC int | bgav_get_text_timescale (bgav_t *bgav, int stream)
| Get the timescale for a text stream.
BGAV_PUBLIC gavl_frame_table_t * | bgav_get_frame_table (bgav_t *bgav, int stream)
| Get the frame table of a video stream.
BGAV_PUBLIC const gavl_video_format_t * | bgav_get_subtitle_format (bgav_t *bgav, int stream)
| Get the video format of a subtitle stream.
BGAV_PUBLIC int | bgav_subtitle_is_text (bgav_t *bgav, int stream)
| Check if a subtitle is text or graphics based.
BGAV_PUBLIC const char * | bgav_get_audio_description (bgav_t *bgav, int stream)
| Get the description of an audio stream.
BGAV_PUBLIC const char * | bgav_get_audio_info (bgav_t *bgav, int stream)
| Get additional info about an audio stream.
BGAV_PUBLIC const char * | bgav_get_video_description (bgav_t *bgav, int stream)
| Get the description of a video stream.
BGAV_PUBLIC const char * | bgav_get_subtitle_description (bgav_t *bgav, int stream)
| Get the description of a subtitle stream.
BGAV_PUBLIC const char * | bgav_get_subtitle_info (bgav_t *bgav, int stream)
| Get additional info about a subtitle stream.
BGAV_PUBLIC int | bgav_can_pause (bgav_t *bgav)
| Query if a track is pausable.

## Detailed Description

## Function Documentation

## bgav_get_audio_format()

BGAV_PUBLIC const gavl_audio_format_t * bgav_get_audio_format | ( | bgav_t * | bgav,
|  | int | stream )

Get the format of an audio stream of the current track.

Parameters

  bgav | A decoder instance
  stream | Stream index (starting with 0)

Returns
  The format

Note, that you can trust the return value of this function only, if you enabled the stream (see bgav_set_audio_stream) and started the decoders (see bgav_start).

## bgav_get_audio_format_t()

BGAV_PUBLIC const gavl_audio_format_t * bgav_get_audio_format_t | ( | bgav_t * | bgav,
|  | int | track,
|  | int | stream )

Get the format of an audio stream.

Parameters

  bgav | A decoder instance
  t | Track index (starting with 0)
  s | Stream index (starting with 0)

Returns
  The format

Note, that you can trust the return value of this function only, if you enabled the stream (see bgav_set_audio_stream) and started the decoders (see bgav_start).

## bgav_get_video_format()

BGAV_PUBLIC const gavl_video_format_t * bgav_get_video_format | ( | bgav_t * | bgav,
|  | int | stream )

Get the format of a video stream.

Parameters

  bgav | A decoder instance
  stream | Stream index (starting with 0)

Returns
  The format

Note, that you can trust the return value of this function only, if you enabled the stream (see bgav_set_video_stream) and started the decoders (see bgav_start).

Special care has to be taken, if the video stream consists of (a) still image(s). This is the case, when the framerate_mode member of the format is GAVL_FRAMERATE_STILL. See bgav_video_has_still.

## bgav_get_video_format_t()

BGAV_PUBLIC const gavl_video_format_t * bgav_get_video_format_t | ( | bgav_t * | bgav,
|  | int | t,
|  | int | stream )

Get the format of a video stream.

Parameters

  bgav | A decoder instance
  t | Track index (starting with 0)
  stream | Stream index (starting with 0)

Returns
  The format

Note, that you can trust the return value of this function only, if you enabled the stream (see bgav_set_video_stream) and started the decoders (see bgav_start).

Special care has to be taken, if the video stream consists of (a) still image(s). This is the case, when the framerate_mode member of the format is GAVL_FRAMERATE_STILL. See bgav_video_has_still.

## bgav_get_overlay_format()

BGAV_PUBLIC const gavl_video_format_t * bgav_get_overlay_format | ( | bgav_t * | bgav,
|  | int | stream )

Get the format of an overlay stream.

Parameters

  bgav | A decoder instance
  stream | Stream index (starting with 0)

Returns
  The format

Note, that you can trust the return value of this function only, if you enabled the stream (see bgav_set_video_stream) and started the decoders (see bgav_start).

## bgav_get_text_timescale()

BGAV_PUBLIC int bgav_get_text_timescale | ( | bgav_t * | bgav,
|  | int | stream )

Get the timescale for a text stream.

Parameters

  bgav | A decoder instance
  stream | Stream index (starting with 0)

Returns
  The timescale

Note, that you can trust the return value of this function only, if you enabled the stream (see bgav_set_video_stream) and started the decoders (see bgav_start).

## bgav_get_frame_table()

BGAV_PUBLIC gavl_frame_table_t * bgav_get_frame_table | ( | bgav_t * | bgav,
|  | int | stream )

Get the frame table of a video stream.

Parameters

  bgav | A decoder instance
  stream | Stream index (starting with 0)

Returns
  The frame table or NULL

Note, that you can trust the return value of this function only, if you enabled the stream (see bgav_set_video_stream) and started the decoders (see bgav_start).

If you want to make sure that the frame table is available for as many files as possible, use sample accurate mode (see bgav_options_set_sample_accurate) The returned table (if non-null) must be freed by the caller with gavl_frame_table_destroy.

Since 1.0.2

## bgav_get_subtitle_format()

BGAV_PUBLIC const gavl_video_format_t * bgav_get_subtitle_format | ( | bgav_t * | bgav,
|  | int | stream )

Get the video format of a subtitle stream.

Parameters

  bgav | A decoder instance
  stream | Stream index (starting with 0)

Returns
  The format

Note, that you can trust the return value of this function only, if you enabled the stream (see bgav_set_subtitle_stream) and started the decoders (see bgav_start). For overlay subtitles, this is the video format of the decoded overlays. For text subtitles, it's the format of the associated video stream. The timescale member is always the timescale of the subtitles (not the video frames).

## bgav_subtitle_is_text()

BGAV_PUBLIC int bgav_subtitle_is_text | ( | bgav_t * | bgav,
|  | int | stream )

Check if a subtitle is text or graphics based.

Parameters

  bgav | A decoder instance
  stream | Stream index (starting with 0)

Returns
  1 for text subtitles, 0 for graphic subtitles

If this function returns 1, you must use bgav_read_subtitle_text to decode subtitles, else use bgav_read_subtitle_overlay

## bgav_get_audio_description()

BGAV_PUBLIC const char * bgav_get_audio_description | ( | bgav_t * | bgav,
|  | int | stream )

Get the description of an audio stream.

Parameters

  bgav | A decoder instance
  stream | Stream index (starting with 0)

Returns
  A technical decription of the stream

Note, that you can trust the return value of this function only, if you enabled the stream (see bgav_set_audio_stream) and started the decoders (see bgav_start).

## bgav_get_audio_info()

BGAV_PUBLIC const char * bgav_get_audio_info | ( | bgav_t * | bgav,
|  | int | stream )

Get additional info about an audio stream.

Parameters

  bgav | A decoder instance
  stream | Stream index (starting with 0)

Returns
  An info string about the stream or NULL

This returns additional information about the audio stream e.g. if it contains directors comments, audio for the visually impaired or whatever.

Note, that you can trust the return value of this function only, if you enabled the stream (see bgav_set_audio_stream) and started the decoders (see bgav_start).

## bgav_get_video_description()

BGAV_PUBLIC const char * bgav_get_video_description | ( | bgav_t * | bgav,
|  | int | stream )

Get the description of a video stream.

Parameters

  bgav | A decoder instance
  stream | Stream index (starting with 0)

Returns
  A technical decription of the stream

Note, that you can trust the return value of this function only, if you enabled the stream (see bgav_set_video_stream) and started the decoders (see bgav_start).

## bgav_get_subtitle_description()

BGAV_PUBLIC const char * bgav_get_subtitle_description | ( | bgav_t * | bgav,
|  | int | stream )

Get the description of a subtitle stream.

Parameters

  bgav | A decoder instance
  stream | Stream index (starting with 0)

Returns
  A technical decription of the stream

Note, that you can trust the return value of this function only, if you enabled the stream (see bgav_set_subtitle_stream) and started the decoders (see bgav_start).

## bgav_get_subtitle_info()

BGAV_PUBLIC const char * bgav_get_subtitle_info | ( | bgav_t * | bgav,
|  | int | stream )

Get additional info about a subtitle stream.

Parameters

  bgav | A decoder instance
  stream | Stream index (starting with 0)

Returns
  An info string about the stream or NULL

This returns additional information about the subtitle stream e.g. if it contains directors comments or whatever.

Note, that you can trust the return value of this function only, if you enabled the stream (see bgav_set_subtitle_stream) and started the decoders (see bgav_start).

## bgav_can_pause()

BGAV_PUBLIC int bgav_can_pause | ( | bgav_t * | bgav | ) |

Query if a track is pausable.

Parameters

  bgav | A decoder instance

Returns
  1 is decoding can be paused for a longer time, 0 else

Check this if you intend to pause decoding. Pausing a livestream doesn't make sense, so in this case 0 is returned.