Commit 347c86d9 authored by Alexander Smorkalov's avatar Alexander Smorkalov

Windows RT related code cleanup.

Windows RT sample cleanup.
Video I/O code cleanup.
parent 91c51946
...@@ -558,7 +558,7 @@ CVAPI(int) cvGetCaptureDomain( CvCapture* capture); ...@@ -558,7 +558,7 @@ CVAPI(int) cvGetCaptureDomain( CvCapture* capture);
/* "black box" video file writer structure */ /* "black box" video file writer structure */
typedef struct CvVideoWriter CvVideoWriter; typedef struct CvVideoWriter CvVideoWriter;
#define CV_FOURCC_MACRO(c1, c2, c3, c4) ((c1 & 255) + ((c2 & 255) << 8) + ((c3 & 255) << 16) + ((c4 & 255) << 24)) #define CV_FOURCC_MACRO(c1, c2, c3, c4) (((c1) & 255) + (((c2) & 255) << 8) + (((c3) & 255) << 16) + (((c4) & 255) << 24))
CV_INLINE int CV_FOURCC(char c1, char c2, char c3, char c4) CV_INLINE int CV_FOURCC(char c1, char c2, char c3, char c4)
{ {
......
...@@ -203,12 +203,8 @@ private: ...@@ -203,12 +203,8 @@ private:
RawImage *ig_RIOut; RawImage *ig_RIOut;
ImageGrabber(unsigned int deviceID, bool synchronous); ImageGrabber(unsigned int deviceID, bool synchronous);
HRESULT CreateTopology(IMFMediaSource *pSource, IMFActivate *pSinkActivate, IMFTopology **ppTopo); HRESULT CreateTopology(IMFMediaSource *pSource, IMFActivate *pSinkActivate, IMFTopology **ppTopo);
HRESULT AddSourceNode( HRESULT AddSourceNode(IMFTopology *pTopology, IMFMediaSource *pSource,
IMFTopology *pTopology, IMFPresentationDescriptor *pPD, IMFStreamDescriptor *pSD, IMFTopologyNode **ppNode);
IMFMediaSource *pSource,
IMFPresentationDescriptor *pPD,
IMFStreamDescriptor *pSD,
IMFTopologyNode **ppNode);
HRESULT AddOutputNode(IMFTopology *pTopology, IMFActivate *pActivate, DWORD dwId, IMFTopologyNode **ppNode); HRESULT AddOutputNode(IMFTopology *pTopology, IMFActivate *pActivate, DWORD dwId, IMFTopologyNode **ppNode);
// IUnknown methods // IUnknown methods
STDMETHODIMP QueryInterface(REFIID iid, void** ppv); STDMETHODIMP QueryInterface(REFIID iid, void** ppv);
...@@ -886,7 +882,7 @@ FormatReader::~FormatReader(void) ...@@ -886,7 +882,7 @@ FormatReader::~FormatReader(void)
{ {
} }
#define CHECK_HR(x) if (FAILED(x)) { printf("Checking failed !!!\n"); goto done; } #define CHECK_HR(x) if (FAILED(x)) { goto done; }
ImageGrabber::ImageGrabber(unsigned int deviceID, bool synchronous): ImageGrabber::ImageGrabber(unsigned int deviceID, bool synchronous):
m_cRef(1), m_cRef(1),
...@@ -904,10 +900,8 @@ ImageGrabber::ImageGrabber(unsigned int deviceID, bool synchronous): ...@@ -904,10 +900,8 @@ ImageGrabber::ImageGrabber(unsigned int deviceID, bool synchronous):
ImageGrabber::~ImageGrabber(void) ImageGrabber::~ImageGrabber(void)
{ {
printf("ImageGrabber::~ImageGrabber()\n");
if (ig_pSession) if (ig_pSession)
{ {
printf("ig_pSession->Shutdown()\n");
ig_pSession->Shutdown(); ig_pSession->Shutdown();
} }
...@@ -947,31 +941,26 @@ HRESULT ImageGrabber::initImageGrabber(IMFMediaSource *pSource, GUID VideoFormat ...@@ -947,31 +941,26 @@ HRESULT ImageGrabber::initImageGrabber(IMFMediaSource *pSource, GUID VideoFormat
hr = pSource->CreatePresentationDescriptor(&pPD); hr = pSource->CreatePresentationDescriptor(&pPD);
if (FAILED(hr)) if (FAILED(hr))
{ {
printf("Error creating CreatePresentationDescriptor()\n");
goto err; goto err;
} }
BOOL fSelected; BOOL fSelected;
hr = pPD->GetStreamDescriptorByIndex(0, &fSelected, &pSD); hr = pPD->GetStreamDescriptorByIndex(0, &fSelected, &pSD);
if (FAILED(hr)) { if (FAILED(hr)) {
printf("Error GetStreamDescriptorByIndex()\n");
goto err; goto err;
} }
hr = pSD->GetMediaTypeHandler(&pHandler); hr = pSD->GetMediaTypeHandler(&pHandler);
if (FAILED(hr)) { if (FAILED(hr)) {
printf("Error GetMediaTypeHandler()\n");
goto err; goto err;
} }
DWORD cTypes = 0; DWORD cTypes = 0;
hr = pHandler->GetMediaTypeCount(&cTypes); hr = pHandler->GetMediaTypeCount(&cTypes);
if (FAILED(hr)) { if (FAILED(hr)) {
printf("Error GetMediaTypeCount()\n");
goto err; goto err;
} }
if(cTypes > 0) if(cTypes > 0)
{ {
hr = pHandler->GetCurrentMediaType(&pCurrentType); hr = pHandler->GetCurrentMediaType(&pCurrentType);
if (FAILED(hr)) { if (FAILED(hr)) {
printf("Error GetCurrentMediaType()\n");
goto err; goto err;
} }
MT = FormatReader::Read(pCurrentType.Get()); MT = FormatReader::Read(pCurrentType.Get());
...@@ -986,10 +975,6 @@ err: ...@@ -986,10 +975,6 @@ err:
{ {
sizeRawImage = MT.MF_MT_FRAME_SIZE * 4; sizeRawImage = MT.MF_MT_FRAME_SIZE * 4;
} }
else
{
printf("Video format is not RBG 24/32!\n");
}
CHECK_HR(hr = RawImage::CreateInstance(&ig_RIFirst, sizeRawImage)); CHECK_HR(hr = RawImage::CreateInstance(&ig_RIFirst, sizeRawImage));
CHECK_HR(hr = RawImage::CreateInstance(&ig_RISecond, sizeRawImage)); CHECK_HR(hr = RawImage::CreateInstance(&ig_RISecond, sizeRawImage));
ig_RIOut = ig_RISecond; ig_RIOut = ig_RISecond;
...@@ -1038,16 +1023,8 @@ HRESULT ImageGrabber::startGrabbing(void) ...@@ -1038,16 +1023,8 @@ HRESULT ImageGrabber::startGrabbing(void)
PropVariantInit(&var); PropVariantInit(&var);
HRESULT hr = S_OK; HRESULT hr = S_OK;
hr = ig_pSession->SetTopology(0, ig_pTopology); hr = ig_pSession->SetTopology(0, ig_pTopology);
if (FAILED(hr))
{
printf("Error: cannot set topology (status %u)\n", hr);
}
DPO->printOut(L"IMAGEGRABBER VIDEODEVICE %i: Start Grabbing of the images\n", ig_DeviceID); DPO->printOut(L"IMAGEGRABBER VIDEODEVICE %i: Start Grabbing of the images\n", ig_DeviceID);
hr = ig_pSession->Start(&GUID_NULL, &var); hr = ig_pSession->Start(&GUID_NULL, &var);
if (FAILED(hr))
{
printf("Error: cannot start session (status %u)\n", hr);
}
for(;;) for(;;)
{ {
HRESULT hrStatus = S_OK; HRESULT hrStatus = S_OK;
...@@ -1289,7 +1266,6 @@ STDMETHODIMP ImageGrabber::OnProcessSample(REFGUID guidMajorMediaType, DWORD dwS ...@@ -1289,7 +1266,6 @@ STDMETHODIMP ImageGrabber::OnProcessSample(REFGUID guidMajorMediaType, DWORD dwS
(void)llSampleDuration; (void)llSampleDuration;
(void)dwSampleSize; (void)dwSampleSize;
//printf("ImageGrabber::OnProcessSample() -- begin\n");
HANDLE tmp[] = {ig_hFinish, ig_hFrameGrabbed, NULL}; HANDLE tmp[] = {ig_hFinish, ig_hFrameGrabbed, NULL};
DWORD status = WaitForMultipleObjects(2, tmp, FALSE, INFINITE); DWORD status = WaitForMultipleObjects(2, tmp, FALSE, INFINITE);
...@@ -1310,8 +1286,6 @@ STDMETHODIMP ImageGrabber::OnProcessSample(REFGUID guidMajorMediaType, DWORD dwS ...@@ -1310,8 +1286,6 @@ STDMETHODIMP ImageGrabber::OnProcessSample(REFGUID guidMajorMediaType, DWORD dwS
ig_RIOut = ig_RISecond; ig_RIOut = ig_RISecond;
} }
//printf("ImageGrabber::OnProcessSample() -- end\n");
if (ig_Synchronous) if (ig_Synchronous)
{ {
SetEvent(ig_hFrameReady); SetEvent(ig_hFrameReady);
...@@ -3128,11 +3102,7 @@ void CvCaptureFile_MSMF::close() ...@@ -3128,11 +3102,7 @@ void CvCaptureFile_MSMF::close()
if (videoFileSource) if (videoFileSource)
{ {
HRESULT hr = videoFileSource->Shutdown(); videoFileSource->Shutdown();
if (FAILED(hr))
{
printf("VideoCapture Closing failed!\n");
}
} }
} }
...@@ -3531,16 +3501,13 @@ bool CvVideoWriter_MSMF::open( const char* filename, int fourcc, ...@@ -3531,16 +3501,13 @@ bool CvVideoWriter_MSMF::open( const char* filename, int fourcc,
void CvVideoWriter_MSMF::close() void CvVideoWriter_MSMF::close()
{ {
printf("VideoWriter::close()\n");
if (!initiated) if (!initiated)
{ {
printf("VideoWriter was not Initialized\n");
return; return;
} }
initiated = false; initiated = false;
HRESULT hr = sinkWriter->Finalize(); HRESULT hr = sinkWriter->Finalize();
printf("sinkWriter Finalize status %u\n", hr);
MFShutdown(); MFShutdown();
} }
...@@ -3569,7 +3536,6 @@ bool CvVideoWriter_MSMF::writeFrame(const IplImage* img) ...@@ -3569,7 +3536,6 @@ bool CvVideoWriter_MSMF::writeFrame(const IplImage* img)
HRESULT hr = WriteFrame(target, rtStart, rtDuration); HRESULT hr = WriteFrame(target, rtStart, rtDuration);
if (FAILED(hr)) if (FAILED(hr))
{ {
printf("Private WriteFrame failed\n");
delete[] target; delete[] target;
return false; return false;
} }
...@@ -3600,7 +3566,6 @@ HRESULT CvVideoWriter_MSMF::InitializeSinkWriter(const char* filename) ...@@ -3600,7 +3566,6 @@ HRESULT CvVideoWriter_MSMF::InitializeSinkWriter(const char* filename)
// Set the output media type. // Set the output media type.
if (SUCCEEDED(hr)) if (SUCCEEDED(hr))
{ {
printf("MFCreateSinkWriterFromURL is successfull\n");
hr = MFCreateMediaType(&mediaTypeOut); hr = MFCreateMediaType(&mediaTypeOut);
} }
if (SUCCEEDED(hr)) if (SUCCEEDED(hr))
...@@ -3755,7 +3720,6 @@ HRESULT CvVideoWriter_MSMF::WriteFrame(DWORD *videoFrameBuffer, const LONGLONG& ...@@ -3755,7 +3720,6 @@ HRESULT CvVideoWriter_MSMF::WriteFrame(DWORD *videoFrameBuffer, const LONGLONG&
CvVideoWriter* cvCreateVideoWriter_MSMF( const char* filename, int fourcc, CvVideoWriter* cvCreateVideoWriter_MSMF( const char* filename, int fourcc,
double fps, CvSize frameSize, int isColor ) double fps, CvSize frameSize, int isColor )
{ {
printf("Creating Media Foundation VideoWriter\n");
CvVideoWriter_MSMF* writer = new CvVideoWriter_MSMF; CvVideoWriter_MSMF* writer = new CvVideoWriter_MSMF;
if( writer->open( filename, fourcc, fps, frameSize, isColor != 0 )) if( writer->open( filename, fourcc, fps, frameSize, isColor != 0 ))
return writer; return writer;
......
mkdir build mkdir build_winrt_arm
cd build cd build_winrt_arm
rem call "C:\Program Files\Microsoft Visual Studio 11.0\VC\bin\x86_arm\vcvarsx86_arm.bat" rem call "C:\Program Files\Microsoft Visual Studio 11.0\VC\bin\x86_arm\vcvarsx86_arm.bat"
cmake.exe -GNinja -DWITH_TBB=ON -DBUILD_TBB=ON -DCMAKE_BUILD_TYPE=Release -DWITH_FFMPEG=OFF -DBUILD_opencv_gpu=OFF -DBUILD_opencv_python=OFF -DCMAKE_TOOLCHAIN_FILE=..\..\winrt\arm.winrt.toolchain.cmake ..\..\.. cmake.exe -GNinja -DWITH_TBB=ON -DBUILD_TBB=ON -DCMAKE_BUILD_TYPE=Release -DWITH_FFMPEG=OFF -DBUILD_opencv_gpu=OFF -DBUILD_opencv_python=OFF -DCMAKE_TOOLCHAIN_FILE=..\winrt\arm.winrt.toolchain.cmake ..\..
/* this ALWAYS GENERATED file contains the definitions for the interfaces */
/* File created by MIDL compiler version 8.00.0595 */
/* at Wed Jun 19 03:47:25 2013
*/
/* Compiler settings for C:\Users\ASMORK~1\AppData\Local\Temp\OcvImageManipulations.idl-2e8e757e:
Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 8.00.0595
protocol : dce , ms_ext, c_ext, robust
error checks: allocation ref bounds_check enum stub_data
VC __declspec() decoration level:
__declspec(uuid()), __declspec(selectany), __declspec(novtable)
DECLSPEC_UUID(), MIDL_INTERFACE()
*/
/* @@MIDL_FILE_HEADING( ) */
#pragma warning( disable: 4049 ) /* more than 64k source lines */
/* verify that the <rpcndr.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCNDR_H_VERSION__
#define __REQUIRED_RPCNDR_H_VERSION__ 475
#endif
#include "rpc.h"
#include "rpcndr.h"
#ifndef __RPCNDR_H_VERSION__
#error this stub requires an updated version of <rpcndr.h>
#endif // __RPCNDR_H_VERSION__
#ifndef __OcvImageManipulations_h__
#define __OcvImageManipulations_h__
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
#pragma once
#endif
#if defined(__cplusplus)
#if defined(__MIDL_USE_C_ENUM)
#define MIDL_ENUM enum
#else
#define MIDL_ENUM enum class
#endif
#endif
/* Forward Declarations */
/* header files for imported files */
#include "Windows.Media.h"
#ifdef __cplusplus
extern "C"{
#endif
/* interface __MIDL_itf_OcvImageManipulations_0000_0000 */
/* [local] */
#pragma warning(push)
#pragma warning(disable:4001)
#pragma once
#pragma warning(pop)
#ifndef RUNTIMECLASS_OcvTransform_OcvImageManipulations_DEFINED
#define RUNTIMECLASS_OcvTransform_OcvImageManipulations_DEFINED
extern const __declspec(selectany) WCHAR RuntimeClass_OcvTransform_OcvImageManipulations[] = L"OcvTransform.OcvImageManipulations";
#endif
/* interface __MIDL_itf_OcvImageManipulations_0000_0000 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_OcvImageManipulations_0000_0000_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_OcvImageManipulations_0000_0000_v0_0_s_ifspec;
/* Additional Prototypes for ALL interfaces */
/* end of Additional Prototypes */
#ifdef __cplusplus
}
#endif
#endif
This diff is collapsed.
This diff is collapsed.
#container {
min-height: 768px;
}
#leftSubHeaderContainer
{
margin-top:20px;
}
#title h1
{
font-size:25px;
}
#subtitle h2
{
font-size:15px;
}
#subtitle
{
margin-left:10px;
}
#formContainer
{
margin-left:10px;
margin-top:30px;
}
.formLabel
{
float:left;
width: 250px;
}
.formRow
{
clear:both;
padding: 10px 0 10px 10px;
}
.formRecaptchaRow
{
clear:both;
float:left;
margin-top:20px;
margin-left:10px;
margin-bottom:20px;
}
.formSubmitRow
{
clear:both;
margin-top:20px;
margin-left:300px;
margin-bottom:20px;
}
.formControl {
width:300px;
float:left;
}
.formControl .textInput
{
width:300px;
}
.formControl textarea
{
width:425px;
height:100px;
}
.formControl .tag
{
width:425px;
}
.formControl .richText
{
margin-top:10px;
width:500px;
height:440px;
}
.formWideLabel
{
width:500px;
}
.formBigLabel
{
margin-top:20px;
font-size:20px;
}
.formControlBelow
{
clear:both;
margin-top:10px;
width:500px;
}
.required
{
color: Red;
}
.helpText
{
color: #9D9D9D;
font-style: italic;
}
#agreementSummary
{
clear:both;
margin-top:10px;
width:800px;
}
.field-validation-error, .validation-summary-errors
{
color: #FF0000;
font-weight: bold;
}
.tinyMCETemplate {
position: relative;
left: 400px;
width: 300px;
max-height: 300px;
overflow: auto;
}
.IE6 .tinyMCETemplate {
left: 25px;
}
.ownerBar {
padding: 5px;
}
.ownerBar .ownerBarOptions {
float: right;
}
/*Global*/
h1 {
font-size: 36px;
font-family: 'Segoe UI Light';
color: #707070;
font-weight: normal;
margin-bottom: 17px !important;
}
h2, h3, h4, h5, h6, #searchPage h3 {
font-family: 'Segoe UI', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif !important;
font-weight:normal;
color: #2A2A2A !important;
}
a, a:link, a:visited {
color: #0095c4;
}
body {
color:#707070;
}
.profile-usercard {
color:#707070 !important;
}
/*temporary setting to override msdn_windows.css
can remove once conflicting settings are removed from that file*/
.LocalNavigation, .LocalNavigation .TabOn, .LocalNavigation .TabOn:hover, .LocalNavigation .TabOff, .LocalNavigation .TabOff a:hover {
display: block;
background-color:transparent !important;
color: #0095c4;
}
.LocalNavigation .TabOff a {
color:#707070 ;
}
/*End Global*/
.EyebrowContainer
{
margin-bottom: 0 !important;
}
#sideNav
{
width: 215px !important;
}
#searchPage #mainContentContainer
{
margin-right:0 !important;
margin-left:243px !important;
}
#searchPage .dirSubHeading h2
{
font-size: 14px !important;
font-weight: normal !important;
color: #454545 !important;
line-height: 1.45;
}
#searchPage #directoryListFooter, #searchPage #Pager {
font-size: 14px;
}
#searchPage h2, #searchPage h3
{
font-size: 1.25em !important;
}
#sideNav #contributeSection h3, .sidebar #contributeSection h3, #contributeSection h3
{
font-size: 1.65em !important;
}
.subMenu > h2
{
font-family: 'Segoe UI Light','Segoe UI', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif !important;
font-weight:normal;
font-size:30px;
margin: 15px 10px 5px 0;
padding-bottom:0px;
}
.itemRow {
}
.itemRow .itemBody, .itemRow .itemInfo {
padding: 18px 17px 20px 0;
font-size: 14px;
line-height: 1.45em;
}
.itemRow .itemTitle {
font-weight: normal;
}
.itemRow .summaryBox{
color: #454545;
}
.Samples #MainContent .itemRow .itemTitle a {
font-weight: 600 !important;
line-height: 1.45;
}
#MainContent a.officialMicrosoftLabel
{
color: #ACACAC;
}
.tabContents {
border-top-width:0px;
}
#UploadPage {
margin: 0px 0px 0px 10px;
}
#UploadPage h1 {
padding: 0;
font-size: 22px;
}
#UploadPage h2 {
color:#F39700 !important;
}
#UploadPage #uploadPageInstruction {
margin-top:10px;
}
#UploadPage fieldset {
margin-left:0px;
}
#UploadPage fieldset h2 {
font-weight:normal;
}
#UploadPage fieldset#uploadsForm{
margin-top:25px;
}
#UploadPage fieldset#summary textarea {
margin-left:0px;
}
#UploadPage .projectTypeChoice > div {
height: 250px;
}
#sideNav {
}
#sideNav .section h3 {
background-color: transparent;
}
#sideNav .section UL LI {
border-bottom-width: 0px;
}
#sideNav .section form > div {
border-bottom: none;
color: #707070;
}
#sideNav .section ul li > div.itemCount
{
color: #707070;
}
#searchPage {
}
#searchPage h2, #searchPage h3 {
text-transform:none;
background-color:transparent;
font-weight:normal;
font-size:1.2em;
}
#searchPage .browseFilterBar {
background-color:transparent;
border-width:0px;
font-weight:normal;
}
#requestsPage {
padding-top:15px;
}
#requestsPage .tabHeaders {
overflow: visible;
}
#requestsPage #requestsList {
border: none;
}
#requestsPage h2, #requestsPage h3 {
text-transform:none;
background-color:transparent;
font-weight:normal;
font-size:1.2em;
}
.reqBrowseContent .title {
font-weight: bold !important;
color:#000 !important;
font-family: 'Segoe UI', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif !important;
}
.reqDescPage #header #votenumber {
height: 30px;
padding: 9px 12px 3px 12px;
}
#extraActions {
}
#extraActions .section
{
margin-bottom: 10px;
}
#extraActions .section a
{
font-weight:normal;
}
#extraActions #contributeSection div img {
width:0px;
}
#projectPage {
}
#projectPage .projectTitle {
color: #707070;
margin: 5px 0px 15px 0px;
}
#projectPage h2.projectSummary, #projectPage #projectInfo, #projectPage .tabHeaders {
font-size: 14px !important;
line-height: 1.45em;
color: #454545 !important;
font-weight: normal !important;
}
#projectPage #projectInfo a {
color: #00749e;
}
#projectPage #Downloads a, #projectPage #Downloads label {
font-size: 14px;
}
#projectPage #reportAbuse {
font-size: 1em;
}
#projectPage #publishBar a, #projectPage #publishBar a:visited {
color: #0095c4;
font-weight: normal;
}
#projectPage #Collections .bevelButton{
background-color: #F8F8F8;
color: #0095C4;
border: 1px solid #707070;
}
#projectPage #DiscussionsTabPane .threadHeader .title {
font-weight:bold !important;
color:Black !important;#F8F8F8;
font-family: 'Segoe UI', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif !important;
}
#projectPage .sidebar .section .titleBar h3 {
font-weight:normal;
font-size:1.2em;
}
#LocalNav {
}
#LocalNav.HeaderTabs {
margin-left:11px;
}
#searchPage .dirSubHeading h1
{
margin-bottom:17px !important;
}
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment