/** Callback from an output port. Buffer is queued for the next component. */ static void mmal_connection_bh_out_cb(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buffer) { MMAL_CONNECTION_T *connection = (MMAL_CONNECTION_T *)port->userdata; MMAL_PARAM_UNUSED(port); LOG_TRACE("(%s)%p,%p,%p,%i", port->name, port, buffer, buffer->data, (int)buffer->length); /* Queue the buffer produced by the output port */ mmal_queue_put(connection->queue, buffer); if (connection->callback) connection->callback(connection); }
/** Callback from the pool. Buffer is available. */ static MMAL_BOOL_T mmal_connection_bh_release_cb(MMAL_POOL_T *pool, MMAL_BUFFER_HEADER_T *buffer, void *userdata) { MMAL_CONNECTION_T *connection = (MMAL_CONNECTION_T *)userdata; MMAL_PARAM_UNUSED(pool); mmal_queue_put(pool->queue, buffer); if (connection->callback) connection->callback(connection); return 0; }