Blender  V2.93
proxy.c
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
17  * All rights reserved.
18  *
19  * - Blender Foundation, 2003-2009
20  * - Peter Schlaile <peter [at] schlaile [dot] de> 2005/2006
21  */
22 
27 #include "MEM_guardedalloc.h"
28 
29 #include "DNA_anim_types.h"
30 #include "DNA_scene_types.h"
31 #include "DNA_sequence_types.h"
32 #include "DNA_space_types.h"
33 
34 #include "BLI_fileops.h"
35 #include "BLI_listbase.h"
36 #include "BLI_path_util.h"
37 #include "BLI_string.h"
38 
39 #ifdef WIN32
40 # include "BLI_winstuff.h"
41 #else
42 # include <unistd.h>
43 #endif
44 
45 #include "BKE_global.h"
46 #include "BKE_image.h"
47 #include "BKE_main.h"
48 #include "BKE_scene.h"
49 
50 #include "DEG_depsgraph.h"
51 
52 #include "IMB_colormanagement.h"
53 #include "IMB_imbuf.h"
54 #include "IMB_imbuf_types.h"
55 #include "IMB_metadata.h"
56 
57 #include "SEQ_proxy.h"
58 #include "SEQ_relations.h"
59 #include "SEQ_render.h"
60 #include "SEQ_sequencer.h"
61 
62 #include "multiview.h"
63 #include "proxy.h"
64 #include "render.h"
65 #include "sequencer.h"
66 #include "strip_time.h"
67 #include "utils.h"
68 
69 typedef struct SeqIndexBuildContext {
71 
72  int tc_flags;
74  int quality;
75  bool overwrite;
76  int view_id;
77 
83 
84 int SEQ_rendersize_to_proxysize(int render_size)
85 {
86  switch (render_size) {
88  return IMB_PROXY_25;
90  return IMB_PROXY_50;
92  return IMB_PROXY_75;
94  return IMB_PROXY_100;
95  }
96  return IMB_PROXY_NONE;
97 }
98 
99 double SEQ_rendersize_to_scale_factor(int render_size)
100 {
101  switch (render_size) {
103  return 0.25;
105  return 0.50;
107  return 0.75;
108  }
109  return 1.0;
110 }
111 
112 bool seq_proxy_get_custom_file_fname(Sequence *seq, char *name, const int view_id)
113 {
114  char fname[FILE_MAXFILE];
115  char suffix[24];
116  StripProxy *proxy = seq->strip->proxy;
117 
118  if (proxy == NULL) {
119  return false;
120  }
121 
122  BLI_join_dirfile(fname, PROXY_MAXFILE, proxy->dir, proxy->file);
124 
125  if (view_id > 0) {
126  BLI_snprintf(suffix, sizeof(suffix), "_%d", view_id);
127  /* TODO(sergey): This will actually append suffix after extension
128  * which is weird but how was originally coded in multi-view branch.
129  */
130  BLI_snprintf(name, PROXY_MAXFILE, "%s_%s", fname, suffix);
131  }
132  else {
133  BLI_strncpy(name, fname, PROXY_MAXFILE);
134  }
135 
136  return true;
137 }
138 
139 static bool seq_proxy_get_fname(Editing *ed,
140  Sequence *seq,
141  int timeline_frame,
142  eSpaceSeq_Proxy_RenderSize render_size,
143  char *name,
144  const int view_id)
145 {
146  char dir[PROXY_MAXFILE];
147  char suffix[24] = {'\0'};
148  StripProxy *proxy = seq->strip->proxy;
149 
150  if (proxy == NULL) {
151  return false;
152  }
153 
154  /* Multi-view suffix. */
155  if (view_id > 0) {
156  BLI_snprintf(suffix, sizeof(suffix), "_%d", view_id);
157  }
158 
159  /* Per strip with Custom file situation is handled separately. */
160  if (proxy->storage & SEQ_STORAGE_PROXY_CUSTOM_FILE &&
162  if (seq_proxy_get_custom_file_fname(seq, name, view_id)) {
163  return true;
164  }
165  }
166 
168  /* Per project default. */
169  if (ed->proxy_dir[0] == 0) {
170  BLI_strncpy(dir, "//BL_proxy", sizeof(dir));
171  }
172  else { /* Per project with custom dir. */
173  BLI_strncpy(dir, ed->proxy_dir, sizeof(dir));
174  }
176  }
177  else {
178  /* Pre strip with custom dir. */
179  if (proxy->storage & SEQ_STORAGE_PROXY_CUSTOM_DIR) {
180  BLI_strncpy(dir, seq->strip->proxy->dir, sizeof(dir));
181  }
182  else { /* Per strip default. */
183  BLI_snprintf(dir, PROXY_MAXFILE, "%s/BL_proxy", seq->strip->dir);
184  }
185  }
186 
187  /* Proxy size number to be used in path. */
188  int proxy_size_number = SEQ_rendersize_to_scale_factor(render_size) * 100;
189 
190  BLI_snprintf(name,
192  "%s/images/%d/%s_proxy%s",
193  dir,
194  proxy_size_number,
195  SEQ_render_give_stripelem(seq, timeline_frame)->name,
196  suffix);
198  strcat(name, ".jpg");
199 
200  return true;
201 }
202 
203 bool SEQ_can_use_proxy(const struct SeqRenderData *context, Sequence *seq, int psize)
204 {
205  if (seq->strip->proxy == NULL || !context->use_proxies) {
206  return false;
207  }
208 
209  short size_flags = seq->strip->proxy->build_size_flags;
210  return (seq->flag & SEQ_USE_PROXY) != 0 && psize != IMB_PROXY_NONE && (size_flags & psize) != 0;
211 }
212 
213 ImBuf *seq_proxy_fetch(const SeqRenderData *context, Sequence *seq, int timeline_frame)
214 {
215  char name[PROXY_MAXFILE];
216  StripProxy *proxy = seq->strip->proxy;
217  const eSpaceSeq_Proxy_RenderSize psize = context->preview_render_size;
218  Editing *ed = context->scene->ed;
219  StripAnim *sanim;
220 
221  /* only use proxies, if they are enabled (even if present!) */
223  return NULL;
224  }
225 
226  if (proxy->storage & SEQ_STORAGE_PROXY_CUSTOM_FILE) {
227  int frameno = (int)seq_give_frame_index(seq, timeline_frame) + seq->anim_startofs;
228  if (proxy->anim == NULL) {
229  if (seq_proxy_get_fname(ed, seq, timeline_frame, psize, name, context->view_id) == 0) {
230  return NULL;
231  }
232 
233  proxy->anim = openanim(name, IB_rect, 0, seq->strip->colorspace_settings.name);
234  }
235  if (proxy->anim == NULL) {
236  return NULL;
237  }
238 
239  seq_open_anim_file(context->scene, seq, true);
240  sanim = seq->anims.first;
241 
243  sanim ? sanim->anim : NULL, seq->strip->proxy->tc, frameno);
244 
245  return IMB_anim_absolute(proxy->anim, frameno, IMB_TC_NONE, IMB_PROXY_NONE);
246  }
247 
248  if (seq_proxy_get_fname(ed, seq, timeline_frame, psize, name, context->view_id) == 0) {
249  return NULL;
250  }
251 
252  if (BLI_exists(name)) {
253  ImBuf *ibuf = IMB_loadiffname(name, IB_rect, NULL);
254 
255  if (ibuf) {
256  seq_imbuf_assign_spaces(context->scene, ibuf);
257  }
258 
259  return ibuf;
260  }
261 
262  return NULL;
263 }
264 
267  Sequence *seq,
268  int timeline_frame,
269  int proxy_render_size,
270  const bool overwrite)
271 {
272  char name[PROXY_MAXFILE];
273  int quality;
274  int rectx, recty;
275  ImBuf *ibuf_tmp, *ibuf;
276  Editing *ed = context->scene->ed;
277 
278  if (!seq_proxy_get_fname(ed, seq, timeline_frame, proxy_render_size, name, context->view_id)) {
279  return;
280  }
281 
282  if (!overwrite && BLI_exists(name)) {
283  return;
284  }
285 
286  ibuf_tmp = seq_render_strip(context, state, seq, timeline_frame);
287 
288  rectx = (proxy_render_size * ibuf_tmp->x) / 100;
289  recty = (proxy_render_size * ibuf_tmp->y) / 100;
290 
291  if (ibuf_tmp->x != rectx || ibuf_tmp->y != recty) {
292  ibuf = IMB_dupImBuf(ibuf_tmp);
293  IMB_metadata_copy(ibuf, ibuf_tmp);
294  IMB_freeImBuf(ibuf_tmp);
295  IMB_scalefastImBuf(ibuf, (short)rectx, (short)recty);
296  }
297  else {
298  ibuf = ibuf_tmp;
299  }
300 
301  /* depth = 32 is intentionally left in, otherwise ALPHA channels
302  * won't work... */
303  quality = seq->strip->proxy->quality;
304  ibuf->ftype = IMB_FTYPE_JPG;
305  ibuf->foptions.quality = quality;
306 
307  /* unsupported feature only confuses other s/w */
308  if (ibuf->planes == 32) {
309  ibuf->planes = 24;
310  }
311 
313 
314  const bool ok = IMB_saveiff(ibuf, name, IB_rect | IB_zbuf | IB_zbuffloat);
315  if (ok == false) {
316  perror(name);
317  }
318 
319  IMB_freeImBuf(ibuf);
320 }
321 
326 static bool seq_proxy_multiview_context_invalid(Sequence *seq, Scene *scene, const int view_id)
327 {
328  if ((scene->r.scemode & R_MULTIVIEW) == 0) {
329  return false;
330  }
331 
332  if ((seq->type == SEQ_TYPE_IMAGE) && (seq->views_format == R_IMF_VIEWS_INDIVIDUAL)) {
333  static char prefix[FILE_MAX];
334  static const char *ext = NULL;
335  char str[FILE_MAX];
336 
337  if (view_id == 0) {
338  char path[FILE_MAX];
339  BLI_join_dirfile(path, sizeof(path), seq->strip->dir, seq->strip->stripdata->name);
341  BKE_scene_multiview_view_prefix_get(scene, path, prefix, &ext);
342  }
343  else {
344  prefix[0] = '\0';
345  }
346 
347  if (prefix[0] == '\0') {
348  return view_id != 0;
349  }
350 
351  seq_multiview_name(scene, view_id, prefix, ext, str, FILE_MAX);
352 
353  if (BLI_access(str, R_OK) == 0) {
354  return false;
355  }
356 
357  return view_id != 0;
358  }
359  return false;
360 }
361 
366 {
367  int num_views = 1;
368 
369  if ((scene->r.scemode & R_MULTIVIEW) == 0) {
370  return 1;
371  }
372 
373  switch (seq->type) {
374  case SEQ_TYPE_MOVIE: {
375  num_views = BLI_listbase_count(&seq->anims);
376  break;
377  }
378  case SEQ_TYPE_IMAGE: {
379  switch (seq->views_format) {
382  break;
384  num_views = 2;
385  break;
387  /* not supported at the moment */
388  /* pass through */
389  default:
390  num_views = 1;
391  }
392  break;
393  }
394  }
395 
396  return num_views;
397 }
398 
399 static bool seq_proxy_need_rebuild(Sequence *seq, struct anim *anim)
400 {
401  if ((seq->strip->proxy->build_flags & SEQ_PROXY_SKIP_EXISTING) == 0) {
402  return true;
403  }
404 
405  IMB_Proxy_Size required_proxies = seq->strip->proxy->build_size_flags;
407  return (required_proxies & built_proxies) != required_proxies;
408 }
409 
412  Scene *scene,
413  Sequence *seq,
414  struct GSet *file_list,
415  ListBase *queue)
416 {
418  Sequence *nseq;
419  LinkData *link;
420  int num_files;
421  int i;
422 
423  if (!seq->strip || !seq->strip->proxy) {
424  return true;
425  }
426 
427  if (!(seq->flag & SEQ_USE_PROXY)) {
428  return true;
429  }
430 
431  num_files = seq_proxy_context_count(seq, scene);
432 
433  for (i = 0; i < num_files; i++) {
435  continue;
436  }
437 
438  /* Check if proxies are already built here, because actually opening anims takes a lot of
439  * time. */
440  seq_open_anim_file(scene, seq, false);
441  StripAnim *sanim = BLI_findlink(&seq->anims, i);
442  if (sanim->anim && !seq_proxy_need_rebuild(seq, sanim->anim)) {
443  continue;
444  }
445 
447 
448  context = MEM_callocN(sizeof(SeqIndexBuildContext), "seq proxy rebuild context");
449 
450  nseq = SEQ_sequence_dupli_recursive(scene, scene, NULL, seq, 0);
451 
452  context->tc_flags = nseq->strip->proxy->build_tc_flags;
453  context->size_flags = nseq->strip->proxy->build_size_flags;
454  context->quality = nseq->strip->proxy->quality;
455  context->overwrite = (nseq->strip->proxy->build_flags & SEQ_PROXY_SKIP_EXISTING) == 0;
456 
457  context->bmain = bmain;
458  context->depsgraph = depsgraph;
459  context->scene = scene;
460  context->orig_seq = seq;
461  context->seq = nseq;
462 
463  context->view_id = i; /* only for images */
464 
465  if (nseq->type == SEQ_TYPE_MOVIE) {
466  seq_open_anim_file(scene, nseq, true);
467  sanim = BLI_findlink(&nseq->anims, i);
468 
469  if (sanim->anim) {
470  context->index_context = IMB_anim_index_rebuild_context(sanim->anim,
471  context->tc_flags,
472  context->size_flags,
473  context->quality,
474  context->overwrite,
475  file_list);
476  }
477  if (!context->index_context) {
479  return false;
480  }
481  }
482 
483  link = BLI_genericNodeN(context);
484  BLI_addtail(queue, link);
485  }
486 
487  return true;
488 }
489 
491  short *stop,
492  short *do_update,
493  float *progress)
494 {
495  const bool overwrite = context->overwrite;
496  SeqRenderData render_context;
497  Sequence *seq = context->seq;
498  Scene *scene = context->scene;
499  Main *bmain = context->bmain;
500  int timeline_frame;
501 
502  if (seq->type == SEQ_TYPE_MOVIE) {
503  if (context->index_context) {
504  IMB_anim_index_rebuild(context->index_context, stop, do_update, progress);
505  }
506 
507  return;
508  }
509 
510  if (!(seq->flag & SEQ_USE_PROXY)) {
511  return;
512  }
513 
514  /* that's why it is called custom... */
516  return;
517  }
518 
519  /* fail safe code */
520 
522  context->depsgraph,
523  context->scene,
524  roundf((scene->r.size * (float)scene->r.xsch) / 100.0f),
525  roundf((scene->r.size * (float)scene->r.ysch) / 100.0f),
526  100,
527  false,
528  &render_context);
529 
530  render_context.skip_cache = true;
531  render_context.is_proxy_render = true;
532  render_context.view_id = context->view_id;
533 
536 
537  for (timeline_frame = seq->startdisp + seq->startstill;
538  timeline_frame < seq->enddisp - seq->endstill;
539  timeline_frame++) {
540  if (context->size_flags & IMB_PROXY_25) {
541  seq_proxy_build_frame(&render_context, &state, seq, timeline_frame, 25, overwrite);
542  }
543  if (context->size_flags & IMB_PROXY_50) {
544  seq_proxy_build_frame(&render_context, &state, seq, timeline_frame, 50, overwrite);
545  }
546  if (context->size_flags & IMB_PROXY_75) {
547  seq_proxy_build_frame(&render_context, &state, seq, timeline_frame, 75, overwrite);
548  }
549  if (context->size_flags & IMB_PROXY_100) {
550  seq_proxy_build_frame(&render_context, &state, seq, timeline_frame, 100, overwrite);
551  }
552 
553  *progress = (float)(timeline_frame - seq->startdisp - seq->startstill) /
554  (seq->enddisp - seq->endstill - seq->startdisp - seq->startstill);
555  *do_update = true;
556 
557  if (*stop || G.is_break) {
558  break;
559  }
560  }
561 }
562 
564 {
565  if (context->index_context) {
566  StripAnim *sanim;
567 
568  for (sanim = context->seq->anims.first; sanim; sanim = sanim->next) {
570  }
571 
572  for (sanim = context->orig_seq->anims.first; sanim; sanim = sanim->next) {
574  }
575 
576  IMB_anim_index_rebuild_finish(context->index_context, stop);
577  }
578 
580 
582 }
583 
584 void SEQ_proxy_set(struct Sequence *seq, bool value)
585 {
586  if (value) {
587  seq->flag |= SEQ_USE_PROXY;
588  if (seq->strip->proxy == NULL) {
589  seq->strip->proxy = MEM_callocN(sizeof(struct StripProxy), "StripProxy");
590  seq->strip->proxy->quality = 50;
593  }
594  }
595  else {
596  seq->flag &= ~SEQ_USE_PROXY;
597  }
598 }
599 
600 void seq_proxy_index_dir_set(struct anim *anim, const char *base_dir)
601 {
602  char dir[FILE_MAX];
603  char fname[FILE_MAXFILE];
604 
606  BLI_strncpy(dir, base_dir, sizeof(dir));
607  BLI_path_append(dir, sizeof(dir), fname);
609 }
610 
612 {
613  if (seq->strip && seq->strip->proxy && seq->strip->proxy->anim) {
614  IMB_free_anim(seq->strip->proxy->anim);
615  seq->strip->proxy->anim = NULL;
616  }
617 }
typedef float(TangentPoint)[2]
struct anim * openanim(const char *name, int flags, int streamindex, char colorspace[IMA_MAX_SPACE])
Definition: image.c:3115
const char * BKE_main_blendfile_path_from_global(void)
Definition: main.c:439
void BKE_scene_multiview_view_prefix_get(struct Scene *scene, const char *name, char *r_prefix, const char **r_ext)
Definition: scene.c:3301
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:349
int BLI_access(const char *filename, int mode) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
Definition: fileops.c:1024
struct GSet GSet
Definition: BLI_ghash.h:189
struct LinkData * BLI_genericNodeN(void *data)
Definition: listbase.c:923
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition: listbase.c:110
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:1347
#define FILE_MAXFILE
#define FILE_MAX
void BLI_path_append(char *__restrict dst, const size_t maxlen, const char *__restrict file) ATTR_NONNULL()
Definition: path_util.c:1716
void BLI_join_dirfile(char *__restrict dst, const size_t maxlen, const char *__restrict dir, const char *__restrict file) ATTR_NONNULL()
Definition: path_util.c:1737
bool BLI_path_abs(char *path, const char *basepath) ATTR_NONNULL()
Definition: path_util.c:1016
size_t BLI_snprintf(char *__restrict dst, size_t maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, const size_t maxncpy) ATTR_NONNULL()
Definition: string.c:108
Compatibility-like things for windows.
struct Depsgraph Depsgraph
Definition: DEG_depsgraph.h:51
#define R_MULTIVIEW
@ R_IMF_VIEWS_MULTIVIEW
@ R_IMF_VIEWS_STEREO_3D
@ R_IMF_VIEWS_INDIVIDUAL
@ SEQ_USE_PROXY
@ SEQ_PROXY_SKIP_EXISTING
#define SEQ_PROXY_TC_ALL
@ SEQ_STORAGE_PROXY_CUSTOM_FILE
@ SEQ_STORAGE_PROXY_CUSTOM_DIR
#define SEQ_EDIT_PROXY_DIR_STORAGE
@ SEQ_TYPE_IMAGE
@ SEQ_TYPE_MOVIE
#define SEQ_PROXY_IMAGE_SIZE_25
eSpaceSeq_Proxy_RenderSize
@ SEQ_RENDER_SIZE_PROXY_25
@ SEQ_RENDER_SIZE_PROXY_75
@ SEQ_RENDER_SIZE_PROXY_50
@ SEQ_RENDER_SIZE_PROXY_100
void IMB_anim_index_rebuild(struct IndexBuildContext *context, short *stop, short *do_update, float *progress)
Definition: indexer.c:1352
void IMB_close_anim_proxies(struct anim *anim)
Definition: anim_movie.c:238
void IMB_free_anim(struct anim *anim)
Definition: anim_movie.c:207
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)
Definition: indexer.c:1274
struct ImBuf * IMB_dupImBuf(const struct ImBuf *ibuf1)
IMB_Proxy_Size
Definition: IMB_imbuf.h:317
@ IMB_PROXY_100
Definition: IMB_imbuf.h:322
@ IMB_PROXY_75
Definition: IMB_imbuf.h:321
@ IMB_PROXY_50
Definition: IMB_imbuf.h:320
@ IMB_PROXY_25
Definition: IMB_imbuf.h:319
@ IMB_PROXY_NONE
Definition: IMB_imbuf.h:318
void IMB_freeImBuf(struct ImBuf *ibuf)
Definition: allocimbuf.c:211
void IMB_anim_set_index_dir(struct anim *anim, const char *dir)
Definition: indexer.c:1417
int IMB_anim_index_get_frame_index(struct anim *anim, IMB_Timecode_Type tc, int position)
Definition: indexer.c:1480
void IMB_anim_index_rebuild_finish(struct IndexBuildContext *context, short stop)
Definition: indexer.c:1376
IMB_Proxy_Size IMB_anim_proxy_get_existing(struct anim *anim)
Definition: indexer.c:1491
struct ImBuf * IMB_loadiffname(const char *filepath, int flags, char colorspace[IM_MAX_SPACE])
Definition: readimage.c:224
void IMB_anim_get_fname(struct anim *anim, char *file, int size)
Definition: indexer.c:402
struct ImBuf * IMB_anim_absolute(struct anim *anim, int position, IMB_Timecode_Type tc, IMB_Proxy_Size preview_size)
Definition: anim_movie.c:1580
bool IMB_scalefastImBuf(struct ImBuf *ibuf, unsigned int newx, unsigned int newy)
Definition: scaling.c:1715
bool IMB_saveiff(struct ImBuf *ibuf, const char *filepath, int flags)
Definition: writeimage.c:44
@ IMB_TC_NONE
Definition: IMB_imbuf.h:300
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:80
Read Guarded memory(de)allocation.
Scene scene
const Depsgraph * depsgraph
#define str(s)
@ IMB_FTYPE_JPG
void(* MEM_freeN)(void *vmemh)
Definition: mallocn.c:41
void *(* MEM_callocN)(size_t len, const char *str)
Definition: mallocn.c:45
static ulong state[N]
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:57
ThreadQueue * queue
all scheduled work for the cpu
static bool seq_proxy_need_rebuild(Sequence *seq, struct anim *anim)
Definition: proxy.c:399
void free_proxy_seq(Sequence *seq)
Definition: proxy.c:611
void SEQ_proxy_set(struct Sequence *seq, bool value)
Definition: proxy.c:584
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:265
void seq_proxy_index_dir_set(struct anim *anim, const char *base_dir)
Definition: proxy.c:600
static bool seq_proxy_get_fname(Editing *ed, Sequence *seq, int timeline_frame, eSpaceSeq_Proxy_RenderSize render_size, char *name, const int view_id)
Definition: proxy.c:139
struct SeqIndexBuildContext SeqIndexBuildContext
void SEQ_proxy_rebuild(SeqIndexBuildContext *context, short *stop, short *do_update, float *progress)
Definition: proxy.c:490
static bool seq_proxy_multiview_context_invalid(Sequence *seq, Scene *scene, const int view_id)
Definition: proxy.c:326
static int seq_proxy_context_count(Sequence *seq, Scene *scene)
Definition: proxy.c:365
int SEQ_rendersize_to_proxysize(int render_size)
Definition: proxy.c:84
void SEQ_proxy_rebuild_finish(SeqIndexBuildContext *context, bool stop)
Definition: proxy.c:563
ImBuf * seq_proxy_fetch(const SeqRenderData *context, Sequence *seq, int timeline_frame)
Definition: proxy.c:213
bool SEQ_can_use_proxy(const struct SeqRenderData *context, Sequence *seq, int psize)
Definition: proxy.c:203
double SEQ_rendersize_to_scale_factor(int render_size)
Definition: proxy.c:99
bool SEQ_proxy_rebuild_context(Main *bmain, Depsgraph *depsgraph, Scene *scene, Sequence *seq, struct GSet *file_list, ListBase *queue)
Definition: proxy.c:410
bool seq_proxy_get_custom_file_fname(Sequence *seq, char *name, const int view_id)
Definition: proxy.c:112
#define PROXY_MAXFILE
Definition: proxy.h:35
StripElem * SEQ_render_give_stripelem(Sequence *seq, int timeline_frame)
Definition: render.c:242
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:211
ImBuf * seq_render_strip(const SeqRenderData *context, SeqRenderState *state, Sequence *seq, float timeline_frame)
Definition: render.c:1774
void seq_imbuf_assign_spaces(Scene *scene, ImBuf *ibuf)
Definition: render.c:95
void seq_render_state_init(SeqRenderState *state)
Definition: render.c:237
struct SELECTID_Context context
Definition: select_engine.c:47
Sequence * SEQ_sequence_dupli_recursive(const Scene *scene_src, Scene *scene_dst, ListBase *new_seq_list, Sequence *seq, int dupe_flag)
Definition: sequencer.c:548
void seq_free_sequence_recurse(Scene *scene, Sequence *seq, const bool do_id_user)
Definition: sequencer.c:220
void SEQ_relations_sequence_free_anim(Sequence *seq)
float seq_give_frame_index(Sequence *seq, float timeline_frame)
Definition: strip_time.c:48
char proxy_dir[1024]
ImbFormatOptions foptions
unsigned char planes
enum eImbFileType ftype
void * first
Definition: DNA_listBase.h:47
Definition: BKE_main.h:116
struct RenderData r
Sequence * seq
Definition: proxy.c:81
struct IndexBuildContext * index_context
Definition: proxy.c:70
Scene * scene
Definition: proxy.c:80
Depsgraph * depsgraph
Definition: proxy.c:79
Sequence * orig_seq
Definition: proxy.c:81
bool is_proxy_render
Definition: SEQ_render.h:52
bool skip_cache
Definition: SEQ_render.h:51
ListBase anims
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:87
#define G(x, y, z)
void seq_open_anim_file(Scene *scene, Sequence *seq, bool openfile)
Definition: utils.c:266