TRVCamSender.SendMediaAccessRequest, SendMediaAccessCancelRequest

Top  Previous  Next

The methods simplify management of default receivers.

procedure SendMediaAccessRequest(const GUID: TRVMAnsiString; ADataType: Word = RVMEDIA_DATA);
procedure SendMediaAccessCancelRequest(const GUID: TRVMAnsiString; ADataType: Word = RVMEDIA_DATA);

These methods are useful when TRVCamSender is connected to TRVMediaServer as a part of a client.

SendMediaAccessRequest sends a request to the client identified by GUID; in response, that client can start sending data (usually video and audio) to the requester.

SendMediaAccessCancelRequest sends a request to the client identified by GUID; in response, that client should stop sending data to the requester.

Technically, these methods send special commands, like SendCmd.

Parameters:

GUID – identifier of other client, from where media is requested. If GUID is empty, GUIDTo is used. If it is empty as well, this request is sent to the group GUIDGroup.

ADataType – reserved for future use (planned: it will list data types, for which the request is made, can contain ***_DATA constants (combined using "or" operator). If this parameter is not specified, audio and video are assumed).

Example:

There are two clients, ClientA and ClientB, connected to a media server. ClientA consists of RVCamSenderA and RVCamReceiverA, ClientB consists of RVCamSenderB and RVCamReceiverB. ClientA's identifier is GUID_A, ClientB's identifier us GUID_B.

ClientA wants to receive video and audio from ClientB via the network. It calls RVCamSenderA.SendMediaAccessRequest(GUID_B). In response, TRVCamReceiverB.OnMediaAccessRequest event occurs. In this event, ClientB (if it agrees to send video and audio to ClientA) calls TRVCamSenderB.AllowMediaAccess(GUID_A).

Next, ClientA do not want to receive video and audio from ClientB any more. It calls RVCamSenderA.SendMediaAccessCancelRequest(GUID_B). In response, TRVCamReceiverB.OnMediaAccessCancelRequest event occurs. In this event, ClientB should call TRVCamSenderB.CancelMediaAccess(GUID_A).