FFmpegfs Fuse Multi Media Filesystem 2.16
|
#include <ffmpeg_utils.h>
Classes | |
struct | _tagFORMAT |
Public Types | |
typedef std::vector< AVCodecID > | CODEC_VECT |
Vector with valid codec ids for file format. More... | |
typedef struct Format_Options::_tagFORMAT | FORMAT |
typedef std::map< SAMPLE_FMT, const FORMAT > | FORMAT_MAP |
Map of formats. One entry per format derivative. More... | |
Public Member Functions | |
Format_Options () | |
Construct Format_Options object with defaults (empty) More... | |
Format_Options (std::string format_name, std::string fileext, FORMAT_MAP format, bool albumart_supported) | |
Construct Format_Options object. More... | |
const std::string & | format_name () const |
Convert destination type to "real" type, i.e., the file extension to be used. More... | |
const std::string & | fileext () const |
Get file extension. More... | |
AVCodecID | video_codec () const |
Get video codec_id. More... | |
bool | is_video_codec_supported (AVCodecID codec_id) const |
Check if video codec/file format combination is supported. More... | |
std::string | video_codec_list () const |
Create a list of supported audio codecs for current audio codec. More... | |
AVCodecID | audio_codec () const |
Get audio codec_id. More... | |
bool | is_audio_codec_supported (AVCodecID codec_id) const |
Check if audio codec/file format combination is supported. More... | |
std::string | audio_codec_list () const |
Create a list of supported audio codecs for current audio codec. More... | |
AVSampleFormat | sample_format () const |
Get sample format (bit width) More... | |
bool | is_sample_fmt_supported () const |
Check if audio codec/sample format combination is supported. More... | |
std::string | sample_fmt_list () const |
Create a list of supported sample formats for current audio codec. More... | |
AVCodecID | subtitle_codec (AVCodecID codec_id) const |
Get subtitle codec_id. More... | |
Protected Attributes | |
std::string | m_format_name |
Descriptive name of the format. Descriptive name of the format, e.g. "opus", "mpegts". Please note that m_format_name is used to select the FFmpeg container by passing it to avformat_alloc_output_context2(). Mostly, but not always, same as m_fileext. More... | |
std::string | m_fileext |
File extension: mp4, mp3, flac or other. Mostly, but not always, same as m_format_name. More... | |
FORMAT_MAP | m_format_map |
Format definition (audio/videocodec, sample format) More... | |
bool | m_albumart_supported |
true if album arts are supported (eg. mp3) or false if not (e.g. wav, aiff) More... | |
Friends | |
class | FFmpegfs_Format |
Format options: Defines file extension, codecs etc. for each format.
Definition at line 262 of file ffmpeg_utils.h.
typedef std::vector<AVCodecID> Format_Options::CODEC_VECT |
Vector with valid codec ids for file format.
Definition at line 266 of file ffmpeg_utils.h.
typedef struct Format_Options::_tagFORMAT Format_Options::FORMAT |
Format options: Audio/video codecs and sample format
typedef std::map<SAMPLE_FMT, const FORMAT> Format_Options::FORMAT_MAP |
Map of formats. One entry per format derivative.
Definition at line 279 of file ffmpeg_utils.h.
Format_Options::Format_Options | ( | ) |
Construct Format_Options object with defaults (empty)
Definition at line 124 of file ffmpeg_utils.cc.
References FMT_DONTCARE.
Format_Options::Format_Options | ( | std::string | format_name, |
std::string | fileext, | ||
FORMAT_MAP | format, | ||
bool | albumart_supported | ||
) |
Construct Format_Options object.
[in] | format_name | - Descriptive name of the format, e.g. "Opus Audio", |
[in] | fileext | - File extension: mp4, mp3, flac or other |
[in] | format | - Format options: Possible audio/video codecs and sample formats |
[in] | albumart_supported | - true if album arts are supported (eg. mp3) or false if not (e.g. wav, aiff |
Definition at line 130 of file ffmpeg_utils.cc.
AVCodecID Format_Options::audio_codec | ( | ) | const |
Get audio codec_id.
Definition at line 197 of file ffmpeg_utils.cc.
References FFMPEGFS_PARAMS::m_audio_codec, m_format_map, FFMPEGFS_PARAMS::m_sample_fmt, and params.
Referenced by FFmpegfs_Format::audio_codec().
std::string Format_Options::audio_codec_list | ( | ) | const |
Create a list of supported audio codecs for current audio codec.
Definition at line 230 of file ffmpeg_utils.cc.
References get_audio_codec_text(), m_format_map, FFMPEGFS_PARAMS::m_sample_fmt, and params.
Referenced by FFmpegfs_Format::audio_codec_list().
const std::string & Format_Options::fileext | ( | ) | const |
Get file extension.
const std::string & Format_Options::format_name | ( | ) | const |
Convert destination type to "real" type, i.e., the file extension to be used.
bool Format_Options::is_audio_codec_supported | ( | AVCodecID | codec_id | ) | const |
Check if audio codec/file format combination is supported.
[in] | codec_id | - Codec ID to check |
Definition at line 214 of file ffmpeg_utils.cc.
References m_format_map, FFMPEGFS_PARAMS::m_sample_fmt, and params.
Referenced by FFmpegfs_Format::is_audio_codec_supported().
bool Format_Options::is_sample_fmt_supported | ( | ) | const |
Check if audio codec/sample format combination is supported.
Definition at line 261 of file ffmpeg_utils.cc.
References m_format_map, FFMPEGFS_PARAMS::m_sample_fmt, and params.
Referenced by FFmpegfs_Format::is_sample_fmt_supported().
bool Format_Options::is_video_codec_supported | ( | AVCodecID | codec_id | ) | const |
Check if video codec/file format combination is supported.
[in] | codec_id | - Codec ID to check |
Definition at line 161 of file ffmpeg_utils.cc.
References m_format_map, FFMPEGFS_PARAMS::m_sample_fmt, and params.
Referenced by FFmpegfs_Format::is_video_codec_supported().
std::string Format_Options::sample_fmt_list | ( | ) | const |
Create a list of supported sample formats for current audio codec.
Definition at line 267 of file ffmpeg_utils.cc.
References get_sampleformat_text(), and m_format_map.
Referenced by FFmpegfs_Format::sample_fmt_list().
AVSampleFormat Format_Options::sample_format | ( | ) | const |
Get sample format (bit width)
Definition at line 250 of file ffmpeg_utils.cc.
References m_format_map, FFMPEGFS_PARAMS::m_sample_fmt, and params.
Referenced by FFmpegfs_Format::sample_format().
AVCodecID Format_Options::subtitle_codec | ( | AVCodecID | codec_id | ) | const |
Get subtitle codec_id.
[in] | codec_id | - Input stream codec ID |
Definition at line 283 of file ffmpeg_utils.cc.
References is_text_codec(), m_format_map, FFMPEGFS_PARAMS::m_sample_fmt, and params.
Referenced by FFmpegfs_Format::subtitle_codec().
AVCodecID Format_Options::video_codec | ( | ) | const |
Get video codec_id.
Definition at line 144 of file ffmpeg_utils.cc.
References m_format_map, FFMPEGFS_PARAMS::m_sample_fmt, FFMPEGFS_PARAMS::m_video_codec, and params.
Referenced by FFmpegfs_Format::video_codec().
std::string Format_Options::video_codec_list | ( | ) | const |
Create a list of supported audio codecs for current audio codec.
Definition at line 177 of file ffmpeg_utils.cc.
References get_video_codec_text(), m_format_map, FFMPEGFS_PARAMS::m_sample_fmt, and params.
Referenced by FFmpegfs_Format::video_codec_list().
|
friend |
Definition at line 264 of file ffmpeg_utils.h.
|
protected |
true if album arts are supported (eg. mp3) or false if not (e.g. wav, aiff)
Definition at line 381 of file ffmpeg_utils.h.
Referenced by FFmpegfs_Format::albumart_supported().
|
protected |
File extension: mp4, mp3, flac or other. Mostly, but not always, same as m_format_name.
Definition at line 379 of file ffmpeg_utils.h.
Referenced by FFmpegfs_Format::fileext().
|
protected |
Format definition (audio/videocodec, sample format)
Definition at line 380 of file ffmpeg_utils.h.
Referenced by audio_codec(), audio_codec_list(), is_audio_codec_supported(), is_sample_fmt_supported(), is_video_codec_supported(), sample_fmt_list(), sample_format(), subtitle_codec(), video_codec(), and video_codec_list().
|
protected |
Descriptive name of the format. Descriptive name of the format, e.g. "opus", "mpegts". Please note that m_format_name is used to select the FFmpeg container by passing it to avformat_alloc_output_context2(). Mostly, but not always, same as m_fileext.
Definition at line 378 of file ffmpeg_utils.h.
Referenced by FFmpegfs_Format::format_name().