private string getPRXProfileForQuality(WTVProfileQuality _quality) { string resourcePath = "FatAttitude.WTVTranscoder.prx."; switch (_quality) { case WTVProfileQuality.Low: resourcePath += "ultralow"; break; case WTVProfileQuality.Normal: resourcePath += "low"; break; case WTVProfileQuality.Med: resourcePath += "normal"; break; case WTVProfileQuality.High: resourcePath += "high"; break; case WTVProfileQuality.UltraHigh: resourcePath += "ultrahigh"; break; case WTVProfileQuality.Test: resourcePath += "test"; break; case WTVProfileQuality.Custom: resourcePath += "custom"; break; default: resourcePath += "low"; break; } resourcePath += ".prx"; try { Assembly _assembly = Assembly.GetExecutingAssembly(); StreamReader sr = new StreamReader(_assembly.GetManifestResourceStream(resourcePath)); return(sr.ReadToEnd()); } catch { SendDebugMessage("Couldnt read profile from DLL embedded resources: " + resourcePath); throw new ApplicationException("Couldnt read profile from DLL embedded resources (" + resourcePath + ")"); } }
public DSStreamResultCodes TranscodeFileAsync(string fileName, WTVProfileQuality quality) { FileName = fileName; Quality = quality; WTVStreamingVideoRequest strq = new WTVStreamingVideoRequest(FileName, quality, TimeSpan.FromSeconds(0)); DSStreamResultCodes result = InitWithFile(strq); if (result != DSStreamResultCodes.OK) return result; // ...and stop Thread th = new Thread(new ThreadStart(DoTranscodeFileAsync)); th.Name = "TranscodeFile1"; th.Start(); return DSStreamResultCodes.OK; }
public DSStreamResultCodes TranscodeFileAsync(string fileName, WTVProfileQuality quality) { FileName = fileName; Quality = quality; WTVStreamingVideoRequest strq = new WTVStreamingVideoRequest(FileName, quality, TimeSpan.FromSeconds(0)); DSStreamResultCodes result = InitWithFile(strq); if (result != DSStreamResultCodes.OK) { return(result); // ...and stop } Thread th = new Thread(new ThreadStart(DoTranscodeFileAsync)); th.Name = "TranscodeFile1"; th.Start(); return(DSStreamResultCodes.OK); }
public WTVStreamingVideoRequest(string filename, WTVProfileQuality quality, int interlaceMode, TimeSpan startat) : this(filename, quality, startat) { DeInterlaceMode = interlaceMode; }
public WTVStreamingVideoRequest(string filename, WTVProfileQuality quality, TimeSpan startat) { FileName = filename; Quality = quality; StartAt = startat; }
private string getPRXProfileForQuality(WTVProfileQuality _quality) { string resourcePath = "FatAttitude.WTVTranscoder.prx."; switch (_quality) { case WTVProfileQuality.Low: resourcePath += "ultralow"; break; case WTVProfileQuality.Normal: resourcePath += "low"; break; case WTVProfileQuality.Med: resourcePath += "normal"; break; case WTVProfileQuality.High: resourcePath += "high"; break; case WTVProfileQuality.UltraHigh: resourcePath += "ultrahigh"; break; case WTVProfileQuality.Test: resourcePath += "test"; break; case WTVProfileQuality.Custom: resourcePath += "custom"; break; default: resourcePath += "low"; break; } resourcePath += ".prx"; try { Assembly _assembly = Assembly.GetExecutingAssembly(); StreamReader sr = new StreamReader(_assembly.GetManifestResourceStream(resourcePath)); return sr.ReadToEnd(); } catch { SendDebugMessage("Couldnt read profile from DLL embedded resources: " + resourcePath); throw new ApplicationException("Couldnt read profile from DLL embedded resources (" + resourcePath + ")"); } }