23 #include <com/avpkit/core/ICodec.h>
24 #include <com/avpkit/core/IContainerFormat.h>
25 #include <com/avpkit/core/FfmpegIncludes.h>
27 #include "PixelFormat.h"
29 namespace com {
namespace avpkit {
namespace core
34 VS_JNIUTILS_REFCOUNTED_OBJECT_PRIVATE_MAKE(
Codec)
36 static Codec * make(
const AVCodec *);
43 ID retval = AV_CODEC_ID_NONE;
52 if (
id != (
int) retval)
55 retval = AV_CODEC_ID_NONE;
61 const AVCodec * getAVCodec() {
return mCodec; }
64 static Codec *findEncodingCodecByIntID(
const int);
65 static Codec *findEncodingCodecByName(
const char*);
68 static Codec *findDecodingCodecByIntID(
const int);
69 static Codec *findDecodingCodecByName(
const char*);
71 static Codec *guessEncodingCodec(IContainerFormat* fmt,
72 const char *shortName,
const char*url,
const char*mime_type,
105 const AVCodec *mCodec;
virtual bool hasCapability(Capabilities flag)
Convenience method to check individual capability flags.
virtual bool canEncode()
Can this codec be used for encoding?
virtual int32_t getNumSupportedAudioChannelLayouts()
Get the number of different audio channel layouts this codec supports for encoding.
virtual int32_t getNumSupportedVideoPixelFormats()
Get the number of supported video pixel formats this codec supports for encoding.
virtual IPixelFormat::Type getSupportedVideoPixelFormat(int32_t index)
Return the supported video pixel format at the given index.
virtual int32_t release()
Internal Only.
virtual IRational * getSupportedVideoFrameRate(int32_t index)
Return the supported frame rate at the given index.
virtual int64_t getSupportedAudioChannelLayout(int32_t index)
Get the supported audio channel layout at this index.
virtual int32_t getNumSupportedAudioSampleFormats()
Get the number of different audio sample formats this codec supports for encoding.
virtual int32_t acquire()
Internal Only.
virtual IAudioSamples::Format getSupportedAudioSampleFormat(int32_t index)
Get the supported sample format at this index.
virtual ID getID()
Get the ID of this codec as an enumeration.
virtual int32_t getCapabilities()
Get the capabilites flag from the codec.
virtual const char * getLongName()
Added for 1.17.
virtual int32_t getNumSupportedVideoFrameRates()
Get the number of frame rates this codec supports for encoding.
virtual const char * getName()
Get the name of the codec.
virtual int32_t getNumSupportedAudioSampleRates()
Get the number of different audio sample rates this codec supports for encoding.
virtual int32_t getSupportedAudioSampleRate(int32_t index)
Return the support audio sample rate at the given index.
virtual bool canDecode()
Can this codec be used for decoding?
virtual Type getType()
Get the type of this codec.
virtual int getIDAsInt()
Get the ID of this codec, as an integer.
Format
The format we use to represent audio.
A "key" to an IStreamCoder that tells it how to encode or decode data.
Capabilities
Capability flags.
ID
These are the codecs this library currently supports.
Type
The different types of Codecs that can exist in the system.
WARNING: Do not use logging in this class, and do not set any static file variables to values other t...