100#define FUSE_USE_VERSION 26
105#pragma GCC diagnostic push
106#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
107#pragma GCC diagnostic ignored "-Wsign-conversion"
109#pragma GCC diagnostic pop
138#if HAVE_VULKAN_HWACCEL
278extern std::unique_ptr<thread_pool>
tp;
374int load_path(
const std::string & path,
const struct stat *statbuf,
void *buf, fuse_fill_dir_t filler);
459int add_fuse_entry(
void *buf, fuse_fill_dir_t filler,
const std::string & name,
const struct stat *stbuf, off_t off);
469int add_dotdot(
void *buf, fuse_fill_dir_t filler,
const struct stat *stbuf, off_t off);
@ NONE
No result code available.
Various FFmpegfs utility functions.
std::array< FFmpegfs_Format, 2 > FFMPEGFS_FORMAT_ARR
Array of FFmpegfs formats. There are two, for audio and video.
#define BITRATE
For FFmpeg bit rate is an int.
LPVIRTUALFILE find_file(const std::string &virtfile)
Find file in cache.
LPVIRTUALFILE find_parent(const std::string &origpath)
Given the destination (post-transcode) file name, determine the parent of the file to be transcoded.
std::string get_recodesame_text(RECODESAME recode)
Convert RECODESAME enum to human readable text.
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.
fuse_operations ffmpegfs_ops
Fuse operations struct.
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.
void transcoder_cache_path(std::string *path)
Get transcoder cache path.
bool docker_client
True if running inside a Docker container.
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.
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.
void transcoder_free()
Free transcoder.
std::string get_profile_text(PROFILE profile)
Convert PROFILE enum to human readable text.
LPVIRTUALFILE find_original(const std::string &origpath)
Given the destination (post-transcode) file name, determine the parent of the file to be transcoded.
struct FFMPEGFS_PARAMS params
Command line parameters.
HWACCELAPI
Hardware acceleration types.
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 guarant...
std::string get_level_text(PRORESLEVEL level)
Convert PRORESLEVEL enum to human readable text.
std::string get_sampleformat_text(SAMPLE_FMT sample_fmt)
Convert SAMPLE_FMT enum to human readable text.
LPVIRTUALFILE find_file_from_orig(const std::string &origfile)
Look for the file in the cache.
bool transcoder_init()
Initialise transcoder, create cache.
LPVIRTUALFILE insert_file(VIRTUALTYPE type, const std::string &virtfile, const struct stat *stbuf, int flags=VIRTUALFLAG_NONE)
Add new virtual file to internal list.
std::string get_video_codec_text(AVCodecID video_codec)
Convert AVCodecID enum for video codec to human readable text.
std::multimap< AVCodecID, int > HWACCEL_BLOCKED_MAP
Map command line option to AVCodecID.
FFMPEGFS_FORMAT_ARR ffmpeg_format
Two FFmpegfs_Format infos, 0: video file, 1: audio file.
std::string get_autocopy_text(AUTOCOPY autocopy)
Convert AUTOCOPY enum to human readable text.
std::string get_audio_codec_text(AVCodecID audio_codec)
Convert AVCodecID enum for audio codec to human readable text.
bool check_hwaccel_dec_blocked(AVCodecID codec_id, int profile)
Check if codec_id and the optional profile are in the block list.
std::string get_hwaccel_API_text(HWACCELAPI hwaccel_API)
Get the selected hardware acceleration as text.
bool transcoder_cache_clear()
Clear transcoder cache.
bool transcoder_cache_maintenance()
Run cache maintenance.
void init_fuse_ops()
Initialise FUSE operation structure.
std::unique_ptr< thread_pool > tp
Thread pool object.
VIRTUALTYPE
Virtual file types enum.
VIRTUALFILE const * LPCVIRTUALFILE
Pointer to const version of VIRTUALFILE.
#define VIRTUALFLAG_NONE
No flags.
Global program parameters.
std::string m_scriptsource
Source script.
std::string m_hwaccel_enc_device
Encoder device. May be AUTO to auto detect or empty.
int m_log_stderr
Log output to standard error.
time_t m_cache_maintenance
Prune timer interval.
bool smart_transcode() const
Check for smart transcode mode.
AVHWDeviceType m_hwaccel_dec_device_type
Enable hardware acceleration buffering for decoder.
time_t m_max_inactive_suspend
Time (seconds) that must elapse without access until transcoding is suspended.
int m_deinterlace
1: deinterlace video, 0: no deinterlace
int m_decoding_errors
Break transcoding on decoding error.
int m_oldnamescheme
Use old output name scheme, can create duplicate filenames.
AVHWDeviceType m_hwaccel_enc_device_type
Enable hardware acceleration buffering for encoder.
time_t m_expiry_time
Time (seconds) after which an cache entry is deleted.
int m_no_subtitles
0: allow subtitles, 1: do no transcode subtitles
FFMPEGFS_PARAMS & operator=(const FFMPEGFS_PARAMS &other) noexcept
Make copy from other FFMPEGFS_PARAMS object.
int m_clear_cache
Clear cache on start up.
std::string m_hwaccel_dec_device
Decoder device. May be AUTO to auto detect or empty.
const FFmpegfs_Format * current_format(LPCVIRTUALFILE virtualfile) const
Get FFmpegfs_Format for a virtual file.
int m_audiochannels
Max. number of audio channels.
int64_t m_min_seek_time_diff
Minimum time diff from current to next requested segment to perform a seek, in AV_TIME_BASE fractiona...
int m_videowidth
Output video width.
BITRATE m_videobitrate
Output video bit rate (bits per second)
HWACCELAPI m_hwaccel_dec_API
Decoder API.
size_t m_prebuffer_size
Number of bytes that will be decoded before the output can be accessed.
int m_videoheight
Output video height.
time_t m_prebuffer_time
Playing time that will be decoded before the output can be accessed.
int64_t m_segment_duration
Duration of one HLS segment file, in AV_TIME_BASE fractional seconds.
BITRATE m_audiobitrate
Output audio bit rate (bits per second)
std::string m_cachepath
Disk cache path, defaults to $XDG_CACHE_HOME.
int m_prune_cache
Prune cache immediately.
RECODESAME m_recodesame
Recode to same format options.
SAMPLE_FMT m_sample_fmt
Sample format.
PROFILE m_profile
Target profile: Firefox, MS Edge/IE or other.
int m_audiosamplerate
Output audio sample rate (in Hz)
size_t m_max_cache_size
Max. cache size in MB. When exceeded, oldest entries will be pruned.
AVCodecID m_video_codec
Either AV_CODEC_ID_NONE for default, or a user selected codec.
unsigned int m_max_threads
Max. number of recoder threads.
int m_disable_cache
Disable cache.
std::unique_ptr< MATCHVEC > m_hide_extensions
Set of extensions to block/hide. Must be a pointer as the fuse API cannot handle advanced c++ objects...
time_t m_max_inactive_abort
Time (seconds) that must elapse without access until transcoding is aborted.
int m_min_dvd_chapter_duration
Min. DVD chapter duration. Shorter chapters will be ignored.
std::string m_logfile
Output filename if logging to file.
std::string m_log_maxlevel
Max. log level.
std::string m_mountpath
Mount path: Files from m_mountpath will be mapped to this directory.
AVCodecID m_audio_codec
Either AV_CODEC_ID_NONE for default, or a user selected codec.
PRORESLEVEL m_level
Level, currently proxy/hq/lt/HQ (ProRes only)
size_t m_min_diskspace
Min. diskspace required for cache.
int m_noalbumarts
Skip album arts.
int m_enablescript
Enable virtual script.
std::unique_ptr< MATCHVEC > m_include_extensions
Set of extensions to include. If empty, include all. Must be a pointer as the fuse API cannot handle ...
HWACCEL_BLOCKED_MAP * m_hwaccel_dec_blocked
List of blocked decoders and optional profiles.
int m_debug
Debug mode (stay in foreground.
std::string m_scriptfile
Script name.
int m_win_smb_fix
Experimental Windows fix for access to EOF at file open.
int m_log_syslog
Log output to system log.
std::string m_basepath
Base path: Files from this directory (including all sub directories) will be mapped to m_mountpath.
HWACCELAPI m_hwaccel_enc_API
Encoder API.
AUTOCOPY m_autocopy
Copy streams if codec matches.