コード例 #1
0
        /// <summary>
        /// The native callback MMAL passes buffer headers to.
        /// </summary>
        /// <param name="port">The port the buffer is sent to.</param>
        /// <param name="buffer">The buffer header.</param>
        internal override void NativeControlPortCallback(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buffer)
        {
            lock (MMALControlPort.ControlLock)
            {
                if (MMALCameraConfig.Debug)
                {
                    MMALLog.Logger.Debug("In native control callback.");
                }

                var bufferImpl = new MMALBufferImpl(buffer);

                if (bufferImpl.CheckState())
                {
                    if (MMALCameraConfig.Debug)
                    {
                        bufferImpl.ParseEvents();
                        bufferImpl.PrintProperties();
                    }

                    this.ManagedControlCallback.Callback(bufferImpl);

                    if (MMALCameraConfig.Debug)
                    {
                        MMALLog.Logger.Debug("Releasing buffer.");
                    }

                    bufferImpl.Release();
                }
                else
                {
                    MMALLog.Logger.Warn("Received null control buffer.");
                }
            }
        }
コード例 #2
0
        /// <summary>
        /// The native callback MMAL passes buffer headers to.
        /// </summary>
        /// <param name="port">The port the buffer is sent to.</param>
        /// <param name="buffer">The buffer header.</param>
        internal override void NativeOutputPortCallback(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buffer)
        {
            if (MMALCameraConfig.Debug)
            {
                MMALLog.Logger.LogDebug($"In native {nameof(FileEncodeOutputPort)} callback");
            }

            var bufferImpl = new MMALBufferImpl(buffer);

            bufferImpl.PrintProperties();
            bufferImpl.ParseEvents();

            this.ProcessBuffer(bufferImpl);
        }