Halyri - Mobiili
0.9.1
|
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] |
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.
AudioVideoTransmitManager | ( | Connection | networkConnection | ) |
Instantializes a AudioVideoTransmitManager that uses the provided NetworkConnection. The NetworkConnection has to be connected to a server with a valid session.
networkConnection | NetworkConnection to be used to send pictures and audio |
AudioVideoTransmitManager | ( | Connection | networkConnection | ) |
Instantializes a AudioVideoTransmitManager that uses the provided NetworkConnection. The NetworkConnection has to be connected to a server with a valid session.
networkConnection | NetworkConnection to be used to send pictures and audio |
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.
videoCaptureDevice | AudioVideoCaptureDevice opened for at least video if video is enabled in the configuration |
audioCaptureDevice | XNA Microphone instance for capturing audio |
mediaConfiguration | The media uploading configuration used to set the devices in the UI |
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.
videoCaptureDevice | AudioVideoCaptureDevice opened for at least video if video is enabled in the configuration |
audioCaptureDevice | XNA Microphone instance for capturing audio |
mediaConfiguration | The media uploading configuration used to set the devices in the UI |
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.
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.
sender | Sending object |
e | Eventargs, not currently used |
config | New media uploading configuration |
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.
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.
sender | Sending object |
e | Eventargs, not currently used |
config | New media uploading configuration |
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.
Has no effect if the UDP transfer channel is being used.
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.
Has no effect if the UDP transfer channel is being used.
void StopAllCaptureTransmit | ( | ) |
Disables media capture and transmission from any device.
void StopAllCaptureTransmit | ( | ) |
Disables media capture and transmission from any device.