예제 #1
0
        public override void Destroy()
        {
            if (_Encoder != null)
            {
                _Encoder.Destroy();
                _Encoder = null;
            }

            if (_Decoder != null)
            {
                _Decoder.Destroy();
                _Decoder = null;
            }
        }
예제 #2
0
        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));
        }
예제 #3
0
        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);
        }
예제 #4
0
        public override void Destroy()
        {
            if (_Encoder != null)
            {
                _Encoder.Destroy();
                _Encoder = null;
            }

            if (_Decoder != null)
            {
                _Decoder.Destroy();
                _Decoder = null;
            }
        }