Classes | Public Member Functions | Static Public Attributes

JAUS::VideoSubscriber Class Reference

This service is used to subscribe to video data from components with the Visual Sensor service. More...

#include <videosubscriber.h>

Inheritance diagram for JAUS::VideoSubscriber:
JAUS::Management::Child JAUS::AccessControl::Child JAUS::Events::Child JAUS::Service

List of all members.

Classes

class  Callback
 Callback class used to receive image/video data as it arrives. More...

Public Member Functions

 VideoSubscriber ()
 Constructor.
 ~VideoSubscriber ()
 Destructor.
virtual void Shutdown ()
 Method called on Shutdown.
bool CreateVideoSubscription (const Address &id, const Byte cameraID=0, const unsigned int waitTimeMs=Service::DefaultWaitMs)
 Create a subscription to video data.
bool GetCameraCount (const Address &id, unsigned int &count, const unsigned int waitTimeMs=Service::DefaultWaitMs *3) const
 Query a component with a Visual Sensor service for number of cameras.
bool GetCameraList (const Address &id, std::vector< Byte > &list, const unsigned int waitTimeMs=Service::DefaultWaitMs *3) const
 Query a component with a Visual Sensor service for number of cameras.
bool HaveVideoSubscription (const Address &id, const int cameraID=-1) const
 Method to check if a video subscription is present.
bool CancelVideoSubscription (const Address &id=Address(), const int cameraID=-1)
 Method to check cancel a video subscription.
void RegisterCallback (Callback *callback, const bool rawImage, const bool add=true)
 Method to register a callback to receive Video data as it arrives.
virtual bool GenerateEvent (const Events::Subscription &info) const
virtual bool IsEventSupported (const Events::Type type, const double requestedPeriodicRate, const Message *queryMessage, double &confirmedPeriodicRate, std::string &errorMessage) const
virtual bool IsDiscoverable () const
virtual void Receive (const Message *message)
 Processes message received by the Service. If not supported, then message is passed to inheriting services.
virtual MessageCreateMessage (const UShort messageCode) const
 Attempts to create the message desired. Only message supported by this Service can be created by this Service.
virtual bool Resume ()
virtual bool Reset ()
virtual bool Standby ()
virtual bool SetEmergency ()
virtual bool ClearEmergency ()
virtual bool ReleaseControl ()
 Method called whenever control of the parent component has been released.

Static Public Attributes

static const std::string Name = "urn:jaus:jss:jpp:extras:VideoSubscriber"
 String name of the Service.

Detailed Description

This service is used to subscribe to video data from components with the Visual Sensor service.

Definition at line 61 of file videosubscriber.h.


Constructor & Destructor Documentation

VideoSubscriber::VideoSubscriber (  )

Constructor.

Definition at line 55 of file videosubscriber.cpp.

VideoSubscriber::~VideoSubscriber (  )

Destructor.

Definition at line 67 of file videosubscriber.cpp.


Member Function Documentation

bool VideoSubscriber::CancelVideoSubscription ( const Address id = Address(),
const int  cameraID = -1 
)

Method to check cancel a video subscription.

Parameters:
[in]idID of the source of the subscription.
[in]cameraIDID of the camera, set to -1 for any camera.
Returns:
True if a video subscription exists, otherwise false.

Definition at line 267 of file videosubscriber.cpp.

virtual bool JAUS::VideoSubscriber::ClearEmergency (  ) [inline, virtual]

Reimplemented from JAUS::Management::Child.

Definition at line 133 of file videosubscriber.h.

Message * VideoSubscriber::CreateMessage ( const UShort  messageCode ) const [virtual]

Attempts to create the message desired. Only message supported by this Service can be created by this Service.

This Service supports the following message: Query Image, Report Image

Parameters:
[in]messageCodeMessage to create.
Returns:
Pointer to newly allocated Message data, NULL if message is not supported by the Service.

Implements JAUS::Service.

Definition at line 453 of file videosubscriber.cpp.

bool VideoSubscriber::CreateVideoSubscription ( const Address id,
const Byte  cameraID = 0,
const unsigned int  waitTimeMs = Service::DefaultWaitMs 
)

Create a subscription to video data.

Parameters:
[in]idThe component ID to get video data from.
[in]cameraIDThe camera/source on the component.
[in]waitTimeMsHow long to wait in ms before timeout on request.
Returns:
True on success, false on failure.

Definition at line 114 of file videosubscriber.cpp.

virtual bool JAUS::VideoSubscriber::GenerateEvent ( const Events::Subscription info ) const [inline, virtual]

Implements JAUS::Events::Child.

Definition at line 111 of file videosubscriber.h.

bool VideoSubscriber::GetCameraCount ( const Address id,
unsigned int &  count,
const unsigned int  waitTimeMs = Service::DefaultWaitMs*3 
) const

Query a component with a Visual Sensor service for number of cameras.

Parameters:
[in]idThe component ID to get video data from.
[out]countNumber of cameras on component.
[in]waitTimeMsHow long to wait in ms before timeout on request.
Returns:
True on success, false on failure.

Definition at line 159 of file videosubscriber.cpp.

bool VideoSubscriber::GetCameraList ( const Address id,
std::vector< Byte > &  list,
const unsigned int  waitTimeMs = Service::DefaultWaitMs*3 
) const

Query a component with a Visual Sensor service for number of cameras.

Parameters:
[in]idThe component ID to get video data from.
[out]listList of component IDs of cameras.
[in]waitTimeMsHow long to wait in ms before timeout on request.
Returns:
True on success, false on failure.

Definition at line 188 of file videosubscriber.cpp.

bool VideoSubscriber::HaveVideoSubscription ( const Address id,
const int  cameraID = -1 
) const

Method to check if a video subscription is present.

Parameters:
[in]idID of the source of the subscription.
[in]cameraIDID of the camera, set to -1 for any camera.
Returns:
True if a video subscription exists, otherwise false.

Definition at line 215 of file videosubscriber.cpp.

virtual bool JAUS::VideoSubscriber::IsDiscoverable (  ) const [inline, virtual]

Implements JAUS::Service.

Definition at line 119 of file videosubscriber.h.

virtual bool JAUS::VideoSubscriber::IsEventSupported ( const Events::Type  type,
const double  requestedPeriodicRate,
const Message queryMessage,
double &  confirmedPeriodicRate,
std::string &  errorMessage 
) const [inline, virtual]

Implements JAUS::Events::Child.

Definition at line 113 of file videosubscriber.h.

void VideoSubscriber::Receive ( const Message message ) [virtual]

Processes message received by the Service. If not supported, then message is passed to inheriting services.

This Service supports the following message: Report Image

Parameters:
[in]messageMessage data to process.

Reimplemented from JAUS::Service.

Definition at line 387 of file videosubscriber.cpp.

void VideoSubscriber::RegisterCallback ( Callback callback,
const bool  rawImage,
const bool  add = true 
)

Method to register a callback to receive Video data as it arrives.

Parameters:
[in]callbackPointer to callback to add/remove.
[in]rawImageIf true, register for decompressed RGB images. If false callback is to receive the compressed video source data.
[in]addIf true, callback is added, if false, it is removed.

Definition at line 339 of file videosubscriber.cpp.

virtual bool JAUS::VideoSubscriber::ReleaseControl (  ) [inline, virtual]

Method called whenever control of the parent component has been released.

Reimplemented from JAUS::Management::Child.

Definition at line 135 of file videosubscriber.h.

virtual bool JAUS::VideoSubscriber::Reset (  ) [inline, virtual]

Implements JAUS::Management::Child.

Definition at line 127 of file videosubscriber.h.

virtual bool JAUS::VideoSubscriber::Resume (  ) [inline, virtual]

Implements JAUS::Management::Child.

Definition at line 125 of file videosubscriber.h.

virtual bool JAUS::VideoSubscriber::SetEmergency (  ) [inline, virtual]

Reimplemented from JAUS::Management::Child.

Definition at line 131 of file videosubscriber.h.

void VideoSubscriber::Shutdown (  ) [virtual]

Method called on Shutdown.

Reimplemented from JAUS::Service.

Definition at line 87 of file videosubscriber.cpp.

virtual bool JAUS::VideoSubscriber::Standby (  ) [inline, virtual]

Implements JAUS::Management::Child.

Definition at line 129 of file videosubscriber.h.


Member Data Documentation

const std::string VideoSubscriber::Name = "urn:jaus:jss:jpp:extras:VideoSubscriber" [static]

String name of the Service.

Definition at line 87 of file videosubscriber.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines