Halyri  0.9
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events
Halyri.AudioVideoTransmitManager Class Reference

Class for managing audio and picture transmission from XNA Microphone and AudioVideoCaptureDevice. Media is captured using PreviewImageCapturer and WavAudioSampleCapturer classes. Capture configuration is taken from MediaConfigurationDto published by the server and available on NetworkConnection's MediaConfigurationUpdatedEvent. Network operations are performed by NetworkConnection class. More...

Public Member Functions

delegate void CaptureConfigurationUpdated (object sender, EventArgs e, MediaConfigurationDto config)
 
 AudioVideoTransmitManager (Connection networkConnection)
 Instantializes a AudioVideoTransmitManager that uses the provided NetworkConnection. The NetworkConnection has to be connected to a server with a valid session. More...
 
void MediaConfigurationUpdateHandler (object sender, EventArgs e, MediaConfigurationDto config)
 Handles media uploading configurations received by NetworkConnection from server. This method only disbles audio and picture transmission if they are currently active and the new configuration suggests that they should be disabled. It also handles configuration changes to active audio and picture capturer classes. More...
 
void StopAllCaptureTransmit ()
 Disables media capture and transmission from any device. More...
 
void ResetThrottlingState ()
 Resets the ECF transfer channel throttling state of this instance. If packet transmissiong has been stalled due to throttling, packet transmission will resume. More...
 
void ExternalSourceDeviceConfigurationChanged (AudioVideoCaptureDevice videoCaptureDevice, Microphone audioCaptureDevice, MediaConfigurationDto mediaConfiguration)
 Handles changes to external media source devices. This method should be called with a valid source device(s) when the media uploading configuration has transitioned from disabled to enabled state for either of the media types. More...
 
delegate void CaptureConfigurationUpdated (object sender, EventArgs e, MediaConfigurationDto config)
 
 AudioVideoTransmitManager (Connection networkConnection)
 Instantializes a AudioVideoTransmitManager that uses the provided NetworkConnection. The NetworkConnection has to be connected to a server with a valid session. More...
 
void MediaConfigurationUpdateHandler (object sender, EventArgs e, MediaConfigurationDto config)
 Handles media uploading configurations received by NetworkConnection from server. This method only disbles audio and picture transmission if they are currently active and the new configuration suggests that they should be disabled. It also handles configuration changes to active audio and picture capturer classes. More...
 
void StopAllCaptureTransmit ()
 Disables media capture and transmission from any device. More...
 
void ResetThrottlingState ()
 Resets the ECF transfer channel throttling state of this instance. If packet transmissiong has been stalled due to throttling, packet transmission will resume. More...
 
void ExternalSourceDeviceConfigurationChanged (AudioVideoCaptureDevice videoCaptureDevice, Microphone audioCaptureDevice, MediaConfigurationDto mediaConfiguration)
 Handles changes to external media source devices. This method should be called with a valid source device(s) when the media uploading configuration has transitioned from disabled to enabled state for either of the media types. More...
 

Public Attributes

CaptureConfigurationUpdated CaptureConfigurationUpdatedEvent
 
PacketThrottlingStarted PacketThrottlingStartedEvent
 
PacketSendStalled PacketSendStalledEvent
 

Properties

bool PacketThrottlingEnabled [get]
 
bool AudioEnabled [get]
 
bool PictureEnabled [get]
 
bool UseUdp [get, set]
 

Detailed Description

Class for managing audio and picture transmission from XNA Microphone and AudioVideoCaptureDevice. Media is captured using PreviewImageCapturer and WavAudioSampleCapturer classes. Capture configuration is taken from MediaConfigurationDto published by the server and available on NetworkConnection's MediaConfigurationUpdatedEvent. Network operations are performed by NetworkConnection class.

<author>Veli-Mikko Puupponen</author> Implements a simple packet level throttling when using WCF connection by measuring packet transmission time and comparing it to a set threshold. For every packet whose time exceeds the threshold, a counter is incremented. Once the counter meets overdue packet threshold level, set ratio of picture data packets are dropped. If the overdue counter keeps increasing, picture packets are dropped completely. If the counter still increases, all packets are dropped and the PacketSendStalledEvent is fired.

If UseUdp = true, uses UDP transfer protocol and no packet throttling is performed by this class.

After this AudioVideoTransmitManager instance has been stalled, it has to be manually reset by a call to the ResetThrottlingState method.

Constructor & Destructor Documentation

Halyri.AudioVideoTransmitManager.AudioVideoTransmitManager ( Connection  networkConnection)

Instantializes a AudioVideoTransmitManager that uses the provided NetworkConnection. The NetworkConnection has to be connected to a server with a valid session.

Parameters
networkConnectionNetworkConnection to be used to send pictures and audio
Halyri.AudioVideoTransmitManager.AudioVideoTransmitManager ( Connection  networkConnection)

Instantializes a AudioVideoTransmitManager that uses the provided NetworkConnection. The NetworkConnection has to be connected to a server with a valid session.

Parameters
networkConnectionNetworkConnection to be used to send pictures and audio

Member Function Documentation

delegate void Halyri.AudioVideoTransmitManager.CaptureConfigurationUpdated ( object  sender,
EventArgs  e,
MediaConfigurationDto  config 
)
delegate void Halyri.AudioVideoTransmitManager.CaptureConfigurationUpdated ( object  sender,
EventArgs  e,
MediaConfigurationDto  config 
)
void Halyri.AudioVideoTransmitManager.ExternalSourceDeviceConfigurationChanged ( AudioVideoCaptureDevice  videoCaptureDevice,
Microphone  audioCaptureDevice,
MediaConfigurationDto  mediaConfiguration 
)

Handles changes to external media source devices. This method should be called with a valid source device(s) when the media uploading configuration has transitioned from disabled to enabled state for either of the media types.

Parameters
videoCaptureDeviceAudioVideoCaptureDevice opened for at least video if video is enabled in the configuration
audioCaptureDeviceXNA Microphone instance for capturing audio
mediaConfigurationThe media uploading configuration used to set the devices in the UI
void Halyri.AudioVideoTransmitManager.ExternalSourceDeviceConfigurationChanged ( AudioVideoCaptureDevice  videoCaptureDevice,
Microphone  audioCaptureDevice,
MediaConfigurationDto  mediaConfiguration 
)

Handles changes to external media source devices. This method should be called with a valid source device(s) when the media uploading configuration has transitioned from disabled to enabled state for either of the media types.

Parameters
videoCaptureDeviceAudioVideoCaptureDevice opened for at least video if video is enabled in the configuration
audioCaptureDeviceXNA Microphone instance for capturing audio
mediaConfigurationThe media uploading configuration used to set the devices in the UI
void Halyri.AudioVideoTransmitManager.MediaConfigurationUpdateHandler ( object  sender,
EventArgs  e,
MediaConfigurationDto  config 
)

Handles media uploading configurations received by NetworkConnection from server. This method only disbles audio and picture transmission if they are currently active and the new configuration suggests that they should be disabled. It also handles configuration changes to active audio and picture capturer classes.

If picture or audio is changed from enabled to disabled or vice versa, the configuration event is propagated through CaptureConfigurationUpdatedEvent to to the UI managing the capture devices.

Parameters
senderSending object
eEventargs, not currently used
configNew media uploading configuration
void Halyri.AudioVideoTransmitManager.MediaConfigurationUpdateHandler ( object  sender,
EventArgs  e,
MediaConfigurationDto  config 
)

Handles media uploading configurations received by NetworkConnection from server. This method only disbles audio and picture transmission if they are currently active and the new configuration suggests that they should be disabled. It also handles configuration changes to active audio and picture capturer classes.

If picture or audio is changed from enabled to disabled or vice versa, the configuration event is propagated through CaptureConfigurationUpdatedEvent to to the UI managing the capture devices.

Parameters
senderSending object
eEventargs, not currently used
configNew media uploading configuration
void Halyri.AudioVideoTransmitManager.ResetThrottlingState ( )

Resets the ECF transfer channel throttling state of this instance. If packet transmissiong has been stalled due to throttling, packet transmission will resume.

Has no effect if the UDP transfer channel is being used.

void Halyri.AudioVideoTransmitManager.ResetThrottlingState ( )

Resets the ECF transfer channel throttling state of this instance. If packet transmissiong has been stalled due to throttling, packet transmission will resume.

Has no effect if the UDP transfer channel is being used.

void Halyri.AudioVideoTransmitManager.StopAllCaptureTransmit ( )

Disables media capture and transmission from any device.

void Halyri.AudioVideoTransmitManager.StopAllCaptureTransmit ( )

Disables media capture and transmission from any device.

Member Data Documentation

CaptureConfigurationUpdated Halyri.AudioVideoTransmitManager.CaptureConfigurationUpdatedEvent
PacketSendStalled Halyri.AudioVideoTransmitManager.PacketSendStalledEvent
PacketThrottlingStarted Halyri.AudioVideoTransmitManager.PacketThrottlingStartedEvent

Property Documentation

bool Halyri.AudioVideoTransmitManager.AudioEnabled
get
bool Halyri.AudioVideoTransmitManager.PacketThrottlingEnabled
get
bool Halyri.AudioVideoTransmitManager.PictureEnabled
get
bool Halyri.AudioVideoTransmitManager.UseUdp
getset

The documentation for this class was generated from the following file: