public static string LongName(this VideoEncoding value) { FieldInfo field = value.GetType().GetField(value.ToString()); LongNameAttribute attribute = Attribute.GetCustomAttribute(field, typeof(LongNameAttribute)) as LongNameAttribute; return(attribute == null?value.ToString() : attribute.LongName); }
public static string Command(this VideoEncoding value) { FieldInfo field = value.GetType().GetField(value.ToString()); CommandAttribute attribute = Attribute.GetCustomAttribute(field, typeof(CommandAttribute)) as CommandAttribute; return(attribute == null?value.ToString() : attribute.Command); }
private string ProcessVideoLog(string log, VideoFrame frame, VideoEncoding encoding, ConnectionInfo remoteConnectionInfo) { var rawBuffer = GetRawVideoBuffer(frame); var compressedBuffer = GetCompressedVideoBuffer(frame); return(log .Replace("{footprint}", compressedBuffer.Footprint.ToString()) .Replace("{width}", rawBuffer.Width.ToString()) .Replace("{height}", rawBuffer.Height.ToString()) .Replace("{mediaStreamId}", frame.Mid) .Replace("{rtpStreamId}", frame.RtpStreamId) .Replace("{sequenceNumber}", frame.SequenceNumber.ToString()) .Replace("{synchronizationSource}", frame.SynchronizationSource.ToString()) .Replace("{systemTimestamp}", frame.SystemTimestamp.ToString()) .Replace("{timestamp}", frame.Timestamp.ToString()) .Replace("{encoding}", encoding.ToString()) .Replace("{applicationId}", Options.ApplicationId) .Replace("{channelId}", Options.ChannelId) .Replace("{userId}", remoteConnectionInfo.UserId) .Replace("{userAlias}", remoteConnectionInfo.UserAlias) .Replace("{deviceId}", remoteConnectionInfo.DeviceId) .Replace("{deviceAlias}", remoteConnectionInfo.DeviceAlias) .Replace("{clientId}", remoteConnectionInfo.ClientId) .Replace("{clientTag}", remoteConnectionInfo.ClientTag) .Replace("{connectionId}", remoteConnectionInfo.Id) .Replace("{connectionTag}", remoteConnectionInfo.Tag) .Replace("{mediaId}", remoteConnectionInfo.MediaId)); }
/// <summary> /// Returns the file extension for specified audio type. /// </summary> /// <param name="audio">The audio type to get file extension for.</param> /// <returns>The file extension.</returns> public string GetVideoExtension(VideoEncoding video) { return("." + video.ToString().ToLower()); }