RDK Documentation (Open Sourced RDK Components)

Description

Described the details about Tuner Reservation Specifications.

Data Structures

class  TRM::ResponseStatus
 This class is responsible for handling response message for tuner reservation. All response messages from TRM will provide information regarding the status of the response. Responses to recognized requests may contain additional information, as described in later sections of this document. Responses to unrecognized requests will contain only this status data, consisting of a status code and message signifying the request was unrecognized. The Tuner response status could be the following types. More...
 
class  TRM::TunerReservationBase
 The TunerReservation class is used to set the requested or granted tuner reservation from client. The reservation has a validity window that is indicated by startTime and duration. The requesting device is required to renew a reservation before its validity window disappears. If it is not renewed, the token will be released by TRM and all messages that follow bearing the token will be considered as MalformedRequest. For Record reservations, the requested startTime should be N seconds ahead of the actual recording start time (or should be left out so that the granted reservation starts at the time when it is granted by TRM), to give room in case a conflict needs to be resolved.

A same reservationToken can be reused if and only if values of {device, activity} are the same. In the case, the {serviceLocator, startTime, duration} of the reused token can be updated. This is useful during a channel change, where the TRM client can reuse a same Live tuner reservation by just updating the serviceLocator of it. More...
 

Data Structure Documentation

◆ TRM::ResponseStatus

class TRM::ResponseStatus

This class is responsible for handling response message for tuner reservation. All response messages from TRM will provide information regarding the status of the response. Responses to recognized requests may contain additional information, as described in later sections of this document. Responses to unrecognized requests will contain only this status data, consisting of a status code and message signifying the request was unrecognized. The Tuner response status could be the following types.

  • Ok : Request was successful
  • GeneralError : Request was unsuccessful
  • MalFormedRequest : Unexpected/Invalid request data
  • UnRecognizedRequest : Unrecognized request
  • InsufficientResource : there is no tuner available
  • UserCancellation: Token is released as result of user cancellation.
  • InvalidToken: Token included in the message is invalid.
  • InvalidState: Token is in invalid state.
  • statusMessage: is a string containing additional information about the status.

Definition at line 62 of file ResponseStatus.h.

Collaboration diagram for TRM::ResponseStatus:
Collaboration graph

Public Types

typedef int EnumType
 

Public Member Functions

 ResponseStatus (const Enum< ResponseStatus > &statusCode, const std::string &details="")
 
 ResponseStatus (const char *name, const std::string &details="")
 
const Enum< ResponseStatus > & getStatusCode (void) const
 
bool operator== (const ResponseStatus &that) const
 
ResponseStatusoperator+= (const char *message)
 
ResponseStatusoperator= (const Enum< ResponseStatus > &status)
 
const std::string & getDetails (void) const
 
std::string & getDetails (void)
 
void print (void) const
 

Static Public Member Functions

static const char * klassName (void)
 
static const std::vector< const Enum< ResponseStatus > * > & getEnums (void)
 

Static Public Attributes

static const Enum< ResponseStatuskOk
 
static const Enum< ResponseStatuskGeneralError
 
static const Enum< ResponseStatuskMalFormedRequest
 
static const Enum< ResponseStatuskUnRecognizedRequest
 
static const Enum< ResponseStatuskInvalidToken
 
static const Enum< ResponseStatuskInvalidState
 
static const Enum< ResponseStatuskUserCancellation
 
static const Enum< ResponseStatuskInsufficientResource
 

Private Attributes

Enum< ResponseStatusstatusCode
 
std::string details
 

◆ TRM::TunerReservationBase

class TRM::TunerReservationBase

The TunerReservation class is used to set the requested or granted tuner reservation from client. The reservation has a validity window that is indicated by startTime and duration. The requesting device is required to renew a reservation before its validity window disappears. If it is not renewed, the token will be released by TRM and all messages that follow bearing the token will be considered as MalformedRequest. For Record reservations, the requested startTime should be N seconds ahead of the actual recording start time (or should be left out so that the granted reservation starts at the time when it is granted by TRM), to give room in case a conflict needs to be resolved.

A same reservationToken can be reused if and only if values of {device, activity} are the same. In the case, the {serviceLocator, startTime, duration} of the reused token can be updated. This is useful during a channel change, where the TRM client can reuse a same Live tuner reservation by just updating the serviceLocator of it.

Definition at line 139 of file TunerReservation.h.

Collaboration diagram for TRM::TunerReservationBase:
Collaboration graph

Public Types

enum  
 
typedef std::list< std::string > TokenList
 

Public Member Functions

const std::string & getReservationToken (void) const
 This function is used to return the unique token generated when a reservation is created. More...
 
const std::string & getDevice (void) const
 This function is used to get the remote device id requesting for tuner reservation. More...
 
const std::string & getServiceLocator (void) const
 This function is used to return the locator of the service that the tuner is tuned to. More...
 
uint64_t getStartTime (void) const
 This function is used to get the start time of the reservation in milliseconds from the epoch. More...
 
uint64_t getDuration (void) const
 This function is used to get the reservation period measured from the start in milliseconds. More...
 
const ActivitygetActivity (void) const
 This function is used to return the granted activity. Granted activity may or may not be the same as the requested. In the later case the owner of the reservation will need to comply with the returned activity, or initiate conflict resolution.
For example, a client requests for Live activity when EAS is in progress, the returned reservation will have the EAS activity. More...
 
void setReservationToken (const std::string &token)
 This function is used to set a unique token generated when a reservation is created. After a reservation is created, this token is used in all messages to uniquely identify an existing reservation within TRM. More...
 
void setServiceLocator (const std::string &_serviceLocator)
 This function is used to set the locator of the service that the tuner will tune to. The service locator is a URL containing tune parameters of the remote device. More...
 
void setStartTime (const uint64_t &_startTime)
 This function is used to set the start time of the reservation in milliseconds from the epoch. If the startTime not present a requested message, this is set to when the reservation is granted or renewed. More...
 
void setDuration (const uint64_t &_duratioin)
 This function is used to set the reservation duration measured from the start in milliseconds. If the duration field not present in a request message, the token is valid for a default duration. More...
 
uint64_t getExpirationTime (void) const
 This function is used to return remaining tuner reservation time. More...
 
void setActivity (const Activity &activity)
 
void addDetail (const std::string &key, const std::string &value)
 This function is used to add the details describing the tuner reservation activity in to the activity list. More...
 
const ReservationCustomAttributesgetCustomAttributes (void) const
 This function is used to return the custom attributes assigned by the application. These attributes are associated with the reservation token for the lifetime of the reservation. More...
 
void setCustomAttributes (ReservationCustomAttributes *)
 This function is used to set the attributes assigned by the application. These attributes are associated with the reservation token for the lifetime of the reservation. More...
 
virtual void print (void) const
 This function is used to print the following attributes of tunerReservation token. More...
 
 TunerReservationBase (const std::string &device, const std::string &serviceLocator, const uint64_t startTime, const uint64_t duration, const Activity &activity, const std::string &reservationToken="", ReservationCustomAttributes *customAttributes=0)
 

Static Public Member Functions

static const char * klassName (void)
 

Data Fields

int state
 

Private Attributes

std::string reservationToken
 
std::string device
 
std::string serviceLocator
 
uint64_t startTime
 
uint64_t duration
 
Activity activity
 
ReservationCustomAttributescustomAttributes