FFmpegfs Fuse Multi Media Filesystem 2.19
Loading...
Searching...
No Matches
ffmpeg_swrcontext.h
Go to the documentation of this file.
1/*
2 * This file is part of FFmpegfs.
3 *
4 * FFmpegfs is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 */
9
17#ifndef FFMPEG_SWRCONTEXT_H
18#define FFMPEG_SWRCONTEXT_H
19
20struct SwrContext;
21
29{
30public:
35
40 explicit FFmpeg_SwrContext(SwrContext *ctx);
41
46
47 FFmpeg_SwrContext(const FFmpeg_SwrContext&) = delete;
48 FFmpeg_SwrContext& operator=(const FFmpeg_SwrContext&) = delete;
49
55
61 FFmpeg_SwrContext& operator=(FFmpeg_SwrContext&& ctx) noexcept;
62
67 SwrContext *get() const;
68
77 SwrContext **address();
78
83 SwrContext *release();
84
90 bool reset(SwrContext *ctx = nullptr);
91
96 bool empty() const;
97
101 explicit operator bool() const;
102
106 operator SwrContext *() const;
107
112 SwrContext *operator->() const;
113
114private:
115 SwrContext *m_ctx;
116};
117
118#endif // FFMPEG_SWRCONTEXT_H
RAII wrapper for SwrContext.
FFmpeg_SwrContext()
Construct an empty resampler-context wrapper.
~FFmpeg_SwrContext()
Release the owned resampler context, if any.
bool empty() const
Check whether the wrapper currently owns a resampler context.
bool reset(SwrContext *ctx=nullptr)
Replace the owned context.
SwrContext * m_ctx
Pointer to underlying SwrContext.
SwrContext * release()
Release ownership without freeing the resampler context.
SwrContext ** address()
Get a writable pointer-to-pointer for FFmpeg allocation APIs.
SwrContext * get() const
Get the owned FFmpeg resampler context pointer.
SwrContext * operator->() const
Access members of the underlying resampler context.