Lines Matching defs:queue

72 int32_t mm_channel_superbuf_flush(mm_channel_t* my_obj, mm_channel_queue_t * queue);
102 /* channel super queue functions */
103 int32_t mm_channel_superbuf_queue_init(mm_channel_queue_t * queue);
104 int32_t mm_channel_superbuf_queue_deinit(mm_channel_queue_t * queue);
106 mm_channel_queue_t * queue,
108 mm_channel_queue_node_t* mm_channel_superbuf_dequeue(mm_channel_queue_t * queue);
110 mm_channel_queue_t *queue);
112 mm_channel_queue_t *queue);
180 * in the superbuf queue, or sending matched superbuf frames to upper
895 /* init superbuf queue */
1048 /* deinit superbuf queue */
1072 * frames from superbuf queue
1113 * of matched frames from superbuf queue
1133 * DESCRIPTION: flush superbuf queue
1397 * DESCRIPTION: initialize superbuf queue in the channel
1400 * @queue : ptr to superbuf queue to be initialized
1406 int32_t mm_channel_superbuf_queue_init(mm_channel_queue_t * queue)
1408 return cam_queue_init(&queue->que);
1414 * DESCRIPTION: deinitialize superbuf queue in the channel
1417 * @queue : ptr to superbuf queue to be deinitialized
1423 int32_t mm_channel_superbuf_queue_deinit(mm_channel_queue_t * queue)
1425 return cam_queue_deinit(&queue->que);
1464 * @queue : superbuf queue
1473 mm_channel_queue_t * queue,
1518 queue->expected_frame_id += max_future_frame_offset;
1520 mm_channel_superbuf_flush(ch_obj, queue);
1523 queue->expected_frame_id) {
1526 queue->expected_frame_id);
1528 queue->expected_frame_id =
1543 * @queue : superbuf queue
1552 mm_channel_queue_t *queue,
1563 for (buf_s_idx = 0; buf_s_idx < queue->num_streams; buf_s_idx++) {
1564 if (buf_info->stream_id == queue->bundled_streams[buf_s_idx]) {
1568 if (buf_s_idx == queue->num_streams) {
1573 if (mm_channel_handle_metadata(ch_obj, queue, buf_info) < 0) {
1578 queue->expected_frame_id) < 0) {
1584 if (MM_CAMERA_SUPER_BUF_PRIORITY_NORMAL != queue->attr.priority) {
1586 /* need to decide if we want to queue the frame based on focus or exposure
1591 pthread_mutex_lock(&queue->que.lock);
1592 head = &queue->que.head.list;
1593 /* get the last one in the queue which is possibly having no matching */
1643 queue->expected_frame_id = buf_info->frame_idx + queue->attr.post_frame_skip;
1644 queue->match_cnt++;
1656 queue->que.size--;
1662 CDBG_ERROR(" %s : Invalid superbuf in queue!", __func__);
1669 if ( ( queue->attr.max_unmatched_frames < unmatched_bundles ) &&
1674 if ( queue->attr.max_unmatched_frames < unmatched_bundles ) {
1683 queue->que.size--;
1700 new_buf->num_of_bufs = queue->num_streams;
1708 cam_list_add_tail_node(&new_node->list, &queue->que.head.list);
1710 queue->que.size++;
1712 if(queue->num_streams == 1) {
1715 queue->expected_frame_id = buf_info->frame_idx + queue->attr.post_frame_skip;
1716 queue->match_cnt++;
1732 pthread_mutex_unlock(&queue->que.lock);
1741 * DESCRIPTION: internal implementation for dequeue from the superbuf queue
1744 * @queue : superbuf queue
1747 * RETURN : ptr to a node from superbuf queue
1749 mm_channel_queue_node_t* mm_channel_superbuf_dequeue_internal(mm_channel_queue_t * queue,
1757 head = &queue->que.head.list;
1771 /* remove from the queue */
1773 queue->que.size--;
1775 queue->match_cnt--;
1787 * DESCRIPTION: dequeue from the superbuf queue
1790 * @queue : superbuf queue
1792 * RETURN : ptr to a node from superbuf queue
1794 mm_channel_queue_node_t* mm_channel_superbuf_dequeue(mm_channel_queue_t * queue)
1798 pthread_mutex_lock(&queue->que.lock);
1799 super_buf = mm_channel_superbuf_dequeue_internal(queue, TRUE);
1800 pthread_mutex_unlock(&queue->que.lock);
1808 * DESCRIPTION: keep superbuf queue no larger than watermark set by upper layer
1813 * @queue : superbuf queue
1820 mm_channel_queue_t * queue)
1824 if (MM_CAMERA_SUPER_BUF_NOTIFY_CONTINUOUS == queue->attr.notify_mode) {
1830 __func__, queue->match_cnt, queue->attr.water_mark);
1832 pthread_mutex_lock(&queue->que.lock);
1833 while (queue->match_cnt > queue->attr.water_mark) {
1834 super_buf = mm_channel_superbuf_dequeue_internal(queue, TRUE);
1844 pthread_mutex_unlock(&queue->que.lock);
1846 __func__, queue->match_cnt, queue->attr.water_mark);
1855 * unwanted superbufs will be removed from the superbuf queue.
1859 * @queue : superbuf queue
1866 mm_channel_queue_t * queue)
1870 if (MM_CAMERA_SUPER_BUF_NOTIFY_CONTINUOUS == queue->attr.notify_mode) {
1876 pthread_mutex_lock(&queue->que.lock);
1877 while (queue->match_cnt > queue->attr.look_back) {
1878 super_buf = mm_channel_superbuf_dequeue_internal(queue, TRUE);
1888 pthread_mutex_unlock(&queue->que.lock);
1896 * DESCRIPTION: flush the superbuf queue.
1900 * @queue : superbuf queue
1907 mm_channel_queue_t * queue)
1913 pthread_mutex_lock(&queue->que.lock);
1914 super_buf = mm_channel_superbuf_dequeue_internal(queue, FALSE);
1922 super_buf = mm_channel_superbuf_dequeue_internal(queue, FALSE);
1924 pthread_mutex_unlock(&queue->que.lock);