FFmpegfs Fuse Multi Media Filesystem 2.16
|
Main include for FFmpegfs project. More...
Go to the source code of this file.
Classes | |
struct | FFMPEGFS_PARAMS |
Global program parameters. More... | |
Macros | |
#define | FUSE_USE_VERSION 26 |
Requested minimum FUSE version. More... | |
Typedefs | |
typedef std::multimap< AVCodecID, int > | HWACCEL_BLOCKED_MAP |
Map command line option to AVCodecID. More... | |
Enumerations | |
enum class | HWACCELAPI { NONE , VAAPI , MMAL , OMX } |
Hardware acceleration types. More... | |
Functions | |
void | init_fuse_ops () |
Initialise FUSE operation structure. More... | |
void | transcoder_cache_path (std::string *path) |
Get transcoder cache path. More... | |
bool | transcoder_init () |
Initialise transcoder, create cache. More... | |
void | transcoder_free () |
Free transcoder. More... | |
bool | transcoder_cache_maintenance () |
Run cache maintenance. More... | |
bool | transcoder_cache_clear () |
Clear transcoder cache. More... | |
LPVIRTUALFILE | insert_file (VIRTUALTYPE type, const std::string &virtfile, const struct stat *stbuf, int flags=VIRTUALFLAG_NONE) |
Add new virtual file to internal list. More... | |
LPVIRTUALFILE | insert_file (VIRTUALTYPE type, const std::string &virtfile, const std::string &origfile, const struct stat *stbuf, int flags=VIRTUALFLAG_NONE) |
Add new virtual file to internal list. If the file already exists, it will be updated. More... | |
LPVIRTUALFILE | insert_dir (VIRTUALTYPE type, const std::string &virtdir, const struct stat *stbuf, int flags=VIRTUALFLAG_NONE) |
Add new virtual directory to the internal list. If the file already exists, it will be updated. More... | |
LPVIRTUALFILE | find_file (const std::string &virtfile) |
Find file in cache. More... | |
LPVIRTUALFILE | find_file_from_orig (const std::string &origfile) |
Look for the file in the cache. More... | |
bool | check_path (const std::string &path) |
Check if the path has already been parsed. Only useful if for DVD, Blu-ray or VCD where it is guaranteed that all files have been parsed whenever the directory is in the hash. More... | |
int | load_path (const std::string &path, const struct stat *statbuf, void *buf, fuse_fill_dir_t filler) |
Load a path with virtual files for FUSE. More... | |
LPVIRTUALFILE | find_original (const std::string &origpath) |
Given the destination (post-transcode) file name, determine the parent of the file to be transcoded. More... | |
LPVIRTUALFILE | find_original (std::string *filepath) |
Given the destination (post-transcode) file name, determine the name of the original file to be transcoded. More... | |
LPVIRTUALFILE | find_parent (const std::string &origpath) |
Given the destination (post-transcode) file name, determine the parent of the file to be transcoded. More... | |
std::string | get_sampleformat_text (SAMPLE_FMT sample_fmt) |
Convert SAMPLE_FMT enum to human readable text. More... | |
std::string | get_audio_codec_text (AVCodecID audio_codec) |
Convert AVCodecID enum for audio codec to human readable text. More... | |
std::string | get_video_codec_text (AVCodecID video_codec) |
Convert AVCodecID enum for video codec to human readable text. More... | |
std::string | get_autocopy_text (AUTOCOPY autocopy) |
Convert AUTOCOPY enum to human readable text. More... | |
std::string | get_recodesame_text (RECODESAME recode) |
Convert RECODESAME enum to human readable text. More... | |
std::string | get_profile_text (PROFILE profile) |
Convert PROFILE enum to human readable text. More... | |
std::string | get_level_text (PRORESLEVEL level) |
Convert PRORESLEVEL enum to human readable text. More... | |
std::string | get_hwaccel_API_text (HWACCELAPI hwaccel_API) |
Get the selected hardware acceleration as text. More... | |
bool | check_hwaccel_dec_blocked (AVCodecID codec_id, int profile) |
Check if codec_id and the optional profile are in the block list. More... | |
int | add_fuse_entry (void *buf, fuse_fill_dir_t filler, const std::string &name, const struct stat *stbuf, off_t off) |
Wrapper to the Fuse filler function. More... | |
int | add_dotdot (void *buf, fuse_fill_dir_t filler, const struct stat *stbuf, off_t off) |
Make dot and double dot entries for a virtual directory. More... | |
Variables | |
FFMPEGFS_FORMAT_ARR | ffmpeg_format |
Two FFmpegfs_Format infos, 0: video file, 1: audio file. More... | |
struct FFMPEGFS_PARAMS | params |
Command line parameters. | |
bool | docker_client |
True if running inside a Docker container. More... | |
fuse_operations | ffmpegfs_ops |
Fuse operations struct. More... | |
std::unique_ptr< thread_pool > | tp |
Thread pool object. More... | |
Main include for FFmpegfs project.
Definition in file ffmpegfs.h.
#define FUSE_USE_VERSION 26 |
Requested minimum FUSE version.
Definition at line 100 of file ffmpegfs.h.
typedef std::multimap<AVCodecID, int> HWACCEL_BLOCKED_MAP |
Map command line option to AVCodecID.
Definition at line 158 of file ffmpegfs.h.
|
strong |
Hardware acceleration types.
Enumerator | |
---|---|
VAAPI | Intel: VAAPI |
MMAL | Raspberry: MMAL |
OMX | Raspberry: OpenMAX |
Definition at line 123 of file ffmpegfs.h.
int add_dotdot | ( | void * | buf, |
fuse_fill_dir_t | filler, | ||
const struct stat * | stbuf, | ||
off_t | off | ||
) |
Make dot and double dot entries for a virtual directory.
[in,out] | buf | - The buffer passed to the readdir() operation. May be nullptr. |
[in] | filler | - Function pointer to the Fuse update function. May be nullptr. |
[in] | stbuf | - File attributes. May be nullptr. |
[in] | off | - Offset of the next entry or zero. |
Definition at line 2416 of file fuseops.cc.
References add_fuse_entry(), and init_stat().
Referenced by check_bluray(), check_dvd(), check_vcd(), and ffmpegfs_readdir().
int add_fuse_entry | ( | void * | buf, |
fuse_fill_dir_t | filler, | ||
const std::string & | name, | ||
const struct stat * | stbuf, | ||
off_t | off | ||
) |
Wrapper to the Fuse filler function.
[in,out] | buf | - The buffer passed to the readdir() operation. May be nullptr. |
[in] | filler | - Function pointer to the Fuse update function. May be nullptr. |
[in] | name | - The file name of the directory entry. Do not include the path! |
[in] | stbuf | - File attributes, can be nullptr. |
[in] | off | - Offset of the next entry or zero. |
Definition at line 2406 of file fuseops.cc.
Referenced by add_dotdot(), create_bluray_virtualfile(), create_dvd_virtualfile(), create_vcd_virtualfile(), ffmpegfs_readdir(), load_path(), and make_file().
bool check_hwaccel_dec_blocked | ( | AVCodecID | codec_id, |
int | profile | ||
) |
Check if codec_id and the optional profile are in the block list.
[in] | codec_id | - Codec ID to check |
[in] | profile | - Profile to check. Set to FF_PROFILE_UNKOWN to ignore. |
Definition at line 1585 of file ffmpegfs.cc.
References FFMPEGFS_PARAMS::m_hwaccel_dec_blocked, and params.
Referenced by FFmpeg_Transcoder::open_decoder().
bool check_path | ( | const std::string & | path | ) |
Check if the path has already been parsed. Only useful if for DVD, Blu-ray or VCD where it is guaranteed that all files have been parsed whenever the directory is in the hash.
[in] | path | - Path to parse. |
Definition at line 1752 of file fuseops.cc.
References filenames, and find_prefix().
Referenced by check_bluray(), check_cuesheet(), check_dvd(), and check_vcd().
LPVIRTUALFILE find_file | ( | const std::string & | virtfile | ) |
Find file in cache.
[in] | virtfile | - Virtual filename and path of file to find. |
Definition at line 1734 of file fuseops.cc.
References filenames, and sanitise_filepath().
Referenced by check_cuesheet(), FFmpeg_Transcoder::encode_finish(), and find_original().
LPVIRTUALFILE find_file_from_orig | ( | const std::string & | origfile | ) |
Look for the file in the cache.
[in] | origfile | - Filename and path of file to find. |
Definition at line 1743 of file fuseops.cc.
References rfilenames, and sanitise_filepath().
Referenced by check_cuesheet(), ffmpegfs_readdir(), and get_format().
LPVIRTUALFILE find_original | ( | const std::string & | origpath | ) |
Given the destination (post-transcode) file name, determine the parent of the file to be transcoded.
[in] | origpath | - The original file |
Definition at line 1894 of file fuseops.cc.
References find_original().
Referenced by ffmpegfs_fgetattr(), ffmpegfs_getattr(), ffmpegfs_open(), ffmpegfs_read(), ffmpegfs_readdir(), ffmpegfs_readlink(), ffmpegfs_statfs(), find_original(), and find_parent().
LPVIRTUALFILE find_original | ( | std::string * | filepath | ) |
Given the destination (post-transcode) file name, determine the name of the original file to be transcoded.
[in,out] | filepath | - Input the original file, output name of transcoded file. |
<*
Definition at line 1900 of file fuseops.cc.
References append_filename(), AUDIO, DISK, Logging::error(), ffmpeg_format, find_ext(), find_file(), insert_file(), VIRTUALFILE::m_origfile, params, remove_ext(), remove_filename(), remove_path(), sanitise_filepath(), scandir(), selector(), FFMPEGFS_PARAMS::smart_transcode(), strcasecmp(), VIDEO, and VIRTUALFLAG_PASSTHROUGH.
LPVIRTUALFILE find_parent | ( | const std::string & | origpath | ) |
Given the destination (post-transcode) file name, determine the parent of the file to be transcoded.
[in] | origpath | - The original file |
Definition at line 1982 of file fuseops.cc.
References find_original(), remove_filename(), and remove_sep().
Referenced by ffmpegfs_getattr(), and ffmpegfs_open().
std::string get_audio_codec_text | ( | AVCodecID | audio_codec | ) |
Convert AVCodecID enum for audio codec to human readable text.
[in] | audio_codec | - AVCodecID enum value to convert. |
Definition at line 1236 of file ffmpegfs.cc.
References audiocodec_map, and search_by_value().
Referenced by Format_Options::audio_codec_list().
std::string get_autocopy_text | ( | AUTOCOPY | autocopy | ) |
Convert AUTOCOPY enum to human readable text.
[in] | autocopy | - AUTOCOPY enum value to convert. |
Definition at line 1256 of file ffmpegfs.cc.
References autocopy_map, and search_by_value().
std::string get_hwaccel_API_text | ( | HWACCELAPI | hwaccel_API | ) |
Get the selected hardware acceleration as text.
[in] | hwaccel_API | - Hardware acceleration buffering API. |
Definition at line 1603 of file ffmpegfs.cc.
References hwaccel_map.
Referenced by FFmpeg_Transcoder::add_stream(), FFmpeg_Transcoder::open_bestmatch_video(), and FFmpeg_Transcoder::open_decoder().
std::string get_level_text | ( | PRORESLEVEL | level | ) |
Convert PRORESLEVEL enum to human readable text.
[in] | level | - PRORESLEVEL enum value to convert. |
Definition at line 1396 of file ffmpegfs.cc.
References prores_level_map, and search_by_value().
std::string get_profile_text | ( | PROFILE | profile | ) |
Convert PROFILE enum to human readable text.
[in] | profile | - PROFILE enum value to convert. |
Definition at line 1348 of file ffmpegfs.cc.
References profile_map, and search_by_value().
std::string get_recodesame_text | ( | RECODESAME | recode | ) |
Convert RECODESAME enum to human readable text.
[in] | recode | - RECODESAME enum value to convert. |
Definition at line 1302 of file ffmpegfs.cc.
References recode_map, and search_by_value().
std::string get_sampleformat_text | ( | SAMPLE_FMT | sample_fmt | ) |
Convert SAMPLE_FMT enum to human readable text.
Definition at line 861 of file ffmpegfs.cc.
References sample_fmt_map, and search_by_value().
Referenced by Format_Options::sample_fmt_list().
std::string get_video_codec_text | ( | AVCodecID | video_codec | ) |
Convert AVCodecID enum for video codec to human readable text.
[in] | video_codec | - AVCodecID enum value to convert. |
Definition at line 1246 of file ffmpegfs.cc.
References search_by_value(), and videocodec_map.
Referenced by Format_Options::video_codec_list().
void init_fuse_ops | ( | ) |
Initialise FUSE operation structure.
Definition at line 247 of file fuseops.cc.
References ffmpegfs_destroy(), ffmpegfs_fgetattr(), ffmpegfs_getattr(), ffmpegfs_init(), ffmpegfs_open(), ffmpegfs_ops, ffmpegfs_read(), ffmpegfs_readdir(), ffmpegfs_readlink(), ffmpegfs_release(), and ffmpegfs_statfs().
Referenced by main().
LPVIRTUALFILE insert_dir | ( | VIRTUALTYPE | type, |
const std::string & | virtdir, | ||
const struct stat * | stbuf, | ||
int | flags = VIRTUALFLAG_NONE |
||
) |
Add new virtual directory to the internal list. If the file already exists, it will be updated.
[in] | type | - Type of virtual file. |
[in] | virtdir | - Name of virtual directory. |
[in] | stbuf | - stat buffer with file size, time etc. |
[in] | flags | - One of the VIRTUALFLAG_* flags to control the detailed behaviour. |
Definition at line 1717 of file fuseops.cc.
References append_sep(), flags_to_dir(), insert_file(), and stat_to_dir().
Referenced by create_bluray_virtualfile(), create_cuesheet_virtualfile(), create_dvd_virtualfile(), create_vcd_virtualfile(), and parse_cuesheet().
LPVIRTUALFILE insert_file | ( | VIRTUALTYPE | type, |
const std::string & | virtfile, | ||
const std::string & | origfile, | ||
const struct stat * | stbuf, | ||
int | flags = VIRTUALFLAG_NONE |
||
) |
Add new virtual file to internal list. If the file already exists, it will be updated.
[in] | type | - Type of virtual file. |
[in] | virtfile | - Name of virtual file. |
[in] | origfile | - Original file name. |
[in] | stbuf | - stat buffer with file size, time etc. |
[in] | flags | - One of the VIRTUALFLAG_* flags to control the detailed behaviour. |
Definition at line 1643 of file fuseops.cc.
References filenames, guess_format_idx(), insert(), FFMPEGFS_PARAMS::m_basepath, VIRTUALFILE::m_destfile, VIRTUALFILE::m_flags, VIRTUALFILE::m_format_idx, FFMPEGFS_PARAMS::m_mountpath, VIRTUALFILE::m_origfile, VIRTUALFILE::m_st, VIRTUALFILE::m_type, VIRTUALFILE::m_virtfile, params, replace_start(), and sanitise_filepath().
LPVIRTUALFILE insert_file | ( | VIRTUALTYPE | type, |
const std::string & | virtfile, | ||
const struct stat * | stbuf, | ||
int | flags = VIRTUALFLAG_NONE |
||
) |
Add new virtual file to internal list.
For Blu-ray/DVD/VCD, actually, no physical input file exists, so virtual and origfile are the same.
The input file is handled by the BlurayIO or VcdIO classes.
For cue sheets, the original (huge) input file is used. Start positions are sought; end positions are reported as EOF.
[in] | type | - Type of virtual file. |
[in] | virtfile | - Name of virtual file. |
[in] | stbuf | - stat buffer with file size, time etc. |
[in] | flags | - One of the VIRTUALFLAG_* flags to control the detailed behaviour. |
Definition at line 1638 of file fuseops.cc.
References insert_file().
Referenced by create_bluray_virtualfile(), create_cuesheet_virtualfile(), create_dvd_virtualfile(), create_vcd_virtualfile(), ffmpegfs_getattr(), ffmpegfs_readdir(), find_original(), insert_dir(), insert_file(), and make_file().
int load_path | ( | const std::string & | path, |
const struct stat * | statbuf, | ||
void * | buf, | ||
fuse_fill_dir_t | filler | ||
) |
Load a path with virtual files for FUSE.
[in] | path | - Physical path to load. |
[in] | statbuf | - stat buffer to load. |
[in] | buf | - FUSE buffer to fill. |
[in] | filler | - Filler function. |
Definition at line 1759 of file fuseops.cc.
References add_fuse_entry(), BLURAY, FFMPEGFS_PARAMS::current_format(), DVD, FFmpegfs_Format::fileext(), filenames, VIRTUALFILE::m_destfile, VIRTUALFILE::m_flags, VIRTUALFILE::m_st, VIRTUALFILE::m_type, Buffer::make_cachefile_name(), params, remove_filename(), remove_path(), remove_sep(), stat_set_size(), VCD, VIRTUALFLAG_CUESHEET, and VIRTUALFLAG_DIRECTORY.
Referenced by check_bluray(), check_dvd(), check_vcd(), and ffmpegfs_readdir().
bool transcoder_cache_clear | ( | ) |
Clear transcoder cache.
Definition at line 755 of file transcode.cc.
References cache.
bool transcoder_cache_maintenance | ( | ) |
Run cache maintenance.
Definition at line 743 of file transcode.cc.
References cache.
Referenced by main(), and maintenance_handler().
void transcoder_cache_path | ( | std::string * | path | ) |
Get transcoder cache path.
[out] | path | - Path to transcoder cache. |
Definition at line 195 of file transcode.cc.
References append_sep(), expand_path(), FFMPEGFS_PARAMS::m_cachepath, and params.
Referenced by Cache::load_index(), Buffer::make_cachefile_name(), print_params(), and Logging::Logger::~Logger().
void transcoder_free | ( | ) |
Free transcoder.
Definition at line 251 of file transcode.cc.
References cache, and Logging::debug().
Referenced by ffmpegfs_destroy().
bool transcoder_init | ( | ) |
Initialise transcoder, create cache.
Definition at line 229 of file transcode.cc.
References cache, Logging::debug(), and Logging::error().
Referenced by main().
|
extern |
True if running inside a Docker container.
Definition at line 98 of file fuseops.cc.
Referenced by ffmpegfs_init(), ffmpegfs_opt_proc(), and main().
|
extern |
Two FFmpegfs_Format infos, 0: video file, 1: audio file.
Definition at line 73 of file ffmpegfs.cc.
Referenced by create_bluray_virtualfile(), create_cuesheet_virtualfile(), create_dvd_virtualfile(), create_vcd_virtualfile(), FFMPEGFS_PARAMS::current_format(), ffmpegfs_getattr(), find_original(), flags_to_dir(), get_format(), guess_format_idx(), main(), print_params(), set_defaults(), and FFMPEGFS_PARAMS::smart_transcode().
|
extern |
Fuse operations struct.
Fuse operations struct.
Definition at line 100 of file fuseops.cc.
Referenced by init_fuse_ops().
|
extern |
Thread pool object.
Definition at line 102 of file fuseops.cc.
Referenced by ffmpegfs_destroy(), ffmpegfs_init(), thread_pool::loop_function_starter(), and transcoder_new().