various: added hooks so that various lengthy functions could be cancelled from another thread

This commit is contained in:
itsmattkc
2020-02-17 02:10:12 +11:00
parent fd49b6eb55
commit 22046535ca
25 changed files with 208 additions and 80 deletions
+3 -3
View File
@@ -38,7 +38,7 @@ QString OIIODecoder::id()
return "oiio";
}
bool OIIODecoder::Probe(Footage *f)
bool OIIODecoder::Probe(Footage *f, const QAtomicInt *cancelled)
{
// We prioritize OIIO over FFmpeg to pick up still images more effectively, but some OIIO decoders (notably OpenJPEG)
// will segfault entirely if given unexpected data (an MPEG-4 for instance). To workaround this issue, we use OIIO's
@@ -133,7 +133,7 @@ bool OIIODecoder::Open()
return true;
}
FramePtr OIIODecoder::RetrieveVideo(const rational &timecode)
FramePtr OIIODecoder::RetrieveVideo(const rational &timecode, const QAtomicInt *cancelled)
{
if (!open_ && !Open()) {
return nullptr;
@@ -174,7 +174,7 @@ void OIIODecoder::Close()
frame_ = nullptr;
}
int64_t OIIODecoder::GetTimestampFromTime(const rational &time)
int64_t OIIODecoder::GetTimestampFromTime(const rational &time, const QAtomicInt *cancelled)
{
Q_UNUSED(time)