avcpp 3.1.0
Wrapper for the FFmpeg that simplify usage from C++ projects.
Loading...
Searching...
No Matches
codec.h
Go to the documentation of this file.
1#pragma once
2
9
10#include <list>
11#include <deque>
12#include <memory>
13
14#include "ffmpeg.h"
15#include "rational.h"
16#include "format.h"
17#include "pixelformat.h"
18#include "sampleformat.h"
19#include "channellayout.h"
20#include "avutils.h"
21
22namespace av {
23
31class Codec : public FFWrapperPtr<const AVCodec>
32{
33public:
34 using FFWrapperPtr<const AVCodec>::FFWrapperPtr;
35
41 const char *name() const;
47 const char *longName() const;
53 bool canEncode() const;
59 bool canDecode() const;
66 bool isEncoder() const;
72 bool isDecoder() const;
78 AVMediaType type() const;
79
85 std::deque<Rational> supportedFramerates() const;
91 std::deque<PixelFormat> supportedPixelFormats() const;
97 std::deque<int> supportedSamplerates() const;
103 std::deque<SampleFormat> supportedSampleFormats() const;
109 std::deque<uint64_t> supportedChannelLayouts() const;
110
111#if AVCPP_API_NEW_CHANNEL_LAYOUT
119 std::deque<ChannelLayoutView> supportedChannelLayouts2() const;
120#endif
121
127 AVCodecID id() const;
128};
129
130
131
147Codec findEncodingCodec(const std::string& name);
148
164Codec findDecodingCodec(const std::string& name);
165
166#if AVCPP_HAS_AVFORMAT
175Codec findEncodingCodec(const OutputFormat &format, bool isVideo = true);
187Codec guessEncodingCodec(OutputFormat format, const char *name, const char *url, const char* mime, AVMediaType mediaType);
188#endif // if AVCPP_HAS_AVFORMAT
189
190} // ::fmpeg
Common helpers: comparisons, value lookup, non-copyable base, string utilities.
Audio channel layouts.
Codec descriptor.
Definition codec.h:32
AVCodecID id() const
Identifier of the codec.
const char * name() const
Short name of the codec, as FFmpeg knows it.
std::deque< Rational > supportedFramerates() const
Frame rates the encoder supports.
std::deque< uint64_t > supportedChannelLayouts() const
Channel layouts the codec supports, as masks.
bool isDecoder() const
Whether this descriptor is a decoder.
bool canEncode() const
Whether the codec can be used for encoding.
bool isEncoder() const
Whether this descriptor is an encoder.
std::deque< PixelFormat > supportedPixelFormats() const
Pixel formats the codec supports.
const char * longName() const
Human-readable name of the codec.
std::deque< SampleFormat > supportedSampleFormats() const
Sample formats the codec supports.
AVMediaType type() const
Media type the codec handles.
std::deque< int > supportedSamplerates() const
Sample rates the codec supports.
std::deque< ChannelLayoutView > supportedChannelLayouts2() const
Channel layouts the codec supports, as structured views.
bool canDecode() const
Whether the codec can be used for decoding.
Muxer descriptor.
Definition format.h:202
FFmpeg types re-exported for the public API and small value wrappers.
Input and output format descriptors.
Root namespace of the library.
Definition audioresampler.h:19
Codec findEncodingCodec(AVCodecID id)
Find an encoder by codec identifier.
Codec findDecodingCodec(AVCodecID id)
Find a decoder by codec identifier.
Codec guessEncodingCodec(OutputFormat format, const char *name, const char *url, const char *mime, AVMediaType mediaType)
Guess the encoder for an output from its hints.
Pixel formats.
Rational numbers, time bases and arithmetic on them.
Audio sample formats.