Live View
This page shows how to obtain live view of connected camera devices using RICOH Camera USB SDK.
For devices that support to live view, please refer to Appendix.
Contents
- Related Classes
- How to Set up Live View Event
- How to Start Live View
- How to Adjust Focus
- How to Focus at Specified Position
- How to Capture with Focusing at Specified Position
- How to Stop Live View
- See Also
Related Classes
The following classes are used when you obtain live view:
CameraEventListener
- The
CameraEventListener
class is a event listener which receives notifications from camera devices.
CameraDevice
- The
CameraDevice
class represents a camera device. - This class includes properties and methods for obtaining camera information and operating camera device.
Set up Live View Event
To start live view, override the virtual method liveViewFrameUpdated
included in the CameraEventListener
class with the user-defined derived class. JPEG data is streamed all the time, which keeps calling liveViewFrameUpdated
.
class UserEventListener : public CameraEventListener {
public:
void liveViewFrameUpdated(const std::shared_ptr<const CameraDevice>& sender,
const std::shared_ptr<const unsigned char>& liveViewFrame,
uint64_t frameSize) override
{
std::cout << "Live View Frame Updated. Frame Size: " << frameSize
<< std::endl;
}
};
Start Live View
Use the startLiveView
to start live view.
std::shared_ptr<CameraEventListener> userEventListener =
std::make_shared<UserEventListener>();
cameraDevice->addEventListener(userEventListener);
Response response = cameraDevice->startLiveView();
Adjust Focus
If you want to adjust the focus while checking the live view, use the focus
method with the adjustment
argument.
Argument represents the moving direction and moving amount of the focus.
If the argument is positive, the focus moves forward. If the argument is negative, the focus moves backward.
int adjustment = 100;
Response response = cameraDevice->focus(adjustment);
Focus at Specified Position
If you want focus at specified position while checking the live view, use the focus
method with the focusPoint
argument.
The position that can be specified varies depending on the devices and setting conditions, and information can be get from the Live View Specification
.
Point focusPoint;
focusPoint.x = 0.2;
focusPoint.y = 0.5;
Response response = cameraDevice->focus(focusPoint);
Capture with Focusing at Specified Position
If you want to capture with focusing at specified position while checking the live view, use the startCapture
method with the focusPoint
argument.
The position that can be specified varies depending on the devices and setting conditions, and information can be get from the Live View Specification
.
Point focusPoint;
focusPoint.x = 0.2;
focusPoint.y = 0.5;
Response response = cameraDevice->startCapture(focusPoint);
Stop Live View
Use the stopLiveView
to stop live view.
Response response = cameraDevice->stopLiveView();
See Also
- Camera Settings - Describes camera settings.
- Events - Describes events such as
liveViewFrameUpdated
.