avcpp  2.0
Wrapper for the FFmpeg that simplify usage from C++ projects.
codec.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <list>
4 #include <deque>
5 #include <memory>
6 
7 #include "ffmpeg.h"
8 #include "rational.h"
9 #include "format.h"
10 #include "pixelformat.h"
11 #include "sampleformat.h"
12 #include "channellayout.h"
13 #include "avutils.h"
14 
15 namespace av {
16 
17 class Codec : public FFWrapperPtr<const AVCodec>
18 {
19 public:
21 
22  const char *name() const;
23  const char *longName() const;
24  bool canEncode() const;
25  bool canDecode() const;
26  bool isEncoder() const;
27  bool isDecoder() const;
28  AVMediaType type() const;
29 
30  std::deque<Rational> supportedFramerates() const;
31  std::deque<PixelFormat> supportedPixelFormats() const;
32  std::deque<int> supportedSamplerates() const;
33  std::deque<SampleFormat> supportedSampleFormats() const;
34  std::deque<uint64_t> supportedChannelLayouts() const;
35 
36 #if API_NEW_CHANNEL_LAYOUT
37  std::deque<ChannelLayoutView> supportedChannelLayouts2() const;
38 #endif
39 
40  AVCodecID id() const;
41 };
42 
43 
44 Codec findEncodingCodec(const OutputFormat &format, bool isVideo = true);
45 Codec findEncodingCodec(AVCodecID id);
46 Codec findEncodingCodec(const std::string& name);
47 
48 Codec findDecodingCodec(AVCodecID id);
49 Codec findDecodingCodec(const std::string& name);
50 
51 Codec guessEncodingCodec(OutputFormat format, const char *name, const char *url, const char* mime, AVMediaType mediaType);
52 
53 } // ::fmpeg
av::Codec::supportedPixelFormats
std::deque< PixelFormat > supportedPixelFormats() const
Definition: codec.cpp:76
rational.h
av::OutputFormat
Definition: format.h:86
av::Codec::type
AVMediaType type() const
Definition: codec.cpp:60
av::Codec::supportedFramerates
std::deque< Rational > supportedFramerates() const
Definition: codec.cpp:65
ffmpeg.h
pixelformat.h
FFWrapperPtr
Definition: ffmpeg.h:68
format.h
av::Codec::isDecoder
bool isDecoder() const
Definition: codec.cpp:55
av::guessEncodingCodec
Codec guessEncodingCodec(OutputFormat format, const char *name, const char *url, const char *mime, AVMediaType mediaType)
Definition: codec.cpp:177
avutils.h
av::Codec::isEncoder
bool isEncoder() const
Definition: codec.cpp:50
av::Codec::id
AVCodecID id() const
Definition: codec.cpp:152
av::Codec::supportedSampleFormats
std::deque< SampleFormat > supportedSampleFormats() const
Definition: codec.cpp:102
sampleformat.h
av::Codec::name
const char * name() const
Definition: codec.cpp:9
av::findDecodingCodec
Codec findDecodingCodec(AVCodecID id)
Definition: codec.cpp:167
av::Codec::longName
const char * longName() const
Definition: codec.cpp:14
av::Codec::canDecode
bool canDecode() const
Definition: codec.cpp:36
av
Definition: audioresampler.cpp:8
channellayout.h
av::Codec::canEncode
bool canEncode() const
Definition: codec.cpp:19
av::Codec
Definition: codec.h:17
av::Codec::supportedSamplerates
std::deque< int > supportedSamplerates() const
Definition: codec.cpp:89
av::Codec::supportedChannelLayouts
std::deque< uint64_t > supportedChannelLayouts() const
Definition: codec.cpp:115
av::findEncodingCodec
Codec findEncodingCodec(AVCodecID id)
Definition: codec.cpp:157