In the original code, setting configuration directly to VideoCapture object in the callback function of dynamic_reconfigure, where setting parameters may fail if the object is not initialized or opened.
(e.g. https://github.com/ros-drivers/video_stream_opencv/blob/master/src/video_stream.cpp#L364 )
This PR changes to let the callback function just update internal variables of the parameters and the subscribe function set all the parameters instead.
The internal variables are also replaced with VideoStreamConfig object to make tracking the change of the parameters easier.
In the original code, setting configuration directly to VideoCapture object in the callback function of dynamic_reconfigure, where setting parameters may fail if the object is not initialized or opened. (e.g. https://github.com/ros-drivers/video_stream_opencv/blob/master/src/video_stream.cpp#L364 ) This PR changes to let the callback function just update internal variables of the parameters and the subscribe function set all the parameters instead. The internal variables are also replaced with VideoStreamConfig object to make tracking the change of the parameters easier.