|
|
| AudioSamples ()=default |
| | Create an invalid buffer.
|
| | AudioSamples (SampleFormat sampleFormat, int samplesCount, uint64_t channelLayout, int sampleRate, int align=SampleFormat::AlignDefault) |
| | Allocate an empty buffer with the given layout.
|
| | AudioSamples (const uint8_t *data, size_t size, SampleFormat sampleFormat, int samplesCount, uint64_t channelLayout, int sampleRate, int align=SampleFormat::AlignDefault) |
| | Copy external sample data into a buffer.
|
| | AudioSamples (const AudioSamples &other) |
| | Copy constructor: references the same sample buffer.
|
| | AudioSamples (AudioSamples &&other) |
| | Move constructor.
|
| AudioSamples & | operator= (const AudioSamples &rhs) |
| | Copy assignment: references the buffer of the other samples.
|
| AudioSamples & | operator= (AudioSamples &&rhs) |
| | Move assignment.
|
| int | init (SampleFormat sampleFormat, int samplesCount, uint64_t channelLayout, int sampleRate, int align=SampleFormat::AlignDefault) |
| | Allocate the buffer storage.
|
| SampleFormat | sampleFormat () const |
| | Sample format of the buffer.
|
| int | samplesCount () const |
| | Number of samples per channel.
|
| int | channelsCount () const |
| | Number of audio channels.
|
| uint64_t | channelsLayout () const |
| | Channel layout as a bit mask.
|
| int | sampleRate () const |
| | Sample rate of the buffer.
|
| size_t | sampleBitDepth (OptionalErrorCode ec=throws()) const |
| | Number of bits per sample.
|
| bool | isPlanar () const |
| | Whether the channels are stored in separate planes.
|
| std::string | channelsLayoutString () const |
| | Human-readable name of the channel layout.
|
|
| FrameCommon () |
| | Create an invalid frame.
|
| | FrameCommon (const AVFrame *frame) |
| | Copy the frame metadata into a new wrapper.
|
| | FrameCommon (const FrameCommon &other) |
| | Copy constructor: references the same buffer.
|
| | FrameCommon (FrameCommon &&other) |
| | Move constructor.
|
| AudioSamples | clone (size_t align=1) const |
| | Deep copy of the frame.
|
|
| FrameCommon () |
| | Create an invalid frame.
|
| | FrameCommon (const AVFrame *frame) |
| | Copy the frame metadata into a new wrapper.
|
| | FrameCommon (const FrameCommon &other) |
| | Copy constructor: references the same buffer.
|
| | FrameCommon (FrameCommon &&other) |
| | Move constructor.
|
| bool | isReferenced () const |
| | Whether the frame data is reference counted.
|
| int | refCount () const |
| | Number of references to the frame buffer.
|
| AVFrame * | makeRef () const |
| | Create an independent reference to the frame.
|
| Timestamp | pts () const |
| | Presentation timestamp.
|
| attribute_deprecated void | setPts (int64_t pts, Rational ptsTimeBase) |
| | Set the timestamp and its time base at once.
|
| void | setPts (const Timestamp &ts) |
| | Set the timestamp.
|
| const Rational & | timeBase () const |
| | Time base of the frame.
|
| void | setTimeBase (const Rational &value) |
| | Set the time base.
|
| int | streamIndex () const |
| | Index of the stream the frame belongs to.
|
| void | setStreamIndex (int streamIndex) |
| | Set the stream index.
|
| void | setComplete (bool isComplete) |
| | Mark the frame as complete or incomplete.
|
| bool | isComplete () const |
| | Whether the frame is marked complete.
|
| bool | isValid () const |
| | Whether the wrapper holds a frame.
|
| | operator bool () const |
| | Whether the wrapper holds a frame.
|
| bool | isHwFrame () const |
| | Whether the frame lives in device memory.
|
| uint8_t * | data (size_t plane=0) |
| | Pointer to one image or audio plane.
|
| const uint8_t * | data (size_t plane=0) const |
| | Pointer to one plane, read-only.
|
| size_t | size (size_t plane) const |
| | Size of one plane.
|
| size_t | size () const |
| | Total size of all planes.
|
|
void | dump () const |
| | Print the frame layout through the FFmpeg log system.
|
|
void | operator= (const FrameCommon &)=delete |
| | Assignment is deleted: derived classes implement it to avoid slicing.
|
| void | swap (FrameCommon &other) |
| | Exchange the contents of two frames.
|
| const FrameSideData | sideData (AVFrameSideDataType type) const |
| | Get packet side data of the given type.
|
| FrameSideData | sideData (AVFrameSideDataType type) |
| | Mutable access to the side data of the given type.
|
| std::size_t | sideDataCount () const noexcept |
| | Return count of the side data elements.
|
| FrameSideData | sideDataIndex (std::size_t index) noexcept |
| | Get side data element by index.
|
| ArrayView< AVFrameSideData *, FrameSideData, std::size_t > | sideData () noexcept |
| | Observe all packet side data via iterators.
|
| ArrayView< const AVFrameSideData *, FrameSideData, std::size_t > | sideData () const noexcept |
| | Read-only iteration over all side data entries.
|
| void | sideDataRemove (AVFrameSideDataType type) noexcept |
| | Remove and free all side data instances of the given type.
|
| FrameSideData | addSideData (AVFrameSideDataType type, std::span< const uint8_t > data, OptionalErrorCode ec=throws()) |
| | Add side data of the given type into packet.
|
| FrameSideData | addSideData (AVFrameSideDataType type, std::span< uint8_t > data, wrap_data, OptionalErrorCode ec=throws()) |
| | Add side data of the given type into packet.
|
| FrameSideData | addSideData (AVFrameSideDataType type, std::span< uint8_t > data, wrap_data_static, OptionalErrorCode ec=throws()) |
| | Add side data of the given type into packet.
|
| FrameSideData | addSideData (AVFrameSideDataType type, BufferRef buf, OptionalErrorCode ec=throws()) |
| | Add side data of the given type into packet.
|
| FrameSideData | allocateSideData (AVFrameSideDataType type, std::size_t size, OptionalErrorCode ec=throws()) |
| | Allocate storage for the packet side data of the given type and return reference to it.
|
|
| FFWrapperPtr ()=default |
| | Create an empty wrapper; isNull() is true.
|
| const AVFrame * | raw () const |
| | Read access to the wrapped object.
|
| void | reset (AVFrame *raw=nullptr) |
| | Replace the stored pointer.
|
| bool | isNull () const |
| | Whether the wrapper is empty.
|
| void | _log (int level, const char *fmt) const |
| | Log through the FFmpeg log system, using this wrapper as the context.
|
The samples follow the layout of their format: planar formats keep one plane per channel, packed formats interleave the channels in the first plane. isPlanar() reports which one this buffer uses.
- Examples
- api2-decode-audio.cpp, api2-decode-encode-audio.cpp, and api2-decode-rasample-audio.cpp.