|
Blender V5.0
|
#include <cstdlib>#include "MEM_guardedalloc.h"#include "BLI_endian_defines.h"#include "BLI_endian_switch.h"#include "BLI_fileops.h"#include "BLI_math_base.h"#include "BLI_math_base.hh"#include "BLI_path_utils.hh"#include "BLI_string.h"#include "BLI_string_utils.hh"#include "BLI_threads.h"#include "BLI_time.h"#include "BLI_utildefines.h"#include "CLG_log.h"#include "MOV_read.hh"#include "ffmpeg_swscale.hh"#include "movie_proxy_indexer.hh"#include "movie_read.hh"#include "movie_util.hh"Go to the source code of this file.
Macros | |
| #define | INDEX_FILE_VERSION 2 |
Functions | |
| static MovieIndex * | movie_index_open (const char *filepath) |
| static void | movie_index_free (MovieIndex *idx) |
| static int | proxy_size_to_array_index (IMB_Proxy_Size pr_size) |
| static void | get_index_dir (const MovieReader *anim, char *index_dir, size_t index_dir_maxncpy) |
| static bool | get_proxy_filepath (const MovieReader *anim, IMB_Proxy_Size preview_size, char *filepath, bool temp) |
| static void | get_tc_filepath (MovieReader *anim, IMB_Timecode_Type tc, char *filepath) |
| MovieProxyBuilder * | MOV_proxy_builder_start (MovieReader *anim, IMB_Timecode_Type tcs_in_use, int proxy_sizes_in_use, int quality, const bool overwrite, blender::Set< std::string > *processed_paths, bool build_only_on_bad_performance) |
| void | MOV_proxy_builder_process (MovieProxyBuilder *context, bool *stop, bool *do_update, float *progress) |
| void | MOV_proxy_builder_finish (MovieProxyBuilder *context, const bool stop) |
| void | MOV_close_proxies (MovieReader *anim) |
| void | MOV_set_custom_proxy_dir (MovieReader *anim, const char *dir) |
| MovieReader * | movie_open_proxy (MovieReader *anim, IMB_Proxy_Size preview_size) |
| const MovieIndex * | movie_open_index (MovieReader *anim, IMB_Timecode_Type tc) |
| int | MOV_calc_frame_index_with_timecode (MovieReader *anim, IMB_Timecode_Type tc, int position) |
| int | MOV_get_existing_proxies (const MovieReader *anim) |
Variables | |
| static CLG_LogRef | LOG = {"video.proxy"} |
| static const char | binary_header_str [] = "BlenMIdx" |
| static const IMB_Proxy_Size | proxy_sizes [] |
| static const float | proxy_fac [] = {0.25, 0.50, 0.75, 1.00} |
| #define INDEX_FILE_VERSION 2 |
Definition at line 52 of file movie_proxy_indexer.cc.
Referenced by movie_index_open().
|
static |
Definition at line 287 of file movie_proxy_indexer.cc.
References BLI_path_join, BLI_path_split_dir_file(), BLI_strncpy(), dirname(), FILE_MAXDIR, FILE_MAXFILE, MovieReader::filepath, and MovieReader::index_dir.
Referenced by get_proxy_filepath(), and get_tc_filepath().
|
static |
Definition at line 300 of file movie_proxy_indexer.cc.
References BLI_assert, BLI_path_join, BLI_path_ncmp, FILE_MAXDIR, FILE_MAXFILE, MovieReader::filepath, get_index_dir(), i, name, proxy_fac, proxy_size_to_array_index(), SNPRINTF, MovieReader::streamindex, and MovieReader::suffix.
Referenced by MOV_get_existing_proxies(), MOV_proxy_builder_start(), and movie_open_proxy().
|
static |
Definition at line 332 of file movie_proxy_indexer.cc.
References BLI_path_join, FILE_MAXDIR, FILE_MAXFILE, get_index_dir(), i, IMB_TC_RECORD_RUN_NO_GAPS, SNPRINTF, MovieReader::streamindex, and MovieReader::suffix.
Referenced by movie_open_index().
| int MOV_calc_frame_index_with_timecode | ( | MovieReader * | anim, |
| IMB_Timecode_Type | tc, | ||
| int | position ) |
Given a frame index, calculate final frame index taking timecode into account.
This does nothing (returns input frame position) if IMB_TC_NONE is used, or movie proxy/index file is not built.
When a timecode index file is present and is requested to be used, this can return a different frame index than input frame, particularly for IMB_TC_RECORD_RUN_NO_GAPS.
Definition at line 1305 of file movie_proxy_indexer.cc.
References MovieIndex::get_frame_index(), and movie_open_index().
Referenced by MOV_decode_frame(), and blender::seq::seq_proxy_fetch().
| void MOV_close_proxies | ( | MovieReader * | anim | ) |
Close any internally opened proxies of this movie.
Definition at line 1210 of file movie_proxy_indexer.cc.
References i, IMB_PROXY_MAX_SLOT, MovieReader::indices_tried, MOV_close(), movie_index_free(), MovieReader::no_gaps, MovieReader::proxies_tried, MovieReader::proxy_anim, and MovieReader::record_run.
Referenced by MOV_close(), MOV_set_custom_proxy_dir(), proxy_endjob(), and blender::seq::proxy_rebuild_finish().
| int MOV_get_existing_proxies | ( | const MovieReader * | anim | ) |
Queries which proxies exist for this movie.
Note that it does not check whether proxies are up to date, or valid files; just merely whether the expected files exist.
Returns bitmask of IMB_Proxy_Size flags.
Definition at line 1316 of file movie_proxy_indexer.cc.
References BLI_exists(), FILE_MAX, get_proxy_filepath(), i, IMB_PROXY_MAX_SLOT, IMB_PROXY_NONE, and proxy_sizes.
Referenced by MOV_proxy_builder_start(), and blender::seq::seq_proxy_need_rebuild().
| void MOV_proxy_builder_finish | ( | MovieProxyBuilder * | context, |
| bool | stop ) |
Finish building proxies / time-codes indices, and delete the builder.
Definition at line 1199 of file movie_proxy_indexer.cc.
References proxy_sizes, and UNUSED_VARS.
Referenced by proxy_endjob(), and blender::seq::proxy_rebuild_finish().
| void MOV_proxy_builder_process | ( | MovieProxyBuilder * | context, |
| bool * | stop, | ||
| bool * | do_update, | ||
| float * | progress ) |
Will rebuild all used indices and proxies at once.
Definition at line 1181 of file movie_proxy_indexer.cc.
References UNUSED_VARS.
Referenced by do_movie_proxy(), and blender::seq::proxy_rebuild().
| MovieProxyBuilder * MOV_proxy_builder_start | ( | MovieReader * | anim, |
| IMB_Timecode_Type | tcs_in_use, | ||
| int | proxy_sizes_in_use, | ||
| int | quality, | ||
| const bool | overwrite, | ||
| blender::Set< std::string > * | processed_paths, | ||
| bool | build_only_on_bad_performance ) |
Initialize movie proxies / time-code indices builder.
Definition at line 1117 of file movie_proxy_indexer.cc.
References blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add(), CLOG_INFO_NOCHECK, FILE_MAX, get_proxy_filepath(), i, IMB_PROXY_MAX_SLOT, LOG, MOV_get_existing_proxies(), proxy_sizes, MovieReader::state, UNUSED_VARS, and MovieReader::Valid.
Referenced by clip_rebuild_proxy_exec(), and blender::seq::proxy_rebuild_context().
| void MOV_set_custom_proxy_dir | ( | MovieReader * | anim, |
| const char * | dir ) |
Custom directory to be used for loading or building proxies. By default "BL_proxy" within the directory of the movie file is used.
Definition at line 1236 of file movie_proxy_indexer.cc.
References MovieReader::index_dir, MOV_close_proxies(), STREQ, and STRNCPY().
Referenced by movieclip_open_anim_file(), and blender::seq::seq_proxy_index_dir_set().
|
static |
Definition at line 259 of file movie_proxy_indexer.cc.
Referenced by MOV_close_proxies().
|
static |
Definition at line 126 of file movie_proxy_indexer.cc.
References B_ENDIAN, binary_header_str, BLI_assert, BLI_endian_switch_int32(), BLI_endian_switch_uint64(), BLI_fopen(), CLOG_ERROR, ELEM, MovieIndex::entries, MovieIndex::filepath, i, INDEX_FILE_VERSION, L_ENDIAN, LOG, pad, Vector< T, InlineBufferCapacity, Allocator >::resize(), and STRNCPY().
Referenced by movie_open_index().
| const MovieIndex * movie_open_index | ( | MovieReader * | anim, |
| IMB_Timecode_Type | tc ) |
Definition at line 1276 of file movie_proxy_indexer.cc.
References FILE_MAX, get_tc_filepath(), IMB_TC_RECORD_RUN, IMB_TC_RECORD_RUN_NO_GAPS, MovieReader::indices_tried, movie_index_open(), MovieReader::no_gaps, and MovieReader::record_run.
Referenced by MOV_calc_frame_index_with_timecode(), and MOV_get_duration_frames().
| MovieReader * movie_open_proxy | ( | MovieReader * | anim, |
| IMB_Proxy_Size | preview_size ) |
Definition at line 1246 of file movie_proxy_indexer.cc.
References MovieReader::colorspace, FILE_MAX, get_proxy_filepath(), i, MOV_open_file(), MovieReader::proxies_tried, MovieReader::proxy_anim, and proxy_size_to_array_index().
Referenced by MOV_decode_frame().
|
static |
Definition at line 264 of file movie_proxy_indexer.cc.
References BLI_assert_msg, IMB_PROXY_100, IMB_PROXY_25, IMB_PROXY_50, IMB_PROXY_75, and IMB_PROXY_NONE.
Referenced by get_proxy_filepath(), and movie_open_proxy().
|
static |
Definition at line 46 of file movie_proxy_indexer.cc.
Referenced by movie_index_open().
|
static |
Definition at line 35 of file movie_proxy_indexer.cc.
|
static |
Definition at line 50 of file movie_proxy_indexer.cc.
Referenced by get_proxy_filepath().
|
static |
Definition at line 48 of file movie_proxy_indexer.cc.
Referenced by MOV_get_existing_proxies(), MOV_proxy_builder_finish(), MOV_proxy_builder_start(), and blender::ed::vse::seq_get_proxy_size_flags().