Exemplo n.º 1
0
 private void Stop()
 {
     if (_started)
     {
         _started = false;
         lock (_videoObj)
         {
             _video.Stop();
         }
         FfmpegHeader = null;
         HikM4Header  = null;
     }
 }
Exemplo n.º 2
0
        private void video_FFMPEGFormatEvent(Constants.AVCodecID codecID, int width, int height)
        {
            _ffmpegCodecId = codecID;
            _ffmpegWidth   = width;
            _ffmpegHeight  = height;
            FfmpegHeader header = new FfmpegHeader()
            {
                CodecID = codecID,
                Width   = width,
                Height  = height
            };

            FfmpegHeader = header;
            onFfmpegHeaderReceived(new FfmpegHeaderEventArgs(header));
        }
Exemplo n.º 3
0
        private void streamPipe_StreamHeaderReceived(object sender, IStreamHeader e)
        {
            _headerType = e.DeviceType;
            switch (e.DeviceType)
            {
            case VideoDeviceType.Hikv:
            {
                _headerReceived = true;
                HikM4Header header = new HikM4Header()
                {
                    Type = HikM4Decoder.HeaderType,
                    Data = (e as HikvStreamHeader).Buffer
                };
                HikM4Header = header;
                onHikM4HeaderReceived(new HikM4HeaderEventArgs(header));
                //初始化包头
                if (_decode)
                {
                    _hikm4Decoder.InputData(header.Type, header.Data);
                }
            }
            break;

            case VideoDeviceType.Ffmpeg:
            {
                _headerReceived = true;
                FfmpegStreamHeader tH     = e as FfmpegStreamHeader;
                FfmpegHeader       header = new FfmpegHeader()
                {
                    CodecID = (Constants.AVCodecID)tH.CodecID,
                    Width   = 0,
                    Height  = 0
                };
                FfmpegHeader = header;
                onFfmpegHeaderReceived(new FfmpegHeaderEventArgs(header));
                //初始化包头
                if (_decode)
                {
                    _ffmpegDecoder.Init(header.CodecID, header.Width, header.Height);
                }
            }
            break;

            default:
                break;
            }
        }
Exemplo n.º 4
0
 public FfmpegHeaderEventArgs(FfmpegHeader header)
 {
     this.Header = header;
 }
Exemplo n.º 5
0
 public void InitHeader(FfmpegHeader header)
 {
     _ffmpegHeaderInit = true;
     _ffmpegDecoder.Init(header.CodecID, header.Width, header.Height);
 }