add an extractor using qtmultimedia
ClosedPublic

Authored by mgallien on Apr 12 2017, 9:18 PM.

Details

Summary

the new extractor is not as good as the taglib built one but depend only
on QtMultimedia

the quality of the extraction depends on the platform specific support
built into QtMultimedia

Test Plan

automatic test passes even if much fewer values are extracted

Diff Detail

Repository
R286 KFileMetaData
Lint
No Linters Available
Unit
No Unit Test Coverage
mgallien created this revision.Apr 12 2017, 9:18 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptApr 12 2017, 9:18 PM
Restricted Application added a subscriber: Frameworks. · View Herald Transcript
mgallien updated this revision to Diff 13367.Apr 12 2017, 9:20 PM

update copyright

mgallien updated this revision to Diff 13840.Apr 26 2017, 3:44 PM

fix several issues when testing on Windows with DirectShow Qt backend

Could somebody review this as that would allow simpler build from source than building taglib and its dependencies and allow simpler deployment on Windows and Android ?
Thanks in advance

dfaure requested changes to this revision.Jun 12 2017, 7:24 AM
dfaure added a subscriber: dfaure.

If this extractor is worse than the taglib one, shouldn't the cmake run issue a warning about that? Or does it already do so because "taglib not found"?

autotests/qtmultimediaextractortest.cpp
2

you probably don't want to commit a merge conflict...

8

+ your own copyright?

39

What if the path contains non-latin characters?
This should use QFile::decodeName instead.

src/extractors/qtmultimediaextractor.cpp
2

todo

78

The mutex needs to be locked for all these writes.

210

If setMediaSource calls wakeAll before this thread gets here, we will wait forever (QWaitCondition = if you're not sleeping, you miss the wakeup call).

Use a QSemaphore instead of a QWaitCondition to fix this problem.

213

Use QMutexLocker instead of manual lock/unlock, to make sure no unlock is forgotten.

src/extractors/qtmultimediaextractor.h
2

todo ;)

This revision now requires changes to proceed.Jun 12 2017, 7:24 AM
mgallien updated this revision to Diff 15454.Jun 14 2017, 9:11 PM
mgallien edited edge metadata.
mgallien marked 7 inline comments as done.

fix issues reported by dfaure

Thanks for the review.
The idea of this extractor is to have an extractor not needing taglib (ease of build, build on platforms other than linux distributions).
QtMultimedia is not extracting a lot of metadata on linux+gstreamer but other platforms have better support.

autotests/qtmultimediaextractortest.cpp
8

I copy/pasted it from the test of taglib and did nothing original. This the reason to keep original copyright.

dfaure accepted this revision.Jun 15 2017, 7:10 AM
This revision is now accepted and ready to land.Jun 15 2017, 7:10 AM
This revision was automatically updated to reflect the committed changes.
dfaure added a comment.EditedDec 2 2017, 9:40 AM

This test seems to fail depending on how QtMultimedia was built. See failure from the flaska CI, below. Can something be done to detect this?

2017-12-01 19:31:03,939 [output] ********* Start testing of QtMultimediaExtractorTest *********
2017-12-01 19:31:03,939 [output] Config: Using QtTest library 5.7.1, Qt 5.7.1 (x86_64-little_endian-lp64 shared (dynamic) debug build; by Clang 3.8.0 (tags/RELEASE_380/final))
2017-12-01 19:31:03,939 [output] PASS   : QtMultimediaExtractorTest::initTestCase()
2017-12-01 19:31:03,939 [output] QWARN  : QtMultimediaExtractorTest::test() Warning: "No decoder available for type 'audio/x-opus'."
2017-12-01 19:31:03,939 [output] FAIL!  : QtMultimediaExtractorTest::test() Compared values are not the same
2017-12-01 19:31:03,940 [output]    Actual   (resultOpus.types().size()): 0
2017-12-01 19:31:03,940 [output]    Expected (1)                        : 1
2017-12-01 19:31:03,940 [output]    Loc: [/home/turbo-hipster/git/d4acdd80bf40/kfilemetadata/autotests/qtmultimediaextractortest.cpp(46)]
2017-12-01 19:31:03,940 [output] QWARN  : QtMultimediaExtractorTest::test() Error: "Your GStreamer installation is missing a plug-in."
2017-12-01 19:31:03,940 [output] QFATAL : QtMultimediaExtractorTest::test() ASSERT failure in QCoreApplication::sendEvent: "Cannot send events to objects owned by a different thread. Current thread 23cc340. Receiver '' (of type 'QGstreamerPlayerSession') was created in thread 2406498", file kernel/qcoreapplication.cpp, line 541
2017-12-01 19:31:03,940 [output] FAIL!  : QtMultimediaExtractorTest::test() Received a fatal error.
2017-12-01 19:31:03,940 [output]    Loc: [Unknown file(0)]
2017-12-01 19:31:03,940 [output] Totals: 1 passed, 2 failed, 0 skipped, 0 blacklisted, 20713ms
2017-12-01 19:31:03,941 [output] ********* Finished testing of QtMultimediaExtractorTest *********

http://ci-logs.kde.flaska.net/6c/6c9111a952fb7c70c864b663d25080e418a0222c/rebuilddep/rebuilddep-kf5-qt57-clang-el7/f7f590a/shell_output.log

This test seems to fail depending on how QtMultimedia was built. See failure from the flaska CI, below. Can something be done to detect this?

The extractor is not working well. On Windows, it appears as a reader in the volume applet. I am missing time to fix all its problems. This is why I did D8886 .

2017-12-01 19:31:03,939 [output] ********* Start testing of QtMultimediaExtractorTest *********
2017-12-01 19:31:03,939 [output] Config: Using QtTest library 5.7.1, Qt 5.7.1 (x86_64-little_endian-lp64 shared (dynamic) debug build; by Clang 3.8.0 (tags/RELEASE_380/final))
2017-12-01 19:31:03,939 [output] PASS   : QtMultimediaExtractorTest::initTestCase()
2017-12-01 19:31:03,939 [output] QWARN  : QtMultimediaExtractorTest::test() Warning: "No decoder available for type 'audio/x-opus'."
2017-12-01 19:31:03,939 [output] FAIL!  : QtMultimediaExtractorTest::test() Compared values are not the same
2017-12-01 19:31:03,940 [output]    Actual   (resultOpus.types().size()): 0
2017-12-01 19:31:03,940 [output]    Expected (1)                        : 1
2017-12-01 19:31:03,940 [output]    Loc: [/home/turbo-hipster/git/d4acdd80bf40/kfilemetadata/autotests/qtmultimediaextractortest.cpp(46)]
2017-12-01 19:31:03,940 [output] QWARN  : QtMultimediaExtractorTest::test() Error: "Your GStreamer installation is missing a plug-in."
2017-12-01 19:31:03,940 [output] QFATAL : QtMultimediaExtractorTest::test() ASSERT failure in QCoreApplication::sendEvent: "Cannot send events to objects owned by a different thread. Current thread 23cc340. Receiver '' (of type 'QGstreamerPlayerSession') was created in thread 2406498", file kernel/qcoreapplication.cpp, line 541
2017-12-01 19:31:03,940 [output] FAIL!  : QtMultimediaExtractorTest::test() Received a fatal error.
2017-12-01 19:31:03,940 [output]    Loc: [Unknown file(0)]
2017-12-01 19:31:03,940 [output] Totals: 1 passed, 2 failed, 0 skipped, 0 blacklisted, 20713ms
2017-12-01 19:31:03,941 [output] ********* Finished testing of QtMultimediaExtractorTest *********

http://ci-logs.kde.flaska.net/6c/6c9111a952fb7c70c864b663d25080e418a0222c/rebuilddep/rebuilddep-kf5-qt57-clang-el7/f7f590a/shell_output.log