GregoryMorse [Sat, 14 Dec 2013 08:53:30 +0000 (16:53 +0800)]
Add support for WinRT in the MF capture framework by removing the disallowed calls to enumerate devices and create a sample grabber sink and adding framework for the MediaCapture interface and a custom sink which interfaces with the sample grabber callback interface. The change requires discussion for making it completely functional as redundancy is required given that if the source is a video file, the old code pathways must be used. Otherwise all IMFMediaSession, IMFMediaSource, and IMFActivate code must use a MediaCapture code path and all sink code must use the CMediaSink custom sink.
Support for the custom sink is extended to non-WinRT not for compatibility as Windows Vista client is a minimum regardless, but because it offers more flexibility, could be faster and is able to be used as an optionally different code path during sink creation based on a future configuration parameter.
My discussion and proposal to finish this change:
Devices are so easily enumerated through WinRT Windows.Devices namespace that wrapping the calls in a library is quite a chore for little benefit though to get the various modes and formats could still be a worthwhile project. For now conditional compilation to remove videodevices and any offending non-video file related activity in videodevice. In my opinion, this is a different , far less fundamental and important change which can possibly be done as a future project and also much more easily implemented in C++/CX.
ImageGrabber has the IMFSampleGrabberSinkCallback replaced with a base class (SharedSampleGrabber) which also be is base class for ImageGrabberRT. This change is necessary as the custom sink does not require a thread to pump events which is done through MediaCapture already. IMFSampleGrabberSinkCallback is the common element between both models and that piece can be shared. Initializing the new ImageGrabberRT is as simple as passing an already initialized MediaCapture object and any video format/encoding parameters.
The concurrency event is necessary to wait for completion and is the way the underlying, IAsyncAction wrappers in the task library work as well. Native WIN32 event objects would be an option if HAVE_CONCURRENCY is not defined. I could even imagine doing it with sleep/thread yield and InterlockedCompareExchange yet I am not enthusiastic about that approach either. Since there is a specific compiler HAVE_ for concurrency, I do not like pulling it in though I think for WinRT it is safe to say we will always have it available though should probably conditionally compile with the Interlocked option as WIN32 events would require HAVE_WIN32.
It looks like C++/CX cannot be used for the IMediaExtension sink (which should not be a problem) as using COM objects requires WRL and though deriving from IMediaExtension can be done, there is little purpose without COM. Objects from C++/CX can be swapped to interact with objects from native C++ as Inspectable* can reinterpret_cast to the ref object IInspectable^ and vice-versa. A solution to the COM class with C++/CX would be great so we could have dual support. Also without #define for every WRL object in use, the code will get quite muddy given that the */^ would need to be ifdef'd everywhere.
Fixed bugs and completed the change. I believe the new classes need to be moved to a header file as the file has become to large and more classes need to be added for handling all the asynchronous problems (one wrapping IAsyncAction in a task and another for making a task out of IAsyncAction). Unfortunately, blocking on the UI thread is not an option in WinRT so a synchronous architecture is considered "illegal" by Microsoft's standards even if implementable (C++/CX ppltasks library throws errors if you try it). Worse, either by design or a bug in the MF MediaCapture class with Custom Sinks causes a crash if stop/start previewing without reinitializing (spPreferredPreviewMediaType is fatally nulled). After decompiling Windows.Media.dll, I worked around this in my own projects by using an activate-able custom sink ID which strangely assigns 1 to this pointer allowing it to be reinitialized in what can only be described as a hack by Microsoft. This would add additional overhead to the project to implement especially for static libraries as it requires IDL/DLL exporting followed by manifest declaration. Better to document that it is not supported.
Furthermore, an additional class for IMFAttributes should be implemented to make clean architecture for passing around attributes as opposed to directly calling non-COM interface calls on the objects and making use of SetProperties which would also be a set up for an object that uses the RuntimeClass activation ID.
The remaining changes are not difficult and will be complete soon along with debug tracing messages.
Update and rename cap_msmf.h to cap_msmf.hpp
Successful test - samples are grabbed
Library updated and cleaned up with comments, marshaling, exceptions and linker settings
Fixed trailing whitespace
VS 2013 support and cleanup consistency plus C++/CX new object fixed
Conflicts:
modules/highgui/src/cap_msmf.cpp
modules/highgui/src/cap_msmf.hpp
modules/highgui/src/ppltasks_winrt.h
Fix merge conflicts
VS 2013 Update 2 library bug fix integrated
a-wi's changed integrated
Alexander Alekhin [Tue, 8 Jul 2014 15:21:35 +0000 (15:21 +0000)]
Merge pull request #2951 from ilya-lavrenov:tapi_ipp_filter2d
Ilya Lavrenov [Tue, 8 Jul 2014 14:51:27 +0000 (18:51 +0400)]
OpenCL before IPP
Alexander Alekhin [Tue, 8 Jul 2014 07:30:48 +0000 (07:30 +0000)]
Merge pull request #2936 from ilya-lavrenov:tapi_minmaxloc_opt
Vadim Pisarevsky [Mon, 7 Jul 2014 13:35:08 +0000 (13:35 +0000)]
Merge pull request #2669 from Adil-Ibragimov:flann_distance_fix
Vadim Pisarevsky [Mon, 7 Jul 2014 11:22:26 +0000 (11:22 +0000)]
Merge pull request #2929 from ilya-lavrenov:sse_pow
Vadim Pisarevsky [Mon, 7 Jul 2014 11:20:30 +0000 (11:20 +0000)]
Merge pull request #2937 from ilya-lavrenov:sse_patch_nans
Vadim Pisarevsky [Mon, 7 Jul 2014 11:19:54 +0000 (11:19 +0000)]
Merge pull request #2941 from ilya-lavrenov:sse_inrange
Alexander Alekhin [Mon, 7 Jul 2014 11:18:31 +0000 (11:18 +0000)]
Merge pull request #2944 from bkueng:fix_compiler_error
Beat Küng [Sat, 5 Jul 2014 07:27:11 +0000 (09:27 +0200)]
imgproc: fix compiler error for gcc 4.8
this bug was introduced in
a73809e6.
Ilya Lavrenov [Thu, 3 Jul 2014 17:28:54 +0000 (21:28 +0400)]
SSE2 optimization of cv::patchNaNs
Ilya Lavrenov [Thu, 3 Jul 2014 20:36:32 +0000 (00:36 +0400)]
SSE2 optimization of cv::inRange
Alexander Alekhin [Thu, 3 Jul 2014 13:02:40 +0000 (13:02 +0000)]
Merge pull request #2932 from ilya-lavrenov:tapi_other_vendors
Ilya Lavrenov [Thu, 3 Jul 2014 12:16:23 +0000 (16:16 +0400)]
optimization of cv::minMaxLoc - used min/max
Ilya Lavrenov [Thu, 3 Jul 2014 09:45:55 +0000 (13:45 +0400)]
use vectors for devices of all vendors
Alexander Alekhin [Thu, 3 Jul 2014 09:26:52 +0000 (09:26 +0000)]
Merge pull request #2931 from alalek:mac_fix_master
Alexander Alekhin [Thu, 3 Jul 2014 09:26:05 +0000 (09:26 +0000)]
Merge pull request #2897 from vbystricky:oclopt_sepFilter2D
Alexander Alekhin [Thu, 3 Jul 2014 08:18:19 +0000 (12:18 +0400)]
ocl: add try-catch for OpenCL device getter
Ilya Lavrenov [Tue, 1 Jul 2014 10:31:25 +0000 (14:31 +0400)]
fixed warnings
Ilya Lavrenov [Wed, 2 Jul 2014 21:28:31 +0000 (01:28 +0400)]
sse2 optimization of inv_sqrt_64f
Alexander Alekhin [Wed, 2 Jul 2014 19:06:45 +0000 (19:06 +0000)]
Merge pull request #2928 from ilya-lavrenov:tapi_warp_fix
Ilya Lavrenov [Wed, 2 Jul 2014 15:32:10 +0000 (19:32 +0400)]
fixed cv::warpPerspective
Vadim Pisarevsky [Wed, 2 Jul 2014 14:22:55 +0000 (14:22 +0000)]
Merge pull request #2856 from sanchom:master
Vadim Pisarevsky [Wed, 2 Jul 2014 09:56:59 +0000 (09:56 +0000)]
Merge pull request #2923 from alalek:ocl_default_device_ignore_cpu
Vadim Pisarevsky [Wed, 2 Jul 2014 09:55:51 +0000 (09:55 +0000)]
Merge pull request #2913 from ilya-lavrenov:sse2_precornerdetect
Alexander Alekhin [Wed, 2 Jul 2014 09:14:48 +0000 (09:14 +0000)]
Merge pull request #2830 from mlyashko:moments
Vadim Pisarevsky [Tue, 1 Jul 2014 17:31:37 +0000 (17:31 +0000)]
Merge pull request #2911 from ilya-lavrenov:sse2_convert_scale_abs
Vadim Pisarevsky [Tue, 1 Jul 2014 17:16:22 +0000 (17:16 +0000)]
Merge pull request #2895 from fradelg:master
Alexander Alekhin [Tue, 1 Jul 2014 13:21:35 +0000 (13:21 +0000)]
Merge pull request #2906 from ilya-lavrenov:tapi_transpose
Alexander Alekhin [Tue, 1 Jul 2014 10:24:14 +0000 (14:24 +0400)]
ocl: don't use OpenCL CPU device in default setup
Ilya Lavrenov [Sun, 29 Jun 2014 17:03:16 +0000 (21:03 +0400)]
sse2 optimization of cv::convertScaleAbs
Ilya Lavrenov [Fri, 27 Jun 2014 10:03:05 +0000 (14:03 +0400)]
optimized cv::transpose inplace
Ilya Lavrenov [Fri, 27 Jun 2014 08:44:32 +0000 (12:44 +0400)]
cv::transpose
Alexander Alekhin [Mon, 30 Jun 2014 14:59:36 +0000 (14:59 +0000)]
Merge pull request #2907 from ilya-lavrenov:tapi_perf_transpose
Ilya Lavrenov [Fri, 27 Jun 2014 10:06:32 +0000 (14:06 +0400)]
added perf test for transpose inplace
Alexander Alekhin [Mon, 30 Jun 2014 11:59:13 +0000 (11:59 +0000)]
Merge pull request #2869 from ilya-lavrenov:tapi_warps
Alexander Alekhin [Mon, 30 Jun 2014 10:06:54 +0000 (10:06 +0000)]
Merge pull request #2876 from vbystricky:oclopt_integralsum
Alexander Alekhin [Mon, 30 Jun 2014 10:05:24 +0000 (10:05 +0000)]
Merge pull request #2899 from ilya-lavrenov:tapi_ex
Alexander Alekhin [Mon, 30 Jun 2014 10:04:04 +0000 (10:04 +0000)]
Merge pull request #2886 from ilya-lavrenov:tapi_inrange
Alexander Alekhin [Mon, 30 Jun 2014 10:02:41 +0000 (10:02 +0000)]
Merge pull request #2829 from ilya-lavrenov:tapi_cvtcolor
Ilya Lavrenov [Sun, 29 Jun 2014 21:47:51 +0000 (01:47 +0400)]
SSE2 optimization of cv::preCornerDetect
Ilya Lavrenov [Thu, 26 Jun 2014 14:15:13 +0000 (18:15 +0400)]
optimized some operations
Alexander Alekhin [Fri, 27 Jun 2014 08:21:06 +0000 (08:21 +0000)]
Merge pull request #2852 from ilya-lavrenov:tapi_abs
Roman Donchenko [Thu, 26 Jun 2014 13:40:25 +0000 (17:40 +0400)]
Merge pull request #2626 from KayKwon:matlab_formatter
Roman Donchenko [Thu, 26 Jun 2014 13:35:07 +0000 (17:35 +0400)]
Merge pull request #2672 from a-wi:findContours
Roman Donchenko [Thu, 26 Jun 2014 13:29:25 +0000 (17:29 +0400)]
Merge pull request #2774 from 23pointsNorth:lsd-nfa-fix
Roman Donchenko [Thu, 26 Jun 2014 13:24:24 +0000 (17:24 +0400)]
Merge pull request #2858 from 23pointsNorth:patch-3
Roman Donchenko [Thu, 26 Jun 2014 13:22:53 +0000 (17:22 +0400)]
Merge pull request #2824 from abidrahmank:pylsd
vbystricky [Thu, 26 Jun 2014 11:43:40 +0000 (15:43 +0400)]
Change local size
Ilya Lavrenov [Thu, 26 Jun 2014 09:25:24 +0000 (13:25 +0400)]
ported changes from PR #2867
Ilya Lavrenov [Thu, 26 Jun 2014 09:18:03 +0000 (13:18 +0400)]
added ocl_** function
Ilya Lavrenov [Thu, 26 Jun 2014 09:13:01 +0000 (13:13 +0400)]
reverted to original plain C++ code
mlyashko [Wed, 25 Jun 2014 12:07:33 +0000 (16:07 +0400)]
added perftest for moments
vbystricky [Thu, 26 Jun 2014 08:46:03 +0000 (12:46 +0400)]
Optimize OpenCL version of sepFilter2D
Andrey Pavlenko [Wed, 25 Jun 2014 17:12:20 +0000 (17:12 +0000)]
Merge pull request #2894 from vpisarev:cleanup_project_tree1
Vadim Pisarevsky [Wed, 25 Jun 2014 16:22:56 +0000 (20:22 +0400)]
fixed some more compile warnings on Windows
Vadim Pisarevsky [Wed, 25 Jun 2014 12:17:52 +0000 (16:17 +0400)]
fixed compile warnings on Windows
Fco. Javier Delgado del Hoyo [Wed, 25 Jun 2014 09:49:26 +0000 (11:49 +0200)]
Change comment according to fix
Fco. Javier Delgado del Hoyo [Wed, 25 Jun 2014 09:46:05 +0000 (11:46 +0200)]
Fix GCC 4.9 compiler warning
Vadim Pisarevsky [Tue, 24 Jun 2014 19:05:24 +0000 (23:05 +0400)]
removed extra whitespaces
Vadim Pisarevsky [Tue, 24 Jun 2014 17:16:09 +0000 (21:16 +0400)]
put the detection-based tracker back (to objdetect module), so that the Android face detection sample builds fine. The patch by Konstantin Matskevich that adds C++11 threads support has been merged in too. Also, fixed compile error in the doc builder.
Alexander Alekhin [Tue, 24 Jun 2014 16:19:52 +0000 (16:19 +0000)]
Merge pull request #2881 from mlyashko:moments_opt
Alexander Alekhin [Tue, 24 Jun 2014 16:12:42 +0000 (16:12 +0000)]
Merge pull request #2786 from ElenaGvozdeva:ocl_matchTemplate
Vadim Pisarevsky [Tue, 24 Jun 2014 15:18:51 +0000 (19:18 +0400)]
removed contrib, legacy and softcsscade modules; removed latentsvm and datamatrix detector from objdetect. removed haartraining and sft apps.
some of the stuff will be moved to opencv_contrib module.
in order to make this PR pass buildbot, please, comment off opencv_legacy, opencv_contrib and opencv_softcascade test runs.
vbystricky [Thu, 19 Jun 2014 10:39:49 +0000 (14:39 +0400)]
Change kernel for optimization. Remove restriction to align data
Fix kernel compilation errors on AMD system
Fix licanse information in cl file
Support CV_64F destination type
Change build options of the kernel
Optimize sum of square
Remove separate kernel for integral square
Increase epsilon for perfomance tests
Increase epsilon for perfomance tests
Test double support on AMD devices
Fix some issues
Try to fix problems with AMD device
Try to solve problem with AMD device
Fix error of destination size in kernel
Fix warnings
Vadim Pisarevsky [Tue, 24 Jun 2014 11:52:36 +0000 (11:52 +0000)]
Merge pull request #2892 from PhilLab:patch-1
PhilLab [Tue, 24 Jun 2014 09:35:22 +0000 (11:35 +0200)]
Updates python feature matching tutorial
The given ORB parameter was misspelled
Alexander Alekhin [Mon, 23 Jun 2014 14:27:10 +0000 (14:27 +0000)]
Merge pull request #2887 from ilya-lavrenov:ipp_morph_fix
Alexander Alekhin [Mon, 23 Jun 2014 14:23:26 +0000 (14:23 +0000)]
Merge pull request #2874 from vbystricky:ocl_LUTAMDfix
Ilya Lavrenov [Sat, 21 Jun 2014 15:17:03 +0000 (19:17 +0400)]
optimized cv::inRange
Ilya Lavrenov [Wed, 11 Jun 2014 15:30:10 +0000 (19:30 +0400)]
added 32s to 32u conversion
Elena Gvozdeva [Tue, 10 Jun 2014 06:37:51 +0000 (10:37 +0400)]
Fixed core for CCORR and SQDIFF. Used float instead of int for CV_8U. Fixed conditions for call dft.
mlyashko [Fri, 20 Jun 2014 07:55:17 +0000 (11:55 +0400)]
replaced factors computation by precomputed values, added kernel for
binary mode
Ilya Lavrenov [Wed, 4 Jun 2014 11:24:29 +0000 (15:24 +0400)]
cvtColor - optimized index calculations; usage of build-in functions
Ilya Lavrenov [Sun, 22 Jun 2014 15:18:14 +0000 (19:18 +0400)]
added extra condition
Alexander Alekhin [Fri, 20 Jun 2014 13:49:14 +0000 (13:49 +0000)]
Merge pull request #2790 from akarsakov:ocl_pyrUp_unroll
Alexander Alekhin [Fri, 20 Jun 2014 08:49:36 +0000 (08:49 +0000)]
Merge pull request #2878 from vbystricky:ocl_integral_sqsum_perf_test
Alexander Alekhin [Fri, 20 Jun 2014 08:47:51 +0000 (08:47 +0000)]
Merge pull request #2864 from ilya-lavrenov:tapi_boxfilter
Alexander Alekhin [Fri, 20 Jun 2014 08:47:18 +0000 (08:47 +0000)]
Merge pull request #2847 from ilya-lavrenov:tapi_pow
Alexander Alekhin [Fri, 20 Jun 2014 08:46:32 +0000 (08:46 +0000)]
Merge pull request #2840 from ilya-lavrenov:tapi_calchist
vbystricky [Thu, 19 Jun 2014 14:52:25 +0000 (18:52 +0400)]
Increase epsilon for pass sanity check
vbystricky [Thu, 19 Jun 2014 14:09:23 +0000 (18:09 +0400)]
Fix error
vbystricky [Thu, 19 Jun 2014 13:45:04 +0000 (17:45 +0400)]
Change threshold
vbystricky [Thu, 19 Jun 2014 13:07:09 +0000 (17:07 +0400)]
Add peromance tests for OCL integral sum of square
Roman Donchenko [Thu, 19 Jun 2014 07:57:51 +0000 (11:57 +0400)]
Merge pull request #2832 from BRAINSia:20140605_Upstream
Andrey Pavlenko [Wed, 18 Jun 2014 12:13:13 +0000 (16:13 +0400)]
Merge pull request #2863 from apavlenko:disable_cuda_stubs_defaults
vbystricky [Wed, 18 Jun 2014 11:44:56 +0000 (15:44 +0400)]
Change uchar2 to short
vbystricky [Wed, 18 Jun 2014 11:03:09 +0000 (15:03 +0400)]
Move some variables into #ifdef
Hans Johnson [Thu, 5 Jun 2014 15:14:56 +0000 (10:14 -0500)]
COMP: Fix problem with narrowing in c++11
modules/core/src/arithm.cpp:345:51:
error: constant expression evaluates to
4294967295 which cannot be narrowed to type 'int' [-Wc++11-narrowing]
static int CV_DECL_ALIGNED(16) v64f_absmask[] = { 0xffffffff, 0x7fffffff, 0xffffffff, 0x7fffffff };
^~~~~~~~~~
Converted to unsigned int. This variable is only used to initialize a bit pattern anywhy for a 128bit type.
Alexander Alekhin [Tue, 17 Jun 2014 14:23:31 +0000 (18:23 +0400)]
Merge pull request #2871 from vbystricky:oclopt_integral
Alexander Karsakov [Wed, 11 Jun 2014 11:15:15 +0000 (15:15 +0400)]
Removed storing of zeros in local memory
Elena Gvozdeva [Fri, 6 Jun 2014 12:53:52 +0000 (16:53 +0400)]
used vector data types for CCORR cn==1
Elena Gvozdeva [Thu, 5 Jun 2014 13:21:25 +0000 (17:21 +0400)]
added dft for CCORR
Elena Gvozdeva [Thu, 29 May 2014 10:49:33 +0000 (14:49 +0400)]
changed CCOEFF cn==1
Elena Gvozdeva [Wed, 21 May 2014 07:54:53 +0000 (11:54 +0400)]
changed support for 3-channels, changed CCOEFF
Alexander Alekhin [Tue, 17 Jun 2014 12:59:00 +0000 (16:59 +0400)]
Merge pull request #2854 from ilya-lavrenov:tapi_filter2d
Alexander Alekhin [Tue, 17 Jun 2014 10:37:51 +0000 (14:37 +0400)]
Merge pull request #2849 from ElenaGvozdeva:ocl_matchTemplate_3cn
Ilya Lavrenov [Thu, 12 Jun 2014 16:10:16 +0000 (20:10 +0400)]
optimization of cv::warpAffine INTER_CUBIC
vbystricky [Mon, 16 Jun 2014 14:14:05 +0000 (18:14 +0400)]
Fix pointer conversion
vbystricky [Mon, 16 Jun 2014 13:17:16 +0000 (17:17 +0400)]
Small refactoring