/** When the socket reader receives a property update from runtime, it decodes object ID * property ID and the new value of the property. It then calls this method of * the target object, to update the new value in property cache. After updating the cache, * this method then fires appropriate event in skype.events to notify the UI of what has happened. * DispatchPropertyUpdate is executed in the socket reader thread. */ internal override void DispatchPropertyUpdate(uint propId, object value, bool hasValue) { switch (propId) { case 130: /* Video.P_STATUS */ cache[0] = hasValue; // if no value - invalidate cache if (hasValue) { cache_status = (SktVideo.STATUS)value; if (skypeRef.logging) skypeRef.Log("Video.P_STATUS = " + cache_status.ToString()); } else if (skypeRef.logging) skypeRef.Log("Video.P_STATUS - update without value"); skypeRef.events.FireOnVideoStatus(this, cache_status); break; case 131: /* Video.P_ERROR */ cache[1] = hasValue; // if no value - invalidate cache if (hasValue) { cache_error = (String)value; if (skypeRef.logging) skypeRef.Log("Video.P_ERROR = " + cache_error.ToString()); } else if (skypeRef.logging) skypeRef.Log("Video.P_ERROR - update without value"); skypeRef.events.FireOnVideoError(this, cache_error); break; case 132: /* Video.P_DEBUGINFO */ cache[2] = hasValue; // if no value - invalidate cache if (hasValue) { cache_debuginfo = (String)value; if (skypeRef.logging) skypeRef.Log("Video.P_DEBUGINFO = " + cache_debuginfo.ToString()); } else if (skypeRef.logging) skypeRef.Log("Video.P_DEBUGINFO - update without value"); skypeRef.events.FireOnVideoDebuginfo(this, cache_debuginfo); break; case 133: /* Video.P_DIMENSIONS */ cache[3] = hasValue; // if no value - invalidate cache if (hasValue) { cache_dimensions = (String)value; if (skypeRef.logging) skypeRef.Log("Video.P_DIMENSIONS = " + cache_dimensions.ToString()); } else if (skypeRef.logging) skypeRef.Log("Video.P_DIMENSIONS - update without value"); skypeRef.events.FireOnVideoDimensions(this, cache_dimensions); break; case 134: /* Video.P_MEDIA_TYPE */ cache[4] = hasValue; // if no value - invalidate cache if (hasValue) { cache_media_type = (SktVideo.MEDIATYPE)value; if (skypeRef.logging) skypeRef.Log("Video.P_MEDIA_TYPE = " + cache_media_type.ToString()); } else if (skypeRef.logging) skypeRef.Log("Video.P_MEDIA_TYPE - update without value"); skypeRef.events.FireOnVideoMediaType(this, cache_media_type); break; case 1104: /* Video.P_CONVO_ID */ cache[5] = hasValue; // if no value - invalidate cache if (hasValue) { cache_convo_id = null; if (skypeRef.logging) skypeRef.Log("A bugged convo_id update. ignoring it."); } else if (skypeRef.logging) skypeRef.Log("Video.P_CONVO_ID - update without value"); skypeRef.events.FireOnVideoConvoId(this, cache_convo_id); break; case 1105: /* Video.P_DEVICE_PATH */ cache[6] = hasValue; // if no value - invalidate cache if (hasValue) { cache_device_path = (String)value; if (skypeRef.logging) skypeRef.Log("Video.P_DEVICE_PATH = " + cache_device_path.ToString()); } else if (skypeRef.logging) skypeRef.Log("Video.P_DEVICE_PATH - update without value"); skypeRef.events.FireOnVideoDevicePath(this, cache_device_path); break; default: skypeRef.Error(String.Format("Invalid Video class property ID ({0})received from socket.", propId)); break; } }
internal void FetchMediaTypeFromRuntime() { if (skypeRef.logging) skypeRef.Log("Fetching P_MEDIA_TYPE from runtime"); skypeRef.transport.SubmitPropertyRequest(11, 134, this.OID); if (skypeRef.transport.PropResponseWasOk(134)) { cache_media_type = (SktVideo.MEDIATYPE)skypeRef.decoder.DecodeUint(); cache[4] = true; } skypeRef.transport.ResumeSocketReaderFromPropRequest(); }
public OnVideoMediaTypeArgs(SktVideo sender, SktVideo.MEDIATYPE newValue) { this.sender = sender; value = newValue; }