Re: AVDemuxer mediastatus after unload call?
Gilles Caulier <[email protected]> Sun, 18 Sep 2022 18:17:37 +0200
| Newsgroups | gmane.comp.kde.digikam.devel |
|---|---|
| Message-ID | <CAHFG6sF9bdE+KMuLeqb7ukS7U=n7EF1hkcZ6UQKStHU=r-pZ5g@mail.gmail.com> |
Looking in source code : mediastatus() return an internal variable based on MediaStatus enum : https://invent.kde.org/graphics/digikam/-/blob/master/core/libs/video/qtav/ffmpeg/AVDemuxer.cpp#L660 Defined here : https://invent.kde.org/graphics/digikam/-/blob/master/core/libs/video/qtav/utils/QtAV_Global.h#L76 So the private value of AVDemuxer::Private::media_status is only changed in class by the provate method AVDemuxer::setMediaStatus(), which is called only in AVDemuxer. So to hack; all must be located in the class, including a bug if any... Gilles Le dim. 18 sept. 2022 à 01:19, Steven Robbins <[email protected]> a écrit : > > Looking for a sanity check on my understanding. I've written a test case (see > below) that passes. What puzzles me is that the call to mediaStatus() returns > "LoadedMedia" after a call to unload(). Is that correct? > > > void status() > { > AVDemuxer demux; > QCOMPARE(demux.mediaStatus(), MediaStatus::NoMedia); > QCOMPARE(demux.atEnd(), false); > QCOMPARE(demux.fileName(), QLatin1String("")); > QCOMPARE(demux.isLoaded(), false); > > QVERIFY(demux.setMedia(testFile1())); > QCOMPARE(demux.mediaStatus(), MediaStatus::NoMedia); > QCOMPARE(demux.atEnd(), false); > QCOMPARE(demux.fileName(), testFile1()); > QCOMPARE(demux.isLoaded(), false); > > QVERIFY(demux.load()); > QCOMPARE(demux.mediaStatus(), MediaStatus::LoadedMedia); > QCOMPARE(demux.atEnd(), false); > QCOMPARE(demux.fileName(), testFile1()); > QCOMPARE(demux.isLoaded(), true); > > QVERIFY(demux.unload()); > QCOMPARE(demux.mediaStatus(), MediaStatus::LoadedMedia); // ??? why > status shows loaded? > QCOMPARE(demux.atEnd(), false); > QCOMPARE(demux.fileName(), testFile1()); > QCOMPARE(demux.isLoaded(), false); > } >