opencv/modules/videoio/test
wanghanmin eb981cc7d7 Merge pull request #12138 from wanghanmin:wanghanmin-patch-videoio_crossbarsetting-1
* Update videoio.hpp

add VideoCapturePropertie for clossbar input pin setting

* Update cap_dshow.cpp

For some kind of capture card, such as "avermedia cv710 " , it use SerialDigital as input pin and so it can not work.
Here added new PhysicalConnectorType enumeration: PhysConn_Video_YRYBY and PhysConn_Video_SerialDigital to support it.
And also provide new property parameter CAP_CROSSBAR_INPIN_TYPE to set the crossbar input pin type which will be used in videoInput::start(int deviceID, videoDevice *VD):
" if(VD->useCrossbar)
    {
        DebugPrintOut("SETUP: Checking crossbar\n");
        routeCrossbar(&VD->pCaptureGraph, &VD->pVideoInputFilter, VD->connection, CAPTURE_MODE);

    }
"

And at last ,fixed one issue for function setSizeAndSubtype, added code 
pVih->rcSource.top = pVih->rcSource.left = pVih->rcTarget.top =pVih->rcTarget.left=0;
pVih->rcSource.right = pVih->rcTarget.right= attemptWidth;
pVih->rcSource.bottom = pVih->rcTarget.bottom = attemptHeight;

without these code , rcSource and rcTarget will keeping use default resolution and cause fail in hr = VD->streamConf->SetFormat(VD->pAmMediaType) and cannot find suitable MediaType.

Tested with python3 and mfc (Avermedia cv710)
Python3 code:
import cv2
print("test cv")
cap=cv2.VideoCapture(0)
cap.set(5,60)
cap.set(3,1920)
cap.set(4,1080)
cap.set(31,6)


ret,img=cap.read()
cv2.namedWindow("cap",cv2.WINDOW_NORMAL)
cv2.resizeWindow("cap",960,640);
while True:
    ret,img=cap.read()
    if ret==False:
        continue
    cv2.imshow("cap",img)
    if cv2.waitKey(1) & 0xFF == ord('q'):
        break
cap.release()

cv2.destroyAllWindows()

MFC code:
void CcvtestDlg::OnBnClickedButton1()
{
VideoCapture cap(0);
cap.set(CAP_PROP_FRAME_WIDTH, 1920);
cap.set(CAP_PROP_FRAME_HEIGHT, 1080);

cap.set(CAP_CROSSBAR_INPIN_TYPE , 6);
Mat img;
namedWindow("test", WINDOW_NORMAL);
resizeWindow("test", 960, 640);
while (1)
{
if (cap.read(img))
{
imshow("test", img);
if ('q' ==waitKey(1))
break;
}
}
destroyAllWindows();
cap.release();
}

* Update cap_dshow.cpp

* Update videoio.hpp

move enum value of CAP_CROSSBAR_INPIN_TYPE to the end of list

* Update videoio.hpp

* Update cap_dshow.cpp

removed trailing whitespace

* Update test_camera.cpp

Add test for capture device using PhysConn_Video_SerialDigital as crossbar input pin

* Update test_camera.cpp

Correction of misunderstanding about how to add test case.
2018-10-25 19:41:37 +03:00
..
test_camera.cpp Merge pull request #12138 from wanghanmin:wanghanmin-patch-videoio_crossbarsetting-1 2018-10-25 19:41:37 +03:00
test_container_avi.cpp Added avi-container with tests 2018-02-15 17:34:49 +03:00
test_ffmpeg.cpp videoio(test): dump file size information 2018-09-18 08:04:51 +00:00
test_fourcc.cpp ts: refactor OpenCV tests 2018-02-03 19:39:47 +00:00
test_gstreamer.cpp VideoIO: prettier test console output, gstreamer capture backend changed to C++ interface 2018-04-23 13:21:37 +03:00
test_main.cpp Merge pull request #11897 from Jakub-Golinowski:hpx_backend 2018-08-31 16:23:26 +03:00
test_mfx.cpp ts: refactor OpenCV tests 2018-02-03 19:39:47 +00:00
test_precomp.hpp videoio: add routines to query information about backends API 2018-07-19 17:27:37 +03:00
test_video_io.cpp videoio: add routines to query information about backends API 2018-07-19 17:27:37 +03:00