Query and select streams
Decoding of multimedia streams

## Enumerations

enum | bgav_stream_action_t { BGAV_STREAM_MUTE = 0 , BGAV_STREAM_DECODE = 1 , BGAV_STREAM_PARSE = 2 , BGAV_STREAM_READRAW = 3 }
| Stream action. More...

## Functions

BGAV_PUBLIC const char * | bgav_get_audio_language (bgav_t *bgav, int stream)
| Get the language of an audio stream.
BGAV_PUBLIC int | bgav_get_audio_bitrate (bgav_t *bgav, int stream)
| Get the bitrate of an audio stream.
BGAV_PUBLIC const bgav_metadata_t * | bgav_get_audio_metadata (bgav_t *bgav, int stream)
| Get the metadata of an audio stream of the current track.
BGAV_PUBLIC const bgav_metadata_t * | bgav_get_audio_metadata_t (bgav_t *b, int t, int s)
| Get the metadata of an audio stream.
BGAV_PUBLIC const char * | bgav_get_subtitle_language (bgav_t *bgav, int stream)
| Get the language of a subtitle stream.
BGAV_PUBLIC const bgav_metadata_t * | bgav_get_subtitle_metadata (bgav_t *bgav, int stream)
| Get the metadata of a subtitle stream.
BGAV_PUBLIC const bgav_metadata_t * | bgav_get_text_metadata (bgav_t *b, int stream)
| Get the metadata of a text stream of the current track.
BGAV_PUBLIC const bgav_metadata_t * | bgav_get_text_metadata_t (bgav_t *b, int track, int stream)
| Get the metadata of a text stream.
BGAV_PUBLIC const bgav_metadata_t * | bgav_get_overlay_metadata (bgav_t *b, int stream)
| Get the metadata of an overlay stream of the current track.
BGAV_PUBLIC const bgav_metadata_t * | bgav_get_overlay_metadata_t (bgav_t *b, int track, int stream)
| Get the metadata of an overlay stream.
BGAV_PUBLIC const bgav_metadata_t * | bgav_get_video_metadata (bgav_t *bgav, int stream)
| Get the metadata of a video stream of the current track.
BGAV_PUBLIC const bgav_metadata_t * | bgav_get_video_metadata_t (bgav_t *b, int t, int s)
| Get the metadata of a video stream.
BGAV_PUBLIC int | bgav_set_audio_stream (bgav_t *bgav, int stream, bgav_stream_action_t action)
| Select mode for an audio stream.
BGAV_PUBLIC int | bgav_set_video_stream (bgav_t *bgav, int stream, bgav_stream_action_t action)
| Select mode for a video stream.
BGAV_PUBLIC int | bgav_set_subtitle_stream (bgav_t *bgav, int stream, bgav_stream_action_t action)
| Select mode for a subtitle stream.
BGAV_PUBLIC int | bgav_set_text_stream (bgav_t *bgav, int stream, bgav_stream_action_t action)
| Select mode for a text stream.
BGAV_PUBLIC int | bgav_set_overlay_stream (bgav_t *bgav, int stream, bgav_stream_action_t action)
| Select mode for an overlay stream.

## Detailed Description

The numbers of streams are already known before selecting a track (see bgav_num_audio_streams and bgav_num_video_streams. Note that by default, all streams are muted, which means that you cannot skip the stream selection in your application.

## Enumeration Type Documentation

## bgav_stream_action_t

enum bgav_stream_action_t

Stream action.

This is used to tell the decoder, what to do with the stream. Only supported actions right now are mute (default) and decode.

Enumerator
BGAV_STREAM_MUTE | Stream is switched off
BGAV_STREAM_DECODE | Stream is switched on and will be decoded
BGAV_STREAM_PARSE | Used internally when building indices
BGAV_STREAM_READRAW | Read compressed packets from the stream

## Function Documentation

## bgav_get_audio_language()

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

Get the language of an audio stream.

Parameters

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

Returns
  A language string.

## bgav_get_audio_bitrate()

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

Get the bitrate of an audio stream.

Parameters

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

Returns
  Bitrate in bits / sec. 0 means VBR or unknown

## bgav_get_audio_metadata()

BGAV_PUBLIC const bgav_metadata_t * bgav_get_audio_metadata | ( | bgav_t * | bgav,
|  | int | stream
| ) |  |

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

Parameters

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

Returns
  The metadata for the stream

## bgav_get_audio_metadata_t()

BGAV_PUBLIC const bgav_metadata_t * bgav_get_audio_metadata_t | ( | bgav_t * | b,
|  | int | t,
|  | int | s
| ) |  |

Get the metadata of an audio stream.

Parameters

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

Returns
  The metadata for the stream

## bgav_get_subtitle_language()

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

Get the language of a subtitle stream.

Parameters

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

Returns
  A language string.

## bgav_get_subtitle_metadata()

BGAV_PUBLIC const bgav_metadata_t * bgav_get_subtitle_metadata | ( | bgav_t * | bgav,
|  | int | stream
| ) |  |

Get the metadata of a subtitle stream.

Parameters

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

Returns
  The metadata for the stream

## bgav_get_text_metadata()

BGAV_PUBLIC const bgav_metadata_t * bgav_get_text_metadata | ( | bgav_t * | b,
|  | int | stream
| ) |  |

Get the metadata of a text stream of the current track.

Parameters

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

Returns
  The metadata for the stream

## bgav_get_text_metadata_t()

BGAV_PUBLIC const bgav_metadata_t * bgav_get_text_metadata_t | ( | bgav_t * | b,
|  | int | track,
|  | int | stream
| ) |  |

Get the metadata of a text stream.

Parameters

  bgav | A decoder instance
  track | Track index (starting with 0)
  stream | Subtitle stream index (starting with 0)

Returns
  The metadata for the stream

## bgav_get_overlay_metadata()

BGAV_PUBLIC const bgav_metadata_t * bgav_get_overlay_metadata | ( | bgav_t * | b,
|  | int | stream
| ) |  |

Get the metadata of an overlay stream of the current track.

Parameters

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

Returns
  The metadata for the stream

## bgav_get_overlay_metadata_t()

BGAV_PUBLIC const bgav_metadata_t * bgav_get_overlay_metadata_t | ( | bgav_t * | b,
|  | int | track,
|  | int | stream
| ) |  |

Get the metadata of an overlay stream.

Parameters

  bgav | A decoder instance
  track | Track index (starting with 0)
  stream | Subtitle stream index (starting with 0)

Returns
  The metadata for the stream

## bgav_get_video_metadata()

BGAV_PUBLIC const bgav_metadata_t * bgav_get_video_metadata | ( | bgav_t * | bgav,
|  | int | stream
| ) |  |

Get the metadata of a video stream of the current track.

Parameters

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

Returns
  The metadata for the stream

## bgav_get_video_metadata_t()

BGAV_PUBLIC const bgav_metadata_t * bgav_get_video_metadata_t | ( | bgav_t * | b,
|  | int | t,
|  | int | s
| ) |  |

Get the metadata of a video stream.

Parameters

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

Returns
  The metadata for the stream

## bgav_set_audio_stream()

BGAV_PUBLIC int bgav_set_audio_stream | ( | bgav_t * | bgav,
|  | int | stream,
|  | bgav_stream_action_t | action
| ) |  |

Select mode for an audio stream.

Parameters

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

Note that the default stream action is BGAV_STREAM_MUTE, which means that all streams are switched off by default.

## bgav_set_video_stream()

BGAV_PUBLIC int bgav_set_video_stream | ( | bgav_t * | bgav,
|  | int | stream,
|  | bgav_stream_action_t | action
| ) |  |

Select mode for a video stream.

Parameters

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

Note that the default stream action is BGAV_STREAM_MUTE, which means that all streams are switched off by default.

## bgav_set_subtitle_stream()

BGAV_PUBLIC int bgav_set_subtitle_stream | ( | bgav_t * | bgav,
|  | int | stream,
|  | bgav_stream_action_t | action
| ) |  |

Select mode for a subtitle stream.

Parameters

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

Note that the default stream action is BGAV_STREAM_MUTE, which means that all streams are switched off by default.

## bgav_set_text_stream()

BGAV_PUBLIC int bgav_set_text_stream | ( | bgav_t * | bgav,
|  | int | stream,
|  | bgav_stream_action_t | action
| ) |  |

Select mode for a text stream.

Parameters

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

Note that the default stream action is BGAV_STREAM_MUTE, which means that all streams are switched off by default.

## bgav_set_overlay_stream()

BGAV_PUBLIC int bgav_set_overlay_stream | ( | bgav_t * | bgav,
|  | int | stream,
|  | bgav_stream_action_t | action
| ) |  |

Select mode for an overlay stream.

Parameters

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

Note that the default stream action is BGAV_STREAM_MUTE, which means that all streams are switched off by default.