|
FFmpegfs Fuse Multi Media Filesystem 2.19
|
RAII wrapper for AVPacket. More...
#include <ffmpeg_packet.h>
Public Member Functions | |
| FFmpeg_Packet (int stream_index=INVALID_STREAM) | |
| Allocate an empty packet. | |
| FFmpeg_Packet (const AVPacket *packet) | |
| Clone an existing packet. | |
| FFmpeg_Packet (const FFmpeg_Packet &packet) | |
| Deep-copy construct from another wrapper. | |
| FFmpeg_Packet (FFmpeg_Packet &&packet) noexcept | |
| Move construct from another wrapper. | |
| virtual | ~FFmpeg_Packet () |
| Free the underlying packet. | |
| FFmpeg_Packet & | operator= (const FFmpeg_Packet &packet) noexcept |
| Deep-copy assign from another wrapper. | |
| FFmpeg_Packet & | operator= (FFmpeg_Packet &&packet) noexcept |
| Move assign from another wrapper. | |
| FFmpeg_Packet & | operator= (const AVPacket *packet) noexcept |
| Deep-copy assign from an AVPacket. | |
| int | res () const |
| Get result of last operation. | |
| AVPacket * | clone () const |
| Clone packet to a new AVPacket*. Caller owns the returned packet. | |
| void | unref () |
| Unreference packet payload, keep the AVPacket object allocated. | |
| void | free () |
| Free the underlying packet. | |
| AVPacket * | get () |
| Access the underlying packet. | |
| const AVPacket * | get () const |
| Access the underlying packet. | |
| operator AVPacket * () | |
| operator AVPacket*: behave like a packet pointer for FFmpeg APIs. | |
| operator const AVPacket * () const | |
| operator const AVPacket*: behave like a const packet pointer for FFmpeg APIs. | |
| AVPacket * | operator-> () |
| operator ->: behave like a packet pointer. | |
| const AVPacket * | operator-> () const |
| operator ->: behave like a const packet pointer. | |
Protected Attributes | |
| AVPacket * | m_packet |
| Pointer to underlying AVPacket struct. | |
| int | m_res |
| 0 if last operation was successful, or negative AVERROR value | |
RAII wrapper for AVPacket.
AVPacket must not be stack allocated anymore. Newer FFmpeg versions deprecated av_init_packet() and explicitly warn that sizeof(AVPacket) is no longer meant to be part of the public ABI. This wrapper always uses av_packet_alloc() and releases the packet with av_packet_free().
Definition at line 32 of file ffmpeg_packet.h.
|
explicit |
Allocate an empty packet.
Definition at line 31 of file ffmpeg_packet.cc.
| FFmpeg_Packet::FFmpeg_Packet | ( | const AVPacket * | packet | ) |
Clone an existing packet.
Definition at line 43 of file ffmpeg_packet.cc.
| FFmpeg_Packet::FFmpeg_Packet | ( | const FFmpeg_Packet & | packet | ) |
Deep-copy construct from another wrapper.
Definition at line 58 of file ffmpeg_packet.cc.
|
noexcept |
Move construct from another wrapper.
Definition at line 73 of file ffmpeg_packet.cc.
|
virtual |
| AVPacket * FFmpeg_Packet::clone | ( | ) | const |
Clone packet to a new AVPacket*. Caller owns the returned packet.
Definition at line 151 of file ffmpeg_packet.cc.
References m_packet.
| void FFmpeg_Packet::free | ( | ) |
Free the underlying packet.
Definition at line 164 of file ffmpeg_packet.cc.
References m_packet.
Referenced by ~FFmpeg_Packet().
| AVPacket * FFmpeg_Packet::get | ( | ) |
| const AVPacket * FFmpeg_Packet::get | ( | ) | const |
| FFmpeg_Packet::operator AVPacket * | ( | ) |
operator AVPacket*: behave like a packet pointer for FFmpeg APIs.
Definition at line 183 of file ffmpeg_packet.cc.
| FFmpeg_Packet::operator const AVPacket * | ( | ) | const |
operator const AVPacket*: behave like a const packet pointer for FFmpeg APIs.
Definition at line 188 of file ffmpeg_packet.cc.
| AVPacket * FFmpeg_Packet::operator-> | ( | ) |
operator ->: behave like a packet pointer.
Definition at line 193 of file ffmpeg_packet.cc.
References m_packet.
| const AVPacket * FFmpeg_Packet::operator-> | ( | ) | const |
operator ->: behave like a const packet pointer.
Definition at line 198 of file ffmpeg_packet.cc.
References m_packet.
|
noexcept |
Deep-copy assign from an AVPacket.
Definition at line 124 of file ffmpeg_packet.cc.
|
noexcept |
Deep-copy assign from another wrapper.
Definition at line 86 of file ffmpeg_packet.cc.
|
noexcept |
Move assign from another wrapper.
Definition at line 108 of file ffmpeg_packet.cc.
| int FFmpeg_Packet::res | ( | ) | const |
Get result of last operation.
Definition at line 146 of file ffmpeg_packet.cc.
References m_res.
Referenced by FFmpeg_Transcoder::add_albumart_frame(), FFmpeg_Transcoder::add_external_subtitle_stream(), FFmpeg_Transcoder::encode_audio_frame(), FFmpeg_Transcoder::encode_image_frame(), FFmpeg_Transcoder::encode_subtitle(), FFmpeg_Transcoder::encode_video_frame(), FFmpeg_Transcoder::flush_frames_single(), FFmpeg_Transcoder::read_decode_convert_and_store(), and FFmpeg_Transcoder::store_packet().
| void FFmpeg_Packet::unref | ( | ) |
Unreference packet payload, keep the AVPacket object allocated.
Definition at line 156 of file ffmpeg_packet.cc.
References m_packet.
Referenced by FFmpeg_Transcoder::encode_audio_frame(), FFmpeg_Transcoder::encode_image_frame(), FFmpeg_Transcoder::encode_subtitle(), and FFmpeg_Transcoder::encode_video_frame().
|
protected |
Pointer to underlying AVPacket struct.
Definition at line 113 of file ffmpeg_packet.h.
Referenced by clone(), FFmpeg_Packet(), FFmpeg_Packet(), FFmpeg_Packet(), free(), get(), get(), operator->(), operator->(), and unref().
|
protected |
0 if last operation was successful, or negative AVERROR value
Definition at line 114 of file ffmpeg_packet.h.
Referenced by FFmpeg_Packet(), FFmpeg_Packet(), FFmpeg_Packet(), and res().