Skip to content

Commit f737aab

Browse files
tnollediegohce
authored andcommitted
Change type of VideoCaptureProperties to int32
This patch changes the type of `VideoCaptureProperties` to `int32`. It is currently set to `int`. This breaks `VideoCapture_OpenDeviceWithAPIParams` because it doesn't correclty unroll the slice into the `std::vector<int>` here: ```c++ bool VideoCapture_OpenDeviceWithAPIParams(VideoCapture v, int device, int apiPreference, int *paramsv, int paramsc) { std::vector< int > params; for( int i = 0; i< paramsc; i++) { params.push_back(paramsv[i]); } return v->open(device, apiPreference, params); } ``` With `int64` this for loop will create only zeros in the value parts of the array that OpenCV expects (`[p1, v1, ..., pn, vn]`). Changing it to `int32` unpacks the slice correctly and OpenCV will pass the parameters correctly to the respective VideoCapture backends.
1 parent fbf4c89 commit f737aab

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

videoio.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ const (
119119
)
120120

121121
// VideoCaptureProperties are the properties used for VideoCapture operations.
122-
type VideoCaptureProperties int
122+
type VideoCaptureProperties int32
123123

124124
const (
125125
// VideoCapturePosMsec contains current position of the

0 commit comments

Comments
 (0)