RAII owner of a libav AVPacket.
More...
#include <StormByte/multimedia/ffmpeg/AVPacket.hxx>
|
| | AVPacket () noexcept |
| | Allocates an empty packet.
|
| | AVPacket (const AVPacket &other) noexcept |
| | Copy.
|
| | AVPacket (AVPacket &&other) noexcept=default |
| | Move constructor.
|
| | ~AVPacket () noexcept override |
| | Destructor.
|
| AVPacket & | operator= (const AVPacket &other) noexcept |
| | Copy assignment.
|
| AVPacket & | operator= (AVPacket &&other) noexcept=default |
| | Move assignment.
|
| FFmpeg::AVPacket | Ref () const noexcept |
| | New packet referencing the same data (av_packet_ref).
|
| void | Unref () noexcept |
| | Unreferences packet data (av_packet_unref).
|
| bool | Load (const std::uint8_t *data, int size, int stream_index, bool key_frame) noexcept |
| | Replaces payload for avcodec_send_packet.
|
| void | Timestamps (std::int64_t pts, std::int64_t dts, std::int64_t duration) noexcept |
| | Sets timestamps in stream time base.
|
| int | StreamIndex () const noexcept |
| | Packet stream index.
|
| std::int64_t | Pts () const noexcept |
| | Presentation timestamp in stream time base.
|
| std::int64_t | Dts () const noexcept |
| | Decode timestamp in stream time base.
|
| std::int64_t | Duration () const noexcept |
| | Packet duration in stream time base.
|
| int | Flags () const noexcept |
| | Packet flags (AV_PKT_FLAG_*).
|
| const std::uint8_t * | Data () const noexcept |
| | Compressed payload pointer.
|
| int | Size () const noexcept |
| | Compressed payload size in bytes.
|
| | operator bool () const noexcept |
| | Whether a packet struct is owned.
|
| int | SideDataCount () const noexcept |
| | Number of side-data entries.
|
| int | SideDataType (int index) const noexcept |
| | Side-data type at index.
|
| const std::uint8_t * | SideData (int index, int &size) const noexcept |
| | Side-data payload at index.
|
| void | Reset (::AVPacket *raw) noexcept |
| | Adopts raw.
|
| constexpr | AVPointer () noexcept=delete |
| | Default constructor (deleted).
|
| virtual | ~AVPointer () noexcept=default |
| | Destructor.
|
| constexpr AVPointer & | operator= (const AVPointer &) noexcept=delete |
| | Copy assignment (deleted).
|
RAII owner of a libav AVPacket.
Copy and Ref share compressed buffers (av_packet_ref). They are not a deep copy of payload. Each wrapper still owns its own AVPacket struct. Get() and Detach() are not public.
◆ AVPacket() [1/3]
| StormByte::Multimedia::FFmpeg::AVPacket::AVPacket |
( |
| ) |
|
|
noexcept |
Allocates an empty packet.
◆ AVPacket() [2/3]
| StormByte::Multimedia::FFmpeg::AVPacket::AVPacket |
( |
const AVPacket & | other | ) |
|
|
noexcept |
Copy.
New struct; payload buffers are referenced (av_packet_ref).
- Parameters
-
Not a deep copy of compressed bytes.
◆ AVPacket() [3/3]
| StormByte::Multimedia::FFmpeg::AVPacket::AVPacket |
( |
AVPacket && | other | ) |
|
|
defaultnoexcept |
Move constructor.
Transfers the libav pointer.
- Parameters
-
| other | Source packet; left empty. |
◆ ~AVPacket()
| StormByte::Multimedia::FFmpeg::AVPacket::~AVPacket |
( |
| ) |
|
|
overridenoexcept |
Destructor.
Unreferences buffers and frees the struct.
◆ Data()
| const std::uint8_t * StormByte::Multimedia::FFmpeg::AVPacket::Data |
( |
| ) |
const |
|
noexcept |
Compressed payload pointer.
- Returns
- data, or nullptr if empty.
◆ Dts()
| std::int64_t StormByte::Multimedia::FFmpeg::AVPacket::Dts |
( |
| ) |
const |
|
noexcept |
Decode timestamp in stream time base.
- Returns
- DTS, or AV_NOPTS_VALUE.
◆ Duration()
| std::int64_t StormByte::Multimedia::FFmpeg::AVPacket::Duration |
( |
| ) |
const |
|
noexcept |
Packet duration in stream time base.
- Returns
- Duration ticks, or 0.
◆ Flags()
| int StormByte::Multimedia::FFmpeg::AVPacket::Flags |
( |
| ) |
const |
|
noexcept |
Packet flags (AV_PKT_FLAG_*).
- Returns
- Flags, or 0 if empty.
◆ Load()
| bool StormByte::Multimedia::FFmpeg::AVPacket::Load |
( |
const std::uint8_t * | data, |
|
|
int | size, |
|
|
int | stream_index, |
|
|
bool | key_frame ) |
|
noexcept |
Replaces payload for avcodec_send_packet.
- Parameters
-
| data | Compressed bytes. |
| size | Byte count. |
| stream_index | Stream index. |
| key_frame | Sets AV_PKT_FLAG_KEY when true. |
- Returns
- false if allocation failed.
◆ operator bool()
| StormByte::Multimedia::FFmpeg::AVPacket::operator bool |
( |
| ) |
const |
|
explicitnoexcept |
Whether a packet struct is owned.
- Returns
- true if the wrapper holds a packet.
◆ operator=() [1/2]
| AVPacket & StormByte::Multimedia::FFmpeg::AVPacket::operator= |
( |
AVPacket && | other | ) |
|
|
defaultnoexcept |
Move assignment.
Frees *this, then takes other.
- Parameters
-
| other | Source packet; left empty. |
- Returns
- *this.
◆ operator=() [2/2]
| AVPacket & StormByte::Multimedia::FFmpeg::AVPacket::operator= |
( |
const AVPacket & | other | ) |
|
|
noexcept |
Copy assignment.
Same as the copy constructor.
- Parameters
-
- Returns
- *this.
◆ Pts()
| std::int64_t StormByte::Multimedia::FFmpeg::AVPacket::Pts |
( |
| ) |
const |
|
noexcept |
Presentation timestamp in stream time base.
- Returns
- PTS, or AV_NOPTS_VALUE.
◆ Ref()
New packet referencing the same data (av_packet_ref).
- Returns
- Referenced packet.
Same as the copy constructor.
◆ Reset()
| void StormByte::Multimedia::FFmpeg::AVPacket::Reset |
( |
::AVPacket * | raw | ) |
|
|
noexcept |
Adopts raw.
Previous packet is freed.
- Parameters
-
| raw | libav packet, or nullptr. |
◆ SideData()
| const std::uint8_t * StormByte::Multimedia::FFmpeg::AVPacket::SideData |
( |
int | index, |
|
|
int & | size ) const |
|
noexcept |
Side-data payload at index.
- Parameters
-
| index | Entry index. |
| size | Set to payload size on success. |
- Returns
- Pointer, or nullptr.
◆ SideDataCount()
| int StormByte::Multimedia::FFmpeg::AVPacket::SideDataCount |
( |
| ) |
const |
|
noexcept |
Number of side-data entries.
- Returns
- Count, or 0.
◆ SideDataType()
| int StormByte::Multimedia::FFmpeg::AVPacket::SideDataType |
( |
int | index | ) |
const |
|
noexcept |
Side-data type at index.
- Parameters
-
- Returns
- AVPacketSideDataType as int, or -1.
◆ Size()
| int StormByte::Multimedia::FFmpeg::AVPacket::Size |
( |
| ) |
const |
|
noexcept |
Compressed payload size in bytes.
- Returns
- size, or 0 if empty.
◆ StreamIndex()
| int StormByte::Multimedia::FFmpeg::AVPacket::StreamIndex |
( |
| ) |
const |
|
noexcept |
Packet stream index.
- Returns
- stream_index, or -1 if empty.
◆ Timestamps()
| void StormByte::Multimedia::FFmpeg::AVPacket::Timestamps |
( |
std::int64_t | pts, |
|
|
std::int64_t | dts, |
|
|
std::int64_t | duration ) |
|
noexcept |
Sets timestamps in stream time base.
- Parameters
-
| pts | Presentation timestamp, or AV_NOPTS_VALUE. |
| dts | Decode timestamp, or AV_NOPTS_VALUE. |
| duration | Duration ticks, or 0. |
◆ Unref()
| void StormByte::Multimedia::FFmpeg::AVPacket::Unref |
( |
| ) |
|
|
noexcept |
Unreferences packet data (av_packet_unref).
◆ AVBSF
◆ AVDecoder
◆ AVEncoder
◆ AVFormatContext
| friend class AVFormatContext |
|
friend |
◆ StormByte::Multimedia::Backend::Pipeline::Packet
| friend class StormByte::Multimedia::Backend::Pipeline::Packet |
|
friend |
◆ StormByte::Multimedia::Pipeline::Filter::FFmpeg
The documentation for this class was generated from the following file: