Lines Matching defs:queue

89         mm_channel_queue_t * queue, cam_stream_type_t cam_type);
124 /* channel super queue functions */
125 int32_t mm_channel_superbuf_queue_init(mm_channel_queue_t * queue);
126 int32_t mm_channel_superbuf_queue_deinit(mm_channel_queue_t * queue);
128 mm_channel_queue_t * queue,
131 mm_channel_queue_t * queue, mm_channel_t *ch_obj);
133 mm_channel_queue_t *queue);
135 mm_channel_queue_t *queue);
140 mm_channel_queue_t * queue);
156 mm_channel_queue_t * queue, uint32_t frame_idx);
254 * DESCRIPTION: Request buffer from super buffer sync queue
286 /* send cam_sem_post to wake up cb thread to flush sync queue */
313 * in the superbuf queue, or sending matched superbuf frames to upper
506 /* Need to Flush the queue and trigger frame config */
543 LOGD("Super Buffer received, pending_cnt=%d queue cnt = %d expected = %d",
570 LOGW("Channel queue is NULL");
1446 * @sync_attr : attibutes for sync queue
1482 mm_frame_sync_queue_t *queue = NULL;
1496 queue = &frame_sync->superbuf_queue;
1497 queue->attr = sync->sync_attr->attr;
1498 queue->num_objs = 0;
1499 memset(&queue->bundled_objs, 0, sizeof(queue->bundled_objs));
1500 queue->bundled_objs[queue->num_objs] = my_obj->my_hdl;
1501 queue->num_objs++;
1502 queue->bundled_objs[queue->num_objs] = sync->a_ch_obj->my_hdl;
1503 queue->num_objs++;
1809 /* init superbuf queue */
1948 /* deinit superbuf queue */
1951 /* memset super buffer queue info */
2102 /* deinit superbuf queue */
2139 * frames from superbuf queue
2187 * of matched frames from superbuf queue
2211 * DESCRIPTION: flush superbuf queue
2685 * DESCRIPTION: initialize superbuf queue in the channel
2688 * @queue : ptr to superbuf queue to be initialized
2694 int32_t mm_channel_superbuf_queue_init(mm_channel_queue_t * queue)
2696 return cam_queue_init(&queue->que);
2702 * DESCRIPTION: deinitialize superbuf queue in the channel
2705 * @queue : ptr to superbuf queue to be deinitialized
2711 int32_t mm_channel_superbuf_queue_deinit(mm_channel_queue_t * queue)
2713 return cam_queue_deinit(&queue->que);
2752 * @queue : superbuf queue
2761 mm_channel_queue_t *queue, mm_camera_buf_info_t *buf_info)
2772 pthread_mutex_lock(&queue->que.lock);
2773 head = &queue->que.head.list;
2774 /* get the last one in the queue which is possibly having no matching */
2791 pthread_mutex_unlock(&queue->que.lock);
2802 * @queue : superbuf queue
2811 mm_channel_queue_t * queue,
2857 LOGL("E , expected frame id: %d", queue->expected_frame_id);
2912 queue->expected_frame_id = buf_info->frame_idx + 1;
2914 queue->expected_frame_id += max_future_frame_offset;
2916 mm_channel_superbuf_flush_matched(ch_obj, queue);
2923 buf_info->frame_idx, queue->expected_frame_id,
2930 queue->expected_frame_id += max_future_frame_offset;
2934 queue, CAM_STREAM_TYPE_DEFAULT);
2942 queue->expected_frame_id =
2944 queue->good_frame_id = good_frame_idx_range.min_frame_idx;
2946 queue->led_on_start_frame_id =
2948 queue->led_off_start_frame_id =
2950 queue->once = 0;
2951 queue->led_on_num_frames =
2953 queue->frame_skip_count = good_frame_idx_range.frame_skip_count;
2956 queue->expected_frame_id, queue->led_on_start_frame_id,
2957 queue->led_off_start_frame_id, queue->led_on_num_frames);
2960 queue->expected_frame_id);
2965 mm_channel_superbuf_flush_matched(ch_obj, queue);
2966 queue->expected_frame_id += max_future_frame_offset;
2973 queue->expected_frame_id =
2976 queue->expected_frame_id_without_led =
2978 queue->good_frame_id =
2981 queue->expected_frame_id =
2984 queue->good_frame_id =
2997 queue->expected_frame_id =
3000 queue->expected_frame_id =
3003 queue->good_frame_id = queue->expected_frame_id;
3010 if((buf_info->frame_idx >= queue->led_off_start_frame_id)
3011 && !queue->once) {
3015 queue->expected_frame_id = queue->led_off_start_frame_id +
3016 queue->frame_skip_count;
3017 queue->once = 1;
3021 buf_info->frame_idx, queue->expected_frame_id);
3032 if (queue->attr.user_expected_frame_id > 0) {
3033 if (queue->attr.user_expected_frame_id > buf_info->frame_idx) {
3037 queue->expected_frame_id = buf_info->frame_idx;
3039 queue->attr.user_expected_frame_id = 0;
3046 queue->attr.user_expected_frame_id = 0;
3062 * @queue : superbuf queue
3071 mm_channel_queue_t *queue,
3083 for (buf_s_idx = 0; buf_s_idx < queue->num_streams; buf_s_idx++) {
3084 if (buf_info->stream_id == queue->bundled_streams[buf_s_idx]) {
3089 if (buf_s_idx == queue->num_streams) {
3099 if (mm_channel_handle_metadata(ch_obj, queue, buf_info) < 0) {
3105 queue->expected_frame_id) < 0) &&
3106 (mm_channel_validate_super_buf(ch_obj, queue, buf_info) <= 0)) {
3108 buf_info->frame_idx, queue->expected_frame_id);
3114 pthread_mutex_lock(&queue->que.lock);
3115 head = &queue->que.head.list;
3116 /* get the last one in the queue which is possibly having no matching */
3136 || ((queue->attr.priority == MM_CAMERA_SUPER_BUF_PRIORITY_LOW)
3141 || ((queue->attr.priority == MM_CAMERA_SUPER_BUF_PRIORITY_LOW)
3152 queue, only meta frame id need not match (closest suffices) but
3179 pthread_mutex_unlock(&queue->que.lock);
3180 LOGW("Warning: frame is already in camera ZSL queue");
3199 queue->expected_frame_id =
3200 queue->expected_frame_id_without_led;
3202 queue->expected_frame_id_without_led) {
3206 queue->expected_frame_id = buf_info->frame_idx
3207 + queue->attr.post_frame_skip;
3214 queue->attr.post_frame_skip, queue->expected_frame_id);
3216 queue->match_cnt++;
3233 queue->que.size--;
3239 LOGE("Invalid superbuf in queue!");
3251 if ((queue->attr.max_unmatched_frames < unmatched_bundles)
3259 while ((queue->attr.max_unmatched_frames < unmatched_bundles)
3270 queue->que.size--;
3279 if (queue->attr.max_unmatched_frames < unmatched_bundles) {
3287 queue->que.size--;
3304 new_buf->num_of_bufs = queue->num_streams;
3309 || (buf_info->frame_idx == queue->good_frame_id)) {
3318 cam_list_add_tail_node(&new_node->list, &queue->que.head.list);
3320 queue->que.size++;
3322 if(queue->num_streams == 1) {
3325 queue->expected_frame_id = buf_info->frame_idx + queue->attr.post_frame_skip;
3326 queue->match_cnt++;
3333 /* In low priority queue, this will become a 'meta only' superbuf. Set the
3336 if ((queue->attr.priority == MM_CAMERA_SUPER_BUF_PRIORITY_LOW)
3354 pthread_mutex_unlock(&queue->que.lock);
3362 * DESCRIPTION: internal implementation for dequeue from the superbuf queue
3365 * @queue : superbuf queue
3369 * RETURN : ptr to a node from superbuf queue
3372 mm_channel_queue_t * queue,
3380 head = &queue->que.head.list;
3394 /* remove from the queue */
3396 queue->que.size--;
3398 queue->match_cnt--;
3416 * from the superbuf queue
3419 * @queue : superbuf queue
3422 * RETURN : ptr to a node from superbuf queue with matched frame index
3426 mm_channel_queue_t *queue, uint32_t frame_idx)
3433 if (!queue) {
3434 LOGE("queue is NULL");
3438 head = &queue->que.head.list;
3447 /* remove from the queue */
3449 queue->que.size--;
3450 queue->match_cnt--;
3467 * DESCRIPTION: dequeue from the superbuf queue
3470 * @queue : superbuf queue
3473 * RETURN : ptr to a node from superbuf queue
3476 mm_channel_queue_t * queue, mm_channel_t *ch_obj)
3480 pthread_mutex_lock(&queue->que.lock);
3481 super_buf = mm_channel_superbuf_dequeue_internal(queue, TRUE, ch_obj);
3482 pthread_mutex_unlock(&queue->que.lock);
3490 * DESCRIPTION: keep superbuf queue no larger than watermark set by upper layer
3495 * @queue : superbuf queue
3502 mm_channel_queue_t * queue)
3506 if (MM_CAMERA_SUPER_BUF_NOTIFY_CONTINUOUS == queue->attr.notify_mode) {
3512 queue->match_cnt, queue->attr.water_mark);
3514 pthread_mutex_lock(&queue->que.lock);
3515 while (queue->match_cnt > queue->attr.water_mark) {
3516 super_buf = mm_channel_superbuf_dequeue_internal(queue, TRUE, my_obj);
3526 pthread_mutex_unlock(&queue->que.lock);
3528 queue->match_cnt, queue->attr.water_mark);
3537 * unwanted superbufs will be removed from the superbuf queue.
3541 * @queue : superbuf queue
3548 mm_channel_queue_t * queue)
3552 if (MM_CAMERA_SUPER_BUF_NOTIFY_CONTINUOUS == queue->attr.notify_mode) {
3558 pthread_mutex_lock(&queue->que.lock);
3559 while (queue->match_cnt > queue->attr.look_back) {
3560 super_buf = mm_channel_superbuf_dequeue_internal(queue, TRUE, my_obj);
3570 pthread_mutex_unlock(&queue->que.lock);
3578 * DESCRIPTION: flush the superbuf frame sync queue.
3599 /* send cam_sem_post to wake up cb thread to flush sync queue */
3619 * DESCRIPTION: flush the superbuf queue.
3623 * @queue : superbuf queue
3631 mm_channel_queue_t * queue, cam_stream_type_t cam_type)
3638 pthread_mutex_lock(&queue->que.lock);
3639 super_buf = mm_channel_superbuf_dequeue_internal(queue, FALSE, my_obj);
3651 super_buf = mm_channel_superbuf_dequeue_internal(queue, FALSE, my_obj);
3653 pthread_mutex_unlock(&queue->que.lock);
3655 /*Flush Super buffer frame sync queue*/
3704 * DESCRIPTION: flush matched buffers from the superbuf queue.
3708 * @queue : superbuf queue
3715 mm_channel_queue_t * queue)
3721 pthread_mutex_lock(&queue->que.lock);
3722 super_buf = mm_channel_superbuf_dequeue_internal(queue, TRUE, my_obj);
3730 super_buf = mm_channel_superbuf_dequeue_internal(queue, TRUE, my_obj);
3732 pthread_mutex_unlock(&queue->que.lock);