Base class for reading media streams via ffmpeg.
More...
#include <ffmpegplayer.h>
|
| int | initializeStream (std::unique_ptr< AVCodecContext, CodecDeleter > &codec_context) |
| | Prepare a ffmpeg source for playing its audio stream. More...
|
| |
| void | processReplayGain (AVReplayGain *gain, int size) |
| | Process a replaygain packet by extracting the track gain, or if not found then then the album gain. More...
|
| |
| virtual void | setGain (float gain)=0 |
| |
Base class for reading media streams via ffmpeg.
◆ LibavMediaReader()
| Audio::LibavMediaReader::LibavMediaReader |
( |
const std::string & |
media_url, |
|
|
int |
timeout = 15 |
|
) |
| |
Base abstract class for reading a media file or URL using ffmpeg.
- Parameters
-
| media_url | The filename or URL of the media. |
| timeout | The timeout for reading the media stream, in seconds. |
◆ ~LibavMediaReader()
| Audio::LibavMediaReader::~LibavMediaReader |
( |
void |
| ) |
|
|
virtual |
◆ initializeStream()
| int Audio::LibavMediaReader::initializeStream |
( |
std::unique_ptr< AVCodecContext, CodecDeleter > & |
codec_context | ) |
|
|
protected |
Prepare a ffmpeg source for playing its audio stream.
Chooses codec, extracts replay gain if available, and sets streams other than the audio are set to ignore.
- Parameters
-
| codec_context | On return, is set to an initialized codec_context with appropriate codec selected for the media. |
- Returns
- The audio stream index.
- Exceptions
-
◆ processReplayGain()
| void Audio::LibavMediaReader::processReplayGain |
( |
AVReplayGain * |
gain, |
|
|
int |
size |
|
) |
| |
|
protected |
Process a replaygain packet by extracting the track gain, or if not found then then the album gain.
◆ setGain()
| virtual void Audio::LibavMediaReader::setGain |
( |
float |
gain | ) |
|
|
protectedpure virtual |
◆ is_network
| bool Audio::LibavMediaReader::is_network = false |
|
protected |
True if media is network streaming.
◆ transport
| AVFormatContext* Audio::LibavMediaReader::transport = nullptr |
|
protected |
◆ url
| const std::string Audio::LibavMediaReader::url |
|
protected |
The documentation for this class was generated from the following files: