[Cin] vmodule.c and caching of decoded video?
Andrew Randrianasulu
randrianasulu at gmail.com
Sat Mar 14 17:04:59 CET 2020
Question:
I was looking at old CinCV repo and found there this commit:
https://repo.or.cz/cinelerra_cv/ct.git/commit/1be2d5c765349982fa1d9b72bdcaaa0377fff05f
r743: Enable caching of frames even when not rendering static frames
diff --git a/cinelerra/vmodule.C b/cinelerra/vmodule.C
index 65efb0a..841fb40 100644 (file)
--- a/cinelerra/vmodule.C
+++ b/cinelerra/vmodule.C
@@ -235,12 +235,12 @@ SET_TRACE
// file -> temp
// Cache for single frame only
- if(renderengine && renderengine->command->single_frame())
+// if(renderengine && renderengine->command->single_frame())
source->set_cache_frames(1);
SET_TRACE
result = source->read_frame((*input));
SET_TRACE
- if(renderengine && renderengine->command->single_frame())
+// if(renderengine && renderengine->command->single_frame())
source->set_cache_frames(0);
//printf("VModule::import_frame 1 %lld %f\n", input_position, frame_rate);
@@ -306,10 +306,10 @@ SET_TRACE
{
//printf("VModule::import_frame 30 %p\n", output);
// Cache single frames only
- if(renderengine && renderengine->command->single_frame())
+// if(renderengine && renderengine->command->single_frame())
source->set_cache_frames(1);
result = source->read_frame(output);
- if(renderengine && renderengine->command->single_frame())
+// if(renderengine && renderengine->command->single_frame())
source->set_cache_frames(0);
//printf("VModule::import_frame 40\n");
}
cehtehs branch of CinelerraCV
in modern CinGG same function done a bit differently, but still only
enables caching of single frames. Why?
https://git.cinelerra-gg.org/git/?p=goodguy/cinelerra.git;a=blob;f=cinelerra-5.1/cinelerra/vmodule.C;h=6659dd4529e5305b11a053fc4b9c4b6ee47b9a03;hb=HEAD
292 int use_cache = renderengine &&
293 renderengine->command->single_frame();
search for more instances of use_cache ....
Of course there might be some bug somewhere preventing such usage -
but I really like to see this commented, then ...
Ah, it was disabled again in
https://repo.or.cz/cinelerra_cv/ct.git/commit/c8d7b9183ac263d540ccbc15b125fc7aaad65311
(part of big 2.1 merge)
I wonder what will hapen if I enable this .. :}
Something else to try ....
As far as I understand, anync decoding by itself also disabled in CinGG, looking at same module?
But even normal decoding still may leave few frames around, and Cin may reuse them,
for example for backward playback, no?
Having some clarification about what each mode was supposed to do at the top of file will be great ....
Unfortunately, I don't understand Cin enough for making those top comments.. I think.
This idea obviously can be low priority - just add new module comment each time you edited
said module ..so, after some time thwy all will contain brief description of their functions
and quircks/historical artifacts, I think
PS; I spend a lot of time trying to debug this bc2000 playback crash - so yes, threading is
not as simple in impl as I made it on (virtual) paper .. :/
More information about the Cin
mailing list