### Install avcpp Source: https://h4tr3d.github.io/avcpp/index.html Installs the avcpp library after it has been built. Use 'sudo make install' for a system-wide installation or 'sudo make DESTDIR= install' for packaging purposes. ```bash sudo make install ``` ```bash sudo make DESTDIR= install ``` -------------------------------- ### Install Project with Meson Source: https://h4tr3d.github.io/avcpp/index.html Install the AvCpp project to the configured prefix using the 'meson install' command. The default prefix is /usr/local. ```bash meson install ``` -------------------------------- ### Install FFmpeg Development Packages (Debian/Ubuntu) Source: https://h4tr3d.github.io/avcpp/index.html Installs necessary FFmpeg development libraries for Debian, Ubuntu, and Linux Mint. Ensure you have the correct repositories configured for your distribution. ```bash sudo apt-get install libavformat-dev \ libavcodec-dev \ libavutil-dev \ libavfilter-dev \ libswscale-dev \ libswresample-dev \ libpostproc-dev \ libavdevice-dev ``` -------------------------------- ### Configure CMake with Custom Install Prefix Source: https://h4tr3d.github.io/avcpp/index.html Configures the CMake build to install avcpp to a specific directory. Use this option to control the installation path. ```bash cmake -DCMAKE_INSTALL_PREFIX=/usr .. ``` -------------------------------- ### av::SampleFormat::alternativeSampleFormat Source: https://h4tr3d.github.io/avcpp/functions_a.html Gets the alternative sample format. ```APIDOC ## av::SampleFormat::alternativeSampleFormat ### Description Gets the alternative sample format. ### Method (Not specified in source) ### Endpoint (Not specified in source) ### Parameters (Not specified in source) ### Request Example (Not specified in source) ### Response #### Success Response (200) (Not specified in source) #### Response Example (Not specified in source) ``` -------------------------------- ### dstSampleFormat() Source: https://h4tr3d.github.io/avcpp/functions_d.html Gets the destination sample format from an AudioResampler. ```APIDOC ## dstSampleFormat() ### Description Retrieves the destination audio sample format from an AudioResampler. ### Method N/A (Function call) ### Parameters None explicitly documented. ### Response The destination sample format (type not specified). ``` -------------------------------- ### init() Source: https://h4tr3d.github.io/avcpp/functions_func_i.html Initializes av::AudioResampler or av::AudioSamples. ```APIDOC ## init() ### Description Initializes an av::AudioResampler or av::AudioSamples object. ### Method N/A (Function Signature) ### Endpoint N/A ### Parameters None ### Request Example None ### Response #### Success Response None (initialization function, typically void return or status indicator not specified). ``` -------------------------------- ### init Source: https://h4tr3d.github.io/avcpp/namespacemembers_func.html Initializes the avcpp library. ```APIDOC ## init() ### Description Initializes the avcpp library. ### Signature av::init() ``` -------------------------------- ### Get Const Iterator to Dictionary End (cend) Source: https://h4tr3d.github.io/avcpp/classav_1_1Dictionary.html Returns a constant iterator pointing to the end of the dictionary. This is a C++11 compliant way to get a const iterator. ```cpp Dictionary::ConstIterator av::Dictionary::cend() const ``` -------------------------------- ### void open (class Dictionary &options, OptionalErrorCode ec=throws()) Source: https://h4tr3d.github.io/avcpp/classav_1_1VideoDecoderContext.html Opens the codec context with specified options. ```APIDOC ## open (with Dictionary) ### Description Opens the codec context using the provided dictionary of options. These options can fine-tune the codec's behavior. Errors can be captured using `OptionalErrorCode`. ### Method Signature `void open(class Dictionary &options, OptionalErrorCode ec=throws())` ### Parameters - `options` (class Dictionary &): A reference to a `Dictionary` object containing configuration options. - `ec` (OptionalErrorCode): An optional error code object to capture any errors during the operation. Defaults to `throws()`. ``` -------------------------------- ### Get Const Iterator to Dictionary Begin (cbegin) Source: https://h4tr3d.github.io/avcpp/classav_1_1Dictionary.html Returns a constant iterator pointing to the beginning of the dictionary. This is a C++11 compliant way to get a const iterator. ```cpp Dictionary::ConstIterator av::Dictionary::cbegin() const ``` -------------------------------- ### av::init Source: https://h4tr3d.github.io/avcpp/av_8h.html Initializes all subsystems required by the avcpp library. This function should be called before using other avcpp functionalities. ```APIDOC ## void av::init () ### Description Init all subsustems needed by avcpp. ### Method void ### Parameters None ### Response None ``` -------------------------------- ### void open (class Dictionary &options, const Codec &codec, OptionalErrorCode ec=throws()) Source: https://h4tr3d.github.io/avcpp/classav_1_1VideoDecoderContext.html Opens the codec context with specified options and codec. ```APIDOC ## open (with Dictionary and Codec) ### Description Opens the codec context using the provided dictionary of options and a specific `Codec` object. Errors can be captured using `OptionalErrorCode`. ### Method Signature `void open(class Dictionary &options, const Codec &codec, OptionalErrorCode ec=throws())` ### Parameters - `options` (class Dictionary &): A reference to a `Dictionary` object containing configuration options. - `codec` (const Codec &): The `Codec` object to use. - `ec` (OptionalErrorCode): An optional error code object to capture any errors during the operation. Defaults to `throws()`. ``` -------------------------------- ### Class Members - Functions starting with 'i' Source: https://h4tr3d.github.io/avcpp/functions_i.html Lists functions within the avcpp library whose names start with the letter 'i'. These functions are associated with various classes and provide specific functionalities. ```APIDOC ## Class Members - Functions starting with 'i' ### Description This section lists functions within the avcpp library whose names start with the letter 'i'. These functions are associated with various classes and provide specific functionalities. ### Functions - **id()** : av::Codec - Description: Retrieves the identifier for a codec. - **init()** : av::AudioResampler, av::AudioSamples - Description: Initializes an audio resampler or audio samples object. - **isComplete()** : av::FrameCommon, av::Packet - Description: Checks if a frame or packet is complete. - **isDecoder()** : av::Codec - Description: Determines if a codec is a decoder. - **isEncoder()** : av::Codec - Description: Determines if a codec is an encoder. - **isFlags()** : av::CodecContext2 - Description: Checks if the codec context has specific flags. - **isFlags2()** : av::CodecContext2 - Description: Checks if the codec context has specific extended flags. - **isHwFrame()** : av::FrameCommon - Description: Checks if a frame is a hardware frame. - **isKeyFrame()** : av::VideoFrame - Description: Determines if a video frame is a keyframe. - **isKeyPacket()** : av::Packet - Description: Determines if a packet is a key packet. - **isNoPts()** : av::Timestamp - Description: Checks if a timestamp has no presentation timestamp. - **isNull()** : av::Dictionary::Entry, av::Packet, FFWrapperPtr< T >, FFWrapperRef< T > - Description: Checks if an object is null or empty. - **isOpened()** : av::CodecContext2 - Description: Checks if the codec context is opened. - **isOwning()** : av::Dictionary - Description: Checks if the dictionary owns its data. - **isPlanar()** : av::AudioSamples, av::SampleFormat - Description: Determines if an audio sample format is planar. - **isRefCountedFrames()** : av::CodecContext2 - Description: Checks if the codec context uses reference-counted frames. - **isReferenced()** : av::FrameCommon, av::Packet - Description: Checks if a frame or packet is referenced. - **isValid()** : av::AudioResampler, av::CodecContext2, av::CodecParametersView, av::FrameCommon, av::LinkedListWrapper< T, W, N, C, R, D, I >, av::Timestamp, av::VideoRescaler - Description: Checks if an object is valid. - **isValidForEncode()** : av::CodecContext2 - Description: Checks if the codec context is valid for encoding. - **isWritable()** : av::BufferRefView - Description: Checks if a buffer view is writable. ### Special Members - **Iterator** : av::Dictionary - Description: Type alias for the dictionary iterator. - **iterator** : av::LinkedListWrapper< T, W, N, C, R, D, I > - Description: Returns an iterator to the beginning of the linked list. - **iterator_category** : av::Dictionary::DictionaryIterator< constIterator >, av::LinkedListWrapper< T, W, N, C, R, D, I >::base_iterator< constIterator > - Description: Provides the iterator category for the associated iterator type. ``` -------------------------------- ### gettime Source: https://h4tr3d.github.io/avcpp/namespacemembers_func.html Gets the current time. ```APIDOC ## gettime() ### Description Gets the current time. ### Signature av::gettime() ``` -------------------------------- ### void open (class Dictionary &&options, OptionalErrorCode ec=throws()) Source: https://h4tr3d.github.io/avcpp/classav_1_1VideoDecoderContext.html Opens the codec context with specified options (move semantics). ```APIDOC ## open (with Dictionary &&) ### Description Opens the codec context using the provided dictionary of options, utilizing move semantics for efficiency. Errors can be captured using `OptionalErrorCode`. ### Method Signature `void open(class Dictionary &&options, OptionalErrorCode ec=throws())` ### Parameters - `options` (class Dictionary &&): An rvalue reference to a `Dictionary` object containing configuration options. - `ec` (OptionalErrorCode): An optional error code object to capture any errors during the operation. Defaults to `throws()`. ``` -------------------------------- ### getWidth() Source: https://h4tr3d.github.io/avcpp/functions_g.html Gets the width of a Rect. ```APIDOC ## getWidth() ### Description Retrieves the width of a rectangle. ### Method Member Function ### Class av::Rect ``` -------------------------------- ### void open (class Dictionary &&options, const Codec &codec, OptionalErrorCode ec=throws()) Source: https://h4tr3d.github.io/avcpp/classav_1_1VideoDecoderContext.html Opens the codec context with specified options and codec (move semantics). ```APIDOC ## open (with Dictionary && and Codec) ### Description Opens the codec context using the provided dictionary of options (with move semantics) and a specific `Codec` object. Errors can be captured using `OptionalErrorCode`. ### Method Signature `void open(class Dictionary &&options, const Codec &codec, OptionalErrorCode ec=throws())` ### Parameters - `options` (class Dictionary &&): An rvalue reference to a `Dictionary` object containing configuration options. - `codec` (const Codec &): The `Codec` object to use. - `ec` (OptionalErrorCode): An optional error code object to capture any errors during the operation. Defaults to `throws()`. ``` -------------------------------- ### void open (const Codec &codec, OptionalErrorCode ec=throws()) Source: https://h4tr3d.github.io/avcpp/classav_1_1VideoDecoderContext.html Opens the codec context with a specified codec. ```APIDOC ## open (with Codec) ### Description Opens the codec context using the provided `Codec` object and the currently configured parameters. Errors can be captured using `OptionalErrorCode`. ### Method Signature `void open(const Codec &codec, OptionalErrorCode ec=throws())` ### Parameters - `codec` (const Codec &): The `Codec` object to use for opening the context. - `ec` (OptionalErrorCode): An optional error code object to capture any errors during the operation. Defaults to `throws()`. ``` -------------------------------- ### getHeight() Source: https://h4tr3d.github.io/avcpp/functions_g.html Gets the height of a Rect. ```APIDOC ## getHeight() ### Description Retrieves the height of a rectangle. ### Method Member Function ### Class av::Rect ``` -------------------------------- ### AudioSamples Constructors Source: https://h4tr3d.github.io/avcpp/classav_1_1AudioSamples.html Demonstrates the various ways to construct an AudioSamples object. ```APIDOC ## AudioSamples Constructors ### Description Constructs an AudioSamples object. ### Methods - `AudioSamples()`: Default constructor. - `AudioSamples(SampleFormat sampleFormat, int samplesCount, uint64_t channelLayout, int sampleRate, int align=SampleFormat::AlignDefault)`: Constructor with specified audio format parameters. - `AudioSamples(const uint8_t *data, size_t size, SampleFormat sampleFormat, int samplesCount, uint64_t channelLayout, int sampleRate, int align=SampleFormat::AlignDefault)`: Constructor initializing with raw data. - `AudioSamples(const AudioSamples &other)`: Copy constructor. - `AudioSamples(AudioSamples &&other)`: Move constructor. ``` -------------------------------- ### getY Source: https://h4tr3d.github.io/avcpp/functions_func_g.html Gets the Y coordinate of a rectangle. ```APIDOC ## getY() ### Description Retrieves the Y coordinate of an av::Rect object. ### Method (Not specified, likely a member function) ### Endpoint (Not applicable) ### Parameters (None specified) ### Request Example (Not applicable) ### Response #### Success Response (Not specified) - **av::Rect** - The Rect object. #### Response Example (Not specified) ``` -------------------------------- ### open Source: https://h4tr3d.github.io/avcpp/classav_1_1CodecContext2.html Opens the codec context with specified options, codec, and error handling. ```APIDOC ## open() [1/7] ### Description Opens the codec context with given options and codec. ### Signature `void av::CodecContext2::open(class Dictionary && _options, const Codec & _codec, OptionalErrorCode _ec = throws()) ### Parameters * **_options** (class Dictionary &&) - Move-only dictionary of options. * **_codec** (const Codec &) - The codec to open. * **_ec** (OptionalErrorCode) - Optional error code handler. ``` ```APIDOC ## open() [2/7] ### Description Opens the codec context with given options. ### Signature `void av::CodecContext2::open(class Dictionary && _options, OptionalErrorCode _ec = throws()) ### Parameters * **_options** (class Dictionary &&) - Move-only dictionary of options. * **_ec** (OptionalErrorCode) - Optional error code handler. ``` ```APIDOC ## open() [3/7] ### Description Opens the codec context with given options and codec (lvalue reference). ### Signature `void av::CodecContext2::open(class Dictionary & _options, const Codec & _codec, OptionalErrorCode _ec = throws()) ### Parameters * **_options** (class Dictionary &) - Dictionary of options. * **_codec** (const Codec &) - The codec to open. * **_ec** (OptionalErrorCode) - Optional error code handler. ``` ```APIDOC ## open() [4/7] ### Description Opens the codec context with given options (lvalue reference). ### Signature `void av::CodecContext2::open(class Dictionary & _options, OptionalErrorCode _ec = throws()) ### Parameters * **_options** (class Dictionary &) - Dictionary of options. * **_ec** (OptionalErrorCode) - Optional error code handler. ``` ```APIDOC ## open() [5/7] ### Description Opens the codec context with the specified codec, AVDictionary options, and error code. ### Signature `void av::CodecContext2::open(const Codec & _codec, AVDictionary ** _options, OptionalErrorCode _ec) protected ### Parameters * **_codec** (const Codec &) - The codec to use. * **_options** (AVDictionary **) - Pointer to an AVDictionary structure for options. * **_ec** (OptionalErrorCode) - Optional error code handler. ``` ```APIDOC ## open() [6/7] ### Description Opens the codec context with the specified codec and an optional error code. ### Signature `void av::CodecContext2::open(const Codec & _codec, OptionalErrorCode _ec = throws()) ### Parameters * **_codec** (const Codec &) - The codec to use. * **_ec** (OptionalErrorCode) - Optional error code handler. ``` ```APIDOC ## open() [7/7] ### Description Opens the codec context with an optional error code. ### Signature `void av::CodecContext2::open(OptionalErrorCode _ec = throws()) ### Parameters * **_ec** (OptionalErrorCode) - Optional error code handler. ``` -------------------------------- ### getWidth Source: https://h4tr3d.github.io/avcpp/functions_func_g.html Gets the width of a rectangle. ```APIDOC ## getWidth() ### Description Retrieves the width of an av::Rect object. ### Method (Not specified, likely a member function) ### Endpoint (Not applicable) ### Parameters (None specified) ### Request Example (Not applicable) ### Response #### Success Response (Not specified) - **av::Rect** - The Rect object. #### Response Example (Not specified) ``` -------------------------------- ### getHeight Source: https://h4tr3d.github.io/avcpp/functions_func_g.html Gets the height of a rectangle. ```APIDOC ## getHeight() ### Description Retrieves the height of an av::Rect object. ### Method (Not specified, likely a member function) ### Endpoint (Not applicable) ### Parameters (None specified) ### Request Example (Not applicable) ### Response #### Success Response (Not specified) - **av::Rect** - The Rect object. #### Response Example (Not specified) ``` -------------------------------- ### av::CodecContext2::CodecContext2() Source: https://h4tr3d.github.io/avcpp/functions_c.html Constructor for av::CodecContext2. ```APIDOC ## CodecContext2() ### Description Constructs a new instance of the av::CodecContext2 class. ### Method N/A (Constructor) ### Endpoint N/A ### Parameters None specified in the source. ### Request Example None ### Response #### Success Response - **return value** (av::CodecContext2) - A newly created CodecContext2 object. ``` -------------------------------- ### av::CodecParameters::CodecParameters() Source: https://h4tr3d.github.io/avcpp/functions_c.html Constructor for av::CodecParameters. ```APIDOC ## CodecParameters() ### Description Constructs a new instance of the av::CodecParameters class. ### Method N/A (Constructor) ### Endpoint N/A ### Parameters None specified in the source. ### Request Example None ### Response #### Success Response - **return value** (av::CodecParameters) - A newly created CodecParameters object. ``` -------------------------------- ### duration() Source: https://h4tr3d.github.io/avcpp/classav_1_1Packet.html Gets the duration of the packet. ```APIDOC ## ◆ duration() int av::Packet::duration() const ``` -------------------------------- ### get_sample_rate Source: https://h4tr3d.github.io/avcpp/namespacemembers_func.html Gets the sample rate of a frame. ```APIDOC ## get_sample_rate() ### Description Gets the sample rate of a frame. ### Signature av::frame::get_sample_rate() ``` -------------------------------- ### av::CodecParametersView::CodecParametersView() Source: https://h4tr3d.github.io/avcpp/functions_c.html Constructor for av::CodecParametersView. ```APIDOC ## CodecParametersView() ### Description Constructs a new instance of the av::CodecParametersView class. ### Method N/A (Constructor) ### Endpoint N/A ### Parameters None specified in the source. ### Request Example None ### Response #### Success Response - **return value** (av::CodecParametersView) - A newly created CodecParametersView object. ``` -------------------------------- ### Build AvCpp with Meson Source: https://h4tr3d.github.io/avcpp/index.html Clone the AvCpp repository and use Meson to configure and build the project. Dependencies can be handled by Meson or installed via a package manager. ```bash git clone https://github.com/h4tr3d/avcpp.git avcpp-git cd avcpp-git mkdir build cd build meson .. meson compile ``` -------------------------------- ### get() Source: https://h4tr3d.github.io/avcpp/functions_g.html Retrieves a value from a Dictionary or PixSampleFmtWrapper. ```APIDOC ## get() ### Description Retrieves a value. This method can be used with av::Dictionary or PixSampleFmtWrapper. ### Method Member Function ### Class av::Dictionary, PixSampleFmtWrapper< WrapperClass, T, NoneValue > ``` -------------------------------- ### FFWrapperPtr (AVCodecContext *raw) Source: https://h4tr3d.github.io/avcpp/classav_1_1VideoDecoderContext.html Constructor for FFWrapperPtr initializing with a raw pointer. ```APIDOC ## FFWrapperPtr (Raw Pointer Constructor) ### Description Constructs an `FFWrapperPtr` and takes ownership of the provided raw `AVCodecContext` pointer. The smart pointer will manage the lifetime of this raw pointer. ### Method Signature `FFWrapperPtr(AVCodecContext *raw)` ### Parameters - `raw` (AVCodecContext *): A raw pointer to an `AVCodecContext` object. ``` -------------------------------- ### getX Source: https://h4tr3d.github.io/avcpp/functions_func_g.html Gets the X coordinate of a rectangle. ```APIDOC ## getX() ### Description Retrieves the X coordinate of an av::Rect object. ### Method (Not specified, likely a member function) ### Endpoint (Not applicable) ### Parameters (None specified) ### Request Example (Not applicable) ### Response #### Success Response (Not specified) - **av::Rect** - The Rect object. #### Response Example (Not specified) ``` -------------------------------- ### getValue Source: https://h4tr3d.github.io/avcpp/functions_func_g.html Gets the value of a rational number. ```APIDOC ## getValue() ### Description Retrieves the value of an av::Rational number. ### Method (Not specified, likely a member function) ### Endpoint (Not applicable) ### Parameters (None specified) ### Request Example (Not applicable) ### Response #### Success Response (Not specified) - **av::Rational** - The Rational object. #### Response Example (Not specified) ``` -------------------------------- ### Integrate AvCpp with FetchContent Source: https://h4tr3d.github.io/avcpp/index.html Use CMake's FetchContent module to download and integrate AvCpp. CMake arguments can be set before FetchContent_MakeAvailable. ```cmake include(FetchContent) FetchContent_Declare( avcpp GIT_REPOSITORY https://github.com/h4tr3d/avcpp.git GIT_TAG v3.0.1 ) FetchContent_MakeAvailable(avcpp) target_link_libraries(prog PRIVATE avcpp::avcpp) ``` ```cmake FetchContent_Declare( avcpp ... ) set(AV_ENABLE_STATIC On) set(AV_ENABLE_SHARED Off) FetchContent_MakeAvailable(avcpp) ``` -------------------------------- ### getNumerator Source: https://h4tr3d.github.io/avcpp/functions_func_g.html Gets the numerator of a rational number. ```APIDOC ## getNumerator() ### Description Retrieves the numerator of an av::Rational number. ### Method (Not specified, likely a member function) ### Endpoint (Not applicable) ### Parameters (None specified) ### Request Example (Not applicable) ### Response #### Success Response (Not specified) - **av::Rational** - The Rational object. #### Response Example (Not specified) ``` -------------------------------- ### void open (OptionalErrorCode ec=throws()) Source: https://h4tr3d.github.io/avcpp/classav_1_1VideoDecoderContext.html Opens the codec context with default parameters. ```APIDOC ## open (default) ### Description Opens the codec context using the currently configured parameters. This prepares the codec for decoding or encoding operations. Errors can be captured using `OptionalErrorCode`. ### Method Signature `void open(OptionalErrorCode ec=throws())` ### Parameters - `ec` (OptionalErrorCode): An optional error code object to capture any errors during the operation. Defaults to `throws()`. ``` -------------------------------- ### getDenominator Source: https://h4tr3d.github.io/avcpp/functions_func_g.html Gets the denominator of a rational number. ```APIDOC ## getDenominator() ### Description Retrieves the denominator of an av::Rational number. ### Method (Not specified, likely a member function) ### Endpoint (Not applicable) ### Parameters (None specified) ### Request Example (Not applicable) ### Response #### Success Response (Not specified) - **av::Rational** - The Rational object. #### Response Example (Not specified) ``` -------------------------------- ### FFWrapperPtr ()=default Source: https://h4tr3d.github.io/avcpp/classav_1_1VideoDecoderContext.html Default constructor for FFWrapperPtr. ```APIDOC ## FFWrapperPtr (Default Constructor) ### Description Default constructor for `FFWrapperPtr`. Creates an empty smart pointer that does not manage any `AVCodecContext`. ### Method Signature `FFWrapperPtr() = default` ``` -------------------------------- ### Wrapper Management Source: https://h4tr3d.github.io/avcpp/classav_1_1Codec-members.html Methods for managing the FFWrapperPtr, including default construction, construction from a raw pointer, and checking for null. ```APIDOC ## FFWrapperPtr()=default ### Description Default constructor for FFWrapperPtr. ### Method FFWrapperPtr< const AVCodec > ### Endpoint FFWrapperPtr()=default ## FFWrapperPtr(const AVCodec *raw) ### Description Constructs FFWrapperPtr from a raw AVCodec pointer. ### Method FFWrapperPtr< const AVCodec > ### Endpoint FFWrapperPtr(const AVCodec *raw) ## isNull() const ### Description Checks if the FFWrapperPtr is null. ### Method FFWrapperPtr< const AVCodec > ### Endpoint isNull() const ``` -------------------------------- ### getAudioFrameDuration Source: https://h4tr3d.github.io/avcpp/functions_func_g.html Gets the duration of an audio frame. ```APIDOC ## getAudioFrameDuration() ### Description Retrieves the duration of an audio frame from CodecParametersView. ### Method (Not specified, likely a member function) ### Endpoint (Not applicable) ### Parameters (None specified) ### Request Example (Not applicable) ### Response #### Success Response (Not specified) - **av::CodecParametersView** - The CodecParametersView object. #### Response Example (Not specified) ``` -------------------------------- ### bufferSize Source: https://h4tr3d.github.io/avcpp/functions_func_b.html Gets the buffer size of a VideoFrame. ```APIDOC ## bufferSize() ### Description Gets the buffer size of a VideoFrame. ### Signature av::VideoFrame::bufferSize() ``` -------------------------------- ### av::AudioResampler Initialization Source: https://h4tr3d.github.io/avcpp/audioresampler_8h_source.html Details the initialization method for setting up the audio resampler with source and destination audio formats. ```APIDOC ## init ### Description Initializes the audio resampler with specified destination and source audio parameters. It can optionally throw an error code on failure. ### Method bool init(uint64_t dstChannelsLayout, int dstRate, SampleFormat dstFormat, uint64_t srcChannelsLayout, int srcRate, SampleFormat srcFormat, OptionalErrorCode ec=throws()) ### Endpoint N/A (Method) ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Parameters * **dstChannelsLayout** (uint64_t) - Required - The channel layout for the destination audio. * **dstRate** (int) - Required - The sample rate for the destination audio. * **dstFormat** (SampleFormat) - Required - The sample format for the destination audio. * **srcChannelsLayout** (uint64_t) - Required - The channel layout for the source audio. * **srcRate** (int) - Required - The sample rate for the source audio. * **srcFormat** (SampleFormat) - Required - The sample format for the source audio. * **ec** (OptionalErrorCode) - Optional - Error code handler, defaults to throws(). ### Response #### Success Response (bool) Returns true if initialization is successful, false otherwise. #### Response Example ``` true ``` ``` -------------------------------- ### dstHeight() Source: https://h4tr3d.github.io/avcpp/functions_d.html Gets the destination height from a VideoRescaler. ```APIDOC ## dstHeight() ### Description Retrieves the destination height of the video frame from a VideoRescaler. ### Method N/A (Function call) ### Parameters None explicitly documented. ### Response The destination height (integer type expected). ``` -------------------------------- ### Initialize avcpp Subsystems Source: https://h4tr3d.github.io/avcpp/avutils_8cpp.html Initializes all necessary subsystems for the avcpp library. This function should be called before using other avcpp functionalities. ```cpp void av::init () ``` -------------------------------- ### bitRate Source: https://h4tr3d.github.io/avcpp/functions_func_b.html Gets the bit rate of the CodecContext2. ```APIDOC ## bitRate() ### Description Gets the bit rate of the CodecContext2. ### Signature av::CodecContext2::bitRate() ``` -------------------------------- ### av::AudioSamples Constructors Source: https://h4tr3d.github.io/avcpp/classav_1_1AudioSamples-members.html Details the various constructors available for creating and initializing av::AudioSamples objects. ```APIDOC ## Constructors ### `AudioSamples()` Default constructor. ### `AudioSamples(SampleFormat sampleFormat, int samplesCount, uint64_t channelLayout, int sampleRate, int align=SampleFormat::AlignDefault)` Constructor to create an AudioSamples object with specified format, count, layout, and rate. ### `AudioSamples(const uint8_t *data, size_t size, SampleFormat sampleFormat, int samplesCount, uint64_t channelLayout, int sampleRate, int align=SampleFormat::AlignDefault)` Constructor to create an AudioSamples object from raw data with specified format and properties. ### `AudioSamples(const AudioSamples &other)` Copy constructor. ### `AudioSamples(AudioSamples &&other)` Move constructor. ``` -------------------------------- ### av::CodecContextBase< Clazz, _direction, _type >::CodecContextBase() Source: https://h4tr3d.github.io/avcpp/functions_c.html Constructor for av::CodecContextBase. ```APIDOC ## CodecContextBase() ### Description Constructs a new instance of the av::CodecContextBase class. ### Method N/A (Constructor) ### Endpoint N/A ### Parameters None specified in the source. ### Request Example None ### Response #### Success Response - **return value** (av::CodecContextBase< Clazz, _direction, _type >) - A newly created CodecContextBase object. ``` -------------------------------- ### delay() Source: https://h4tr3d.github.io/avcpp/functions_d.html Gets the delay associated with an AudioResampler. ```APIDOC ## delay() ### Description Returns the current delay value for an AudioResampler object. ### Method N/A (Function call) ### Parameters None explicitly documented. ### Response The delay value (type not specified). ``` -------------------------------- ### Constructors Source: https://h4tr3d.github.io/avcpp/classav_1_1VideoFrame-members.html Details on how to construct av::VideoFrame objects. ```APIDOC ## Constructors ### `VideoFrame()` Default constructor. ### `VideoFrame(PixelFormat pixelFormat, int width, int height, int align=1)` Constructs a VideoFrame with the specified pixel format, dimensions, and alignment. ### `VideoFrame(const uint8_t *data, size_t size, PixelFormat pixelFormat, int width, int height, int align=1)` Constructs a VideoFrame by wrapping existing data. ### `VideoFrame(const VideoFrame &other)` Copy constructor. ### `VideoFrame(VideoFrame &&other)` Move constructor. ``` -------------------------------- ### flags() Source: https://h4tr3d.github.io/avcpp/classav_1_1Packet.html Gets the flags associated with the packet. ```APIDOC ## ◆ flags() int av::Packet::flags() const ``` -------------------------------- ### codecTag (getter) Source: https://h4tr3d.github.io/avcpp/classav_1_1CodecParametersView.html Gets the codec tag. ```APIDOC ## codecTag() [1/2] uint32_t | av::CodecParametersView::codecTag | ( | | ) | const ``` -------------------------------- ### Set Audio Sample Format Source: https://h4tr3d.github.io/avcpp/codeccontext_8h_source.html Sets the audio sample format. Requires the context to be valid. ```cpp void setSampleFormat(SampleFormat sampleFormat) noexcept { RAW_SET2(isValid(), sample_fmt, sampleFormat); } ``` -------------------------------- ### decodingCodec Source: https://h4tr3d.github.io/avcpp/classav_1_1CodecParametersView.html Gets the codec used for decoding. ```APIDOC ## decodingCodec() Codec | av::CodecParametersView::decodingCodec | ( | | ) | const ``` -------------------------------- ### encodingCodec Source: https://h4tr3d.github.io/avcpp/classav_1_1CodecParametersView.html Gets the codec used for encoding. ```APIDOC ## encodingCodec() Codec | av::CodecParametersView::encodingCodec | ( | | ) | const ``` -------------------------------- ### CodecContextBase (const Codec &codec) Source: https://h4tr3d.github.io/avcpp/classav_1_1VideoDecoderContext.html Constructor for CodecContextBase initializing with a Codec. ```APIDOC ## CodecContextBase (Codec Constructor) ### Description Constructs a `CodecContextBase` instance and initializes it with the specified `Codec`. ### Method Signature `CodecContextBase(const Codec &codec)` ### Parameters - `codec` (const Codec &): The `Codec` object to initialize the context with. ``` -------------------------------- ### av::Dictionary Constructors Source: https://h4tr3d.github.io/avcpp/classav_1_1Dictionary.html Documentation for the various constructors of the av::Dictionary class, including default, assignment, copy, move, and initializer list constructors. ```APIDOC ## ◆ Dictionary() [1/5] av::Dictionary::Dictionary | ( | | ) | default ctor do nothig, null dictionary creates. ## ◆ Dictionary() [2/5] | av::Dictionary::Dictionary | ( | AVDictionary * | _dict_ , | | bool | _takeOwning_ = `true` | ) | | explicit Assign ctor Wrap around raw dictionary. Useful to iterate with low-level FFmpeg API Parameters dict| dictionary to hold takeOwning| ownershipping flag. If false, Dictionary only wraps access to the AVDictionary and do not free resources on destroy. ## ◆ Dictionary() [3/5] av::Dictionary::Dictionary | ( | const Dictionary & | _other_| ) Copy ctor Make deep copy of dictionary. Takes ownershipping on newly created dict. Parameters other| ## ◆ Dictionary() [4/5] av::Dictionary::Dictionary | ( | Dictionary && | _other_| ) Move ctor Takes resources. Other dictionary moves to uninited state. Ownershpping same to other. Parameters other| ## ◆ Dictionary() [5/5] av::Dictionary::Dictionary | ( | std::initializer_list< std::pair< const char *, const char * >> | _list_ , | | int | _flags_ = `0` | ) Initializer ctor Allows create dictionaries in array manier: Dictionary dict = { {"key1", "value1"}, {"key2", "value2"}, }; av::Dictionary::Dictionary Dictionary() Default ctor do nothig, null dictionary creates. **Definition:** dictionary.cpp:11 New dictionary owning resources. Parameters list| init list flags| see Flags ``` -------------------------------- ### codecId (getter) Source: https://h4tr3d.github.io/avcpp/classav_1_1CodecParametersView.html Gets the codec ID. ```APIDOC ## codecId() [1/2] AVCodecID | av::CodecParametersView::codecId | ( | | ) | const ``` -------------------------------- ### Constructors and Destructor Source: https://h4tr3d.github.io/avcpp/classav_1_1Dictionary.html Details on how to create, copy, move, and destroy AVDictionary objects. ```APIDOC ## Constructors and Destructor ### Default Constructor - `Dictionary()`: Default constructor that does nothing; a null dictionary is created. ### Assignment Constructor - `Dictionary(AVDictionary *dict, bool takeOwning = true)`: Assigns a raw AVDictionary pointer, with an option to take ownership. ### Destructor - `~Dictionary()`: Destructor. If the Dictionary takes ownership of the AVDictionary, it frees the allocated resources. ### Copy Constructor - `Dictionary(const Dictionary &other)`: Creates a deep copy of the dictionary. ### Copy Assignment Operator - `Dictionary &operator=(const Dictionary &rhs)`: Makes a deep copy of the dictionary. ### Move Constructor - `Dictionary(Dictionary &&other)`: Takes resources from another Dictionary object. ### Move Assignment Operator - `Dictionary &operator=(Dictionary &&rhs)`: Takes resources from another Dictionary object. ### Initializer Constructor - `Dictionary(std::initializer_list> list, int flags = 0)`: Allows creating dictionaries in an array-like manner. ### Initializer Assignment Operator - `Dictionary &operator=(std::initializer_list> list)`: Allows assigning dictionaries in an array-like manner. ``` -------------------------------- ### mediaType (getter) Source: https://h4tr3d.github.io/avcpp/classav_1_1CodecParametersView.html Gets the media type. ```APIDOC ## mediaType() AVMediaType | av::CodecParametersView::mediaType | ( | | ) | const ``` -------------------------------- ### Get Timebase Source: https://h4tr3d.github.io/avcpp/timestamp_8h_source.html Retrieves the timebase associated with the timestamp. ```cpp const Rational& timebase() const noexcept; ``` -------------------------------- ### sampleFormat Source: https://h4tr3d.github.io/avcpp/functions_s.html Retrieves or sets the sample format for audio. ```APIDOC ## sampleFormat() ### Description Retrieves the sample format. ### Method `sampleFormat()` ### Returns `av::AudioCodecContext< Clazz, _direction >`, `av::AudioSamples` ``` ```APIDOC ## setSampleFormat ### Description Sets the sample format for audio codec contexts. ### Method `setSampleFormat(av::AudioCodecContext< Clazz, _direction >)` ### Parameters - `context` (av::AudioCodecContext< Clazz, _direction >) - The audio codec context. ``` -------------------------------- ### get_best_effort_timestamp Source: https://h4tr3d.github.io/avcpp/namespacemembers_func.html Gets the best effort timestamp for a frame. ```APIDOC ## get_best_effort_timestamp() ### Description Gets the best effort timestamp for a frame. ### Signature av::frame::get_best_effort_timestamp() ``` -------------------------------- ### open Source: https://h4tr3d.github.io/avcpp/classav_1_1CodecContext2-members.html Opens the codec context with various configurations. Overloaded methods allow opening with an optional error code, a specific codec, or a dictionary of options. ```APIDOC ## open ### Description Opens the codec context. This method has multiple overloads to accommodate different initialization scenarios, including optional error codes and dictionary options. ### Method `open(OptionalErrorCode ec=throws())` `open(const Codec &codec, OptionalErrorCode ec=throws())` `open(class Dictionary &options, OptionalErrorCode ec=throws())` `open(class Dictionary &&options, OptionalErrorCode ec=throws())` `open(class Dictionary &options, const Codec &codec, OptionalErrorCode ec=throws())` `open(class Dictionary &&options, const Codec &codec, OptionalErrorCode ec=throws())` ### Parameters - `ec` (OptionalErrorCode): An optional error code to capture any errors during the operation. Defaults to `throws()`. - `codec` (const Codec &): The codec to open. - `options` (Dictionary & or Dictionary &&): A dictionary containing configuration options. ``` -------------------------------- ### getDouble Source: https://h4tr3d.github.io/avcpp/functions_func_g.html Gets the double representation of a rational number. ```APIDOC ## getDouble() ### Description Retrieves the double-precision floating-point representation of an av::Rational number. ### Method (Not specified, likely a member function) ### Endpoint (Not applicable) ### Parameters (None specified) ### Request Example (Not applicable) ### Response #### Success Response (Not specified) - **av::Rational** - The Rational object. #### Response Example (Not specified) ``` -------------------------------- ### PixSampleFmtWrapper Constructors Source: https://h4tr3d.github.io/avcpp/structPixSampleFmtWrapper.html Details the default constructor and the constructor that takes a sample format value. ```APIDOC ## ◆ PixSampleFmtWrapper() [1/2] template(-1)> | constexpr PixSampleFmtWrapper< WrapperClass, T, NoneValue >::PixSampleFmtWrapper | ( | | ) | ---|---|---|---| constexprdefault ``` ```APIDOC ## ◆ PixSampleFmtWrapper() [2/2] template(-1)> | constexpr PixSampleFmtWrapper< WrapperClass, T, NoneValue >::PixSampleFmtWrapper | ( | T | _fmt_ | ) | ---|---|---|---|---| inlineconstexprnoexcept ``` -------------------------------- ### dstSampleRate() Source: https://h4tr3d.github.io/avcpp/functions_d.html Gets the destination sample rate from an AudioResampler. ```APIDOC ## dstSampleRate() ### Description Returns the destination audio sample rate for an AudioResampler. ### Method N/A (Function call) ### Parameters None explicitly documented. ### Response The destination sample rate (integer type expected). ``` -------------------------------- ### AudioResampler Initialization Methods Source: https://h4tr3d.github.io/avcpp/classav_1_1AudioResampler-members.html Methods to initialize or re-initialize the audio resampler with specific parameters. ```APIDOC ## init(uint64_t dstChannelsLayout, int dstRate, SampleFormat dstFormat, uint64_t srcChannelsLayout, int srcRate, SampleFormat srcFormat, OptionalErrorCode ec=throws()) ### Description Initializes the audio resampler with the given destination and source audio parameters. ### Method init ### Endpoint N/A ``` ```APIDOC ## init(uint64_t dstChannelsLayout, int dstRate, SampleFormat dstFormat, uint64_t srcChannelsLayout, int srcRate, SampleFormat srcFormat, Dictionary &options, OptionalErrorCode ec=throws()) ### Description Initializes the audio resampler with the given parameters and additional options. ### Method init ### Endpoint N/A ``` ```APIDOC ## init(uint64_t dstChannelsLayout, int dstRate, SampleFormat dstFormat, uint64_t srcChannelsLayout, int srcRate, SampleFormat srcFormat, Dictionary &&options, OptionalErrorCode ec=throws()) ### Description Initializes the audio resampler with the given parameters and additional options (move semantics). ### Method init ### Endpoint N/A ``` -------------------------------- ### av::AudioSamples::AudioSamples Source: https://h4tr3d.github.io/avcpp/functions_a.html Constructor for AudioSamples. ```APIDOC ## av::AudioSamples::AudioSamples ### Description Constructor for AudioSamples. ### Method (Not specified in source) ### Endpoint (Not specified in source) ### Parameters (Not specified in source) ### Request Example (Not specified in source) ### Response #### Success Response (200) (Not specified in source) #### Response Example (Not specified in source) ``` -------------------------------- ### dstPixelFormat() Source: https://h4tr3d.github.io/avcpp/functions_d.html Gets the destination pixel format from a VideoRescaler. ```APIDOC ## dstPixelFormat() ### Description Returns the destination pixel format for video scaling operations performed by a VideoRescaler. ### Method N/A (Function call) ### Parameters None explicitly documented. ### Response The destination pixel format (type not specified). ``` -------------------------------- ### dstChannels() Source: https://h4tr3d.github.io/avcpp/functions_d.html Gets the number of destination channels from an AudioResampler. ```APIDOC ## dstChannels() ### Description Returns the number of audio channels in the destination format for an AudioResampler. ### Method N/A (Function call) ### Parameters None explicitly documented. ### Response The count of destination channels (integer type expected). ``` -------------------------------- ### AudioSamples Source: https://h4tr3d.github.io/avcpp/functions_func_a.html Constructor for AudioSamples. ```APIDOC ## AudioSamples() ### Description Constructs a new AudioSamples object. ### Method Not specified (likely a C++ constructor) ### Endpoint N/A ### Parameters None explicitly documented for this signature. ### Request Example N/A ### Response - **av::AudioSamples**: A newly created AudioSamples object. ``` -------------------------------- ### bitRateTolerance Source: https://h4tr3d.github.io/avcpp/functions_func_b.html Gets the bit rate tolerance for the VideoCodecContext. ```APIDOC ## bitRateTolerance() ### Description Gets the bit rate tolerance for the VideoCodecContext. ### Signature av::VideoCodecContext< Clazz, _direction >::bitRateTolerance() ``` -------------------------------- ### av::SampleFormat::SampleFormat Source: https://h4tr3d.github.io/avcpp/classav_1_1SampleFormat-members.html Constructs a SampleFormat object. ```APIDOC ## SampleFormat ### Description Constructs a SampleFormat object. ### Method `explicit` ### Parameters #### Path Parameters - **name** (const char *) - The name of the sample format. ### Signature `SampleFormat(const char *name) noexcept` ``` ```APIDOC ## SampleFormat ### Description Constructs a SampleFormat object. ### Method `explicit` ### Parameters #### Path Parameters - **name** (const std::string &) - The name of the sample format. ### Signature `SampleFormat(const std::string &name) noexcept` ``` -------------------------------- ### SampleFormat Constructors Source: https://h4tr3d.github.io/avcpp/classav_1_1SampleFormat.html Constructs a SampleFormat object from a name, either as a C-style string or a C++ std::string. ```APIDOC ## ◆ SampleFormat() [2/3] | av::SampleFormat::SampleFormat | ( | const char * | _name_| ) | |---|---|---|---|---| | explicit noexcept ``` ```APIDOC ## ◆ SampleFormat() [3/3] | av::SampleFormat::SampleFormat | ( | const std::string & | _name_| ) | |---|---|---|---|---| | explicit noexcept ``` -------------------------------- ### frameSize() Source: https://h4tr3d.github.io/avcpp/functions_f.html Gets the frame size from a CodecContext2 object. ```APIDOC ## frameSize() ### Description Gets the size of the frames processed by the `CodecContext2` object. ### Class `av::CodecContext2` ``` -------------------------------- ### av::AudioEncoderContext::AudioEncoderContext() Source: https://h4tr3d.github.io/avcpp/classav_1_1AudioEncoderContext.html Default constructor for av::AudioEncoderContext. ```APIDOC ## AudioEncoderContext() ### Description Default constructor for the `AudioEncoderContext` class. ### Method `AudioEncoderContext()` ### Parameters None ``` -------------------------------- ### frameNumber() Source: https://h4tr3d.github.io/avcpp/functions_f.html Gets the frame number from a CodecContext2 object. ```APIDOC ## frameNumber() ### Description Gets the current frame number from the `CodecContext2` object. ### Class `av::CodecContext2` ``` -------------------------------- ### av::VideoFrame::VideoFrame() Source: https://h4tr3d.github.io/avcpp/functions_v.html Constructor for VideoFrame. ```APIDOC ## av::VideoFrame::VideoFrame() ### Description Initializes a new instance of the `VideoFrame` class. This constructor is used to create objects representing video frames. ### Method N/A (This is a C++ constructor) ### Endpoint N/A ### Parameters None (Default constructor) ### Request Example ```cpp av::VideoFrame frame; ``` ### Response #### Success Response Creates and initializes a `VideoFrame` object. #### Response Example ```cpp // A VideoFrame object is created. ``` ``` -------------------------------- ### width Source: https://h4tr3d.github.io/avcpp/classav_1_1VideoCodecContext.html Gets the width of the video codec context. ```APIDOC ## width() ### Description Gets the width of the video codec context. ### Signature ```cpp template int av::VideoCodecContext< Clazz, _direction >::width() const ``` ### Returns * (int) - The current width of the video codec context. ``` -------------------------------- ### Configure Meson Build Options Source: https://h4tr3d.github.io/avcpp/index.html Modify Meson build options to disable tests or samples, or to set a custom installation prefix. Use 'meson configure' to view all available options. ```bash meson configure -Dbuild_tests=false meson configure -Dbuild_samples=false ``` ```bash meson --prefix ``` -------------------------------- ### VideoFrame::width Source: https://h4tr3d.github.io/avcpp/classav_1_1VideoFrame.html Gets the width of the video frame. ```APIDOC ## VideoFrame::width ### Description Gets the width of the video frame. ### Signature `int av::VideoFrame::width () const` ``` -------------------------------- ### VideoFrame::quality Source: https://h4tr3d.github.io/avcpp/classav_1_1VideoFrame.html Gets the quality of the video frame. ```APIDOC ## VideoFrame::quality ### Description Gets the quality of the video frame. ### Signature `int av::VideoFrame::quality () const` ``` -------------------------------- ### CodecContextBase (CodecContextBase &&other) Source: https://h4tr3d.github.io/avcpp/classav_1_1VideoDecoderContext.html Move constructor for CodecContextBase. ```APIDOC ## CodecContextBase (Move Constructor) ### Description Move constructor for `CodecContextBase`. Transfers ownership of resources from another `CodecContextBase` instance. ### Method Signature `CodecContextBase(CodecContextBase &&other)` ### Parameters - `other` (CodecContextBase &&): The rvalue reference to the `CodecContextBase` object to move from. ``` -------------------------------- ### Run Tests with Meson Source: https://h4tr3d.github.io/avcpp/index.html Execute the project's tests using the 'meson test' command. This command will do nothing if tests were disabled during configuration. ```bash meson test ``` -------------------------------- ### VideoFrame::height Source: https://h4tr3d.github.io/avcpp/classav_1_1VideoFrame.html Gets the height of the video frame. ```APIDOC ## VideoFrame::height ### Description Gets the height of the video frame. ### Signature `int av::VideoFrame::height () const` ```