public void x264loglineitemidentifierservice_can_identify_encodedframes_lineitem_test() { //given a encoded frames line item string lineItem = "encoded 74525 frames, 2.48 fps, 5235.46 kb/s"; //when i attempt to identify it IX264LogLineItemIdentifierService service = new X264LogLineItemIdentifierService(); EnumX264LogLineItemType lineItemType = service.GetLineItemType(lineItem); //then line item type is encode frames lineItemType.Should().Be(EnumX264LogLineItemType.EncodedFrames); }
public void x264loglineitemidentifierservice_can_identify_consecutivebframes_lineitem_test() { //given a consecutive b frames line item string lineItem = "x264 [info]: consecutive B-frames: 1.1% 1.7% 5.0% 8.2% 17.7% 47.3% 11.8% 3.3% 3.8%"; //when i attempt to identify it IX264LogLineItemIdentifierService service = new X264LogLineItemIdentifierService(); EnumX264LogLineItemType lineItemType = service.GetLineItemType(lineItem); //then line item type is consecutive b frames lineItemType.Should().Be(EnumX264LogLineItemType.ConsecutiveBFrames); }
public void x264loglineitemidentifierservice_can_identify_bframe_lineitem_test() { //given a bframe line item string lineItem = "x264 [info]: frame B:59868 Avg QP:16.37 size: 19269"; //when i attempt to identify it IX264LogLineItemIdentifierService service = new X264LogLineItemIdentifierService(); EnumX264LogLineItemType lineItemType = service.GetLineItemType(lineItem); //then line item type is bframe lineItemType.Should().Be(EnumX264LogLineItemType.BFrame); }
public void x264loglineitemidentifierservice_can_identify_pframe_lineitem_test() { //given a pframe line item string lineItem = "x264 [info]: frame P:14240 Avg QP:14.42 size: 52055"; //when i attempt to identify it IX264LogLineItemIdentifierService service = new X264LogLineItemIdentifierService(); EnumX264LogLineItemType lineItemType = service.GetLineItemType(lineItem); //then line item type is pframe lineItemType.Should().Be(EnumX264LogLineItemType.PFrame); }
public void x264loglineitemidentifierservice_can_identify_iframe_lineitem_test() { //given a iframe line item string lineItem = "x264 [info]: frame I:417 Avg QP:12.56 size:134237"; //when i attempt to identify it IX264LogLineItemIdentifierService service = new X264LogLineItemIdentifierService(); EnumX264LogLineItemType lineItemType = service.GetLineItemType(lineItem); //then line item type is iframe lineItemType.Should().Be(EnumX264LogLineItemType.IFrame); }
public string GetLogs() { StringBuilder sb = new StringBuilder(); try { sb.AppendLine("[pre]"); sb.AppendLine("[quote]"); sb.AppendLine("[b]x264 Logs[/b]"); sb.AppendLine(); if (_x264LogFileSerttings.BBCodeHiddenAroundLogs) { sb.AppendLine("[hide]"); } foreach (X264LogFile logFile in _logFiles.OrderBy(l => l.FileNameOnly)) { if (_x264LogFileSerttings.BBCodeBoldLogFileName) { sb.AppendLine(string.Format("[b]{0}[/b]", logFile.FileNameOnly)); } else { sb.AppendLine(string.Format("{0}", logFile.FileNameOnly)); } sb.AppendLine(); using (StreamReader sw = new StreamReader(logFile.FilePath)) { while (true) { string line = sw.ReadLine(); if (line != null) { EnumX264LogLineItemType lineItemType = _x264LogLineItemIdentifierService.GetLineItemType(line); if (lineItemType != EnumX264LogLineItemType.None) { sb.AppendLine(line); } } else { break; } } sb.AppendLine(); } } if (_x264LogFileSerttings.BBCodeHiddenAroundLogs) { sb.AppendLine("[/hide]"); } sb.AppendLine("[/quote]"); sb.AppendLine("[/pre]"); } catch (Exception ex) { _log.ErrorFormat(Program.GetLogErrorFormat(), ex.Message, ex.StackTrace, MethodBase.GetCurrentMethod().Name); _errors.Add(new Error() { Description = string.Format("Error: {0}", ex.Message) }); } _logs = sb.ToString(); return(sb.ToString()); }