public override void Destroy() { if (_Encoder != null) { _Encoder.Destroy(); _Encoder = null; } if (_Decoder != null) { _Decoder.Destroy(); _Decoder = null; } }
public override byte[] Encode(VideoBuffer frame) { if (_Encoder == null) { _Encoder = new Win8_VP8.Encoder(); } if (frame.ResetKeyFrame) { _Encoder.ForceKeyframe(); } // buffer -> bitmap var bitmap = new Win8_VP8.Nv12Bitmap(frame.Width, frame.Height) { Buffer = frame.Plane.Data }; // bitmap -> vp8 return(_Encoder.Encode(bitmap)); }
public override byte[] Encode(VideoBuffer frame) { if (_Encoder == null) { _Encoder = new Win8_VP8.Encoder(); } if (frame.ResetKeyFrame) { _Encoder.ForceKeyframe(); } // buffer -> bitmap var bitmap = new Win8_VP8.Yuy2Bitmap(frame.Width, frame.Height) { Buffer = frame.Plane.Data }; // bitmap -> vp8 return _Encoder.Encode(bitmap); }