Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2019-02-05 18:50:57 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2019-02-05 18:52:36 +0300
commit08ab09cf04d93520118460b3d1f243313b7892b8 (patch)
tree71b2852270fb653a041266bf789cee842cd0f461 /source/blender
parent3467e40e01fd84c322189329a4f38ac830bc4729 (diff)
Clip editor: Fixes for prefetch
Seems metadata was never read while prefetching, at least was never requested to be read. Also fixed prefetch for multilayer EXR.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/blenkernel/BKE_movieclip.h2
-rw-r--r--source/blender/blenkernel/intern/movieclip.c23
-rw-r--r--source/blender/editors/space_clip/clip_editor.c6
3 files changed, 21 insertions, 10 deletions
diff --git a/source/blender/blenkernel/BKE_movieclip.h b/source/blender/blenkernel/BKE_movieclip.h
index cc41e6ba084..4c3b8d05ca5 100644
--- a/source/blender/blenkernel/BKE_movieclip.h
+++ b/source/blender/blenkernel/BKE_movieclip.h
@@ -45,6 +45,8 @@ void BKE_movieclip_reload(struct Main *bmain, struct MovieClip *clip);
void BKE_movieclip_clear_cache(struct MovieClip *clip);
void BKE_movieclip_clear_proxy_cache(struct MovieClip *clip);
+void BKE_movieclip_convert_multilayer_ibuf(struct ImBuf *ibuf);
+
struct ImBuf *BKE_movieclip_get_ibuf(struct MovieClip *clip, struct MovieClipUser *user);
struct ImBuf *BKE_movieclip_get_postprocessed_ibuf(struct MovieClip *clip, struct MovieClipUser *user, int postprocess_flag);
struct ImBuf *BKE_movieclip_get_stable_ibuf(struct MovieClip *clip, struct MovieClipUser *user, float loc[2], float *scale, float *angle, int postprocess_flag);
diff --git a/source/blender/blenkernel/intern/movieclip.c b/source/blender/blenkernel/intern/movieclip.c
index 5d2616b7720..b67a39494c3 100644
--- a/source/blender/blenkernel/intern/movieclip.c
+++ b/source/blender/blenkernel/intern/movieclip.c
@@ -197,6 +197,8 @@ static void get_proxy_fname(const MovieClip *clip,
strcat(name, ".jpg");
}
+#ifdef WITH_OPENEXR
+
typedef struct MultilayerConvertContext {
float *combined_pass;
int num_combined_channels;
@@ -247,12 +249,21 @@ static void movieclip_convert_multilayer_add_pass(
}
}
+#endif /* WITH_OPENEXR */
+
/* Will try to make image buffer usable when originating from the multi-layer
* source.
* Internally finds a first combined pass and uses that as a buffer. Not ideal,
* but is better than a complete empty buffer. */
-static void movieclip_convert_multilayer(ImBuf *ibuf)
+void BKE_movieclip_convert_multilayer_ibuf(struct ImBuf *ibuf)
{
+ if (ibuf == NULL) {
+ return;
+ }
+#ifdef WITH_OPENEXR
+ if (ibuf->ftype != IMB_FTYPE_OPENEXR || ibuf->userdata == NULL) {
+ return;
+ }
MultilayerConvertContext ctx;
ctx.combined_pass = NULL;
ctx.num_combined_channels = 0;
@@ -271,6 +282,7 @@ static void movieclip_convert_multilayer(ImBuf *ibuf)
}
IMB_exr_close(ibuf->userdata);
ibuf->userdata = NULL;
+#endif
}
static ImBuf *movieclip_load_sequence_file(MovieClip *clip,
@@ -310,14 +322,7 @@ static ImBuf *movieclip_load_sequence_file(MovieClip *clip,
/* read ibuf */
ibuf = IMB_loadiffname(name, loadflag, colorspace);
-
-#ifdef WITH_OPENEXR
- if (ibuf) {
- if (ibuf->ftype == IMB_FTYPE_OPENEXR && ibuf->userdata) {
- movieclip_convert_multilayer(ibuf);
- }
- }
-#endif
+ BKE_movieclip_convert_multilayer_ibuf(ibuf);
return ibuf;
}
diff --git a/source/blender/editors/space_clip/clip_editor.c b/source/blender/editors/space_clip/clip_editor.c
index 24103ed9054..c8694647d9d 100644
--- a/source/blender/editors/space_clip/clip_editor.c
+++ b/source/blender/editors/space_clip/clip_editor.c
@@ -773,7 +773,7 @@ static void prefetch_task_func(TaskPool * __restrict pool, void *task_data, int
while ((mem = prefetch_thread_next_frame(queue, clip, &size, &current_frame))) {
ImBuf *ibuf;
MovieClipUser user = {0};
- int flag = IB_rect | IB_alphamode_detect;
+ int flag = IB_rect | IB_multilayer | IB_alphamode_detect | IB_metadata;
int result;
char *colorspace_name = NULL;
const bool use_proxy = (clip->flag & MCLIP_USE_PROXY) &&
@@ -789,6 +789,10 @@ static void prefetch_task_func(TaskPool * __restrict pool, void *task_data, int
}
ibuf = IMB_ibImageFromMemory(mem, size, flag, colorspace_name, "prefetch frame");
+ if (ibuf == NULL) {
+ continue;
+ }
+ BKE_movieclip_convert_multilayer_ibuf(ibuf);
result = BKE_movieclip_put_frame_if_possible(clip, &user, ibuf);