|
|
|
@ -115,6 +115,11 @@ struct IMFActivate; |
|
|
|
|
struct IMFMediaSource; |
|
|
|
|
struct IMFAttributes; |
|
|
|
|
|
|
|
|
|
#define CV_CAP_MODE_BGR CV_FOURCC_MACRO('B','G','R','3') |
|
|
|
|
#define CV_CAP_MODE_RGB CV_FOURCC_MACRO('R','G','B','3') |
|
|
|
|
#define CV_CAP_MODE_GRAY CV_FOURCC_MACRO('G','R','E','Y') |
|
|
|
|
#define CV_CAP_MODE_YUYV CV_FOURCC_MACRO('Y', 'U', 'Y', 'V') |
|
|
|
|
|
|
|
|
|
namespace |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
@ -704,7 +709,7 @@ public: |
|
|
|
|
virtual int getCaptureDomain() CV_OVERRIDE { return CV_CAP_MSMF; } |
|
|
|
|
protected: |
|
|
|
|
double getFramerate(MediaType MT) const; |
|
|
|
|
bool configureOutput(UINT32 width, UINT32 height, double prefFramerate, UINT32 aspectRatioN, UINT32 aspectRatioD, int outFormat, bool convertToFormat); |
|
|
|
|
bool configureOutput(UINT32 width, UINT32 height, double prefFramerate, UINT32 aspectRatioN, UINT32 aspectRatioD, cv::uint32_t outFormat, bool convertToFormat); |
|
|
|
|
bool setTime(double time, bool rough); |
|
|
|
|
bool configureHW(bool enable); |
|
|
|
|
|
|
|
|
@ -720,7 +725,7 @@ protected: |
|
|
|
|
DWORD dwStreamIndex; |
|
|
|
|
MediaType nativeFormat; |
|
|
|
|
MediaType captureFormat; |
|
|
|
|
int outputFormat; |
|
|
|
|
cv::uint32_t outputFormat; |
|
|
|
|
UINT32 requestedWidth, requestedHeight; |
|
|
|
|
bool convertFormat; |
|
|
|
|
UINT32 aspectN, aspectD; |
|
|
|
@ -836,7 +841,7 @@ static UINT32 resolutionDiff(MediaType& mType, UINT32 refWidth, UINT32 refHeight |
|
|
|
|
{ return UDIFF(mType.width, refWidth) + UDIFF(mType.height, refHeight); } |
|
|
|
|
#undef UDIFF |
|
|
|
|
|
|
|
|
|
bool CvCapture_MSMF::configureOutput(UINT32 width, UINT32 height, double prefFramerate, UINT32 aspectRatioN, UINT32 aspectRatioD, int outFormat, bool convertToFormat) |
|
|
|
|
bool CvCapture_MSMF::configureOutput(UINT32 width, UINT32 height, double prefFramerate, UINT32 aspectRatioN, UINT32 aspectRatioD, cv::uint32_t outFormat, bool convertToFormat) |
|
|
|
|
{ |
|
|
|
|
if (width != 0 && height != 0 && |
|
|
|
|
width == captureFormat.width && height == captureFormat.height && prefFramerate == getFramerate(nativeFormat) && |
|
|
|
@ -1375,8 +1380,6 @@ double CvCapture_MSMF::getProperty( int property_id ) const |
|
|
|
|
if (isOpen) |
|
|
|
|
switch (property_id) |
|
|
|
|
{ |
|
|
|
|
case CV_CAP_PROP_FORMAT: |
|
|
|
|
return outputFormat; |
|
|
|
|
case CV_CAP_PROP_MODE: |
|
|
|
|
return captureMode; |
|
|
|
|
case CV_CAP_PROP_CONVERT_RGB: |
|
|
|
@ -1687,7 +1690,7 @@ bool CvCapture_MSMF::setProperty( int property_id, double value ) |
|
|
|
|
default: |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
case CV_CAP_PROP_FORMAT: |
|
|
|
|
case CV_CAP_PROP_FOURCC: |
|
|
|
|
return configureOutput(requestedWidth, requestedHeight, getFramerate(nativeFormat), aspectN, aspectD, (int)cvRound(value), convertFormat); |
|
|
|
|
case CV_CAP_PROP_CONVERT_RGB: |
|
|
|
|
return configureOutput(requestedWidth, requestedHeight, getFramerate(nativeFormat), aspectN, aspectD, outputFormat, value != 0); |
|
|
|
@ -1711,8 +1714,6 @@ bool CvCapture_MSMF::setProperty( int property_id, double value ) |
|
|
|
|
if (value >= 0) |
|
|
|
|
return configureOutput(requestedWidth, requestedHeight, value, aspectN, aspectD, outputFormat, convertFormat); |
|
|
|
|
break; |
|
|
|
|
case CV_CAP_PROP_FOURCC: |
|
|
|
|
break; |
|
|
|
|
case CV_CAP_PROP_FRAME_COUNT: |
|
|
|
|
break; |
|
|
|
|
case CV_CAP_PROP_POS_AVI_RATIO: |
|
|
|
|