Welcome to MOST’s Visualization Module documentation¶
The MOST project aims to achieve an open, modular and scalable solution for the creation, execution and management of remote clinical consultations with direct interaction between specialists.
The project consists of a set of frameworks that deal with different aspects and technologies useful for the creation of telemedicine applications.
Visualization Framework¶
The Visualization Framework allows you to include into your mobile applications visual and interactive widgets capable of rendering , inspecting and changing properties of IStream objects. This framework internally uses the Android Touch Gallery Library for rendering images and the MOST Streaming Library for managing audio/video streams.
TREE:
Android Most Visualization API¶
Contents:
Javadoc¶
org.crs4.most.visualization¶
IPtzCommandReceiver¶
-
public interface
IPtzCommandReceiver
¶ An activity must implement this interface to be able to receive notifications from the attached PTZ_ControllerFragment or PTZ_PopupWindow
-
public void
onGoHome
()¶ Called when the user clicks on the home button of the pan-tilt panel
-
public void
onPTZstartMove
(PTZ_Direction dir)¶ Called when the user presses one button of the pan-tilt panel
Parameters: - dir – the required moving direction
-
public void
onPTZstartZoom
(PTZ_Zoom dir)¶ Called when the user presses one button of the zoom panel
Parameters: - dir – the required zooming direction
-
public void
onPTZstopMove
(PTZ_Direction dir)¶ Called when the user releases one button of the pan-tilt panel
Parameters: - the – moving direction before this stop command
IStreamArrayAdapter¶
-
class
IStreamArrayAdapter
extends ArrayAdapter<IStream>¶ This adapter is internally used from the
StreamInspectorFragment
for representing IStream data.
-
public
IStreamArrayAdapter
(Context context, int viewId, List<IStream> objects, List<StreamProperty> streamProperties)¶ This adapter provides a way of rendering informations about a list of
IStream
objects.Parameters: - context –
- viewId – the view id where to render the informations about each stream
- objects – the list of
IStream
objects. - streamProperties – the properties to render for each stream (a null value renders all the available properties)
IStreamFragmentCommandListener¶
-
public interface
IStreamFragmentCommandListener
¶ This interface must be implemented by activities attached to the
StreamViewerFragment
fragment
-
public void
onPlay
(String streamId)¶ Callback triggered after the user clicked on the play button
Parameters: - streamId – the id of the stream the
StreamViewerFragment
refer to
- streamId – the id of the stream the
-
public void
onSurfaceViewCreated
(String streamId, SurfaceView surfaceView)¶ Callback triggered once the surfaceView of the fragment became available
Parameters: - streamId – the id of the stream the
StreamViewerFragment
refer to - surfaceView – the surfaceView where to render the stream
- streamId – the id of the stream the
-
public void
onSurfaceViewDestroyed
(String streamId)¶ Callback triggered after the surfaceView of this fragment has been destroyed
Parameters: - streamId – the id of the stream the
StreamViewerFragment
refer to
- streamId – the id of the stream the
PTZ_ControllerFragment¶
-
public class
PTZ_ControllerFragment
extends DialogFragment implements OnTouchListener¶ This fragment provides you a set of visual panels and buttons to be used as a GUI frontend for handling remote PTZ webcams. This fragment expects the attached activity implements the
IPtzCommandReceiver
interface, because it notifies to this interface all the GUI actions (e.g button clicks)
-
public static PTZ_ControllerFragment
newInstance
()¶ Provides a new instance of this fragment, with all panels visible
Returns: the PTZ_ControllerFragment instance
-
public static PTZ_ControllerFragment
newInstance
(boolean panTiltPanelVisible, boolean zoomPanelVisible, boolean snapShotVisible)¶ Provides a new instance of this fragment, with a selection of desired panels
Parameters: - panTiltPanelVisible – set the pan-tilt panel visible or not
- zoomPanelVisible – set the zoom panel visible or not
- snapShotVisible – set the snapshot button visible or not
PTZ_ControllerPopupWindowFactory¶
-
public class
PTZ_ControllerPopupWindowFactory
implements OnTouchListener¶ This Factory class provides you an interactive visual panel containing a set of buttons to be used as a GUI frontend for handling remote PTZ webcams. You need to pass a
IPtzCommandReceiver
interface to the factory method of this class, because it notifies to this interface all the GUI actions (e.g button clicks) Note that the created window implements theandroid.view.View.OnTouchListener
interface, so you can move it to the desired position on the screen.
-
public
PTZ_ControllerPopupWindowFactory
(Context context, IPtzCommandReceiver ptzReceiver, boolean panTiltPanelVisible, boolean zoomPanelVisible, boolean snapShotVisible, int xPos, int yPos)¶ Creates a new floating popupWindow, containing a set of optional panels to be viewed
Parameters: - context – the context where to render the popup Window
- ptzReceiver – the remote object to use as the target of all user notifications
- panTiltPanelVisible – set the pan-tilt panel visible or not
- zoomPanelVisible – set the zoom panel visible or not
- snapShotVisible – set the snapshot button visible or not
- xPos – the initial X position of the popupWindow
- yPos – the initial y position of the popupWindow
StreamInspectorFragment¶
-
public class
StreamInspectorFragment
extends Fragment¶ This fragment provides a way for visually getting and/or updating the video properties of a list of
IStream
objects. Also, you can specify a filter for getting only a subset of stream properties you are interested in. You can attach this fragment to any activity, provided that it implements theStreamInspectorFragment.IStreamProvider
interface.
-
public static StreamInspectorFragment
newInstance
()¶ Provides a new istance of this fragment
Returns: the StreamInspectorFragment instance
-
public View
onCreateView
(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)¶
StreamInspectorFragment.IStreamProvider¶
-
public interface
IStreamProvider
¶ This interface is used by the StreamInspector for getting the streams to inspect along with their properties.
StreamViewerFragment¶
-
public class
StreamViewerFragment
extends Fragment¶ This fragment represents a visual container for an
IStream
. It can be attached to any Activity, provided that it implements theIStreamFragmentCommandListener
interface. This fragment contains a surface where to render the stream along with two image buttons that you can optionally use for sending play or pause stream requests to the attached activity
-
public static StreamViewerFragment
newInstance
(String streamId)¶ Intances a new StreamViewerFragment
Parameters: - streamId – the id of the stream to render
Returns: a new StreamViewerFragment instance
org.crs4.most.visualization.image_gallery¶
EclairMotionEvent¶
-
public class
EclairMotionEvent
extends WrapMotionEvent¶
ImageGalleryFragment¶
-
public class
ImageGalleryFragment
extends Fragment¶ This fragment allows you to embed in your activity an image gallery.
Examples¶
Android¶
All the following examples are located into the folder examples/android.
- StreamInspectorExample This example explains you:
- how to play a stream on a StreamViewerFragment
- how to get and/or update the properties of the stream by using a StreamInspectorFragment
- how to change the Stream Rendering mode. You can choose among the following 3 modalities:
- rstp streamning (the continous stream that the user can play or pause by clicking the player buttons provided by the StreamViewer fragment)
- still-image (you load a snapshot from the renmote camera by clicking on a button)
- timed still-images (the system loads a jpeg image from the remote camera every # seconds, as specified by the user)
- PTZ_ControllerExample This example explains you:
- how to play a stream on a StreamViewerFragment
- how to get and/or update the properties of the stream by using a StreamInspectorFragment
- how to remotely control pan, tilt and zoom values of an Axis PTZ Webcam by using a PTZ_ControllerFragment
- how to make snapshots of the stream and save them into the internal storage
- PTZ_ImageGalleryExample This example contains all the features of the PTZ_ControllerExample example, and in addition, explains you:
- how to open an Image Gallery containing all the stream snaphots, by using a ImageGalleryFragment
- how to select an image from the gallery, zoom in/out and move it by touch screen gestures
- how to delete an image from the gallery (simply by a double tap on it)
- For running the Android examples, open your preferred IDE (e.g Eclipse) and do the following changes:
- Import the Most-Streaming project library
- Edit the file jni/Android.mk and properly change the absolute path of the environment variables GSTREAMER_SDK_ROOT_ANDROID and GSTREAMER_ROOT
- Import the Android project example located from the android/examples folder and add the Most-Streaming and the Most-Visualization projects both as Library and project references
- Create your uri.properties.default property file and put it into the assets folder.(That folder already contains the uri.properties file that you can use as template for your own property file)
- Build the projects (Note that the NDK must be installed and configurated on your system in order to build the project)
- Deploy the application on an android device or emulator
License¶
/*!
* Project MOST - Moving Outcomes to Standard Telemedicine Practice
* http://most.crs4.it/
*
* Copyright 2014-15, CRS4 srl. (http://www.crs4.it/)
* Dual licensed under the MIT or GPL Version 2 licenses.
* See license-GPLv2.txt or license-MIT.txt
*/
Authors¶
Code author: Francesco Cabras <francesco.cabras@crs4.it>
Code author: Stefano Leone Monni <stefano.monni@crs4.it>