summaryrefslogtreecommitdiffstats
path: root/src/plugins/directshow
Commit message (Collapse)AuthorAgeFilesLines
* Fix case of header file includes for building with mingw-w645.14Marius Kittler2020-04-261-1/+1
| | | | | Change-Id: Ie0e6599234c38c5e5a75b681a911f3728871861e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* DirectShow: Use MEDIASUBTYPE_Y800 as QVideoFrame::Format_Y8Val Doroshchuk2020-04-082-3/+14
| | | | | | | | Added MEDIASUBTYPE_Y800 with GUID: {30303859-0000-0010-8000-00AA00389B71} Fixes: QTBUG-83071 Change-Id: I2e51ae1d2ae62d4d4cd7f68eecc0605bdc8c7f3a Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* DirectShow: Handle QVideoFormat::BGR24 in bytesPerLine()Andy Shaw2020-03-201-0/+1
| | | | | | | | Since we are mapping from MEDIASUBTYPE_RGB24 to QVideoFormat::BGR24 then we should make sure this returns the correct value from bytesPerLine. Change-Id: I8cc31d29a03bf2c1d7682de32448db0db9656cc7 Reviewed-by: VaL Doroshchuk <valentyn.doroshchuk@qt.io>
* DirectShow: Round stop position down to available bytes in IAsyncReaderVal Doroshchuk2020-03-161-1/+1
| | | | | | | | | | | | | | | | | | Currently requested IMediaSample might contain the end time that exceeds the available bytes which causes returning an error in WaitForNext() and stopping the playback. Regarding to IAsyncReader::Request documentation: The start and stop positions should match the alignment that was decided when the pins connected. The stop position might exceed the real duration. If so, the method rounds the stop position down to the actual alignment. Fixes: QTBUG-77782 Change-Id: I644e25bfc6bb8f6d345b8424b79fb56490d82c0e Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit 9e96fe2cbf79a44039de0edcc854050d84b87588) Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Merge remote-tracking branch 'origin/5.13' into 5.14Qt Forward Merge Bot2019-10-151-1/+1
|\ | | | | | | | | | | | | | | Conflicts: src/multimedia/video/qvideoframe.cpp src/plugins/directshow/player/directshowplayercontrol.cpp Change-Id: I00840245e35861cf4fe1d62789815ca125b2052a
| * DirectShow: Fix crash when media in qrc is set twiceVal Doroshchuk2019-10-081-1/+2
| | | | | | | | | | | | | | | | | | | | | | When qrc media content is set, it allocates and opens QFile. If the same content is set again, the url remains the same, but it creats new QFile, and need to update DirectShowIOReader by new stream. Change-Id: If3f5c187c4e2987e1a593b45f9a46c3c1b77ce45 Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* | Merge remote-tracking branch 'origin/5.13' into 5.14Qt Forward Merge Bot2019-10-081-6/+8
|\| | | | | | | | | | | | | Conflicts: src/multimedia/configure.json Change-Id: Ie887a5f4d718cb3e082b0e2ee996c6687af330cb
| * DirectShow: Don't seek if playback is stoppedVal Doroshchuk2019-10-011-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the playback is already stopped, and after that new position is requested twice, e.g. stop(); setPosition(0); setPosition(0); this causes the playback to start. Need to postpone setting of new position until play is requested. Also no need to emit positionChanged when position is not changed. Fixes: QTBUG-68778 Change-Id: Ib62942ee155d9c8ed2310132dcc6b501dfef1a04 Reviewed-by: Christian Strømme <christian.stromme@qt.io>
| * DirectShow: Emit media status before errorVal Doroshchuk2019-10-011-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Media status should be emitted before any error. Since error can cause changing the media and changing to new media status. Fixes BFAIL : tst_QMediaPlayerBackend::playlistObject() Compared values are not the same Actual (mediaStatusSpy.count()): 4 Expected (6) : 6 Task-number: QTBUG-46368 Change-Id: I8eb82e7a551d78abd143baa594cfda9bacd7e544 Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* | Merge remote-tracking branch 'origin/5.13' into 5.14Qt Forward Merge Bot2019-10-013-1/+23
|\| | | | | | | | | | | | | Conflicts: src/multimedia/video/qvideoframe.h Change-Id: I8458c4138be05f661d6528116cbc6b18298f0a91
| * DirectShow: Implement QMediaVideoProbeControl->flushVal Doroshchuk2019-09-273-1/+23
| | | | | | | | | | | | | | | | | | | | | | | | Need to flush when at least one frame is probed and stop is called, EOS or QMediaPlayer is destroyed. Fixes BFAIL : tst_QMediaPlayerBackend::probes() '(probeHandler.isVideoFlushCalled)' returned FALSE. () Task-number: QTBUG-46368 Change-Id: I09ebd6608c9a1b8a0a0707d83200d75ddb435734 Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* | Merge remote-tracking branch 'origin/5.13' into 5.14Qt Forward Merge Bot2019-09-126-22/+34
|\| | | | | | | | | | | | | | | Conflicts: src/gsttools/qgstvideorenderersink.cpp src/gsttools/qgstvideorenderersink_p.h Change-Id: I7fe29161d568fa3f7688abfd2f993d1b16ac3fb9
| * DirectShow: Allow QMediaPlayer in secondary threadVal Doroshchuk2019-09-094-22/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since using of any COM objects must be only after CoInitialize(), otherwise CoCreateInstance() returns nothing which causes a crash. If QMediaPlayer is moved to another thread, loading of any content will also cause a crash because of COM is not initialized. Proposing to use thread_local ref counter to keep each thread initialized and avoid double initialization. Fixes: QTBUG-77163 Change-Id: I81c67d6407b853c824edd3b42454fddf792fd90c Reviewed-by: Christian Strømme <christian.stromme@qt.io>
| * Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-09-083-0/+5
| |\ | | | | | | | | | Change-Id: Idc377c82cc1d2bd53069babc7f14618ef46dc67b
| | * DirectShow: Add startTime and endTime to QVideoFrameVal Doroshchuk2019-08-293-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the application seeks to a new position, the Media Session restarts the presentation clock at the specified seek time. The media source might deliver samples with a slightly earlier time stamp if the seek time does not fall on a key-frame boundary. And IMFSample->GetSampleTime will return time that is related to a position when the clock has been restarted, and can be also negative. So if it needs to have times from the beginning, it would require to add seeked position to times from IMFSample. It also reverts c4de056a6aa44567cdbf2ce91a464e597ad4af8f Fixes: QTBUG-77849 Change-Id: I1a7cb7bd18aee73087a61d2ed2c3d644ad0fbd50 Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* | | Port from QMutex::Recursive to QRecursiveMutexMarc Mutz2019-08-016-42/+43
| | | | | | | | | | | | | | | | | | | | | | | | Also port from QMutexLocker to std::lock_guard or std::unique_lock, as the former will not support QRecursiveMutex going forward. Change-Id: I1ed1a129e2b9b77aa0a729e8cab03c673566a345 Reviewed-by: VaL Doroshchuk <valentyn.doroshchuk@qt.io>
* | | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-07-306-20/+21
|\| | | | | | | | | | | Change-Id: I329eeefafed87ff7467d21d5d099cf9897660167
| * | Merge remote-tracking branch 'origin/5.12' into 5.13Liang Qi2019-07-2318-89/+90
| |\| | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/directshow/player/directshowplayerservice.cpp Change-Id: I482098bb3c3b5b291175ca798b0d6ba61ad87d86
| | * DirectShow: Set QMediaPlayer::NoMedia if empty url is providedVal Doroshchuk2019-07-172-8/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In case of clearing current playlist by passing nullptr to QMediaPlayer::setPlaylist, empty url is passed to a backend: QMediaContent m(playlist, QUrl(), false); setMedia(m); The status should be updated by QMediaPlayer::NoMedia if empty url is passed. Fixes tst_QMediaPlayerBackend::playlistObject() Task-number: QTBUG-65574 Change-Id: Iea03e3fcb8d74c9b1b482aa06b42686cf8c9e9a7 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
| | * use correct types when creating an empty Windows eventRolf Eike Beer2019-07-162-3/+3
| | | | | | | | | | | | | | | Change-Id: I9f811b4d0aadb04d3552dcd1f26a1565dfc230e2 Reviewed-by: VaL Doroshchuk <valentyn.doroshchuk@qt.io>
| | * DirectShow plugin: use new style connect syntaxRolf Eike Beer2019-07-164-15/+15
| | | | | | | | | | | | | | | Change-Id: I5c2dadfe1154961adcecf779126166aea4d32393 Reviewed-by: VaL Doroshchuk <valentyn.doroshchuk@qt.io>
| | * DirectShow plugin: use nullptr instead of NULLRolf Eike Beer2019-07-1614-71/+71
| | | | | | | | | | | | | | | Change-Id: Ied89175c4b7f5df090deac174b1da1e8496ee533 Reviewed-by: VaL Doroshchuk <valentyn.doroshchuk@qt.io>
* | | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-07-163-3/+9
|\| | | | | | | | | | | Change-Id: I7ca7fb6143ec296c16a37a7be236470dbd1742a7
| * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-07-113-3/+9
| |\| | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: Ic700bdddc5b4ae663af0daae54feb2420c8a1730
| | * Fix GetFrameRateList checks and memory leakNate Weibley2019-07-051-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GetFrameRateList passes an unmanaged pointer to the caller which must be manually freed with CoTaskMemFree. Additionally the Chromium project notes that some drivers cause quirky return values which we would not catch without stricter checks. See: https://chromium.googlesource.com/chromium/src/media/+/8cc93abd7339eeb9b7c2a12cca07b3dc245b2139/video/capture/win/video_capture_device_win.cc#484 Change-Id: I6aa4a6ea1ac0241e585e98cf9ff63240bacd3956 Reviewed-by: Christian Strømme <christian.stromme@qt.io>
| | * Fix MinGW buildJoerg Bornemann2019-07-021-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With newer MinGW versions we have to link against libamstrmid for the symbols IID_IMFTopologyServiceLookupClient, IID_IMFVideoDeviceID and IID_IMFVideoPresenter. Fixes: QTBUG-70655 Change-Id: Ib203d991d2bd8cd63193a7319c156f30f0e8826b Reviewed-by: VaL Doroshchuk <valentyn.doroshchuk@qt.io>
| | * DirectShow: Map MEDIASUBTYPE_RGB24 to QVideoFrame::Format_BGR24Val Doroshchuk2019-07-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MEDIASUBTYPE_RGB24 inverts Red and Blue channels, i.e. on Little-Endian: BGR and thus Format_BGR24 should be used instead of Format_RGB24. To reproduce the bug: QCameraViewfinderSettings settings; settings.setPixelFormat(QVideoFrame::Format_RGB24); camera->setViewfinderSettings(settings); If the camera supports MEDIASUBTYPE_RGB24 it will show Red and Blue channels inverted. *NOTE* This fix causes ignoring MEDIASUBTYPE_RGB24 format and using MEDUASUBTYPE_RGB32 instead. Because the video surfaces currently do not support QVideoFrame::Format_BGR32. So it fixes the issue with inverted colors by ignoring RGB24 media type. If there is a need to use RGB24, it would require to implement custom surface which supports QVideoFrame::Format_BGR24 and swap colors manually. Change-Id: I0d77694ef688a05dc52d13f991a5088e00f72867 Fixes: QTBUG-75959 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | | DirectShow: Introduce nullptrFriedemann Kleint2019-06-1235-173/+173
| | | | | | | | | | | | | | | | | | | | | Apply Fixits by Qt Creator. Change-Id: Idbd52ceaac6ee02f23d05f5a9b1ab6d58298b6a5 Reviewed-by: André de la Rocha <andre.rocha@qt.io>
* | | DirectShow: Use member initializationFriedemann Kleint2019-06-1240-283/+144
| | | | | | | | | | | | | | | Change-Id: I4e696083c2ed78b374f2df64706ecb2297f122dd Reviewed-by: André de la Rocha <andre.rocha@qt.io>
* | | DirectShow: Clang warnings about else after return, breakFriedemann Kleint2019-06-125-25/+24
| | | | | | | | | | | | | | | | | | | | | Disentangle code of DirectShowPlayerService::requestControl(). Change-Id: I2e90d5c86acdbe2f20f421f43929e0e9c5580eaf Reviewed-by: André de la Rocha <andre.rocha@qt.io>
* | | DirectShow: Fix clang-warning about mixing const/non-const iteratorsFriedemann Kleint2019-06-121-1/+1
| | | | | | | | | | | | | | | Change-Id: Iadaae490ff88737cf8a73ef8024617f60773a631 Reviewed-by: VaL Doroshchuk <valentyn.doroshchuk@qt.io>
* | | DirectShow: Replace typedef by usingFriedemann Kleint2019-06-122-2/+2
| | | | | | | | | | | | | | | | | | | | | Apply some fixits by Qt Creator. Change-Id: I20b62c70b5ed0e79ca735f1ab9b048023eb9dc7d Reviewed-by: VaL Doroshchuk <valentyn.doroshchuk@qt.io>
* | | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-06-032-5/+23
|\| | | | | | | | | | | Change-Id: Id1638836ea3faf16c4ba39119029522b2afbe803
| * | Merge remote-tracking branch 'origin/5.12' into 5.13Liang Qi2019-06-032-5/+23
| |\| | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/directshow/player/directshowplayerservice.cpp Change-Id: I6b7edc312ecfadf84653ce24321ec55da41e131a
| | * DirectShow: Don't hide returned error when video output was not providedVal Doroshchuk2019-04-111-2/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since the video output could be set after doRender(), we do not report an error in this case. But need to report the error when the video output has not been submitted at all. Otherwise it hides the error and not possible to determine playback issues. Added a fix to remember an error while rendering without the video output and handle it if playing is requested. That means, if it is required, the video output must be set before play() is called. Not all medias require valid video output, but if there is an error, we need to report about it. Fixes tst_QMediaPlayerBackend::playlist() Task-number: QTBUG-65574 Change-Id: I9faae19c08ad0273545bb7617ea3a11539084f1f Reviewed-by: Andy Shaw <andy.shaw@qt.io>
| | * DirectShow: Report about an error for wrong urlsVal Doroshchuk2019-05-201-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If wrong url is passed, no need to try it again. But report an error instead. Also there cannot be empty url, because if an url is empty, NoMedia should be emitted. Fixes tst_QMediaPlayerBackend::playlistObject() Task-number: QTBUG-65574 Change-Id: I658b16cfe7b96c202715651d6b20d01a9af6c746 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
| | * DirectShow: Don't update status on pending tasks when graph is loadedVal Doroshchuk2019-05-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The tests expect to see updated playback position together with QMediaPlayer::BufferedMedia. But currently QMediaPlayer::BufferedMedia is emitted before updating the position. Removed updating the status if the graph is already loaded but a task is still pending. Fixes tst_QMediaPlayerBackend::seekInStoppedState Task-number: QTBUG-65574 Change-Id: I66d214312dbf31973a13b5154a52599aa517f38c Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Christian Strømme <christian.stromme@qt.io>
| | * DirectShow: Don't set the same mediaVal Doroshchuk2019-05-141-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes tst_QMediaPlayerBackend::playlistObject() Actual (currentMediaSpy.count()): 2 Expected (1) : 1 .\tst_qmediaplayerbackend.cpp(1224) : failure location Task-number: QTBUG-65574 Change-Id: Ia7cbcb4a22ee43df9e1efff065910b084bdbf00e Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* | | Deprecate canonicalUrl and canonicalRequest in QMediaContentVaL Doroshchuk2019-05-131-1/+1
|/ / | | | | | | | | | | | | | | | | | | | | Since QMediaContent can contain only one content and media resources are already deprecated, canonicalUrl and canonicalRequest are a bit confusing and outdated. Deprecated and replaced by QMediaContent::request() which already contains the url. Change-Id: I418006e112f49466b0129bf1e6e1ae629c714538 Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into 5.13Liang Qi2019-04-102-3/+4
|\| | | | | | | | | | | | | | | Conflicts: tests/auto/integration/qdeclarativevideooutput/tst_qdeclarativevideooutput.cpp Done-with: Val Doroshchuk <valentyn.doroshchuk@qt.io> Change-Id: I745dd948c1e98180115f85c17bef802351bbdb6b
| * Windows: Reset position on pause in QMediaPlayer after EOSVal Doroshchuk2019-04-101-2/+3
| | | | | | | | | | | | | | | | | | | | pause() should reset position to the beginning after EOS. Fixes tst_QMediaPlayerBackend::processEOS Task-number: QTBUG-65574 Change-Id: I4802102bde657d7a3dde0b426c335b021207ae08 Reviewed-by: Christian Strømme <christian.stromme@qt.io>
| * DirectShow: don't change camera zoom level if not requestedIhor Dutchak2019-04-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | DirectShowCameraZoomControl sets camera zoom level to 1x each time, when camera goes into LoadedStatus (e.g. on stream stop), which is inconveniant, specially if camera has physical remote, and zoom level may be changed externally. Disable this behavior, if zoom level was not requested explicitly by zoomTo(...) function from client code. Fixes: QTBUG-74180 Change-Id: I99ff76af04f80c630a0c397db5713e6706ebf175 Reviewed-by: VaL Doroshchuk <valentyn.doroshchuk@qt.io> Reviewed-by: Ihor Dutchak <ihor.youw@gmail.com>
* | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-02-091-4/+1
|\| | | | | | | Change-Id: I26440611372622174c5b077be21e5a22b8136e97
| * DirectShow: Fix crash when camera is being destroyedVal Doroshchuk2019-02-061-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | If a camera is going to be destroyed, a service plugin releases media service, (which releases ds camera session) and might call CoUninitialize. This leads to a crash when DirectShowSampleGrabber is destroyed after releasing the camera. Added a fix to release the sample grabber together with camera session. Task-number: QTBUG-73461 Change-Id: I8e518d0242d983c8d2bb00c30ad87c7e8e1e2c93 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* | DirectShow: Fix video and audio probes in media playerVal Doroshchuk2019-01-153-39/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Added using ICaptureGraphBuilder2 to connect source filter and sample grabber to probe video and audio buffers. The capture graph builder can automatically add some intermediate filters as needed. Video buffers are always requested in ARGB32 format. Task-number: QTBUG-71819 Change-Id: I7382635758ba3bd76c8806cabd0895c67072be6c Reviewed-by: Andy Shaw <andy.shaw@qt.io> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* | Windows: Build directshow media player with wmf if availableVal Doroshchuk2019-01-144-17/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Removed -mediaplayer-backend configure param. It allows to build directshow media player together with wmf's one, if the last is available. It is useful to switch to another backend without rebuilding. By default directshow media player will be used. [ChangeLog][Platform Specific Changes][Windows] Removed -mediaplayer-backend config param which allowed to build wmf together with DirectShow. Task-number: QTBUG-32783 Change-Id: I486a93d9493407af3793cfe338b35daab7c642db Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2019-01-042-35/+40
|\| | | | | | | Change-Id: I5394a9d75850771068d43d2509b14a3ac4efcf83
| * DirectShow: Don't queue video buffers from sample grabberVal Doroshchuk2018-11-291-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | Fixed an issue when buffers are sent using queued connection. Thus all buffers were collected before they were handled. Now only last buffer is kept. Also moved handling of device lost timer to main thread. Task-number: QTBUG-72012 Change-Id: I338587c5854739d6081c5cb502377e5779776417 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
| * DirectShow: use supported pixel formats for QCamera video surfaceIhor Dutchak2018-11-282-25/+29
| | | | | | | | | | | | | | | | | | | | [ChangeLog][DirectShow] Do not convert QCamera video frames to RGB32 if provided QAbstractVideoSurface supports frame pixel format, requested by QCameraViewfinderSettings. Task-number: QTBUG-68768 Change-Id: I78d0aaf6c22c4bfee2b17f78a3709d7ba9a8b4fa Reviewed-by: VaL Doroshchuk <valentyn.doroshchuk@qt.io>
| * DirectShow: Display windows error string when camera failsVal Doroshchuk2018-11-272-5/+6
| | | | | | | | | | | | | | | | | | | | Additionally to custom error messages it needs to show standard ones with error codes. Task-number: QTBUG-71851 Change-Id: I6504ec2417b0f686ab4e1a6902c4f00eeefcbbf2 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Andy Shaw <andy.shaw@qt.io>