Live View
This page shows how to obtain live view of connected camera devices using RICOH Camera Wireless SDK.
Contents
Related Classes
The following interfaces and 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
interface represents a camera device. - This interface include 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 extends CameraEventListener {
// Display liveViewFrame in imageView
@Override
public void liveViewFrameUpdated(
CameraDevice sender, byte[] liveViewFrame) {
final Bitmap bitmap =
BitmapFactory.decodeByteArray(
liveViewFrame, 0, liveViewFrame.length);
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
imageView.setImageBitmap(bitmap);
}
});
}
}
Start Live View
Use the startLiveView
to start live view.
CameraEventListener cameraEventListener = new UserEventListener();
cameraDevice.addEventListener(cameraEventListener);
Response response = cameraDevice.startLiveView();
Stop Live View
Use the stopLiveView
to stop live view.
Response response = cameraDevice.stopLiveView();
See Also
- Events - Describes events such as
liveViewFrameUpdated
.