Blender V2.61 - r43446
|
#include "IMB_indexer.h"
#include "IMB_anim.h"
#include "AVI_avi.h"
#include "imbuf.h"
#include "MEM_guardedalloc.h"
#include "BLI_utildefines.h"
#include "BLI_blenlib.h"
#include "BLI_math_base.h"
#include "DNA_userdef_types.h"
#include "BKE_global.h"
#include <stdlib.h>
Go to the source code of this file.
Defines | |
#define | INDEX_FILE_VERSION 1 |
Functions | |
void | IMB_indexer_dv_new (anim_index_builder *idx) |
anim_index_builder * | IMB_index_builder_create (const char *name) |
void | IMB_index_builder_add_entry (anim_index_builder *fp, int frameno, unsigned long long seek_pos, unsigned long long seek_pos_dts, unsigned long long pts) |
void | IMB_index_builder_proc_frame (anim_index_builder *fp, unsigned char *buffer, int data_size, int frameno, unsigned long long seek_pos, unsigned long long seek_pos_dts, unsigned long long pts) |
void | IMB_index_builder_finish (anim_index_builder *fp, int rollback) |
struct anim_index * | IMB_indexer_open (const char *name) |
unsigned long long | IMB_indexer_get_seek_pos (struct anim_index *idx, int frame_index) |
unsigned long long | IMB_indexer_get_seek_pos_dts (struct anim_index *idx, int frame_index) |
int | IMB_indexer_get_frame_index (struct anim_index *idx, int frameno) |
unsigned long long | IMB_indexer_get_pts (struct anim_index *idx, int frame_index) |
int | IMB_indexer_get_duration (struct anim_index *idx) |
int | IMB_indexer_can_scan (struct anim_index *idx, int old_frame_index, int new_frame_index) |
void | IMB_indexer_close (struct anim_index *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 (struct anim *anim, char *index_dir) |
static void | get_proxy_filename (struct anim *anim, IMB_Proxy_Size preview_size, char *fname, int temp) |
static void | get_tc_filename (struct anim *anim, IMB_Timecode_Type tc, char *fname) |
static AviMovie * | alloc_proxy_output_avi (struct anim *anim, char *filename, int width, int height, int quality) |
static void | index_rebuild_fallback (struct anim *anim, IMB_Timecode_Type UNUSED(tcs_in_use), IMB_Proxy_Size proxy_sizes_in_use, int quality, short *stop, short *do_update, float *progress) |
void | IMB_anim_index_rebuild (struct anim *anim, IMB_Timecode_Type tcs_in_use, IMB_Proxy_Size proxy_sizes_in_use, int quality, short *stop, short *do_update, float *progress) |
void | IMB_free_indices (struct anim *anim) |
void | IMB_anim_set_index_dir (struct anim *anim, const char *dir) |
struct anim * | IMB_anim_open_proxy (struct anim *anim, IMB_Proxy_Size preview_size) |
struct anim_index * | IMB_anim_open_index (struct anim *anim, IMB_Timecode_Type tc) |
int | IMB_anim_index_get_frame_index (struct anim *anim, IMB_Timecode_Type tc, int position) |
Variables | |
static char | magic [] = "BlenMIdx" |
static char | temp_ext [] = "_part" |
static int | proxy_sizes [] |
static float | proxy_fac [] = { 0.25, 0.50, 0.75, 1.00 } |
#define INDEX_FILE_VERSION 1 |
Definition at line 62 of file indexer.c.
Referenced by IMB_index_builder_create(), and IMB_indexer_open().
static AviMovie* alloc_proxy_output_avi | ( | struct anim * | anim, |
char * | filename, | ||
int | width, | ||
int | height, | ||
int | quality | ||
) | [static] |
Definition at line 910 of file indexer.c.
References avi, AVI_ERROR_NONE, AVI_FORMAT_MJPEG, AVI_open_compress(), AVI_OPTION_FRAMERATE, AVI_OPTION_HEIGHT, AVI_OPTION_QUALITY, AVI_OPTION_TYPE_MAIN, AVI_OPTION_WIDTH, AVI_set_compress_option(), IMB_anim_get_fps(), _AviMovie::interlace, MEM_freeN(), MEM_mallocN(), NULL, and _AviMovie::odd_fields.
Referenced by index_rebuild_fallback().
static void get_index_dir | ( | struct anim * | anim, |
char * | index_dir | ||
) | [static] |
Definition at line 363 of file indexer.c.
References BLI_join_dirfile(), BLI_splitdirstring(), BLI_strncpy(), FILE_MAXDIR, FILE_MAXFILE, anim::index_dir, and anim::name.
Referenced by get_proxy_filename(), and get_tc_filename().
static void get_proxy_filename | ( | struct anim * | anim, |
IMB_Proxy_Size | preview_size, | ||
char * | fname, | ||
int | temp | ||
) | [static] |
Definition at line 376 of file indexer.c.
References BLI_join_dirfile(), BLI_snprintf(), FILE_MAXDIR, FILE_MAXFILE, get_index_dir(), i, IMB_proxy_size_to_array_index(), proxy_fac, and anim::streamindex.
Referenced by IMB_anim_open_proxy(), and index_rebuild_fallback().
static void get_tc_filename | ( | struct anim * | anim, |
IMB_Timecode_Type | tc, | ||
char * | fname | ||
) | [static] |
Definition at line 403 of file indexer.c.
References BLI_join_dirfile(), BLI_snprintf(), FILE_MAXDIR, FILE_MAXFILE, get_index_dir(), i, IMB_timecode_to_array_index(), and anim::streamindex.
Referenced by IMB_anim_open_index().
int IMB_anim_index_get_frame_index | ( | struct anim * | anim, |
IMB_Timecode_Type | tc, | ||
int | position | ||
) |
Definition at line 1147 of file indexer.c.
References IMB_anim_open_index(), and IMB_indexer_get_frame_index().
Referenced by IMB_anim_absolute(), and seq_proxy_fetch().
void IMB_anim_index_rebuild | ( | struct anim * | anim, |
IMB_Timecode_Type | tcs_in_use, | ||
IMB_Proxy_Size | proxy_sizes_in_use, | ||
int | quality, | ||
short * | stop, | ||
short * | do_update, | ||
float * | progress | ||
) |
Definition at line 1049 of file indexer.c.
References ANIM_FFMPEG, anim::curtype, and index_rebuild_fallback().
Referenced by proxy_startjob(), and seq_proxy_rebuild().
struct anim_index* IMB_anim_open_index | ( | struct anim * | anim, |
IMB_Timecode_Type | tc | ||
) | [read] |
Definition at line 1124 of file indexer.c.
References anim::curr_idx, FILE_MAX, get_tc_filename(), i, IMB_indexer_open(), IMB_timecode_to_array_index(), anim::indices_tried, and NULL.
Referenced by avi_fetchibuf(), IMB_anim_get_duration(), and IMB_anim_index_get_frame_index().
struct anim* IMB_anim_open_proxy | ( | struct anim * | anim, |
IMB_Proxy_Size | preview_size | ||
) | [read] |
Definition at line 1101 of file indexer.c.
References FALSE, FILE_MAX, get_proxy_filename(), i, IMB_open_anim(), IMB_proxy_size_to_array_index(), NULL, anim::proxies_tried, and anim::proxy_anim.
Referenced by IMB_anim_absolute().
void IMB_anim_set_index_dir | ( | struct anim * | anim, |
const char * | dir | ||
) |
Definition at line 1091 of file indexer.c.
References BLI_strncpy(), IMB_free_indices(), and anim::index_dir.
Referenced by movieclip_load_movie_file(), and seq_open_anim_file().
void IMB_free_indices | ( | struct anim * | anim | ) |
Definition at line 1068 of file indexer.c.
References anim::curr_idx, i, IMB_close_anim(), IMB_indexer_close(), IMB_PROXY_MAX_SLOT, IMB_TC_MAX_SLOT, anim::indices_tried, NULL, anim::proxies_tried, and anim::proxy_anim.
Referenced by IMB_anim_set_index_dir(), and IMB_free_anim().
void IMB_index_builder_add_entry | ( | anim_index_builder * | fp, |
int | frameno, | ||
unsigned long long | seek_pos, | ||
unsigned long long | seek_pos_dts, | ||
unsigned long long | pts | ||
) |
Definition at line 107 of file indexer.c.
References anim_index_builder::fp.
Referenced by IMB_index_builder_proc_frame(), and write_index().
anim_index_builder* IMB_index_builder_create | ( | const char * | name | ) |
Definition at line 76 of file indexer.c.
References B_ENDIAN, BLI_make_existing_file(), BLI_strncpy(), ENDIAN_ORDER, anim_index_builder::fp, INDEX_FILE_VERSION, magic, MEM_callocN(), MEM_freeN(), anim_index_builder::name, NULL, temp_ext, and anim_index_builder::temp_name.
void IMB_index_builder_finish | ( | anim_index_builder * | fp, |
int | rollback | ||
) |
Definition at line 139 of file indexer.c.
References anim_index_builder::delete_priv_data, anim_index_builder::fp, MEM_freeN(), anim_index_builder::name, and anim_index_builder::temp_name.
void IMB_index_builder_proc_frame | ( | anim_index_builder * | fp, |
unsigned char * | buffer, | ||
int | data_size, | ||
int | frameno, | ||
unsigned long long | seek_pos, | ||
unsigned long long | seek_pos_dts, | ||
unsigned long long | pts | ||
) |
Definition at line 118 of file indexer.c.
References credits_svn_gen::e, anim_index_entry::frameno, IMB_index_builder_add_entry(), anim_index_builder::proc_frame, anim_index_entry::pts, anim_index_entry::seek_pos, and anim_index_entry::seek_pos_dts.
int IMB_indexer_can_scan | ( | struct anim_index * | idx, |
int | old_frame_index, | ||
int | new_frame_index | ||
) |
Definition at line 302 of file indexer.c.
References IMB_indexer_get_seek_pos().
Referenced by avi_fetchibuf().
void IMB_indexer_close | ( | struct anim_index * | idx | ) |
Definition at line 312 of file indexer.c.
References anim_index::entries, and MEM_freeN().
Referenced by IMB_free_indices().
void IMB_indexer_dv_new | ( | anim_index_builder * | idx | ) |
Definition at line 378 of file indexer_dv.c.
References indexer_dv_context::curr_frame, anim_index_builder::delete_priv_data, indexer_dv_context::gap_frame, indexer_dv_context::idx, indexer_dv_delete(), indexer_dv_proc_frame(), MEM_callocN(), anim_index_builder::private_data, anim_index_builder::proc_frame, and indexer_dv_context::ref_time_read.
int IMB_indexer_get_duration | ( | struct anim_index * | idx | ) |
Definition at line 294 of file indexer.c.
References anim_index::entries, anim_index_entry::frameno, and anim_index::num_entries.
Referenced by IMB_anim_get_duration().
int IMB_indexer_get_frame_index | ( | struct anim_index * | idx, |
int | frameno | ||
) |
Definition at line 251 of file indexer.c.
References anim_index::entries, anim_index_entry::frameno, len(), and anim_index::num_entries.
Referenced by avi_fetchibuf(), and IMB_anim_index_get_frame_index().
unsigned long long IMB_indexer_get_pts | ( | struct anim_index * | idx, |
int | frame_index | ||
) |
Definition at line 282 of file indexer.c.
References anim_index::entries, anim_index::num_entries, and anim_index_entry::pts.
Referenced by avi_fetchibuf().
unsigned long long IMB_indexer_get_seek_pos | ( | struct anim_index * | idx, |
int | frame_index | ||
) |
Definition at line 227 of file indexer.c.
References anim_index::entries, anim_index::num_entries, and anim_index_entry::seek_pos.
Referenced by avi_fetchibuf(), and IMB_indexer_can_scan().
unsigned long long IMB_indexer_get_seek_pos_dts | ( | struct anim_index * | idx, |
int | frame_index | ||
) |
Definition at line 239 of file indexer.c.
References anim_index::entries, anim_index::num_entries, and anim_index_entry::seek_pos_dts.
Referenced by avi_fetchibuf().
struct anim_index* IMB_indexer_open | ( | const char * | name | ) | [read] |
Definition at line 156 of file indexer.c.
References B_ENDIAN, BLI_strncpy(), ENDIAN_ORDER, anim_index::entries, anim_index_entry::frameno, i, INDEX_FILE_VERSION, magic, MEM_callocN(), anim_index::name, NULL, anim_index::num_entries, anim_index_entry::pts, anim_index_entry::seek_pos, anim_index_entry::seek_pos_dts, SWITCH_INT, and SWITCH_INT64.
Referenced by IMB_anim_open_index().
int IMB_proxy_size_to_array_index | ( | IMB_Proxy_Size | pr_size | ) |
Definition at line 318 of file indexer.c.
References IMB_PROXY_100, IMB_PROXY_25, IMB_PROXY_50, IMB_PROXY_75, and IMB_PROXY_NONE.
Referenced by get_proxy_filename(), and IMB_anim_open_proxy().
int IMB_timecode_to_array_index | ( | IMB_Timecode_Type | tc | ) |
Definition at line 338 of file indexer.c.
References IMB_TC_FREE_RUN, IMB_TC_INTERPOLATED_REC_DATE_FREE_RUN, IMB_TC_NONE, IMB_TC_RECORD_RUN, and IMB_TC_RECORD_RUN_NO_GAPS.
Referenced by get_tc_filename(), and IMB_anim_open_index().
static void index_rebuild_fallback | ( | struct anim * | anim, |
IMB_Timecode_Type | UNUSEDtcs_in_use, | ||
IMB_Proxy_Size | proxy_sizes_in_use, | ||
int | quality, | ||
short * | stop, | ||
short * | do_update, | ||
float * | progress | ||
) | [static] |
Definition at line 949 of file indexer.c.
References alloc_proxy_output_avi(), AVI_close_compress(), AVI_FORMAT_RGB32, AVI_write_frame(), BLI_make_existing_file(), FALSE, FILE_MAX, get_proxy_filename(), i, IMB_anim_absolute(), IMB_anim_get_duration(), IMB_convert_rgba_to_abgr(), IMB_flipy(), IMB_freeImBuf(), IMB_PROXY_MAX_SLOT, IMB_PROXY_NONE, IMB_scalefastImBuf(), IMB_TC_NONE, MEM_freeN(), NULL, proxy_fac, proxy_sizes, ImBuf::rect, TRUE, ImBuf::x, anim::x, ImBuf::y, and anim::y.
Referenced by IMB_anim_index_rebuild().
char magic[] = "BlenMIdx" [static] |
Definition at line 47 of file indexer.c.
Referenced by add_node(), IMB_index_builder_create(), IMB_indexer_open(), logImageDump(), and xml_read_shader_graph().
float proxy_fac[] = { 0.25, 0.50, 0.75, 1.00 } [static] |
Definition at line 52 of file indexer.c.
Referenced by get_proxy_filename(), and index_rebuild_fallback().
int proxy_sizes[] [static] |
Definition at line 50 of file indexer.c.
Referenced by index_rebuild_fallback().
char temp_ext[] = "_part" [static] |
Definition at line 48 of file indexer.c.
Referenced by IMB_index_builder_create().