public SlideImageMgr(PresenterWireFormatType format, int width, int height) { this.format = format; currentSlide = new SlideReference(); this.exportWidth = width; this.exportHeight = height; //Set the default background colors if ((format == PresenterWireFormatType.CPCapability) || (format == PresenterWireFormatType.CPNav)) { currentSlide.SetBGColor(Color.PapayaWhip); } else { currentSlide.SetBGColor(Color.White); } if (format == PresenterWireFormatType.CP3) { cp3Mgr = new CP3Manager.CP3Manager(); } slideImages = new Hashtable(); orgToResource = new Hashtable(); nullSlide = null; }
/// <summary> /// Infer a payload type from a format /// </summary> /// <param name="f"></param> /// <returns></returns> public static PayloadType formatToPayload(PresenterWireFormatType f) { PayloadType p = PayloadType.xApplication2; switch (f) { case PresenterWireFormatType.CPNav: { p = PayloadType.dynamicPresentation; break; } case PresenterWireFormatType.CPCapability: { p = PayloadType.RTDocument; break; } case PresenterWireFormatType.CP3: { p = PayloadType.dynamicPresentation; break; } case PresenterWireFormatType.RTDocument: { p = PayloadType.RTDocument; break; } case PresenterWireFormatType.Video: { p = PayloadType.dynamicVideo; break; } } return(p); }
public StreamGroup(String cname, String name, String payload) { streams = new ArrayList(); this.cname = cname; this.payload = payload; role = PresenterRoleType.Other; wireFormat = PresenterWireFormatType.Other; }
/// <summary> /// Return true if this stream matches the existing format/role in the group. /// </summary> /// <param name="s"></param> /// <param name="wireFormat"></param> /// <param name="role"></param> /// <returns></returns> public bool IsInPresGroup(Stream s, PresenterWireFormatType wireFormat, PresenterRoleType role) { if ((s.Payload == this.payload) && ((this.payload == "dynamicPresentation") || (this.payload == "RTDocument"))) { if ((wireFormat == this.wireFormat) && (role == this.role)) { return(true); } } return(false); }
public StreamGroup(ArchiveTranscoderJobSegmentPresentationDescriptor presDescriptor) { streams = new ArrayList(); this.payload = "dynamicPresentation"; this.cname = presDescriptor.PresentationCname; this.wireFormat = PresenterWireFormatType.Unknown; foreach (PresenterWireFormatType t in Enum.GetValues(typeof(PresenterWireFormatType))) { if (presDescriptor.PresentationFormat == t.ToString()) { this.wireFormat = t; payload = Utility.formatToPayload(t).ToString(); break; } } }
public void AddStream(Stream stream, PresenterWireFormatType wireFormat, PresenterRoleType role) { this.wireFormat = wireFormat; this.role = role; this.AddStream(stream); }
public SlideStreamMgr(ArchiveTranscoderJob job, ArchiveTranscoderJobSegment segment, LogMgr logMgr, double fps, int width, int height) { this.job = job; this.segment = segment; this.logMgr = logMgr; if (width > 0 && height > 0) { this.outputWidth = width; this.outputHeight = height; } this.ticksBetweenFrames = (long)((double)Constants.TicksPerSec / fps); uncompressedMT = getUncompressedMT(this.outputWidth, this.outputHeight, fps); cancel = false; initialized = false; pptInstalled = Utility.CheckPptIsInstalled(); if ((!DateTime.TryParse(segment.StartTime, out start)) || (!DateTime.TryParse(segment.EndTime, out end))) { throw(new System.Exception("Failed to parse start/end time")); } this.nextFrameTime = start.Ticks; format = Utility.StringToPresenterWireFormatType(segment.PresentationDescriptor.PresentationFormat); payload = Utility.formatToPayload(format); cname = segment.PresentationDescriptor.PresentationCname; slideImageMgr = new SlideImageMgr(format, this.outputWidth, this.outputHeight); //Get the start time for the entire conference and use that to get streams. long confStart = DatabaseUtility.GetConferenceStartTime(payload, cname, start.Ticks, end.Ticks); if (confStart <= 0) { logMgr.WriteLine("Warning: No conference exists in the database that matches this presentation: " + cname + " with PresentationFormat " + format.ToString()); logMgr.ErrorLevel = 7; confStart = start.Ticks; } //Get the relevant stream_id's and create DBStreamPlayers for each. streamIDs = DatabaseUtility.GetStreams(payload, segment.PresentationDescriptor.PresentationCname, null, confStart, end.Ticks); DateTime sdt = new DateTime(confStart); Debug.WriteLine("***Conference start: " + sdt.ToString() + " end: " + end.ToString()); if ((streamIDs == null) || (streamIDs.Length == 0)) { Debug.WriteLine("No presentation data found."); logMgr.WriteLine("Warning: No presentation data was found for the given time range for " + cname + " with PresentationFormat " + format.ToString()); logMgr.ErrorLevel = 7; streamPlayers = null; return; } streamPlayers = new DBStreamPlayer[streamIDs.Length]; for (int i = 0; i < streamIDs.Length; i++) { streamPlayers[i] = new DBStreamPlayer(streamIDs[i], confStart, end.Ticks, payload); } lookBehindDuration = 0; if (streamPlayers[0].Start < start) { lookBehindDuration = ((TimeSpan)(start - streamPlayers[0].Start)).TotalSeconds; } }