Blender V4.3
indexer.cc File Reference
#include <cstdlib>
#include "MEM_guardedalloc.h"
#include "BLI_array.hh"
#include "BLI_endian_defines.h"
#include "BLI_endian_switch.h"
#include "BLI_fileops.h"
#include "BLI_ghash.h"
#include "BLI_math_base.h"
#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 "BKE_writeffmpeg.hh"
#include "IMB_anim.hh"
#include "IMB_imbuf.hh"
#include "IMB_indexer.hh"
#include "imbuf.hh"

Go to the source code of this file.

Classes

struct  IndexBuildContext
 

Macros

#define INDEX_FILE_VERSION   2
 

Functions

anim_index_builderIMB_index_builder_create (const char *filepath)
 
void IMB_index_builder_add_entry (anim_index_builder *fp, int frameno, uint64_t seek_pos, uint64_t seek_pos_pts, uint64_t seek_pos_dts, uint64_t pts)
 
void IMB_index_builder_proc_frame (anim_index_builder *fp, uchar *buffer, int data_size, int frameno, uint64_t seek_pos, uint64_t seek_pos_pts, uint64_t seek_pos_dts, uint64_t pts)
 
void IMB_index_builder_finish (anim_index_builder *fp, int rollback)
 
ImBufAnimIndexIMB_indexer_open (const char *filepath)
 
uint64_t IMB_indexer_get_seek_pos (ImBufAnimIndex *idx, int frame_index)
 
uint64_t IMB_indexer_get_seek_pos_pts (ImBufAnimIndex *idx, int frame_index)
 
uint64_t IMB_indexer_get_seek_pos_dts (ImBufAnimIndex *idx, int frame_index)
 
int IMB_indexer_get_frame_index (ImBufAnimIndex *idx, int frameno)
 
uint64_t IMB_indexer_get_pts (ImBufAnimIndex *idx, int frame_index)
 
int IMB_indexer_get_duration (ImBufAnimIndex *idx)
 
int IMB_indexer_can_scan (ImBufAnimIndex *idx, int old_frame_index, int new_frame_index)
 
void IMB_indexer_close (ImBufAnimIndex *idx)
 
int IMB_proxy_size_to_array_index (IMB_Proxy_Size pr_size)
 
int IMB_timecode_to_array_index (IMB_Timecode_Type tc)
 
static void get_index_dir (ImBufAnim *anim, char *index_dir, size_t index_dir_maxncpy)
 
void IMB_anim_get_filename (ImBufAnim *anim, char *filename, int filename_maxncpy)
 
static bool get_proxy_filepath (ImBufAnim *anim, IMB_Proxy_Size preview_size, char *filepath, bool temp)
 
static void get_tc_filepath (ImBufAnim *anim, IMB_Timecode_Type tc, char *filepath)
 
IndexBuildContextIMB_anim_index_rebuild_context (ImBufAnim *anim, IMB_Timecode_Type tcs_in_use, int proxy_sizes_in_use, int quality, const bool overwrite, GSet *file_list, bool build_only_on_bad_performance)
 
void IMB_anim_index_rebuild (IndexBuildContext *context, bool *stop, bool *do_update, float *progress)
 
void IMB_anim_index_rebuild_finish (IndexBuildContext *context, const bool stop)
 
void IMB_free_indices (ImBufAnim *anim)
 
void IMB_anim_set_index_dir (ImBufAnim *anim, const char *dir)
 
ImBufAnimIMB_anim_open_proxy (ImBufAnim *anim, IMB_Proxy_Size preview_size)
 
ImBufAnimIndexIMB_anim_open_index (ImBufAnim *anim, IMB_Timecode_Type tc)
 
int IMB_anim_index_get_frame_index (ImBufAnim *anim, IMB_Timecode_Type tc, int position)
 
int IMB_anim_proxy_get_existing (ImBufAnim *anim)
 

Variables

static const char binary_header_str [] = "BlenMIdx"
 
static const char temp_ext [] = "_part"
 
static const IMB_Proxy_Size proxy_sizes []
 
static const float proxy_fac [] = {0.25, 0.50, 0.75, 1.00}
 

Macro Definition Documentation

◆ INDEX_FILE_VERSION

#define INDEX_FILE_VERSION   2

Definition at line 51 of file indexer.cc.

Referenced by IMB_index_builder_create(), and IMB_indexer_open().

Function Documentation

◆ get_index_dir()

static void get_index_dir ( ImBufAnim * anim,
char * index_dir,
size_t index_dir_maxncpy )
static

◆ get_proxy_filepath()

◆ get_tc_filepath()

static void get_tc_filepath ( ImBufAnim * anim,
IMB_Timecode_Type tc,
char * filepath )
static

◆ IMB_anim_get_filename()

void IMB_anim_get_filename ( ImBufAnim * anim,
char * filename,
int filename_maxncpy )

Definition at line 381 of file indexer.cc.

References BLI_path_split_file_part(), and ImBufAnim::filepath.

Referenced by seq_proxy_index_dir_set().

◆ IMB_anim_index_get_frame_index()

int IMB_anim_index_get_frame_index ( ImBufAnim * anim,
IMB_Timecode_Type tc,
int position )

Definition at line 1402 of file indexer.cc.

References IMB_anim_open_index(), and IMB_indexer_get_frame_index().

Referenced by IMB_anim_absolute(), and seq_proxy_fetch().

◆ IMB_anim_index_rebuild()

void IMB_anim_index_rebuild ( IndexBuildContext * context,
bool * stop,
bool * do_update,
float * progress )

Will rebuild all used indices and proxies at once.

Definition at line 1283 of file indexer.cc.

References UNUSED_VARS.

Referenced by do_movie_proxy(), and SEQ_proxy_rebuild().

◆ IMB_anim_index_rebuild_context()

IndexBuildContext * IMB_anim_index_rebuild_context ( ImBufAnim * anim,
IMB_Timecode_Type tcs_in_use,
int proxy_sizes_in_use,
int quality,
const bool overwrite,
GSet * file_list,
bool build_only_on_bad_performance )

◆ IMB_anim_index_rebuild_finish()

void IMB_anim_index_rebuild_finish ( IndexBuildContext * context,
bool stop )

Finish rebuilding proxies/time-codes and free temporary contexts used.

Definition at line 1301 of file indexer.cc.

References proxy_sizes, and UNUSED_VARS.

Referenced by proxy_endjob(), and SEQ_proxy_rebuild_finish().

◆ IMB_anim_open_index()

◆ IMB_anim_open_proxy()

◆ IMB_anim_proxy_get_existing()

int IMB_anim_proxy_get_existing ( ImBufAnim * anim)

◆ IMB_anim_set_index_dir()

void IMB_anim_set_index_dir ( ImBufAnim * anim,
const char * dir )

Defaults to BL_proxy within the directory of the animation.

Definition at line 1336 of file indexer.cc.

References IMB_free_indices(), ImBufAnim::index_dir, STREQ, and STRNCPY.

Referenced by movieclip_open_anim_file(), and seq_proxy_index_dir_set().

◆ IMB_free_indices()

◆ IMB_index_builder_add_entry()

void IMB_index_builder_add_entry ( anim_index_builder * fp,
int frameno,
uint64_t seek_pos,
uint64_t seek_pos_pts,
uint64_t seek_pos_dts,
uint64_t pts )

Definition at line 91 of file indexer.cc.

References anim_index_builder::fp.

Referenced by IMB_index_builder_proc_frame().

◆ IMB_index_builder_create()

◆ IMB_index_builder_finish()

◆ IMB_index_builder_proc_frame()

void IMB_index_builder_proc_frame ( anim_index_builder * fp,
uchar * buffer,
int data_size,
int frameno,
uint64_t seek_pos,
uint64_t seek_pos_pts,
uint64_t seek_pos_dts,
uint64_t pts )

Definition at line 105 of file indexer.cc.

References e, IMB_index_builder_add_entry(), and anim_index_builder::proc_frame.

◆ IMB_indexer_can_scan()

int IMB_indexer_can_scan ( ImBufAnimIndex * idx,
int old_frame_index,
int new_frame_index )

Definition at line 315 of file indexer.cc.

References IMB_indexer_get_seek_pos().

◆ IMB_indexer_close()

void IMB_indexer_close ( ImBufAnimIndex * idx)

Definition at line 324 of file indexer.cc.

References ImBufAnimIndex::entries, and MEM_freeN().

Referenced by IMB_free_indices().

◆ IMB_indexer_get_duration()

int IMB_indexer_get_duration ( ImBufAnimIndex * idx)

◆ IMB_indexer_get_frame_index()

int IMB_indexer_get_frame_index ( ImBufAnimIndex * idx,
int frameno )

◆ IMB_indexer_get_pts()

uint64_t IMB_indexer_get_pts ( ImBufAnimIndex * idx,
int frame_index )

◆ IMB_indexer_get_seek_pos()

uint64_t IMB_indexer_get_seek_pos ( ImBufAnimIndex * idx,
int frame_index )

◆ IMB_indexer_get_seek_pos_dts()

uint64_t IMB_indexer_get_seek_pos_dts ( ImBufAnimIndex * idx,
int frame_index )

◆ IMB_indexer_get_seek_pos_pts()

uint64_t IMB_indexer_get_seek_pos_pts ( ImBufAnimIndex * idx,
int frame_index )

◆ IMB_indexer_open()

◆ IMB_proxy_size_to_array_index()

int IMB_proxy_size_to_array_index ( IMB_Proxy_Size pr_size)

◆ IMB_timecode_to_array_index()

int IMB_timecode_to_array_index ( IMB_Timecode_Type tc)

Definition at line 349 of file indexer.cc.

References BLI_assert_msg, IMB_TC_NONE, IMB_TC_RECORD_RUN, and IMB_TC_RECORD_RUN_NO_GAPS.

Referenced by get_tc_filepath().

Variable Documentation

◆ binary_header_str

const char binary_header_str[] = "BlenMIdx"
static

Definition at line 44 of file indexer.cc.

Referenced by IMB_index_builder_create(), and IMB_indexer_open().

◆ proxy_fac

const float proxy_fac[] = {0.25, 0.50, 0.75, 1.00}
static

Definition at line 49 of file indexer.cc.

Referenced by get_proxy_filepath().

◆ proxy_sizes

const IMB_Proxy_Size proxy_sizes[]
static

◆ temp_ext

const char temp_ext[] = "_part"
static

Definition at line 45 of file indexer.cc.

Referenced by IMB_index_builder_create().