AVPKit
com::avpkit::core::Codec Class Reference
Inheritance diagram for com::avpkit::core::Codec:
Collaboration diagram for com::avpkit::core::Codec:

Public Member Functions

virtual const char * getName ()
 Get the name of the codec. More...
 
virtual int getIDAsInt ()
 Get the ID of this codec, as an integer. More...
 
virtual Type getType ()
 Get the type of this codec. More...
 
virtual ID getID ()
 Get the ID of this codec as an enumeration. More...
 
const AVCodec * getAVCodec ()
 
virtual bool canDecode ()
 Can this codec be used for decoding? More...
 
virtual bool canEncode ()
 Can this codec be used for encoding? More...
 
virtual const char * getLongName ()
 Added for 1.17. More...
 
virtual int32_t getCapabilities ()
 Get the capabilites flag from the codec. More...
 
virtual bool hasCapability (Capabilities flag)
 Convenience method to check individual capability flags. More...
 
virtual int32_t getNumSupportedVideoFrameRates ()
 Get the number of frame rates this codec supports for encoding. More...
 
virtual IRationalgetSupportedVideoFrameRate (int32_t index)
 Return the supported frame rate at the given index. More...
 
virtual int32_t getNumSupportedVideoPixelFormats ()
 Get the number of supported video pixel formats this codec supports for encoding. More...
 
virtual IPixelFormat::Type getSupportedVideoPixelFormat (int32_t index)
 Return the supported video pixel format at the given index. More...
 
virtual int32_t getNumSupportedAudioSampleRates ()
 Get the number of different audio sample rates this codec supports for encoding. More...
 
virtual int32_t getSupportedAudioSampleRate (int32_t index)
 Return the support audio sample rate at the given index. More...
 
virtual int32_t getNumSupportedAudioSampleFormats ()
 Get the number of different audio sample formats this codec supports for encoding. More...
 
virtual IAudioSamples::Format getSupportedAudioSampleFormat (int32_t index)
 Get the supported sample format at this index. More...
 
virtual int32_t getNumSupportedAudioChannelLayouts ()
 Get the number of different audio channel layouts this codec supports for encoding. More...
 
virtual int64_t getSupportedAudioChannelLayout (int32_t index)
 Get the supported audio channel layout at this index. More...
 
virtual int32_t acquire ()
 Internal Only. More...
 
virtual int32_t release ()
 Internal Only. More...
 
- Public Member Functions inherited from com::avpkit::ferry::RefCounted
virtual RefCountedcopyReference ()
 Create a new Java object that refers to the same native object. More...
 
virtual int32_t getCurrentRefCount ()
 Return the current reference count on this object. More...
 
void setJavaAllocator (void *allocator)
 This method is public but not part of the standard API. More...
 
void * getJavaAllocator ()
 This method is public but not part of the standard API. More...
 

Static Public Member Functions

static Codecmake (const AVCodec *)
 
static CodecfindEncodingCodec (const ICodec::ID, const IPixelFormat::Type=IPixelFormat::NONE)
 
static CodecfindEncodingCodecByIntID (const int)
 
static CodecfindEncodingCodecByName (const char *)
 
static CodecfindDecodingCodec (const ICodec::ID, const IPixelFormat::Type=IPixelFormat::NONE)
 
static CodecfindDecodingCodecByIntID (const int)
 
static CodecfindDecodingCodecByName (const char *)
 
static CodecguessEncodingCodec (IContainerFormat *fmt, const char *shortName, const char *url, const char *mime_type, ICodec::Type type)
 
- Static Public Member Functions inherited from com::avpkit::core::ICodec
static ICodecfindEncodingCodec (ICodec::ID id, const IPixelFormat::Type=IPixelFormat::NONE)
 Find a codec that can be used for encoding or find a HW codec that can be used for encoding. More...
 
static ICodecfindEncodingCodecByIntID (int id)
 Find a codec that can be used for encoding. More...
 
static ICodecfindEncodingCodecByName (const char *id)
 Find a codec that can be used for encoding. More...
 
static ICodecfindDecodingCodec (ICodec::ID id, const IPixelFormat::Type=IPixelFormat::NONE)
 Find a codec that can be used for decoding or find a HW codec that can be used for decoding. More...
 
static ICodecfindDecodingCodecByIntID (int id)
 Find a codec that can be used for decoding. More...
 
static ICodecfindDecodingCodecByName (const char *id)
 Find a codec that can be used for decoding. More...
 
static ICodecguessEncodingCodec (IContainerFormat *fmt, const char *shortName, const char *url, const char *mimeType, ICodec::Type type)
 Ask us to guess an encoding codec based on the inputs passed in. More...
 
static int32_t getNumInstalledCodecs ()
 Get the number of installed codecs on this system. More...
 
static ICodecgetInstalledCodec (int32_t index)
 Get the ICodec at the given index. More...
 

Public Attributes

const AVCodec * mCodec
 

Additional Inherited Members

- Public Types inherited from com::avpkit::core::ICodec
enum  ID {
  AV_CODEC_ID_NONE , AV_CODEC_ID_MPEG1VIDEO , AV_CODEC_ID_MPEG2VIDEO , AV_CODEC_ID_H261 ,
  AV_CODEC_ID_H263 , AV_CODEC_ID_RV10 , AV_CODEC_ID_RV20 , AV_CODEC_ID_MJPEG ,
  AV_CODEC_ID_MJPEGB , AV_CODEC_ID_LJPEG , AV_CODEC_ID_SP5X , AV_CODEC_ID_JPEGLS ,
  AV_CODEC_ID_MPEG4 , AV_CODEC_ID_RAWVIDEO , AV_CODEC_ID_MSMPEG4V1 , AV_CODEC_ID_MSMPEG4V2 ,
  AV_CODEC_ID_MSMPEG4V3 , AV_CODEC_ID_WMV1 , AV_CODEC_ID_WMV2 , AV_CODEC_ID_H263P ,
  AV_CODEC_ID_H263I , AV_CODEC_ID_FLV1 , AV_CODEC_ID_SVQ1 , AV_CODEC_ID_SVQ3 ,
  AV_CODEC_ID_DVVIDEO , AV_CODEC_ID_HUFFYUV , AV_CODEC_ID_CYUV , AV_CODEC_ID_H264 ,
  AV_CODEC_ID_INDEO3 , AV_CODEC_ID_VP3 , AV_CODEC_ID_THEORA , AV_CODEC_ID_ASV1 ,
  AV_CODEC_ID_ASV2 , AV_CODEC_ID_FFV1 , AV_CODEC_ID_4XM , AV_CODEC_ID_VCR1 ,
  AV_CODEC_ID_CLJR , AV_CODEC_ID_MDEC , AV_CODEC_ID_ROQ , AV_CODEC_ID_INTERPLAY_VIDEO ,
  AV_CODEC_ID_XAN_WC3 , AV_CODEC_ID_XAN_WC4 , AV_CODEC_ID_RPZA , AV_CODEC_ID_CINEPAK ,
  AV_CODEC_ID_WS_VQA , AV_CODEC_ID_MSRLE , AV_CODEC_ID_MSVIDEO1 , AV_CODEC_ID_IDCIN ,
  AV_CODEC_ID_8BPS , AV_CODEC_ID_SMC , AV_CODEC_ID_FLIC , AV_CODEC_ID_TRUEMOTION1 ,
  AV_CODEC_ID_VMDVIDEO , AV_CODEC_ID_MSZH , AV_CODEC_ID_ZLIB , AV_CODEC_ID_QTRLE ,
  AV_CODEC_ID_TSCC , AV_CODEC_ID_ULTI , AV_CODEC_ID_QDRAW , AV_CODEC_ID_VIXL ,
  AV_CODEC_ID_QPEG , AV_CODEC_ID_PNG , AV_CODEC_ID_PPM , AV_CODEC_ID_PBM ,
  AV_CODEC_ID_PGM , AV_CODEC_ID_PGMYUV , AV_CODEC_ID_PAM , AV_CODEC_ID_FFVHUFF ,
  AV_CODEC_ID_RV30 , AV_CODEC_ID_RV40 , AV_CODEC_ID_VC1 , AV_CODEC_ID_WMV3 ,
  AV_CODEC_ID_LOCO , AV_CODEC_ID_WNV1 , AV_CODEC_ID_AASC , AV_CODEC_ID_INDEO2 ,
  AV_CODEC_ID_FRAPS , AV_CODEC_ID_TRUEMOTION2 , AV_CODEC_ID_BMP , AV_CODEC_ID_CSCD ,
  AV_CODEC_ID_MMVIDEO , AV_CODEC_ID_ZMBV , AV_CODEC_ID_AVS , AV_CODEC_ID_SMACKVIDEO ,
  AV_CODEC_ID_NUV , AV_CODEC_ID_KMVC , AV_CODEC_ID_FLASHSV , AV_CODEC_ID_CAVS ,
  AV_CODEC_ID_JPEG2000 , AV_CODEC_ID_VMNC , AV_CODEC_ID_VP5 , AV_CODEC_ID_VP6 ,
  AV_CODEC_ID_VP6F , AV_CODEC_ID_TARGA , AV_CODEC_ID_DSICINVIDEO , AV_CODEC_ID_TIERTEXSEQVIDEO ,
  AV_CODEC_ID_TIFF , AV_CODEC_ID_GIF , AV_CODEC_ID_DXA , AV_CODEC_ID_DNXHD ,
  AV_CODEC_ID_THP , AV_CODEC_ID_SGI , AV_CODEC_ID_C93 , AV_CODEC_ID_BETHSOFTVID ,
  AV_CODEC_ID_PTX , AV_CODEC_ID_TXD , AV_CODEC_ID_VP6A , AV_CODEC_ID_AMV ,
  AV_CODEC_ID_VB , AV_CODEC_ID_PCX , AV_CODEC_ID_SUNRAST , AV_CODEC_ID_INDEO4 ,
  AV_CODEC_ID_INDEO5 , AV_CODEC_ID_MIMIC , AV_CODEC_ID_RL2 , AV_CODEC_ID_ESCAPE124 ,
  AV_CODEC_ID_DIRAC , AV_CODEC_ID_BFI , AV_CODEC_ID_CMV , AV_CODEC_ID_MOTIONPIXELS ,
  AV_CODEC_ID_TGV , AV_CODEC_ID_TGQ , AV_CODEC_ID_TQI , AV_CODEC_ID_AURA ,
  AV_CODEC_ID_AURA2 , AV_CODEC_ID_V210X , AV_CODEC_ID_TMV , AV_CODEC_ID_V210 ,
  AV_CODEC_ID_DPX , AV_CODEC_ID_MAD , AV_CODEC_ID_FRWU , AV_CODEC_ID_FLASHSV2 ,
  AV_CODEC_ID_CDGRAPHICS , AV_CODEC_ID_R210 , AV_CODEC_ID_ANM , AV_CODEC_ID_BINKVIDEO ,
  AV_CODEC_ID_IFF_ILBM , AV_CODEC_ID_KGV1 , AV_CODEC_ID_YOP , AV_CODEC_ID_VP8 ,
  AV_CODEC_ID_PICTOR , AV_CODEC_ID_ANSI , AV_CODEC_ID_A64_MULTI , AV_CODEC_ID_A64_MULTI5 ,
  AV_CODEC_ID_R10K , AV_CODEC_ID_MXPEG , AV_CODEC_ID_LAGARITH , AV_CODEC_ID_PRORES ,
  AV_CODEC_ID_JV , AV_CODEC_ID_DFA , AV_CODEC_ID_WMV3IMAGE , AV_CODEC_ID_VC1IMAGE ,
  AV_CODEC_ID_UTVIDEO , AV_CODEC_ID_BMV_VIDEO , AV_CODEC_ID_VBLE , AV_CODEC_ID_DXTORY ,
  AV_CODEC_ID_V410 , AV_CODEC_ID_XWD , AV_CODEC_ID_CDXL , AV_CODEC_ID_XBM ,
  AV_CODEC_ID_ZEROCODEC , AV_CODEC_ID_MSS1 , AV_CODEC_ID_MSA1 , AV_CODEC_ID_TSCC2 ,
  AV_CODEC_ID_MTS2 , AV_CODEC_ID_CLLC , AV_CODEC_ID_MSS2 , AV_CODEC_ID_VP9 ,
  AV_CODEC_ID_AIC , AV_CODEC_ID_ESCAPE130 , AV_CODEC_ID_G2M , AV_CODEC_ID_WEBP ,
  AV_CODEC_ID_HNM4_VIDEO , AV_CODEC_ID_HEVC , AV_CODEC_ID_FIC , AV_CODEC_ID_ALIAS_PIX ,
  AV_CODEC_ID_BRENDER_PIX , AV_CODEC_ID_PAF_VIDEO , AV_CODEC_ID_EXR , AV_CODEC_ID_VP7 ,
  AV_CODEC_ID_SANM , AV_CODEC_ID_SGIRLE , AV_CODEC_ID_MVC1 , AV_CODEC_ID_MVC2 ,
  AV_CODEC_ID_HQX , AV_CODEC_ID_TDSC , AV_CODEC_ID_HQ_HQA , AV_CODEC_ID_HAP ,
  AV_CODEC_ID_DDS , AV_CODEC_ID_DXV , AV_CODEC_ID_SCREENPRESSO , AV_CODEC_ID_RSCC ,
  AV_CODEC_ID_AVS2 , AV_CODEC_ID_Y41P = 0x8000 , AV_CODEC_ID_AVRP , AV_CODEC_ID_012V ,
  AV_CODEC_ID_AVUI , AV_CODEC_ID_AYUV , AV_CODEC_ID_TARGA_Y216 , AV_CODEC_ID_V308 ,
  AV_CODEC_ID_V408 , AV_CODEC_ID_YUV4 , AV_CODEC_ID_AVRN , AV_CODEC_ID_CPIA ,
  AV_CODEC_ID_XFACE , AV_CODEC_ID_SNOW , AV_CODEC_ID_SMVJPEG , AV_CODEC_ID_APNG ,
  AV_CODEC_ID_DAALA , AV_CODEC_ID_CFHD , AV_CODEC_ID_TRUEMOTION2RT , AV_CODEC_ID_M101 ,
  AV_CODEC_ID_MAGICYUV , AV_CODEC_ID_SHEERVIDEO , AV_CODEC_ID_YLC , AV_CODEC_ID_PSD ,
  AV_CODEC_ID_PIXLET , AV_CODEC_ID_SPEEDHQ , AV_CODEC_ID_FMVC , AV_CODEC_ID_SCPR ,
  AV_CODEC_ID_CLEARVIDEO , AV_CODEC_ID_XPM , AV_CODEC_ID_AV1 , AV_CODEC_ID_BITPACKED ,
  AV_CODEC_ID_MSCC , AV_CODEC_ID_SRGC , AV_CODEC_ID_SVG , AV_CODEC_ID_GDV ,
  AV_CODEC_ID_FITS , AV_CODEC_ID_IMM4 , AV_CODEC_ID_PROSUMER , AV_CODEC_ID_MWSC ,
  AV_CODEC_ID_WCMV , AV_CODEC_ID_RASC , AV_CODEC_ID_HYMT , AV_CODEC_ID_ARBC ,
  AV_CODEC_ID_AGM , AV_CODEC_ID_LSCR , AV_CODEC_ID_VP4 , AV_CODEC_ID_IMM5 ,
  AV_CODEC_ID_MVDV , AV_CODEC_ID_MVHA , AV_CODEC_ID_CDTOONS , AV_CODEC_ID_MV30 ,
  AV_CODEC_ID_NOTCHLC , AV_CODEC_ID_PFM , AV_CODEC_ID_FIRST_AUDIO = 0x10000 , AV_CODEC_ID_PCM_S16LE = 0x10000 ,
  AV_CODEC_ID_PCM_S16BE , AV_CODEC_ID_PCM_U16LE , AV_CODEC_ID_PCM_U16BE , AV_CODEC_ID_PCM_S8 ,
  AV_CODEC_ID_PCM_U8 , AV_CODEC_ID_PCM_MULAW , AV_CODEC_ID_PCM_ALAW , AV_CODEC_ID_PCM_S32LE ,
  AV_CODEC_ID_PCM_S32BE , AV_CODEC_ID_PCM_U32LE , AV_CODEC_ID_PCM_U32BE , AV_CODEC_ID_PCM_S24LE ,
  AV_CODEC_ID_PCM_S24BE , AV_CODEC_ID_PCM_U24LE , AV_CODEC_ID_PCM_U24BE , AV_CODEC_ID_PCM_S24DAUD ,
  AV_CODEC_ID_PCM_ZORK , AV_CODEC_ID_PCM_S16LE_PLANAR , AV_CODEC_ID_PCM_DVD , AV_CODEC_ID_PCM_F32BE ,
  AV_CODEC_ID_PCM_F32LE , AV_CODEC_ID_PCM_F64BE , AV_CODEC_ID_PCM_F64LE , AV_CODEC_ID_PCM_BLURAY ,
  AV_CODEC_ID_PCM_LXF , AV_CODEC_ID_S302M , AV_CODEC_ID_PCM_S8_PLANAR , AV_CODEC_ID_PCM_S24LE_PLANAR ,
  AV_CODEC_ID_PCM_S32LE_PLANAR , AV_CODEC_ID_PCM_S16BE_PLANAR , AV_CODEC_ID_PCM_S64LE = 0x10800 , AV_CODEC_ID_PCM_S64BE ,
  AV_CODEC_ID_PCM_F16LE , AV_CODEC_ID_PCM_F24LE , AV_CODEC_ID_PCM_VIDC , AV_CODEC_ID_ADPCM_IMA_QT = 0x11000 ,
  AV_CODEC_ID_ADPCM_IMA_WAV , AV_CODEC_ID_ADPCM_IMA_DK3 , AV_CODEC_ID_ADPCM_IMA_DK4 , AV_CODEC_ID_ADPCM_IMA_WS ,
  AV_CODEC_ID_ADPCM_IMA_SMJPEG , AV_CODEC_ID_ADPCM_MS , AV_CODEC_ID_ADPCM_4XM , AV_CODEC_ID_ADPCM_XA ,
  AV_CODEC_ID_ADPCM_ADX , AV_CODEC_ID_ADPCM_EA , AV_CODEC_ID_ADPCM_G726 , AV_CODEC_ID_ADPCM_CT ,
  AV_CODEC_ID_ADPCM_SWF , AV_CODEC_ID_ADPCM_YAMAHA , AV_CODEC_ID_ADPCM_SBPRO_4 , AV_CODEC_ID_ADPCM_SBPRO_3 ,
  AV_CODEC_ID_ADPCM_SBPRO_2 , AV_CODEC_ID_ADPCM_THP , AV_CODEC_ID_ADPCM_IMA_AMV , AV_CODEC_ID_ADPCM_EA_R1 ,
  AV_CODEC_ID_ADPCM_EA_R3 , AV_CODEC_ID_ADPCM_EA_R2 , AV_CODEC_ID_ADPCM_IMA_EA_SEAD , AV_CODEC_ID_ADPCM_IMA_EA_EACS ,
  AV_CODEC_ID_ADPCM_EA_XAS , AV_CODEC_ID_ADPCM_EA_MAXIS_XA , AV_CODEC_ID_ADPCM_IMA_ISS , AV_CODEC_ID_ADPCM_G722 ,
  AV_CODEC_ID_ADPCM_IMA_APC , AV_CODEC_ID_ADPCM_VIMA , AV_CODEC_ID_ADPCM_AFC = 0x11800 , AV_CODEC_ID_ADPCM_IMA_OKI ,
  AV_CODEC_ID_ADPCM_DTK , AV_CODEC_ID_ADPCM_IMA_RAD , AV_CODEC_ID_ADPCM_G726LE , AV_CODEC_ID_ADPCM_THP_LE ,
  AV_CODEC_ID_ADPCM_PSX , AV_CODEC_ID_ADPCM_AICA , AV_CODEC_ID_ADPCM_IMA_DAT4 , AV_CODEC_ID_ADPCM_MTAF ,
  AV_CODEC_ID_ADPCM_AGM , AV_CODEC_ID_ADPCM_ARGO , AV_CODEC_ID_ADPCM_IMA_SSI , AV_CODEC_ID_ADPCM_ZORK ,
  AV_CODEC_ID_ADPCM_IMA_APM , AV_CODEC_ID_ADPCM_IMA_ALP , AV_CODEC_ID_ADPCM_IMA_MTF , AV_CODEC_ID_ADPCM_IMA_CUNNING ,
  AV_CODEC_ID_AMR_NB = 0x12000 , AV_CODEC_ID_AMR_WB , AV_CODEC_ID_RA_144 = 0x13000 , AV_CODEC_ID_RA_288 ,
  AV_CODEC_ID_ROQ_DPCM = 0x14000 , AV_CODEC_ID_INTERPLAY_DPCM , AV_CODEC_ID_XAN_DPCM , AV_CODEC_ID_SOL_DPCM ,
  AV_CODEC_ID_SDX2_DPCM = 0x14800 , AV_CODEC_ID_GREMLIN_DPCM , AV_CODEC_ID_DERF_DPCM , AV_CODEC_ID_MP2 = 0x15000 ,
  AV_CODEC_ID_MP3 , AV_CODEC_ID_AAC , AV_CODEC_ID_AC3 , AV_CODEC_ID_DTS ,
  AV_CODEC_ID_VORBIS , AV_CODEC_ID_DVAUDIO , AV_CODEC_ID_WMAV1 , AV_CODEC_ID_WMAV2 ,
  AV_CODEC_ID_MACE3 , AV_CODEC_ID_MACE6 , AV_CODEC_ID_VMDAUDIO , AV_CODEC_ID_FLAC ,
  AV_CODEC_ID_MP3ADU , AV_CODEC_ID_MP3ON4 , AV_CODEC_ID_SHORTEN , AV_CODEC_ID_ALAC ,
  AV_CODEC_ID_WESTWOOD_SND1 , AV_CODEC_ID_GSM , AV_CODEC_ID_QDM2 , AV_CODEC_ID_COOK ,
  AV_CODEC_ID_TRUESPEECH , AV_CODEC_ID_TTA , AV_CODEC_ID_SMACKAUDIO , AV_CODEC_ID_QCELP ,
  AV_CODEC_ID_WAVPACK , AV_CODEC_ID_DSICINAUDIO , AV_CODEC_ID_IMC , AV_CODEC_ID_MUSEPACK7 ,
  AV_CODEC_ID_MLP , AV_CODEC_ID_GSM_MS , AV_CODEC_ID_ATRAC3 , AV_CODEC_ID_APE ,
  AV_CODEC_ID_NELLYMOSER , AV_CODEC_ID_MUSEPACK8 , AV_CODEC_ID_SPEEX , AV_CODEC_ID_WMAVOICE ,
  AV_CODEC_ID_WMAPRO , AV_CODEC_ID_WMALOSSLESS , AV_CODEC_ID_ATRAC3P , AV_CODEC_ID_EAC3 ,
  AV_CODEC_ID_SIPR , AV_CODEC_ID_MP1 , AV_CODEC_ID_TWINVQ , AV_CODEC_ID_TRUEHD ,
  AV_CODEC_ID_MP4ALS , AV_CODEC_ID_ATRAC1 , AV_CODEC_ID_BINKAUDIO_RDFT , AV_CODEC_ID_BINKAUDIO_DCT ,
  AV_CODEC_ID_AAC_LATM , AV_CODEC_ID_QDMC , AV_CODEC_ID_CELT , AV_CODEC_ID_G723_1 ,
  AV_CODEC_ID_G729 , AV_CODEC_ID_8SVX_EXP , AV_CODEC_ID_8SVX_FIB , AV_CODEC_ID_BMV_AUDIO ,
  AV_CODEC_ID_RALF , AV_CODEC_ID_IAC , AV_CODEC_ID_ILBC , AV_CODEC_ID_OPUS ,
  AV_CODEC_ID_COMFORT_NOISE , AV_CODEC_ID_TAK , AV_CODEC_ID_METASOUND , AV_CODEC_ID_PAF_AUDIO ,
  AV_CODEC_ID_ON2AVC , AV_CODEC_ID_DSS_SP , AV_CODEC_ID_CODEC2 , AV_CODEC_ID_FFWAVESYNTH = 0x15800 ,
  AV_CODEC_ID_SONIC , AV_CODEC_ID_SONIC_LS , AV_CODEC_ID_EVRC , AV_CODEC_ID_SMV ,
  AV_CODEC_ID_DSD_LSBF , AV_CODEC_ID_DSD_MSBF , AV_CODEC_ID_DSD_LSBF_PLANAR , AV_CODEC_ID_DSD_MSBF_PLANAR ,
  AV_CODEC_ID_4GV , AV_CODEC_ID_INTERPLAY_ACM , AV_CODEC_ID_XMA1 , AV_CODEC_ID_XMA2 ,
  AV_CODEC_ID_DST , AV_CODEC_ID_ATRAC3AL , AV_CODEC_ID_ATRAC3PAL , AV_CODEC_ID_DOLBY_E ,
  AV_CODEC_ID_APTX , AV_CODEC_ID_APTX_HD , AV_CODEC_ID_SBC , AV_CODEC_ID_ATRAC9 ,
  AV_CODEC_ID_HCOM , AV_CODEC_ID_ACELP_KELVIN , AV_CODEC_ID_MPEGH_3D_AUDIO , AV_CODEC_ID_SIREN ,
  AV_CODEC_ID_HCA , AV_CODEC_ID_FIRST_SUBTITLE = 0x17000 , AV_CODEC_ID_DVD_SUBTITLE = 0x17000 , AV_CODEC_ID_DVB_SUBTITLE ,
  AV_CODEC_ID_TEXT , AV_CODEC_ID_XSUB , AV_CODEC_ID_SSA , AV_CODEC_ID_MOV_TEXT ,
  AV_CODEC_ID_HDMV_PGS_SUBTITLE , AV_CODEC_ID_DVB_TELETEXT , AV_CODEC_ID_SRT , AV_CODEC_ID_MICRODVD = 0x17800 ,
  AV_CODEC_ID_EIA_608 , AV_CODEC_ID_JACOSUB , AV_CODEC_ID_SAMI , AV_CODEC_ID_REALTEXT ,
  AV_CODEC_ID_STL , AV_CODEC_ID_SUBVIEWER1 , AV_CODEC_ID_SUBVIEWER , AV_CODEC_ID_SUBRIP ,
  AV_CODEC_ID_WEBVTT , AV_CODEC_ID_MPL2 , AV_CODEC_ID_VPLAYER , AV_CODEC_ID_PJS ,
  AV_CODEC_ID_ASS , AV_CODEC_ID_HDMV_TEXT_SUBTITLE , AV_CODEC_ID_TTML , AV_CODEC_ID_ARIB_CAPTION ,
  AV_CODEC_ID_FIRST_UNKNOWN = 0x18000 , AV_CODEC_ID_TTF = 0x18000 , AV_CODEC_ID_SCTE_35 , AV_CODEC_ID_EPG ,
  AV_CODEC_ID_BINTEXT = 0x18800 , AV_CODEC_ID_XBIN , AV_CODEC_ID_IDF , AV_CODEC_ID_OTF ,
  AV_CODEC_ID_SMPTE_KLV , AV_CODEC_ID_DVD_NAV , AV_CODEC_ID_TIMED_ID3 , AV_CODEC_ID_BIN_DATA ,
  AV_CODEC_ID_PROBE = 0x19000 , AV_CODEC_ID_MPEG2TS = 0x20000 , AV_CODEC_ID_MPEG4SYSTEMS = 0x20001 , AV_CODEC_ID_FFMETADATA = 0x21000 ,
  AV_CODEC_ID_WRAPPED_AVFRAME = 0x21001
}
 These are the codecs this library currently supports. More...
 
enum  Type {
  CODEC_TYPE_UNKNOWN = -1 , CODEC_TYPE_VIDEO , CODEC_TYPE_AUDIO , CODEC_TYPE_DATA ,
  CODEC_TYPE_SUBTITLE , CODEC_TYPE_ATTACHMENT
}
 The different types of Codecs that can exist in the system.
 
enum  Capabilities {
  CAP_DRAW_HORIZ_BAND = 0x0001 , CAP_DR1 = 0x0002 , CAP_PARSE_ONLY = 0x0004 , CAP_TRUNCATED = 0x0008 ,
  CAP_HWACCEL = 0x0010 , CAP_DELAY = 0x0020 , CAP_SMALL_LAST_FRAME = 0x0040 , CAP_HWACCEL_VDPAU = 0x0080 ,
  CAP_SUBFRAMES =0x0100
}
 Capability flags.
 
typedef enum com::avpkit::core::ICodec::ID ID
 These are the codecs this library currently supports. More...
 
typedef enum com::avpkit::core::ICodec::Type Type
 The different types of Codecs that can exist in the system.
 
typedef enum com::avpkit::core::ICodec::Capabilities Capabilities
 Capability flags.
 
- Protected Member Functions inherited from com::avpkit::ferry::RefCounted
virtual void destroy ()
 This method is called by RefCounted objects when their Ref Count reaches zero and they are about to be destroyed.
 
- Protected Attributes inherited from com::avpkit::ferry::RefCounted
AtomicIntegermRefCount
 This is the internal reference count, represented as an AtomicInteger to make sure it is thread safe.
 
void * mAllocator
 Not part of public API.
 

Detailed Description

Definition at line 32 of file Codec.h.

Member Function Documentation

◆ acquire()

int32_t com::avpkit::core::Codec::acquire ( )
virtual

Internal Only.

DO NOT USE FROM JAVA.

Acquire a reference to this object. This increments the native internal ref count in native code by +1.

This method is called internally by Ferry in Java, and you should not call it without knowing what you are doing. But if you do call it, make sure you call release() once for each call you make to this method.

Returns
The refcount after the acquire. Note due to multi-threaded issues, you should not rely on this value, as it may change before the method returns to you.

Reimplemented from com::avpkit::ferry::RefCounted.

Definition at line 236 of file Codec.cpp.

237  {
238  int retval = 0;
239  retval = RefCounted::acquire();
240  VS_LOG_TRACE("Acquired %p: %d", this, retval);
241  return retval;
242  }
virtual int32_t acquire()
Internal Only.
Definition: RefCounted.cpp:63

References com::avpkit::ferry::RefCounted::acquire().

◆ canDecode()

bool com::avpkit::core::Codec::canDecode ( )
virtual

Can this codec be used for decoding?

Returns
Can this Codec decode?

Implements com::avpkit::core::ICodec.

Definition at line 182 of file Codec.cpp.

183  {
184  return mCodec ? (mCodec->decode != NULL) : false;
185  }

◆ canEncode()

bool com::avpkit::core::Codec::canEncode ( )
virtual

Can this codec be used for encoding?

Returns
Can this Codec encode?

Implements com::avpkit::core::ICodec.

Definition at line 188 of file Codec.cpp.

189  {
190  return mCodec ? (mCodec->encode2 != NULL) : false;
191  }

◆ getCapabilities()

int32_t com::avpkit::core::Codec::getCapabilities ( )
virtual

Get the capabilites flag from the codec.

Returns
the capabilities flag

Implements com::avpkit::core::ICodec.

Definition at line 258 of file Codec.cpp.

259  {
260  if (!mCodec)
261  return 0;
262  return mCodec->capabilities;
263  }

◆ getID()

virtual ID com::avpkit::core::Codec::getID ( )
inlinevirtual

Get the ID of this codec as an enumeration.

Returns
the ID of this codec, an enum ID

Implements com::avpkit::core::ICodec.

Definition at line 40 of file Codec.h.

41  {
42  // Warning; this might not be protable
43  ID retval = AV_CODEC_ID_NONE;
44  int id = getIDAsInt();
45 
46  // This cast is not defined in C++ when id is
47  // not in ID. That means if we're using a
48  // newer version of LIBAVCODEC this might
49  // give a bogus value for a Codec we don't
50  // know about.
51  retval = (ID)id;
52  if (id != (int) retval)
53  {
54  // we assume some back and forth conversion failed...
55  retval = AV_CODEC_ID_NONE;
56  }
57  return retval;
58  }
virtual int getIDAsInt()
Get the ID of this codec, as an integer.
Definition: Codec.cpp:53
ID
These are the codecs this library currently supports.
Definition: ICodec.h:61

References getIDAsInt().

◆ getIDAsInt()

int com::avpkit::core::Codec::getIDAsInt ( )
virtual

Get the ID of this codec, as an integer.

Returns
the ID of this codec, as an integer.

Implements com::avpkit::core::ICodec.

Definition at line 53 of file Codec.cpp.

54  {
55  int retval = AV_CODEC_ID_NONE;
56  if (mCodec)
57  retval = mCodec->id;
58  return retval;
59  }

Referenced by getID().

◆ getLongName()

const char * com::avpkit::core::Codec::getLongName ( )
virtual

Added for 1.17.

Get the long name for this codec.

Returns
the long name.

Implements com::avpkit::core::ICodec.

Definition at line 252 of file Codec.cpp.

253  {
254  return mCodec ? mCodec->long_name : 0;
255  }

◆ getName()

const char * com::avpkit::core::Codec::getName ( )
virtual

Get the name of the codec.

Returns
The name of this Codec.

Implements com::avpkit::core::ICodec.

Definition at line 45 of file Codec.cpp.

45  {
46  const char * retval = 0;
47  if (mCodec)
48  retval = mCodec->name;
49  return retval;
50  }

◆ getNumSupportedAudioChannelLayouts()

int32_t com::avpkit::core::Codec::getNumSupportedAudioChannelLayouts ( )
virtual

Get the number of different audio channel layouts this codec supports for encoding.

Not all codecs will report this.

Returns
the number or 0 if we don't know.

Implements com::avpkit::core::ICodec.

Definition at line 385 of file Codec.cpp.

386  {
387  if (!mCodec)
388  return 0;
389  int i = 0;
390  for(const uint64_t* p=mCodec->channel_layouts;
391  p && *p;
392  p++,i++)
393  ;
394  return i;
395  }

◆ getNumSupportedAudioSampleFormats()

int32_t com::avpkit::core::Codec::getNumSupportedAudioSampleFormats ( )
virtual

Get the number of different audio sample formats this codec supports for encoding.

Not all codecs will report this.

Returns
the number or 0 if we don't know.

Implements com::avpkit::core::ICodec.

Definition at line 357 of file Codec.cpp.

358  {
359  if (!mCodec)
360  return 0;
361  int i = 0;
362  for(const enum AVSampleFormat* p=mCodec->sample_fmts;
363  p && (*p != -1);
364  p++,i++)
365  ;
366  return i;
367  }

◆ getNumSupportedAudioSampleRates()

int32_t com::avpkit::core::Codec::getNumSupportedAudioSampleRates ( )
virtual

Get the number of different audio sample rates this codec supports for encoding.

Not all codecs will report this.

Returns
the number or 0 if we don't know.

Implements com::avpkit::core::ICodec.

Definition at line 331 of file Codec.cpp.

332  {
333  if (!mCodec)
334  return 0;
335  int i = 0;
336  for(const int *p = mCodec->supported_samplerates;
337  p && *p;
338  ++p, ++i)
339  ;
340  return i;
341  }

◆ getNumSupportedVideoFrameRates()

int32_t com::avpkit::core::Codec::getNumSupportedVideoFrameRates ( )
virtual

Get the number of frame rates this codec supports for encoding.

Not all codecs will report this number.

Returns
the number or 0 if we don't know.

Implements com::avpkit::core::ICodec.

Definition at line 273 of file Codec.cpp.

274  {
275  if (!mCodec)
276  return 0;
277  int count = 0;
278  for(
279  const AVRational* p=mCodec->supported_framerates;
280  p && !(!p->den && !p->num);
281  p++
282  )
283  ++count;
284  return count;
285  }

◆ getNumSupportedVideoPixelFormats()

int32_t com::avpkit::core::Codec::getNumSupportedVideoPixelFormats ( )
virtual

Get the number of supported video pixel formats this codec supports for encoding.

Not all codecs will report this.

Returns
the number or 0 if we don't know.

Implements com::avpkit::core::ICodec.

Definition at line 303 of file Codec.cpp.

304  {
305  if (!mCodec)
306  return 0;
307  int count = 0;
308  for(const AVPixelFormat* p = mCodec->pix_fmts;
309  p && (*p!=-1);
310  p++)
311  ++count;
312  return count;
313 
314  }

◆ getSupportedAudioChannelLayout()

int64_t com::avpkit::core::Codec::getSupportedAudioChannelLayout ( int32_t  index)
virtual

Get the supported audio channel layout at this index.

The value returned is a bit flag representing the different types of audio layout this codec can support. Test the values by bit-comparing them to the IAudioSamples.ChannelLayout enum types.

Parameters
indexthe index
Returns
the channel layout, or 0 if unknown, index < 0 or index >= getNumSupportedAudioChannelLayouts.

Implements com::avpkit::core::ICodec.

Definition at line 397 of file Codec.cpp.

398  {
399  if (!mCodec)
400  return 0;
401  int i = 0;
402  for(const uint64_t* p=mCodec->channel_layouts;
403  p && *p;
404  p++,i++)
405  if (index == i)
406  return (int64_t)*p;
407  return 0;
408  }

◆ getSupportedAudioSampleFormat()

IAudioSamples::Format com::avpkit::core::Codec::getSupportedAudioSampleFormat ( int32_t  index)
virtual

Get the supported sample format at this index.

Parameters
indexthe index in our list.
Returns
the format, or IAudioSamples.Format.FMT_NONE if unknown, index < 0 or index >= getNumSupportedAudioSampleFormats().

Implements com::avpkit::core::ICodec.

Definition at line 370 of file Codec.cpp.

371  {
372  if (!mCodec)
373  return IAudioSamples::FMT_NONE;
374  int i = 0;
375  for(const enum AVSampleFormat* p=mCodec->sample_fmts;
376  p && (*p != -1);
377  p++,i++)
378  if (index == i)
379  return (IAudioSamples::Format)*p;
380  return IAudioSamples::FMT_NONE;
381 
382  }
Format
The format we use to represent audio.
Definition: IAudioSamples.h:46

◆ getSupportedAudioSampleRate()

int32_t com::avpkit::core::Codec::getSupportedAudioSampleRate ( int32_t  index)
virtual

Return the support audio sample rate at the given index.

Parameters
indexthe index in our list.
Returns
the sample rate, or 0 if unknown, index < 0 or index >= getNumSupportedAudioSampleRates()

Implements com::avpkit::core::ICodec.

Definition at line 343 of file Codec.cpp.

344  {
345  if (!mCodec)
346  return 0;
347  int i = 0;
348  for(const int *p = mCodec->supported_samplerates;
349  p && *p;
350  p++, i++)
351  if (i == index)
352  return *p;
353  return 0;
354  }

◆ getSupportedVideoFrameRate()

IRational * com::avpkit::core::Codec::getSupportedVideoFrameRate ( int32_t  index)
virtual

Return the supported frame rate at the given index.

Parameters
indexthe index in our list.
Returns
the frame rate, or null if unknown, if index <0 or if index >= getNumSupportedVideoFrameRates()

Implements com::avpkit::core::ICodec.

Definition at line 287 of file Codec.cpp.

288  {
289  if (!mCodec)
290  return 0;
291  int i = 0;
292  for(
293  const AVRational* p=mCodec->supported_framerates;
294  p && !(!p->den && !p->num);
295  p++, i++
296  )
297  if (index == i)
298  return IRational::make(p->num,p->den);
299  return 0;
300  }
static IRational * make()
Get a new rational that will be set to 0/0.
Definition: IRational.cpp:79

References com::avpkit::core::IRational::make().

◆ getSupportedVideoPixelFormat()

IPixelFormat::Type com::avpkit::core::Codec::getSupportedVideoPixelFormat ( int32_t  index)
virtual

Return the supported video pixel format at the given index.

Parameters
indexthe index in our list.
Returns
the pixel format, or IPixelFormat.Type#NONE if unknown, if index <0 or if index >= getNumSupportedVideoPixelFormats()

Implements com::avpkit::core::ICodec.

Definition at line 317 of file Codec.cpp.

318  {
319  if (!mCodec)
320  return IPixelFormat::NONE;
321  int i = 0;
322  for(const AVPixelFormat* p = mCodec->pix_fmts;
323  p && (*p!=-1);
324  p++,i++)
325  if (index == i)
326  return (IPixelFormat::Type)*p;
327  return IPixelFormat::NONE;
328  }

◆ getType()

ICodec::Type com::avpkit::core::Codec::getType ( )
virtual

Get the type of this codec.

Returns
The type of this Codec, as a enum Type

Implements com::avpkit::core::ICodec.

Definition at line 62 of file Codec.cpp.

63  {
64  Type retval = (Type) AVMEDIA_TYPE_UNKNOWN;
65  if (mCodec)
66  retval = (Type) mCodec->type;
67  return retval;
68  }
Type
The different types of Codecs that can exist in the system.
Definition: ICodec.h:582

◆ hasCapability()

bool com::avpkit::core::Codec::hasCapability ( Capabilities  capability)
virtual

Convenience method to check individual capability flags.

Parameters
capabilitythe capability
Returns
true if flag is set; false otherwise.

Implements com::avpkit::core::ICodec.

Definition at line 265 of file Codec.cpp.

266  {
267  if (!mCodec)
268  return false;
269  return mCodec->capabilities&flag;
270  }

◆ release()

int32_t com::avpkit::core::Codec::release ( )
virtual

Internal Only.

DO NOT USE FROM JAVA.

This decrements the native internal ref count by -1; the object is destroyed if its ref count reaches zero.

This method is called internally by Ferry in Java, and you should not call it without knowing what you are doing. But if you do call it, make sure you had previously called acquire() once for each call to release() you make.

Returns
The ref count after the release. Note due to multi-threaded issues, you should not rely on this value, as it may change before the method returns to you.

Reimplemented from com::avpkit::ferry::RefCounted.

Definition at line 244 of file Codec.cpp.

245  {
246  int retval = 0;
247  retval = RefCounted::release();
248  VS_LOG_TRACE("Released %p: %d", this, retval);
249  return retval;
250  }
virtual int32_t release()
Internal Only.
Definition: RefCounted.cpp:70

References com::avpkit::ferry::RefCounted::release().


The documentation for this class was generated from the following files: