Blender  V3.3
proxy.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2001-2002 NaN Holding BV. All rights reserved.
3  * 2003-2009 Blender Foundation.
4  * 2005-2006 Peter Schlaile <peter [at] schlaile [dot] de> */
5 
10 #include "MEM_guardedalloc.h"
11 
12 #include "DNA_anim_types.h"
13 #include "DNA_scene_types.h"
14 #include "DNA_sequence_types.h"
15 #include "DNA_space_types.h"
16 
17 #include "BLI_fileops.h"
18 #include "BLI_listbase.h"
19 #include "BLI_path_util.h"
20 #include "BLI_session_uuid.h"
21 #include "BLI_string.h"
22 
23 #ifdef WIN32
24 # include "BLI_winstuff.h"
25 #else
26 # include <unistd.h>
27 #endif
28 
29 #include "BKE_global.h"
30 #include "BKE_image.h"
31 #include "BKE_main.h"
32 #include "BKE_scene.h"
33 
34 #include "DEG_depsgraph.h"
35 
36 #include "IMB_colormanagement.h"
37 #include "IMB_imbuf.h"
38 #include "IMB_imbuf_types.h"
39 #include "IMB_metadata.h"
40 
41 #include "SEQ_iterator.h"
42 #include "SEQ_proxy.h"
43 #include "SEQ_relations.h"
44 #include "SEQ_render.h"
45 #include "SEQ_sequencer.h"
46 #include "SEQ_time.h"
47 
48 #include "multiview.h"
49 #include "proxy.h"
50 #include "render.h"
51 #include "sequencer.h"
52 #include "strip_time.h"
53 #include "utils.h"
54 
55 typedef struct SeqIndexBuildContext {
57 
58  int tc_flags;
60  int quality;
61  bool overwrite;
62  int view_id;
63 
70 
71 int SEQ_rendersize_to_proxysize(int render_size)
72 {
73  switch (render_size) {
75  return IMB_PROXY_25;
77  return IMB_PROXY_50;
79  return IMB_PROXY_75;
81  return IMB_PROXY_100;
82  }
83  return IMB_PROXY_NONE;
84 }
85 
86 double SEQ_rendersize_to_scale_factor(int render_size)
87 {
88  switch (render_size) {
90  return 0.25;
92  return 0.50;
94  return 0.75;
95  }
96  return 1.0;
97 }
98 
99 bool seq_proxy_get_custom_file_fname(Sequence *seq, char *name, const int view_id)
100 {
101  char fname[FILE_MAXFILE];
102  char suffix[24];
103  StripProxy *proxy = seq->strip->proxy;
104 
105  if (proxy == NULL) {
106  return false;
107  }
108 
109  BLI_join_dirfile(fname, PROXY_MAXFILE, proxy->dir, proxy->file);
111 
112  if (view_id > 0) {
113  BLI_snprintf(suffix, sizeof(suffix), "_%d", view_id);
114  /* TODO(sergey): This will actually append suffix after extension
115  * which is weird but how was originally coded in multi-view branch.
116  */
117  BLI_snprintf(name, PROXY_MAXFILE, "%s_%s", fname, suffix);
118  }
119  else {
120  BLI_strncpy(name, fname, PROXY_MAXFILE);
121  }
122 
123  return true;
124 }
125 
127  Sequence *seq,
128  int timeline_frame,
129  eSpaceSeq_Proxy_RenderSize render_size,
130  char *name,
131  const int view_id)
132 {
133  char dir[PROXY_MAXFILE];
134  char suffix[24] = {'\0'};
136  StripProxy *proxy = seq->strip->proxy;
137 
138  if (proxy == NULL) {
139  return false;
140  }
141 
142  /* Multi-view suffix. */
143  if (view_id > 0) {
144  BLI_snprintf(suffix, sizeof(suffix), "_%d", view_id);
145  }
146 
147  /* Per strip with Custom file situation is handled separately. */
148  if (proxy->storage & SEQ_STORAGE_PROXY_CUSTOM_FILE &&
150  if (seq_proxy_get_custom_file_fname(seq, name, view_id)) {
151  return true;
152  }
153  }
154 
156  /* Per project default. */
157  if (ed->proxy_dir[0] == 0) {
158  BLI_strncpy(dir, "//BL_proxy", sizeof(dir));
159  }
160  else { /* Per project with custom dir. */
161  BLI_strncpy(dir, ed->proxy_dir, sizeof(dir));
162  }
164  }
165  else {
166  /* Pre strip with custom dir. */
167  if (proxy->storage & SEQ_STORAGE_PROXY_CUSTOM_DIR) {
168  BLI_strncpy(dir, seq->strip->proxy->dir, sizeof(dir));
169  }
170  else { /* Per strip default. */
171  BLI_snprintf(dir, PROXY_MAXFILE, "%s/BL_proxy", seq->strip->dir);
172  }
173  }
174 
175  /* Proxy size number to be used in path. */
176  int proxy_size_number = SEQ_rendersize_to_scale_factor(render_size) * 100;
177 
178  BLI_snprintf(name,
180  "%s/images/%d/%s_proxy%s",
181  dir,
182  proxy_size_number,
183  SEQ_render_give_stripelem(scene, seq, timeline_frame)->name,
184  suffix);
186  strcat(name, ".jpg");
187 
188  return true;
189 }
190 
191 bool SEQ_can_use_proxy(const struct SeqRenderData *context, Sequence *seq, int psize)
192 {
193  if (seq->strip->proxy == NULL || !context->use_proxies) {
194  return false;
195  }
196 
197  short size_flags = seq->strip->proxy->build_size_flags;
198  return (seq->flag & SEQ_USE_PROXY) != 0 && psize != IMB_PROXY_NONE && (size_flags & psize) != 0;
199 }
200 
201 ImBuf *seq_proxy_fetch(const SeqRenderData *context, Sequence *seq, int timeline_frame)
202 {
203  char name[PROXY_MAXFILE];
204  StripProxy *proxy = seq->strip->proxy;
205  const eSpaceSeq_Proxy_RenderSize psize = context->preview_render_size;
206  StripAnim *sanim;
207 
208  /* only use proxies, if they are enabled (even if present!) */
210  return NULL;
211  }
212 
213  if (proxy->storage & SEQ_STORAGE_PROXY_CUSTOM_FILE) {
214  int frameno = (int)seq_give_frame_index(context->scene, seq, timeline_frame) +
215  seq->anim_startofs;
216  if (proxy->anim == NULL) {
218  context->scene, seq, timeline_frame, psize, name, context->view_id) == 0) {
219  return NULL;
220  }
221 
222  proxy->anim = openanim(name, IB_rect, 0, seq->strip->colorspace_settings.name);
223  }
224  if (proxy->anim == NULL) {
225  return NULL;
226  }
227 
228  seq_open_anim_file(context->scene, seq, true);
229  sanim = seq->anims.first;
230 
232  sanim ? sanim->anim : NULL, seq->strip->proxy->tc, frameno);
233 
234  return IMB_anim_absolute(proxy->anim, frameno, IMB_TC_NONE, IMB_PROXY_NONE);
235  }
236 
237  if (seq_proxy_get_fname(context->scene, seq, timeline_frame, psize, name, context->view_id) ==
238  0) {
239  return NULL;
240  }
241 
242  if (BLI_exists(name)) {
243  ImBuf *ibuf = IMB_loadiffname(name, IB_rect, NULL);
244 
245  if (ibuf) {
246  seq_imbuf_assign_spaces(context->scene, ibuf);
247  }
248 
249  return ibuf;
250  }
251 
252  return NULL;
253 }
254 
257  Sequence *seq,
258  int timeline_frame,
259  int proxy_render_size,
260  const bool overwrite)
261 {
262  char name[PROXY_MAXFILE];
263  int quality;
264  int rectx, recty;
265  ImBuf *ibuf_tmp, *ibuf;
266  Scene *scene = context->scene;
267 
268  if (!seq_proxy_get_fname(
269  scene, seq, timeline_frame, proxy_render_size, name, context->view_id)) {
270  return;
271  }
272 
273  if (!overwrite && BLI_exists(name)) {
274  return;
275  }
276 
277  ibuf_tmp = seq_render_strip(context, state, seq, timeline_frame);
278 
279  rectx = (proxy_render_size * ibuf_tmp->x) / 100;
280  recty = (proxy_render_size * ibuf_tmp->y) / 100;
281 
282  if (ibuf_tmp->x != rectx || ibuf_tmp->y != recty) {
283  ibuf = IMB_dupImBuf(ibuf_tmp);
284  IMB_metadata_copy(ibuf, ibuf_tmp);
285  IMB_freeImBuf(ibuf_tmp);
286  IMB_scalefastImBuf(ibuf, (short)rectx, (short)recty);
287  }
288  else {
289  ibuf = ibuf_tmp;
290  }
291 
292  /* depth = 32 is intentionally left in, otherwise ALPHA channels
293  * won't work... */
294  quality = seq->strip->proxy->quality;
295  ibuf->ftype = IMB_FTYPE_JPG;
296  ibuf->foptions.quality = quality;
297 
298  /* unsupported feature only confuses other s/w */
299  if (ibuf->planes == 32) {
300  ibuf->planes = 24;
301  }
302 
304 
305  const bool ok = IMB_saveiff(ibuf, name, IB_rect | IB_zbuf | IB_zbuffloat);
306  if (ok == false) {
307  perror(name);
308  }
309 
310  IMB_freeImBuf(ibuf);
311 }
312 
317 static bool seq_proxy_multiview_context_invalid(Sequence *seq, Scene *scene, const int view_id)
318 {
319  if ((scene->r.scemode & R_MULTIVIEW) == 0) {
320  return false;
321  }
322 
323  if ((seq->type == SEQ_TYPE_IMAGE) && (seq->views_format == R_IMF_VIEWS_INDIVIDUAL)) {
324  static char prefix[FILE_MAX];
325  static const char *ext = NULL;
326  char str[FILE_MAX];
327 
328  if (view_id == 0) {
329  char path[FILE_MAX];
330  BLI_join_dirfile(path, sizeof(path), seq->strip->dir, seq->strip->stripdata->name);
332  BKE_scene_multiview_view_prefix_get(scene, path, prefix, &ext);
333  }
334  else {
335  prefix[0] = '\0';
336  }
337 
338  if (prefix[0] == '\0') {
339  return view_id != 0;
340  }
341 
342  seq_multiview_name(scene, view_id, prefix, ext, str, FILE_MAX);
343 
344  if (BLI_access(str, R_OK) == 0) {
345  return false;
346  }
347 
348  return view_id != 0;
349  }
350  return false;
351 }
352 
357 {
358  int num_views = 1;
359 
360  if ((scene->r.scemode & R_MULTIVIEW) == 0) {
361  return 1;
362  }
363 
364  switch (seq->type) {
365  case SEQ_TYPE_MOVIE: {
366  num_views = BLI_listbase_count(&seq->anims);
367  break;
368  }
369  case SEQ_TYPE_IMAGE: {
370  switch (seq->views_format) {
373  break;
375  num_views = 2;
376  break;
378  /* not supported at the moment */
379  /* pass through */
380  default:
381  num_views = 1;
382  }
383  break;
384  }
385  }
386 
387  return num_views;
388 }
389 
390 static bool seq_proxy_need_rebuild(Sequence *seq, struct anim *anim)
391 {
392  if ((seq->strip->proxy->build_flags & SEQ_PROXY_SKIP_EXISTING) == 0) {
393  return true;
394  }
395 
396  IMB_Proxy_Size required_proxies = seq->strip->proxy->build_size_flags;
398  return (required_proxies & built_proxies) != required_proxies;
399 }
400 
403  Scene *scene,
404  Sequence *seq,
405  struct GSet *file_list,
406  ListBase *queue,
407  bool build_only_on_bad_performance)
408 {
410  Sequence *nseq;
411  LinkData *link;
412  int num_files;
413  int i;
414 
415  if (!seq->strip || !seq->strip->proxy) {
416  return true;
417  }
418 
419  if (!(seq->flag & SEQ_USE_PROXY)) {
420  return true;
421  }
422 
423  num_files = seq_proxy_context_count(seq, scene);
424 
425  for (i = 0; i < num_files; i++) {
427  continue;
428  }
429 
430  /* Check if proxies are already built here, because actually opening anims takes a lot of
431  * time. */
432  seq_open_anim_file(scene, seq, false);
433  StripAnim *sanim = BLI_findlink(&seq->anims, i);
434  if (sanim->anim && !seq_proxy_need_rebuild(seq, sanim->anim)) {
435  continue;
436  }
437 
439 
440  context = MEM_callocN(sizeof(SeqIndexBuildContext), "seq proxy rebuild context");
441 
442  nseq = SEQ_sequence_dupli_recursive(scene, scene, NULL, seq, 0);
443 
444  context->tc_flags = nseq->strip->proxy->build_tc_flags;
445  context->size_flags = nseq->strip->proxy->build_size_flags;
446  context->quality = nseq->strip->proxy->quality;
447  context->overwrite = (nseq->strip->proxy->build_flags & SEQ_PROXY_SKIP_EXISTING) == 0;
448 
449  context->bmain = bmain;
450  context->depsgraph = depsgraph;
451  context->scene = scene;
452  context->orig_seq = seq;
453  context->orig_seq_uuid = seq->runtime.session_uuid;
454  context->seq = nseq;
455 
456  context->view_id = i; /* only for images */
457 
458  if (nseq->type == SEQ_TYPE_MOVIE) {
459  seq_open_anim_file(scene, nseq, true);
460  sanim = BLI_findlink(&nseq->anims, i);
461 
462  if (sanim->anim) {
463  context->index_context = IMB_anim_index_rebuild_context(sanim->anim,
464  context->tc_flags,
465  context->size_flags,
466  context->quality,
467  context->overwrite,
468  file_list,
469  build_only_on_bad_performance);
470  }
471  if (!context->index_context) {
473  return false;
474  }
475  }
476 
477  link = BLI_genericNodeN(context);
478  BLI_addtail(queue, link);
479  }
480 
481  return true;
482 }
483 
485  short *stop,
486  short *do_update,
487  float *progress)
488 {
489  const bool overwrite = context->overwrite;
490  SeqRenderData render_context;
491  Sequence *seq = context->seq;
492  Scene *scene = context->scene;
493  Main *bmain = context->bmain;
494  int timeline_frame;
495 
496  if (seq->type == SEQ_TYPE_MOVIE) {
497  if (context->index_context) {
498  IMB_anim_index_rebuild(context->index_context, stop, do_update, progress);
499  }
500 
501  return;
502  }
503 
504  if (!(seq->flag & SEQ_USE_PROXY)) {
505  return;
506  }
507 
508  /* that's why it is called custom... */
510  return;
511  }
512 
513  /* fail safe code */
514  int width, height;
515  BKE_render_resolution(&scene->r, false, &width, &height);
516 
518  bmain, context->depsgraph, context->scene, width, height, 100, false, &render_context);
519 
520  render_context.skip_cache = true;
521  render_context.is_proxy_render = true;
522  render_context.view_id = context->view_id;
523 
526 
527  for (timeline_frame = SEQ_time_left_handle_frame_get(scene, seq);
528  timeline_frame < SEQ_time_right_handle_frame_get(scene, seq);
529  timeline_frame++) {
530  if (context->size_flags & IMB_PROXY_25) {
531  seq_proxy_build_frame(&render_context, &state, seq, timeline_frame, 25, overwrite);
532  }
533  if (context->size_flags & IMB_PROXY_50) {
534  seq_proxy_build_frame(&render_context, &state, seq, timeline_frame, 50, overwrite);
535  }
536  if (context->size_flags & IMB_PROXY_75) {
537  seq_proxy_build_frame(&render_context, &state, seq, timeline_frame, 75, overwrite);
538  }
539  if (context->size_flags & IMB_PROXY_100) {
540  seq_proxy_build_frame(&render_context, &state, seq, timeline_frame, 100, overwrite);
541  }
542 
543  *progress = (float)(timeline_frame - SEQ_time_left_handle_frame_get(scene, seq)) /
546  *do_update = true;
547 
548  if (*stop || G.is_break) {
549  break;
550  }
551  }
552 }
553 
555 {
556  if (context->index_context) {
557  StripAnim *sanim;
558 
559  for (sanim = context->seq->anims.first; sanim; sanim = sanim->next) {
561  }
562 
563  IMB_anim_index_rebuild_finish(context->index_context, stop);
564  }
565 
567 
569 }
570 
571 void SEQ_proxy_set(struct Sequence *seq, bool value)
572 {
573  if (value) {
574  seq->flag |= SEQ_USE_PROXY;
575  if (seq->strip->proxy == NULL) {
577  }
578  }
579  else {
580  seq->flag &= ~SEQ_USE_PROXY;
581  }
582 }
583 
584 void seq_proxy_index_dir_set(struct anim *anim, const char *base_dir)
585 {
586  char dir[FILE_MAX];
587  char fname[FILE_MAXFILE];
588 
590  BLI_strncpy(dir, base_dir, sizeof(dir));
591  BLI_path_append(dir, sizeof(dir), fname);
593 }
594 
596 {
597  if (seq->strip && seq->strip->proxy && seq->strip->proxy->anim) {
598  IMB_free_anim(seq->strip->proxy->anim);
599  seq->strip->proxy->anim = NULL;
600  }
601 }
typedef float(TangentPoint)[2]
struct anim * openanim(const char *name, int flags, int streamindex, char colorspace[IMA_MAX_SPACE])
const char * BKE_main_blendfile_path_from_global(void)
Definition: main.c:562
void BKE_render_resolution(const struct RenderData *r, const bool use_crop, int *r_width, int *r_height)
Definition: scene.cc:2960
void BKE_scene_multiview_view_prefix_get(struct Scene *scene, const char *name, char *r_prefix, const char **r_ext)
Definition: scene.cc:3233
int BKE_scene_multiview_num_views_get(const struct RenderData *rd)
File and directory operations.
int BLI_exists(const char *path) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
Definition: storage.c:314
int BLI_access(const char *filepath, int mode) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
Definition: fileops.c:927
struct GSet GSet
Definition: BLI_ghash.h:340
struct LinkData * BLI_genericNodeN(void *data)
Definition: listbase.c:842
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition: listbase.c:80
void * BLI_findlink(const struct ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
int BLI_listbase_count(const struct ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
bool BLI_make_existing_file(const char *name)
Definition: path_util.c:1197
#define FILE_MAXFILE
#define FILE_MAX
void BLI_path_append(char *__restrict dst, size_t maxlen, const char *__restrict file) ATTR_NONNULL()
Definition: path_util.c:1514
bool BLI_path_abs(char *path, const char *basepath) ATTR_NONNULL()
Definition: path_util.c:897
void BLI_join_dirfile(char *__restrict dst, size_t maxlen, const char *__restrict dir, const char *__restrict file) ATTR_NONNULL()
Definition: path_util.c:1531
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t maxncpy) ATTR_NONNULL()
Definition: string.c:64
size_t BLI_snprintf(char *__restrict dst, size_t maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
Compatibility-like things for windows.
struct Depsgraph Depsgraph
Definition: DEG_depsgraph.h:35
#define R_MULTIVIEW
@ R_IMF_VIEWS_MULTIVIEW
@ R_IMF_VIEWS_STEREO_3D
@ R_IMF_VIEWS_INDIVIDUAL
@ SEQ_TYPE_IMAGE
@ SEQ_TYPE_MOVIE
@ SEQ_STORAGE_PROXY_CUSTOM_FILE
@ SEQ_STORAGE_PROXY_CUSTOM_DIR
@ SEQ_USE_PROXY
@ SEQ_PROXY_SKIP_EXISTING
#define SEQ_EDIT_PROXY_DIR_STORAGE
eSpaceSeq_Proxy_RenderSize
@ SEQ_RENDER_SIZE_PROXY_25
@ SEQ_RENDER_SIZE_PROXY_75
@ SEQ_RENDER_SIZE_PROXY_50
@ SEQ_RENDER_SIZE_PROXY_100
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei height
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei width
struct IndexBuildContext * IMB_anim_index_rebuild_context(struct anim *anim, IMB_Timecode_Type tcs_in_use, IMB_Proxy_Size proxy_sizes_in_use, int quality, const bool overwrite, struct GSet *file_list, bool build_only_on_bad_performance)
Definition: indexer.c:1377
void IMB_anim_index_rebuild(struct IndexBuildContext *context, short *stop, short *do_update, float *progress)
Definition: indexer.c:1460
void IMB_close_anim_proxies(struct anim *anim)
Definition: anim_movie.c:224
void IMB_free_anim(struct anim *anim)
Definition: anim_movie.c:193
struct ImBuf * IMB_dupImBuf(const struct ImBuf *ibuf1)
IMB_Proxy_Size
Definition: IMB_imbuf.h:340
@ IMB_PROXY_100
Definition: IMB_imbuf.h:345
@ IMB_PROXY_75
Definition: IMB_imbuf.h:344
@ IMB_PROXY_50
Definition: IMB_imbuf.h:343
@ IMB_PROXY_25
Definition: IMB_imbuf.h:342
@ IMB_PROXY_NONE
Definition: IMB_imbuf.h:341
void IMB_anim_set_index_dir(struct anim *anim, const char *dir)
Definition: indexer.c:1527
int IMB_anim_index_get_frame_index(struct anim *anim, IMB_Timecode_Type tc, int position)
Definition: indexer.c:1590
void IMB_anim_index_rebuild_finish(struct IndexBuildContext *context, short stop)
Definition: indexer.c:1486
IMB_Proxy_Size IMB_anim_proxy_get_existing(struct anim *anim)
Definition: indexer.c:1601
struct ImBuf * IMB_loadiffname(const char *filepath, int flags, char colorspace[IM_MAX_SPACE])
Definition: readimage.c:209
void IMB_anim_get_fname(struct anim *anim, char *file, int size)
Definition: indexer.c:389
struct ImBuf * IMB_anim_absolute(struct anim *anim, int position, IMB_Timecode_Type tc, IMB_Proxy_Size preview_size)
Definition: anim_movie.c:1571
bool IMB_scalefastImBuf(struct ImBuf *ibuf, unsigned int newx, unsigned int newy)
Definition: scaling.c:1689
bool IMB_saveiff(struct ImBuf *ibuf, const char *filepath, int flags)
Definition: writeimage.c:22
@ IMB_TC_NONE
Definition: IMB_imbuf.h:318
Contains defines and structs used throughout the imbuf module.
@ IB_zbuf
@ IB_zbuffloat
@ IB_rect
void IMB_metadata_copy(struct ImBuf *dimb, struct ImBuf *simb)
Definition: metadata.c:64
Read Guarded memory(de)allocation.
Scene scene
const Depsgraph * depsgraph
SyclQueue * queue
#define str(s)
void IMB_freeImBuf(ImBuf *UNUSED(ibuf))
@ IMB_FTYPE_JPG
const int state
void(* MEM_freeN)(void *vmemh)
Definition: mallocn.c:27
void *(* MEM_callocN)(size_t len, const char *str)
Definition: mallocn.c:31
#define G(x, y, z)
void seq_multiview_name(Scene *scene, const int view_id, const char *prefix, const char *ext, char *r_path, size_t r_size)
Definition: multiview.c:39
static bool seq_proxy_need_rebuild(Sequence *seq, struct anim *anim)
Definition: proxy.c:390
void free_proxy_seq(Sequence *seq)
Definition: proxy.c:595
static bool seq_proxy_get_fname(Scene *scene, Sequence *seq, int timeline_frame, eSpaceSeq_Proxy_RenderSize render_size, char *name, const int view_id)
Definition: proxy.c:126
void SEQ_proxy_set(struct Sequence *seq, bool value)
Definition: proxy.c:571
static void seq_proxy_build_frame(const SeqRenderData *context, SeqRenderState *state, Sequence *seq, int timeline_frame, int proxy_render_size, const bool overwrite)
Definition: proxy.c:255
void seq_proxy_index_dir_set(struct anim *anim, const char *base_dir)
Definition: proxy.c:584
struct SeqIndexBuildContext SeqIndexBuildContext
void SEQ_proxy_rebuild(SeqIndexBuildContext *context, short *stop, short *do_update, float *progress)
Definition: proxy.c:484
static bool seq_proxy_multiview_context_invalid(Sequence *seq, Scene *scene, const int view_id)
Definition: proxy.c:317
static int seq_proxy_context_count(Sequence *seq, Scene *scene)
Definition: proxy.c:356
int SEQ_rendersize_to_proxysize(int render_size)
Definition: proxy.c:71
void SEQ_proxy_rebuild_finish(SeqIndexBuildContext *context, bool stop)
Definition: proxy.c:554
ImBuf * seq_proxy_fetch(const SeqRenderData *context, Sequence *seq, int timeline_frame)
Definition: proxy.c:201
bool SEQ_can_use_proxy(const struct SeqRenderData *context, Sequence *seq, int psize)
Definition: proxy.c:191
double SEQ_rendersize_to_scale_factor(int render_size)
Definition: proxy.c:86
bool seq_proxy_get_custom_file_fname(Sequence *seq, char *name, const int view_id)
Definition: proxy.c:99
bool SEQ_proxy_rebuild_context(Main *bmain, Depsgraph *depsgraph, Scene *scene, Sequence *seq, struct GSet *file_list, ListBase *queue, bool build_only_on_bad_performance)
Definition: proxy.c:401
#define PROXY_MAXFILE
Definition: proxy.h:19
void SEQ_render_new_render_data(Main *bmain, struct Depsgraph *depsgraph, Scene *scene, int rectx, int recty, int preview_render_size, int for_render, SeqRenderData *r_context)
Definition: render.c:205
ImBuf * seq_render_strip(const SeqRenderData *context, SeqRenderState *state, Sequence *seq, float timeline_frame)
Definition: render.c:1723
void seq_imbuf_assign_spaces(Scene *scene, ImBuf *ibuf)
Definition: render.c:88
StripElem * SEQ_render_give_stripelem(const Scene *scene, Sequence *seq, int timeline_frame)
Definition: render.c:236
void seq_render_state_init(SeqRenderState *state)
Definition: render.c:231
StripProxy * seq_strip_proxy_alloc(void)
Definition: sequencer.c:54
Sequence * SEQ_sequence_dupli_recursive(const Scene *scene_src, Scene *scene_dst, ListBase *new_seq_list, Sequence *seq, int dupe_flag)
Definition: sequencer.c:602
void seq_free_sequence_recurse(Scene *scene, Sequence *seq, const bool do_id_user)
Definition: sequencer.c:229
Editing * SEQ_editing_get(const Scene *scene)
Definition: sequencer.c:241
void SEQ_relations_sequence_free_anim(Sequence *seq)
int SEQ_time_left_handle_frame_get(const Scene *UNUSED(scene), const Sequence *seq)
Definition: strip_time.c:506
float seq_give_frame_index(const Scene *scene, Sequence *seq, float timeline_frame)
Definition: strip_time.c:52
int SEQ_time_right_handle_frame_get(const Scene *scene, const Sequence *seq)
Definition: strip_time.c:515
char proxy_dir[1024]
ImbFormatOptions foptions
unsigned char planes
enum eImbFileType ftype
void * first
Definition: DNA_listBase.h:31
Definition: BKE_main.h:121
struct RenderData r
Sequence * seq
Definition: proxy.c:67
struct IndexBuildContext * index_context
Definition: proxy.c:56
Scene * scene
Definition: proxy.c:66
Depsgraph * depsgraph
Definition: proxy.c:65
Sequence * orig_seq
Definition: proxy.c:67
SessionUUID orig_seq_uuid
Definition: proxy.c:68
bool is_proxy_render
Definition: SEQ_render.h:39
bool skip_cache
Definition: SEQ_render.h:38
SessionUUID session_uuid
ListBase anims
SequenceRuntime runtime
struct anim * anim
struct StripAnim * next
char name[256]
struct anim * anim
char file[256]
short build_size_flags
ColorManagedColorspaceSettings colorspace_settings
StripProxy * proxy
StripElem * stripdata
char dir[768]
Definition: IMB_anim.h:71
void seq_open_anim_file(Scene *scene, Sequence *seq, bool openfile)
Definition: utils.c:209