|
FFmpegfs Fuse Multi Media Filesystem 2.19
|
RAII wrapper for SwsContext. More...
#include <ffmpeg_swscontext.h>
Public Member Functions | |
| FFmpeg_SwsContext () | |
| Construct an empty scaler-context wrapper. | |
| FFmpeg_SwsContext (SwsContext *ctx) | |
| Construct a wrapper taking ownership of an existing context. | |
| ~FFmpeg_SwsContext () | |
| Release the owned scaler context, if any. | |
| FFmpeg_SwsContext (const FFmpeg_SwsContext &)=delete | |
| FFmpeg_SwsContext & | operator= (const FFmpeg_SwsContext &)=delete |
| FFmpeg_SwsContext (FFmpeg_SwsContext &&ctx) noexcept | |
| Move-construct a scaler-context wrapper. | |
| FFmpeg_SwsContext & | operator= (FFmpeg_SwsContext &&ctx) noexcept |
| Move-assign a scaler-context wrapper. | |
| SwsContext * | get () const |
| Get the owned FFmpeg scaler context pointer. | |
| SwsContext * | release () |
| Release ownership without freeing the scaler context. | |
| bool | reset (SwsContext *ctx=nullptr) |
| Replace the owned context. | |
| bool | empty () const |
| Check whether the wrapper currently owns a scaler context. | |
| operator bool () const | |
| Check whether the wrapper owns a valid context. | |
| operator SwsContext * () const | |
| Convert to the underlying scaler context pointer. | |
| SwsContext * | operator-> () const |
| Access members of the underlying scaler context. | |
Private Attributes | |
| SwsContext * | m_ctx |
| Pointer to underlying SwsContext. | |
RAII wrapper for SwsContext.
Owns a libswscale context and releases it with sws_freeContext(). The wrapper is movable but not copyable.
Definition at line 28 of file ffmpeg_swscontext.h.
| FFmpeg_SwsContext::FFmpeg_SwsContext | ( | ) |
Construct an empty scaler-context wrapper.
Definition at line 16 of file ffmpeg_swscontext.cc.
|
explicit |
Construct a wrapper taking ownership of an existing context.
| [in] | ctx | Context pointer to take ownership of, or nullptr. |
Definition at line 21 of file ffmpeg_swscontext.cc.
| FFmpeg_SwsContext::~FFmpeg_SwsContext | ( | ) |
Release the owned scaler context, if any.
Definition at line 26 of file ffmpeg_swscontext.cc.
References reset().
|
noexcept |
Move-construct a scaler-context wrapper.
| [in,out] | ctx | Source wrapper whose context ownership is transferred. |
Definition at line 31 of file ffmpeg_swscontext.cc.
| bool FFmpeg_SwsContext::empty | ( | ) | const |
Check whether the wrapper currently owns a scaler context.
Definition at line 72 of file ffmpeg_swscontext.cc.
References m_ctx.
| SwsContext * FFmpeg_SwsContext::get | ( | ) | const |
Get the owned FFmpeg scaler context pointer.
Definition at line 45 of file ffmpeg_swscontext.cc.
References m_ctx.
|
explicit |
Check whether the wrapper owns a valid context.
Definition at line 77 of file ffmpeg_swscontext.cc.
| FFmpeg_SwsContext::operator SwsContext * | ( | ) | const |
Convert to the underlying scaler context pointer.
Definition at line 82 of file ffmpeg_swscontext.cc.
| SwsContext * FFmpeg_SwsContext::operator-> | ( | ) | const |
Access members of the underlying scaler context.
Definition at line 87 of file ffmpeg_swscontext.cc.
References m_ctx.
|
noexcept |
Move-assign a scaler-context wrapper.
| [in,out] | ctx | Source wrapper whose context ownership is transferred. |
Definition at line 36 of file ffmpeg_swscontext.cc.
| SwsContext * FFmpeg_SwsContext::release | ( | ) |
Release ownership without freeing the scaler context.
Definition at line 50 of file ffmpeg_swscontext.cc.
References m_ctx.
| bool FFmpeg_SwsContext::reset | ( | SwsContext * | ctx = nullptr | ) |
Replace the owned context.
| [in] | ctx | New context pointer to own, or nullptr to only reset. |
Definition at line 57 of file ffmpeg_swscontext.cc.
References m_ctx.
Referenced by FFmpeg_Transcoder::close_output_file(), FFmpeg_Transcoder::init_rescaler(), and ~FFmpeg_SwsContext().
|
private |
Pointer to underlying SwsContext.
Definition at line 105 of file ffmpeg_swscontext.h.
Referenced by empty(), get(), operator->(), release(), and reset().