Commit Graph

872 Commits

Author SHA1 Message Date
Artur Wieczorek
3603102c89 Fixed assertion warning in MSMF frame grabber 2014-09-22 19:38:04 +02:00
Artur Wieczorek
a615102947 Fixed MSMF video capture initialization 2014-09-22 19:35:36 +02:00
Vadim Pisarevsky
9c91d0103f Merge pull request #3247 from a-wi:CMake_MSMF_configuration 2014-09-22 15:31:09 +00:00
Artur Wieczorek
7c354c14f7 CMake configuration for MSMF capture 2014-09-21 21:03:41 +02:00
Artur Wieczorek
d2ba09e6ff Fix linking error under Win 7 - do not import MinCore_Downlevel.lib if target is Win 7 or earlier. 2014-09-19 22:46:09 +02:00
Artur Wieczorek
539f8032dc Fixed compilation errors under VS 2010 and Win 7 2014-09-19 17:07:52 +02:00
Vadim Pisarevsky
ccaedaedc8 Merge pull request #2047 from GregoryMorse:patch-4 2014-09-17 12:48:45 +00:00
Vadim Pisarevsky
533dd85299 Merge pull request #3225 from jormansa:bug_#3631 2014-09-17 10:40:42 +00:00
jormansa
1d2d579bd6 bug fixed 2014-09-15 18:09:44 +02:00
Maksim Shabunin
882426a9b2 Stripped iCCP chunk from png files 2014-09-15 12:48:28 +04:00
Vadim Pisarevsky
cf15b9e8ad Merge pull request #3204 from parafin:ximea_unix-2.4 2014-09-14 18:44:23 +00:00
GregoryMorse
b9d5f3f6e9 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.

Update cap_msmf.cpp

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

VS 2013 Update 2 library bug fix integrated

Various minor cleanup

Create agile_wrl.h

a-wi's changes integrated

Update cap_msmf.hpp

Update cap_msmf.cpp

Regression test fixes and simplifications
2014-09-10 17:21:38 +08:00
Igor Kuzmin
0421da78b3 XIMEA cam support: allow on OS X too 2014-09-09 19:17:13 +04:00
Igor Kuzmin
b027a84fa1 XIMEA cam support: use correct library for 64 bit Linux 2014-09-09 19:15:03 +04:00
Igor Kuzmin
fbbf4e380f fix for issue 3858 (remove unneeded #include's)
also use correct include path on Linux
2014-09-09 19:10:05 +04:00
Daniel Stonier
161f50962d make sure children are included in the moveToThread 2014-09-08 04:31:37 +09:00
Daniel Stonier
e638b9e805 support invokation of cv windows from parallel threads to an external qt application. 2014-09-08 03:19:56 +09:00
StevenPuttemans
34103ef1cb fixing setting the locale back to what should be expected
fix should be applyed for every window interface and generation
2014-08-05 16:20:08 +02:00
Vadim Pisarevsky
7cefaa49dd Merge pull request #2816 from ehren:avcapturesession_leak 2014-07-25 13:18:06 +00:00
Martijn Liem
9c285da329 Bugfix for bug #3767
Fixed a memory leak in cap_dshow.cpp in videoInput::setVideoSettingCamera(). The leak was caused by not releasing an IBaseFilter object created in a call to getDevice(). Tho object is now properly released.
2014-07-23 12:33:51 +02:00
Vadim Pisarevsky
39020fc9cf Merge pull request #2898 from PhilLab:2.4 2014-07-18 09:26:50 +00:00
Roman Donchenko
d262b04d99 Merge pull request #2903 from mmaraya:2.4 2014-07-11 14:15:59 +00:00
Vadim Pisarevsky
39127d942e Merge pull request #2908 from mmaraya:bug_3737 2014-07-07 13:29:38 +00:00
Alexander Alekhin
dcf96b2da7 Merge pull request #2922 from ilya-lavrenov:mac_fix 2014-07-02 12:18:11 +00:00
Ilya Lavrenov
070be56e14 fixed warnings 2014-07-01 14:32:16 +04:00
Alexander Alekhin
5c8cd76893 fix bug with invalid signature size (should not be less than signatureLength()) 2014-06-30 16:03:20 +04:00
Mike Maraya
7936faf9a3 Fixes build failure on Mac OS X 10.10 Yosemite Beta due to highgui/src/window_cocoa.mm (Bug #3737) 2014-06-27 08:34:40 -04:00
Mike Maraya
5c85f816c9 Revert "Fixes build failure on Mac OS X 10.10 Yosemite Beta due to highgui/src/window_cocoa.mm (Bug #3737)"
This reverts commit 56683e6d11.
2014-06-27 08:20:22 -04:00
Mike Maraya
56683e6d11 Fixes build failure on Mac OS X 10.10 Yosemite Beta due to highgui/src/window_cocoa.mm (Bug #3737) 2014-06-27 08:02:01 -04:00
Mike Maraya
fbac578c79 Fixes resizeWindow() on OS X (Bug #3200) 2014-06-27 23:26:09 -04:00
unknown
ade46bd428 Fixed typos in comments 2014-06-26 16:29:45 +02:00
Neo Alienson
b6e25a9fc7 Fix typos 2014-06-16 18:48:10 +08:00
Ehren Metcalfe
cd3aa0184a Fix resource leak with iOS camera due to failure to remove AVCaptureSession input/outputs on stop (Bug #3389) 2014-05-31 19:41:16 -04:00
Vadim Pisarevsky
44acfc38a1 Merge pull request #2739 from StevenPuttemans:bug_1523 2014-05-19 17:33:36 +04:00
StevenPuttemans
12207ac763 fix coordinate problem with large images - bug 1523 2014-05-19 13:07:44 +02:00
Yash Vadalia
7e56cfafbc fixed a syntax error in cap_giganetix.cpp
Ticket 3458 (http://code.opencv.org/issues/3458)
2014-05-13 19:59:37 +05:30
Luis Zarrabeitia
bb5a22c504 highgui: fix segfault on CvCapture_GStreamer::retrieveFrame
CvCapture_GStreamer::retrieveFrame assumes that RGB videos are 24BPP.
This is not necesarily the case, unless we explicitly tell GStreamer
that we want 24BPP RGB streams.

Adding bpp=(int)24 to the appsink caps.
2014-05-11 19:00:14 -04:00
Adrian Stratulat
4fb5680d91 Documentation - minor fix-ups 2014-04-23 17:30:27 +00:00
Artur Wieczorek
f27a886314 Fix for issue #3645 (http://code.opencv.org/issues/3645).
Implement missing features in CvCaptureCAM_VFW class.

Implemented missing CvCaptureCAM_VFW::setProperty() member function (handling CV_CAP_PROP_FRAME_WIDTH, CV_CAP_PROP_FRAME_HEIGHT, CV_CAP_PROP_FPS properties).
Extended CvCaptureCAM_VFW::setProperty()/getProperty() functions to handle also CV_CAP_PROP_FPS property.
Minor refactoring of CvCaptureCAM_VFW class.
2014-04-21 17:10:58 +02:00
David Rolland
cb8ddb1179 Corrected bug #1437. Corrected the cast of two short values from an lParam. lParam contains two signed-short, the position can be negative when another mouse event happens with a mouse_move (mouse_click, etc.)
The Microsoft documentation specifies NOT to use LOWORD and HIWORD macros to extract the x/y positions as it won't work correctly with multiple monitors. See http://msdn.microsoft.com/en-us/library/windows/desktop/ms645607(v=vs.85).aspx.
2014-04-09 18:24:21 +12:00
Roman Donchenko
8af175b81b Merge pull request #2521 from atrebbi:#3620 2014-03-24 18:54:00 +04:00
Roman Donchenko
9aa6528fd7 Merge pull request #2504 from asmorkalov:android_camera_locks_24 2014-03-24 12:06:51 +04:00
Alessandro Trebbi
c4a63f6a86 - 2014-03-23 22:00:16 +01:00
Ilya Lavrenov
20b6191842 doc fix 2014-03-23 16:20:00 +04:00
Alexander Smorkalov
0dba5bdc4a Multiple fixes in camera.
Fixed constant value for focus mode FOCUS_MODE_CONTINUES_PHOTO;
Add setters and getters for exposure lock and white balance lock flags;
Excluded camera restart for all setters except frame size.
2014-03-21 17:26:05 +04:00
Dave Hughes
b184d7f27b Fix for #3554
v4l2_scan_controls_enumerate_menu is unused and causes ioctl error on
RaspberryPi and possibly other Video4Linux variants. See
http://www.raspberrypi.org/forum/viewtopic.php?f=43&t=65026 for more
detail.
2014-03-05 02:44:40 +00:00
Ilya Lavrenov
099ea91823 typos 2014-03-04 12:47:40 +04:00
Roman Donchenko
af8aa8a2fa Merge pull request #2433 from ilya-lavrenov:typos 2014-03-03 12:20:35 +04:00
Ilya Lavrenov
eedf86402d typos 2014-03-02 21:04:17 +04:00
Alexander Smorkalov
dbb7aa7856 Highgui_Tiff.decode_tile16384x16384 disabled for Android.
Last changes in test leads to SIGKILL on Android.
SIGKILL is called by out of memory killer.
2014-02-25 10:36:20 +04:00
Matti Picus
dc50dc7254 fix merge 2014-02-21 13:54:58 +02:00
Matti Picus
f5330a44e8 merge with origin 2014-02-21 11:59:49 +02:00
Matti Picus
31c8f2ec57 fix code, it turns out only TIFFReadRGBATile needs buffer pointer mangling 2014-02-20 22:12:22 +02:00
Matti Picus
46d128e073 add test (needs updated opencv_extra repo) 2014-02-20 22:10:22 +02:00
Alexander Shishkov
77df5948e7 removed trailing spaces 2014-02-18 13:56:26 +04:00
Alexander Shishkov
cc529d971b removed tabs 2014-02-17 17:37:02 +04:00
Marijan Vukcevich
9a98cd6e65 Update cap_ios_abstract_camera.mm
AVCaptureVideoPreviewLayer setOrientation is depricated. This fixes the warning and provides backward compatibility.
2014-02-17 13:23:25 +04:00
Stuart Cunningham
5d43d3ca88 Fix Windows build of grfmt_tiff.cpp by using libtiff's integer types. 2014-02-12 23:41:38 +11:00
Stuart Cunningham
8bbce0a2a2 Fix reading of 16-bit TIFF images on big endian host.
Use correct integer types for arguments to TIFFGetField to avoid corruption
of values and failed loads of TIFF file when using cv::imread().

Added test where both big and little endian TIFF files are read using imread().

Fixed build of 3rdparty libtiff on big endian hosts.

Reduced memory required during decode_tile16384x16384 test by not converting
large grayscale test image to color image during read.
2014-02-12 21:21:06 +11:00
Alexander Smorkalov
87935f3560 Highgui test output fixes.
Useless output to console fixed;
Test output files moved from cwd to temp folder.
2014-01-31 12:49:10 +04:00
Matti Picus
64fd54ffb4 fix tiled read for reading tiles into partial blocks in image 2014-01-24 13:03:47 +02:00
Alexander Smorkalov
b75cbfde45 All installed files marked with component names for install customization. 2014-01-21 20:34:36 +04:00
Ilya Lavrenov
6b9ebcbf3d deleted extra semicolons 2014-01-07 02:52:30 +04:00
Roman Donchenko
795c108f2b Fixed MinGW build by declaring the minimal required Windows version.
Also deleted miscellaneous remaining multimon cruft.
Deleted #include <winuser.h>, because <windows.h> includes it
already.

This should have a nice side effect of preventing us from
accidentally using any Windows API that's too new.
2013-12-30 18:13:42 +04:00
Andrey Pavlenko
734bf8babd removing legacy stuff 2013-12-26 15:49:12 +04:00
Andrey Pavlenko
f9aa148ba9 eliminating VS2013 build warnings 2013-12-26 13:35:59 +04:00
Roman Donchenko
6e22be4100 Merge pull request #2003 from vbystricky:intelperc_camera_2.4 2013-12-20 17:06:27 +04:00
Vladimir Bystricky
d6a7e8f84f Remove TBB ifdef form code 2013-12-20 12:33:39 +04:00
Vladimir Bystricky
80d0593dbd Delete end comma in enumerations 2013-12-18 11:46:52 +04:00
Vladimir Bystricky
cc08e00876 Fix notes about cmake files. Fix build warning. 2013-12-17 16:13:55 +04:00
Vladimir Bystricky
4088013251 Add set/get depth generator properties by default. Add documentation 2013-12-17 12:00:40 +04:00
Vladimir Bystricky
e8d2a9752b Add support Creative Senz3D camera by Intel Perceptual Computing SDK 2013-12-13 17:25:16 +04:00
Josep Bosch
2153453fd1 Fixed little issue with mouse callback refering to issue 3409. Was using round instead of floor. 2013-12-04 22:32:20 +01:00
Andrey Pavlenko
429ab8ebee Merge pull request #1845 from StevenPuttemans:bugfix_3306 2013-11-29 23:08:20 +04:00
Roman Donchenko
10aec14a4d Merge pull request #1849 from StevenPuttemans:feature_3375_documentation 2013-11-27 13:22:31 +04:00
StevenPuttemans
6f892b10ff Applied feature #3375 and fix of pull 1842 to avoid merging problems later 2013-11-25 10:53:03 +01:00
StevenPuttemans
1b0297d92b Added fixes mentioned in bugreport 3306
- Added author provided fixes
- Added code example
- Added documentation fixes
2013-11-25 09:35:23 +01:00
Roman Donchenko
b8f5fcf3f9 Merge pull request #1776 from philippefoubert:merge_upstream_2.4_ximea 2013-11-21 12:03:02 +04:00
Roman Donchenko
b197ec9413 Merge pull request #1761 from bhuroc:qtkit-video-file-2.4 2013-11-20 13:36:37 +04:00
Philippe FOUBERT
78e16a906b Back to the previous coding way (using the macro with the goto). 2013-11-19 21:51:47 +01:00
Anatoly Baksheev
13bb236ad5 fixed some warnings 2013-11-16 21:18:36 +04:00
Roman Donchenko
2e79dde357 Merge pull request #1799 from SpecLad:avformat-53-6 2013-11-15 11:51:59 +04:00
Roman Donchenko
3b7acf2657 Fix building with FFmpeg 0.8.
avformat_find_stream_info was introduced in Libav avformat 53.3,
but it was only merged to FFmpeg in avformat 53.6.

In Libav avformat 53.3-53.5 av_find_stream_info is not removed
(only deprecated), so this shouldn't break building with that.
2013-11-14 17:25:46 +04:00
Roman Donchenko
411629a57d Merge pull request #1786 from SpecLad:cap-images-file-pattern 2013-11-13 17:00:20 +04:00
Roman Donchenko
28e0d3d771 Merge pull request #1784 from SpecLad:ffmpeg-no-png 2013-11-13 15:52:42 +04:00
Roman Donchenko
b8e3d3f791 In the image sequence capture, only search for the ordinal in the file name.
Searching in directory names can yield confusing results; e.g. if
the input is "jpeg2000/image1.jp2", it will infer the pattern
"jpeg%04d/image1.jp2", which is likely not what the user intended.

If the user really desires for the variable part to be in the
directory name, it can always use an explicit pattern.
2013-11-12 16:26:21 +04:00
Philippe FOUBERT
93120775cd Using four spaces for indentation. 2013-11-11 20:40:18 +01:00
Roman Donchenko
405227d531 Replaced the image used in the Highgui_Video.ffmpeg_image test.
Our prebuilt FFmpeg Windows binaries don't have PNG support enabled
(because that requires zlib), so that makes a PNG image a bad choice
for this test.

When FFmpeg doesn't support PNG, VideoCapture falls back to the
"image sequence" implementation, which doesn't work for single images.
2013-11-11 18:30:04 +04:00
Roman Donchenko
eff53e95f9 Fixed the "image sequence" capture not failing when a pattern isn't found.
at can't be a null pointer, so the condition was always false, and
a nonsensical pattern like "image.png%00d" was being inferred.
2013-11-11 18:12:49 +04:00
Philippe FOUBERT
05d9375759 Trailing whitespace removal. 2013-11-11 10:26:28 +01:00
Philippe FOUBERT
8b0fc04d93 Fix the build of OpenCV with XIMEA on Windows 64 bits:
- crosses initializations in "cap_ximea.cpp" (which also contained some awfull "goto" instructions)
  - the "CMAKE_CL_64" variable is not initialized when using mingw

PR#1039 modified to be able to merge on branch 2.4
2013-11-10 17:46:59 +01:00
Bo Hu
c88fa27b1d Removed trailing whitespace in cap_qtkit.mm. 2013-11-06 13:33:17 -08:00
Bo Hu
114579c33b Added proper testing of the end of quicktime video files.
CvCaptureFile::grabFrame() always returns 1 regardless, which causes
dead loop when relying on the return value of VideoCapture::read().
2013-11-06 13:32:11 -08:00
Roman Donchenko
d6a7a6d503 VideoCapture: copy the captured frame, to avoid dangling Mats
Previously, VideoCapture::retrieve would return a Mat that referenced
the internal IplImage. Since the latter is rewritten every time a
frame is captured, it means that if the user captures two frames in a row,
the first frame would reference nothing. Similar if a user captures a frame,
then destroys the VideoCapture instance.

Note that the other branch of the if isn't affected, since flip allocates
a new Mat.
2013-10-29 18:47:08 +04:00
Roman Donchenko
36b5180aa1 Another FFmpeg fix from master.
From commit dd74a851, to be exact. Now cap_ffmpeg.cpp should actually
build if HAVE_FFMPEG is true.

Also modified some gpu sources in a similar manner.
2013-10-25 16:08:14 +04:00
Roman Donchenko
1188894133 Fixed indentation in CV_FFmpegWriteBigVideoTest::run. 2013-10-25 14:37:54 +04:00
Roman Donchenko
2ca49eef37 Added stupid hacks to make the video tests pass with FFmpeg 2.0.2.
Need to go back at some point and fix this for real.

(cherry picked from commit dfe07df87b)
2013-10-25 14:34:02 +04:00
Roman Donchenko
5a5d569d72 Changed MPEG-2 resolution in the FFmpeg test.
Newer FFmpeg prohibits 4096x4096 MPEG-2, presumably because it violates
the standard.

http://git.videolan.org/gitweb.cgi/ffmpeg.git/?p=ffmpeg.git;a=commit;h=7fb87bc5f24b1be13269109506c05e4c54695b5e

(cherry picked from commit 424a7b0ab0)

Conflicts:
	modules/highgui/test/test_ffmpeg.cpp
2013-10-25 14:31:27 +04:00
Roman Donchenko
260c2e0b08 Decoupled test_ffmpeg.cpp from ffmpeg_codecs.hpp.
(cherry picked from commit 3f3ae33327)
2013-10-25 14:29:37 +04:00
Roman Donchenko
83b36dcbcf Merge pull request #1459 from asmorkalov:ocv_qt_segflt_fix 2013-10-18 18:39:08 +04:00