mirror of
https://github.com/opencv/opencv.git
synced 2025-06-11 03:33:28 +08:00
Merge pull request #18736 from mshabunin:mfx-frame-size-34
This commit is contained in:
commit
39ecd96b09
@ -111,6 +111,7 @@ VideoCapture_IntelMFX::VideoCapture_IntelMFX(const cv::String &filename)
|
||||
return;
|
||||
}
|
||||
|
||||
frameSize = Size(params.mfx.FrameInfo.CropW, params.mfx.FrameInfo.CropH);
|
||||
good = true;
|
||||
}
|
||||
|
||||
@ -126,10 +127,23 @@ VideoCapture_IntelMFX::~VideoCapture_IntelMFX()
|
||||
cleanup(deviceHandler);
|
||||
}
|
||||
|
||||
double VideoCapture_IntelMFX::getProperty(int) const
|
||||
double VideoCapture_IntelMFX::getProperty(int prop) const
|
||||
{
|
||||
MSG(cerr << "MFX: getProperty() is not implemented" << endl);
|
||||
return 0;
|
||||
if (!good)
|
||||
{
|
||||
MSG(cerr << "MFX: can not call getProperty(), backend has not been initialized" << endl);
|
||||
return 0;
|
||||
}
|
||||
switch (prop)
|
||||
{
|
||||
case CAP_PROP_FRAME_WIDTH:
|
||||
return frameSize.width;
|
||||
case CAP_PROP_FRAME_HEIGHT:
|
||||
return frameSize.height;
|
||||
default:
|
||||
MSG(cerr << "MFX: unsupported property" << endl);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
bool VideoCapture_IntelMFX::setProperty(int, double)
|
||||
|
@ -34,6 +34,7 @@ private:
|
||||
MFXVideoDECODE *decoder;
|
||||
SurfacePool *pool;
|
||||
void *outSurface;
|
||||
cv::Size frameSize;
|
||||
bool good;
|
||||
};
|
||||
|
||||
|
@ -111,6 +111,8 @@ TEST_P(Videoio_MFX, read_write_raw)
|
||||
VideoCapture cap;
|
||||
cap.open(filename, CAP_INTEL_MFX);
|
||||
ASSERT_TRUE(cap.isOpened());
|
||||
EXPECT_EQ(FRAME_SIZE.width, cap.get(CAP_PROP_FRAME_WIDTH));
|
||||
EXPECT_EQ(FRAME_SIZE.height, cap.get(CAP_PROP_FRAME_HEIGHT));
|
||||
for (int i = 0; i < FRAME_COUNT; ++i)
|
||||
{
|
||||
ASSERT_TRUE(cap.read(frame));
|
||||
|
Loading…
Reference in New Issue
Block a user