Skip to content

Commit

Permalink
Use correct order of params and enforce type for VideoCapture
Browse files Browse the repository at this point in the history
Signed-off-by: deadprogram <[email protected]>
  • Loading branch information
deadprogram committed Oct 9, 2017
1 parent d8b7b4d commit f86f1eb
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion videoio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ int VideoCapture_OpenDevice(VideoCapture v, int device) {
return v->open(device);
}

void VideoCapture_Set(VideoCapture v, int prop, int param) {
void VideoCapture_Set(VideoCapture v, int prop, double param) {
v->set(prop, param);
}

Expand Down
4 changes: 2 additions & 2 deletions videoio.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,8 @@ func (v *VideoCapture) Close() error {
}

// Set parameter with property (=key).
func (v *VideoCapture) Set(prop int, param VideoCaptureProperties) {
C.VideoCapture_Set(v.p, C.int(prop), C.int(param))
func (v *VideoCapture) Set(prop VideoCaptureProperties, param float64) {
C.VideoCapture_Set(v.p, C.int(prop), C.double(param))
}

// IsOpened returns if the VideoCapture has been opened to read from
Expand Down
2 changes: 1 addition & 1 deletion videoio.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ VideoCapture VideoCapture_New();
void VideoCapture_Close(VideoCapture v);
int VideoCapture_Open(VideoCapture v, const char* uri);
int VideoCapture_OpenDevice(VideoCapture v, int device);
void VideoCapture_Set(VideoCapture v, int prop, int param);
void VideoCapture_Set(VideoCapture v, int prop, double param);
int VideoCapture_IsOpened(VideoCapture v);
int VideoCapture_Read(VideoCapture v, Mat buf);
void VideoCapture_Grab(VideoCapture v, int skip);
Expand Down
2 changes: 1 addition & 1 deletion videoio_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ func TestVideoCaptureFile(t *testing.T) {
t.Error("Unable to open VideoCaptureFile")
}

vc.Set(VideoCaptureBrightness, 100)
vc.Set(VideoCaptureBrightness, 100.0)
vc.Grab(10)

img := NewMat()
Expand Down

0 comments on commit f86f1eb

Please sign in to comment.