StormByte C++ Library: Multimedia module 0.0.9999
StormByte-Multimedia is a StormByte library module for parsing configuration files
Loading...
Searching...
No Matches
Classes | Typedefs | Enumerations | Functions | Variables
StormByte::Multimedia::FFmpeg Namespace Reference

Private RAII wrappers over libav*. More...

Classes

class  AudioFifo
 RAII AVAudioFifo for sample buffering (loudnorm / encoder). More...
 
class  AVBSF
 RAII bitstream filter context. More...
 
class  AVBSFPipeline
 Ordered chain of bitstream filters applied to packets. More...
 
class  AVChannelLayout
 RAII AVChannelLayout (av_channel_layout_copy / uninit). More...
 
class  AVCodecParameters
 Deep-copying RAII wrapper for AVCodecParameters. More...
 
class  AVDecoder
 RAII decoder context with optional BSF pipeline. More...
 
class  AVEncoder
 RAII encoder context with optional BSF pipeline. More...
 
class  AVFormatContext
 RAII input format context (demuxer). More...
 
class  AVFrame
 RAII owner of a libav AVFrame. More...
 
class  AVPacket
 RAII owner of a libav AVPacket. More...
 
class  AVPointer
 Move-only RAII base for FFmpeg C pointers. More...
 
class  AVStream
 Non-owning view of an AVStream (owned by AVFormatContext). More...
 
class  AVSubtitle
 RAII wrapper for AVSubtitle (avsubtitle_free). More...
 
class  BSFError
 Bitstream filter failure. More...
 
struct  Convert
 Friend of AVChannelLayout. More...
 
class  DecoderError
 Decoder open or process failure. More...
 
class  Dictionary
 RAII AVDictionary for muxer metadata / options. More...
 
class  EncoderError
 Encoder open or process failure. More...
 
class  Exception
 Base for FFmpeg backend errors. More...
 
class  Swr
 RAII SwrContext for audio convert / resample. More...
 
class  Sws
 RAII SwsContext for video scale / convert. More...
 

Typedefs

using ExpectedAVFormatContext = StormByte::Expected< AVFormatContext, FFmpeg::DecoderError >
 Open demuxer.
 
using ExpectedAVDecoder = StormByte::Expected< AVDecoder, FFmpeg::DecoderError >
 Open decoder.
 
using ExpectedAVEncoder = StormByte::Expected< AVEncoder, FFmpeg::EncoderError >
 Open encoder.
 
using ExpectedAVBSF = StormByte::Expected< AVBSF, FFmpeg::BSFError >
 Create BSF.
 
using Streams = std::set< AVStream >
 Stream set.
 

Enumerations

enum  OperationResult { Success , EndOfFile , Error , TryAgain }
 Result of send/receive style FFmpeg calls. More...
 

Functions

std::int64_t Rescale (std::int64_t ticks, const AVRational &src, const AVRational &dst) noexcept
 av_rescale_q(ticks, src, dst).
 
inline ::AVRational ToRaw (const AVRational &rational) noexcept
 Public / backend rational → C AVRational.
 
AVRational FromRaw (::AVRational rational) noexcept
 C AVRational → public / backend rational.
 
const ::AVChannelLayout * ToRaw (const AVChannelLayout &layout) noexcept
 Const C channel layout, or nullptr.
 
inline ::AVChannelLayout * ToRaw (AVChannelLayout &layout) noexcept
 Mutable C channel layout, or nullptr.
 
AVChannelLayout FromRaw (const ::AVChannelLayout &layout) noexcept
 C channel layout → RAII wrapper (copy).
 
AVChannelLayout FromRaw (const ::AVChannelLayout *layout) noexcept
 Optional C channel layout → RAII wrapper (copy).
 
Multimedia::Stream::Properties MapProperties (const AVStream &stream) noexcept
 Builds the public property bag from a stream view.
 
std::string ErrorToString (int errnum)
 Converts an FFmpeg error code to a string.
 

Variables

constexpr int TimeBase = 1000000
 < Same {num, den} the public API uses
 
constexpr AVRational TimeBaseQ {1, TimeBase}
 AV_TIME_BASE_Q
 
constexpr AVRational Nanosecond {1, 1000000000}
 1 ns tick
 
constexpr std::int64_t NoPts = std::numeric_limits<std::int64_t>::min()
 AV_NOPTS_VALUE
 

Detailed Description

Private RAII wrappers over libav*.

Typedef Documentation

◆ ExpectedAVBSF

Create BSF.

◆ ExpectedAVDecoder

Open decoder.

◆ ExpectedAVEncoder

Open encoder.

◆ ExpectedAVFormatContext

Open demuxer.

◆ Streams

Stream set.

Enumeration Type Documentation

◆ OperationResult

Result of send/receive style FFmpeg calls.

Enumerator
Success 

Completed successfully.

EndOfFile 

EOF reached.

Error 

Hard error.

TryAgain 

EAGAIN — need more input/output.

Function Documentation

◆ ErrorToString()

std::string StormByte::Multimedia::FFmpeg::ErrorToString ( int  errnum)

Converts an FFmpeg error code to a string.

Parameters
errnumCode from av_strerror.
Returns
Human-readable message.

◆ FromRaw() [1/3]

AVRational StormByte::Multimedia::FFmpeg::FromRaw ( ::AVRational  rational)
inlinenoexcept

C AVRational → public / backend rational.

Parameters
rationalC aggregate.
Returns
Wrapper.

◆ FromRaw() [2/3]

AVChannelLayout StormByte::Multimedia::FFmpeg::FromRaw ( const ::AVChannelLayout &  layout)
inlinenoexcept

C channel layout → RAII wrapper (copy).

Parameters
layoutC layout.
Returns
Wrapper.

◆ FromRaw() [3/3]

AVChannelLayout StormByte::Multimedia::FFmpeg::FromRaw ( const ::AVChannelLayout *  layout)
inlinenoexcept

Optional C channel layout → RAII wrapper (copy).

Parameters
layoutC layout, or nullptr.
Returns
Wrapper, or empty.

◆ MapProperties()

Multimedia::Stream::Properties StormByte::Multimedia::FFmpeg::MapProperties ( const AVStream stream)
noexcept

Builds the public property bag from a stream view.

Parameters
streamStream view.
Returns
Video, audio or monostate.

◆ Rescale()

std::int64_t StormByte::Multimedia::FFmpeg::Rescale ( std::int64_t  ticks,
const AVRational src,
const AVRational dst 
)
inlinenoexcept

av_rescale_q(ticks, src, dst).

Parameters
ticksSource ticks.
srcSource time base.
dstDestination time base.
Returns
Scaled ticks, or NoPts when either side is invalid.

◆ ToRaw() [1/3]

inline ::AVChannelLayout * StormByte::Multimedia::FFmpeg::ToRaw ( AVChannelLayout layout)
noexcept

Mutable C channel layout, or nullptr.

Parameters
layoutWrapper.
Returns
Pointer, or nullptr.

◆ ToRaw() [2/3]

const ::AVChannelLayout * StormByte::Multimedia::FFmpeg::ToRaw ( const AVChannelLayout layout)
inlinenoexcept

Const C channel layout, or nullptr.

Parameters
layoutWrapper.
Returns
Pointer, or nullptr.

◆ ToRaw() [3/3]

inline ::AVRational StormByte::Multimedia::FFmpeg::ToRaw ( const AVRational rational)
noexcept

Public / backend rational → C AVRational.

Parameters
rationalWrapper.
Returns
C aggregate.

Variable Documentation

◆ Nanosecond

constexpr AVRational StormByte::Multimedia::FFmpeg::Nanosecond {1, 1000000000}
inlineconstexpr

1 ns tick

◆ NoPts

constexpr std::int64_t StormByte::Multimedia::FFmpeg::NoPts = std::numeric_limits<std::int64_t>::min()
inlineconstexpr

AV_NOPTS_VALUE

◆ TimeBase

constexpr int StormByte::Multimedia::FFmpeg::TimeBase = 1000000
inlineconstexpr

< Same {num, den} the public API uses

AV_TIME_BASE (µs)

◆ TimeBaseQ

constexpr AVRational StormByte::Multimedia::FFmpeg::TimeBaseQ {1, TimeBase}
inlineconstexpr

AV_TIME_BASE_Q