FFmpegfs Fuse Multi Media Filesystem 2.16
|
The FFmpegfs_Format class. More...
#include <ffmpeg_utils.h>
Public Member Functions | |
FFmpegfs_Format () | |
Construct FFmpegfs_Format object. More... | |
bool | init (const std::string &desttype) |
Get codecs for the selected destination type. 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 & | desttype () const |
Get destination type. More... | |
const std::string & | fileext () const |
Get file extension. More... | |
FILETYPE | filetype () const |
Get selected filetype. 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... | |
bool | is_multiformat () const |
Check if this is some sort of multi file format (any of the following: is_frameset() or is_hls()). More... | |
bool | is_frameset () const |
Check for an export frame format. More... | |
bool | is_hls () const |
Check for HLS format. More... | |
bool | albumart_supported () const |
Check if album arts are supported. More... | |
Protected Attributes | |
const Format_Options | m_empty_options |
Set of empty (invalid) options as default. More... | |
const Format_Options * | m_cur_opts |
Currently selected options. Will never be nullptr. More... | |
std::string | m_desttype |
Destination type: mp4, mp3 or other. More... | |
FILETYPE | m_filetype |
File type, MP3, MP4, OPUS etc. More... | |
Static Protected Attributes | |
static const OPTIONS_MAP | m_options_map |
Map of options. One entry per supported destination type. More... | |
Private Types | |
typedef std::map< FILETYPE, const Format_Options > | OPTIONS_MAP |
Map of options. One entry per supported destination type. More... | |
The FFmpegfs_Format class.
Definition at line 387 of file ffmpeg_utils.h.
|
private |
Map of options. One entry per supported destination type.
Definition at line 389 of file ffmpeg_utils.h.
FFmpegfs_Format::FFmpegfs_Format | ( | ) |
Construct FFmpegfs_Format object.
Definition at line 862 of file ffmpeg_utils.cc.
bool FFmpegfs_Format::albumart_supported | ( | ) | const |
Check if album arts are supported.
Definition at line 928 of file ffmpeg_utils.cc.
References Format_Options::m_albumart_supported, and m_cur_opts.
Referenced by FFmpeg_Transcoder::open_output_filestreams().
AVCodecID FFmpegfs_Format::audio_codec | ( | ) | const |
Get audio codec_id.
Definition at line 948 of file ffmpeg_utils.cc.
References Format_Options::audio_codec(), and m_cur_opts.
Referenced by FFmpeg_Transcoder::calculate_predicted_filesize(), FFmpeg_Transcoder::can_copy_stream(), FFmpeg_Transcoder::open_output_filestreams(), and transcoder_set_filesize().
std::string FFmpegfs_Format::audio_codec_list | ( | ) | const |
Create a list of supported audio codecs for current audio codec.
Definition at line 958 of file ffmpeg_utils.cc.
References Format_Options::audio_codec_list(), and m_cur_opts.
const std::string & FFmpegfs_Format::desttype | ( | ) | const |
Get destination type.
Definition at line 893 of file ffmpeg_utils.cc.
References m_desttype.
Referenced by Cache_Entry::Cache_Entry(), FFmpeg_Transcoder::calculate_predicted_filesize(), init(), FFmpeg_Transcoder::open_output_file(), FFmpeg_Transcoder::open_output_filestreams(), transcode(), and transcoder_set_filesize().
const std::string & FFmpegfs_Format::fileext | ( | ) | const |
Get file extension.
Definition at line 903 of file ffmpeg_utils.cc.
References m_cur_opts, and Format_Options::m_fileext.
Referenced by FFmpeg_Transcoder::encode_finish(), ffmpegfs_getattr(), ffmpegfs_readdir(), load_path(), make_hls_fileset(), and virtual_name().
FILETYPE FFmpegfs_Format::filetype | ( | ) | const |
Get selected filetype.
Definition at line 908 of file ffmpeg_utils.cc.
References m_filetype.
Referenced by FFmpeg_Transcoder::calculate_predicted_filesize(), FFmpeg_Transcoder::open_output_file(), FFmpeg_Transcoder::open_output_filestreams(), FFmpeg_Transcoder::produce_audio_dts(), transcoder_read(), transcoder_set_filesize(), and FFmpeg_Transcoder::write_output_file_header().
const std::string & FFmpegfs_Format::format_name | ( | ) | const |
Convert destination type to "real" type, i.e., the file extension to be used.
Definition at line 898 of file ffmpeg_utils.cc.
References m_cur_opts, and Format_Options::m_format_name.
Referenced by FFmpeg_Transcoder::open_output_filestreams().
bool FFmpegfs_Format::init | ( | const std::string & | desttype | ) |
Get codecs for the selected destination type.
[in] | desttype | - Destination type (MP4, WEBM etc.). |
Definition at line 869 of file ffmpeg_utils.cc.
References desttype(), get_filetype(), m_desttype, m_filetype, and m_options_map.
bool FFmpegfs_Format::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 953 of file ffmpeg_utils.cc.
References Format_Options::is_audio_codec_supported(), and m_cur_opts.
bool FFmpegfs_Format::is_frameset | ( | ) | const |
Check for an export frame format.
Definition at line 918 of file ffmpeg_utils.cc.
References m_filetype.
Referenced by ffmpegfs_getattr(), ffmpegfs_readdir(), FFmpeg_Transcoder::is_frameset(), and is_multiformat().
bool FFmpegfs_Format::is_hls | ( | ) | const |
Check for HLS format.
Definition at line 923 of file ffmpeg_utils.cc.
References m_filetype.
Referenced by ffmpegfs_getattr(), ffmpegfs_readdir(), FFmpeg_Transcoder::is_hls(), and is_multiformat().
bool FFmpegfs_Format::is_multiformat | ( | ) | const |
Check if this is some sort of multi file format (any of the following: is_frameset() or is_hls()).
Definition at line 913 of file ffmpeg_utils.cc.
References is_frameset(), and is_hls().
Referenced by ffmpegfs_getattr(), ffmpegfs_readdir(), FFmpeg_Transcoder::is_multiformat(), and virtual_name().
bool FFmpegfs_Format::is_sample_fmt_supported | ( | ) | const |
Check if audio codec/sample format combination is supported.
Definition at line 968 of file ffmpeg_utils.cc.
References Format_Options::is_sample_fmt_supported(), and m_cur_opts.
bool FFmpegfs_Format::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 938 of file ffmpeg_utils.cc.
References Format_Options::is_video_codec_supported(), and m_cur_opts.
std::string FFmpegfs_Format::sample_fmt_list | ( | ) | const |
Create a list of supported sample formats for current audio codec.
Definition at line 973 of file ffmpeg_utils.cc.
References m_cur_opts, and Format_Options::sample_fmt_list().
AVSampleFormat FFmpegfs_Format::sample_format | ( | ) | const |
Get sample format (bit width)
Definition at line 963 of file ffmpeg_utils.cc.
References m_cur_opts, and Format_Options::sample_format().
Referenced by FFmpeg_Transcoder::add_stream().
AVCodecID FFmpegfs_Format::subtitle_codec | ( | AVCodecID | codec_id | ) | const |
Get subtitle codec_id.
[in] | codec_id | - Input stream codec ID |
Definition at line 978 of file ffmpeg_utils.cc.
References m_cur_opts, and Format_Options::subtitle_codec().
Referenced by FFmpeg_Transcoder::add_external_subtitle_stream(), FFmpeg_Transcoder::add_subtitle_streams(), and FFmpeg_Transcoder::open_subtitles().
AVCodecID FFmpegfs_Format::video_codec | ( | ) | const |
Get video codec_id.
Definition at line 933 of file ffmpeg_utils.cc.
References m_cur_opts, and Format_Options::video_codec().
Referenced by FFmpeg_Transcoder::calculate_predicted_filesize(), FFmpeg_Transcoder::can_copy_stream(), FFmpeg_Transcoder::encode_image_frame(), ffmpegfs_readdir(), FFmpeg_Transcoder::open_bestmatch_video(), FFmpeg_Transcoder::open_output(), FFmpeg_Transcoder::open_output_file(), FFmpeg_Transcoder::open_output_filestreams(), FFmpeg_Transcoder::open_output_frame_set(), and transcoder_set_filesize().
std::string FFmpegfs_Format::video_codec_list | ( | ) | const |
Create a list of supported audio codecs for current audio codec.
Definition at line 943 of file ffmpeg_utils.cc.
References m_cur_opts, and Format_Options::video_codec_list().
|
protected |
Currently selected options. Will never be nullptr.
Definition at line 506 of file ffmpeg_utils.h.
Referenced by albumart_supported(), audio_codec(), audio_codec_list(), fileext(), format_name(), 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 |
Destination type: mp4, mp3 or other.
Definition at line 508 of file ffmpeg_utils.h.
Referenced by desttype(), and init().
|
protected |
Set of empty (invalid) options as default.
Definition at line 505 of file ffmpeg_utils.h.
|
protected |
File type, MP3, MP4, OPUS etc.
Definition at line 509 of file ffmpeg_utils.h.
Referenced by filetype(), init(), is_frameset(), and is_hls().
|
staticprotected |
Map of options. One entry per supported destination type.
Definition at line 507 of file ffmpeg_utils.h.
Referenced by init().