/// <summary> /// Create a new EncoderPackage /// </summary> public EncoderPackage(PackageSpec SrcSpec, int Index, EncoderJob Job, MediaFrame Frame) { Buffers = new List<IEncoderBuffer>(); this.JobIndex = Index; this.Job = Job; this.Frame = Frame; Specification = SrcSpec; }
/// <summary> /// Returns the codec's startup data (other than in frames). /// This may be null or empty. /// </summary> public static byte[] GetVideoCodecData(EncoderJob JobSpec) { int bufsz = EncoderBridge.GetVideoCodecDataSize(ref JobSpec); byte[] buffer = null; if (bufsz > 0) { buffer = new byte[bufsz]; GCHandle bufh = GCHandle.Alloc(buffer, GCHandleType.Pinned); try { EncoderBridge.GetVideoCodecData(ref JobSpec, bufh.AddrOfPinnedObject()); } finally { bufh.Free(); } } return(buffer); }
private static extern void GetVideoCodecData(ref EncoderJob JobSpec, IntPtr Buffer);
private static extern int GetVideoCodecDataSize(ref EncoderJob JobSpec);
public static extern void CloseEncoderJob(ref EncoderJob JobSpec);
[System.Security.SuppressUnmanagedCodeSecurity] // this is for performance. Only makes a difference in tight loops. public static extern void EncodeFrame(ref EncoderJob JobSpec, ref MediaFrame Frame);
public static extern int InitialiseEncoderJob(ref EncoderJob JobSpec, int Width, int Height, string BaseDirectory, int FrameRate, int Bitrate, double SegmentDuration);
/// <summary> /// Returns the codec's startup data (other than in frames). /// This may be null or empty. /// </summary> public static byte[] GetVideoCodecData(EncoderJob JobSpec) { int bufsz = EncoderBridge.GetVideoCodecDataSize(ref JobSpec); byte[] buffer = null; if (bufsz > 0) { buffer = new byte[bufsz]; GCHandle bufh = GCHandle.Alloc(buffer, GCHandleType.Pinned); try { EncoderBridge.GetVideoCodecData(ref JobSpec, bufh.AddrOfPinnedObject()); } finally { bufh.Free(); } } return buffer; }
public static extern void EncodeFrame(ref EncoderJob JobSpec, ref MediaFrame Frame);