Template Class Codec¶
Defined in File codec.h
Nested Relationships¶
Nested Types¶
Class Documentation¶
-
template<MediaType media>
class Codec¶ Codec information wrapper.
This class encapsulates codec parameters and provides a media-type-aware interface for accessing codec properties. It abstracts away AVCodecParameters so that SPDL public headers do not require FFmpeg headers.
This class is primarily intended to carry information about codecs for decoding operations, as AVCodecParameters is required when creating decoders. Codec objects are created by libspdl_ffmpeg (for example by demuxers), which also manages the underlying codec parameters.
Public Functions
-
Codec() = default¶
Default constructor.
-
~Codec()¶
Destructor.
-
int64_t get_bit_rate() const¶
Get the bit rate.
- Returns:
Bit rate in bits per second.
-
int get_bits_per_sample() const¶
Get bits per sample.
- Returns:
Number of bits per sample.
-
int get_sample_rate() const¶
Get the audio sample rate.
- Returns:
Sample rate in Hz.
-
int get_num_channels() const¶
Get the number of audio channels.
- Returns:
Number of channels.
-
std::string get_sample_fmt() const¶
Get the audio sample format.
- Returns:
Sample format as a string.
-
std::string get_channel_layout() const¶
Get the audio channel layout.
- Returns:
Channel layout as a string.
-
int get_width() const¶
Get the video/image width.
- Returns:
Width in pixels.
-
int get_height() const¶
Get the video/image height.
- Returns:
Height in pixels.
-
std::string get_pix_fmt() const¶
Get the pixel format.
- Returns:
Pixel format as a string.
Friends
- friend struct detail::ContainerAccess
-
Codec() = default¶