Ask Your Question

Revision history [back]

You are using the new C++ style interface which is in fact a structure to avoid the use of pointers. Internally it creates its own pointer to the object so that you can actually use the pointer as an object itself.

This also means that you do not have to destroy/delete the objects itself. The garbage collector will do the work for you when needed.

So just use

VideoCapture x = new VideoCapture();

You are using the new C++ style interface which is in fact a structure to avoid the use of pointers. Internally it creates its own pointer to the object so that you can actually use the pointer as an object itself.

This also means that you do not have to destroy/delete the objects itself. The garbage collector will do the work for you when needed.

So just use

VideoCapture x = new VideoCapture();
x('location_to_file);

You are using the new C++ style interface which is in fact a structure to avoid the use of pointers. Internally it creates its own pointer to the object so that you can actually use the pointer as an object itself.

This also means that you do not have to destroy/delete the objects itself. The garbage collector will do the work for you when needed.

So just use

VideoCapture x('location_to_file);
x("location_to_file");