Lines Matching refs:my_obj
1281 * @my_obj: jpeg object
1291 inline int mm_jpeg_get_new_session_idx(mm_jpeg_obj *my_obj, int client_idx,
1297 pthread_mutex_lock(&my_obj->clnt_mgr[client_idx].lock);
1298 if (!my_obj->clnt_mgr[client_idx].session[i].active) {
1299 *pp_session = &my_obj->clnt_mgr[client_idx].session[i];
1300 my_obj->clnt_mgr[client_idx].session[i].active = OMX_TRUE;
1302 pthread_mutex_unlock(&my_obj->clnt_mgr[client_idx].lock);
1305 pthread_mutex_unlock(&my_obj->clnt_mgr[client_idx].lock);
1313 * @my_obj: jpeg object
1323 inline void mm_jpeg_remove_session_idx(mm_jpeg_obj *my_obj, uint32_t job_id)
1329 pthread_mutex_lock(&my_obj->clnt_mgr[client_idx].lock);
1330 my_obj->clnt_mgr[client_idx].session[session_idx].active = OMX_FALSE;
1331 pthread_mutex_unlock(&my_obj->clnt_mgr[client_idx].lock);
1337 * @my_obj: jpeg object
1347 inline mm_jpeg_job_session_t *mm_jpeg_get_session(mm_jpeg_obj *my_obj, uint32_t job_id)
1361 pthread_mutex_lock(&my_obj->clnt_mgr[client_idx].lock);
1362 p_session = &my_obj->clnt_mgr[client_idx].session[session_idx];
1363 pthread_mutex_unlock(&my_obj->clnt_mgr[client_idx].lock);
1439 mm_jpeg_obj *my_obj = (mm_jpeg_obj *)p_session->jpeg_obj;
1486 mm_jpeg_obj *my_obj = (mm_jpeg_obj *)p_session->jpeg_obj;
1493 node = mm_jpeg_queue_remove_job_by_job_id(&my_obj->ongoing_job_q,
1501 cam_sem_post(&my_obj->job_mgr.job_sem);
1522 mm_jpeg_obj *my_obj = (mm_jpeg_obj *)p_session->jpeg_obj;
1589 * @my_obj: jpeg client
1599 int32_t mm_jpeg_process_encoding_job(mm_jpeg_obj *my_obj, mm_jpeg_job_q_node_t* job_node)
1607 p_session = mm_jpeg_get_session(my_obj, job_node->enc_info.job_id);
1615 rc = mm_jpeg_queue_enq(&my_obj->ongoing_job_q, job_node);
1657 * @my_obj: jpeg object
1671 mm_jpeg_obj *my_obj = (mm_jpeg_obj*)data;
1672 mm_jpeg_job_cmd_thread_t *cmd_thread = &my_obj->job_mgr;
1687 num_ongoing_jobs = mm_jpeg_queue_get_size(&my_obj->ongoing_job_q);
1694 pthread_mutex_lock(&my_obj->job_lock);
1700 rc = mm_jpeg_process_encoding_job(my_obj, node);
1711 pthread_mutex_unlock(&my_obj->job_lock);
1720 * @my_obj: jpeg object
1729 int32_t mm_jpeg_jobmgr_thread_launch(mm_jpeg_obj *my_obj)
1732 mm_jpeg_job_cmd_thread_t *job_mgr = &my_obj->job_mgr;
1741 (void *)my_obj);
1748 * @my_obj: jpeg object
1757 int32_t mm_jpeg_jobmgr_thread_release(mm_jpeg_obj * my_obj)
1760 mm_jpeg_job_cmd_thread_t * cmd_thread = &my_obj->job_mgr;
1788 * @my_obj: jpeg object
1797 int32_t mm_jpeg_init(mm_jpeg_obj *my_obj)
1802 pthread_mutex_init(&my_obj->job_lock, NULL);
1805 rc = mm_jpeg_queue_init(&my_obj->ongoing_job_q);
1813 rc = mm_jpeg_jobmgr_thread_launch(my_obj);
1823 mm_jpeg_jobmgr_thread_release(my_obj);
1824 mm_jpeg_queue_deinit(&my_obj->ongoing_job_q);
1825 pthread_mutex_destroy(&my_obj->job_lock);
1834 * @my_obj: jpeg object
1843 int32_t mm_jpeg_deinit(mm_jpeg_obj *my_obj)
1848 rc = mm_jpeg_jobmgr_thread_release(my_obj);
1857 rc = mm_jpeg_queue_deinit(&my_obj->ongoing_job_q);
1863 pthread_mutex_destroy(&my_obj->job_lock);
1871 * @my_obj: jpeg object
1880 uint32_t mm_jpeg_new_client(mm_jpeg_obj *my_obj)
1886 if (my_obj->num_clients >= MAX_JPEG_CLIENT_NUM) {
1892 if (0 == my_obj->clnt_mgr[idx].is_used) {
1903 my_obj->clnt_mgr[idx].is_used = 1;
1904 my_obj->clnt_mgr[idx].client_handle = client_hdl;
1906 pthread_mutex_init(&my_obj->clnt_mgr[idx].lock, NULL);
1908 memset(&my_obj->clnt_mgr[idx].session[i], 0x0, sizeof(mm_jpeg_job_session_t));
1912 my_obj->num_clients++;
1921 * @my_obj: jpeg object
1933 int32_t mm_jpeg_start_job(mm_jpeg_obj *my_obj,
1959 p_session = &my_obj->clnt_mgr[client_idx].session[session_idx];
1988 rc = mm_jpeg_queue_enq(&my_obj->job_mgr.job_queue, node);
1990 cam_sem_post(&my_obj->job_mgr.job_sem);
1999 * @my_obj: jpeg object
2010 int32_t mm_jpeg_abort_job(mm_jpeg_obj *my_obj,
2020 pthread_mutex_lock(&my_obj->job_lock);
2023 node = mm_jpeg_queue_remove_job_by_job_id(&my_obj->job_mgr.job_queue, jobId);
2030 node = mm_jpeg_queue_remove_job_by_job_id(&my_obj->ongoing_job_q, jobId);
2033 p_session = mm_jpeg_get_session(my_obj, node->enc_info.job_id);
2045 pthread_mutex_unlock(&my_obj->job_lock);
2053 * @my_obj: jpeg object
2065 int32_t mm_jpeg_create_session(mm_jpeg_obj *my_obj,
2091 session_idx = mm_jpeg_get_new_session_idx(my_obj, clnt_idx, &p_session);
2110 p_session->jpeg_obj = (void*)my_obj; /* save a ptr to jpeg_obj */
2149 * @my_obj: jpeg object
2159 int32_t mm_jpeg_destroy_session(mm_jpeg_obj *my_obj,
2173 pthread_mutex_lock(&my_obj->job_lock);
2177 node = mm_jpeg_queue_remove_job_by_session_id(&my_obj->job_mgr.job_queue, session_id);
2180 node = mm_jpeg_queue_remove_job_by_session_id(&my_obj->job_mgr.job_queue, session_id);
2185 node = mm_jpeg_queue_remove_job_by_session_id(&my_obj->ongoing_job_q, session_id);
2188 node = mm_jpeg_queue_remove_job_by_session_id(&my_obj->ongoing_job_q, session_id);
2194 mm_jpeg_remove_session_idx(my_obj, session_id);
2195 pthread_mutex_unlock(&my_obj->job_lock);
2198 cam_sem_post(&my_obj->job_mgr.job_sem);
2207 * @my_obj: jpeg object
2217 int32_t mm_jpeg_destroy_session_unlocked(mm_jpeg_obj *my_obj,
2233 node = mm_jpeg_queue_remove_job_by_session_id(&my_obj->job_mgr.job_queue, session_id);
2236 node = mm_jpeg_queue_remove_job_by_session_id(&my_obj->job_mgr.job_queue, session_id);
2241 node = mm_jpeg_queue_remove_job_by_session_id(&my_obj->ongoing_job_q, session_id);
2244 node = mm_jpeg_queue_remove_job_by_session_id(&my_obj->ongoing_job_q, session_id);
2249 mm_jpeg_remove_session_idx(my_obj, session_id);
2257 * @my_obj: jpeg object
2267 int32_t mm_jpeg_destroy_session_by_id(mm_jpeg_obj *my_obj, uint32_t session_id)
2269 mm_jpeg_job_session_t *p_session = mm_jpeg_get_session(my_obj, session_id);
2271 return mm_jpeg_destroy_session(my_obj, p_session);
2277 * @my_obj: jpeg object
2287 int32_t mm_jpeg_close(mm_jpeg_obj *my_obj, uint32_t client_hdl)
2305 pthread_mutex_lock(&my_obj->job_lock);
2310 if (OMX_TRUE == my_obj->clnt_mgr[clnt_idx].session[i].active)
2311 mm_jpeg_destroy_session_unlocked(my_obj,
2312 &my_obj->clnt_mgr[clnt_idx].session[i]);
2317 pthread_mutex_unlock(&my_obj->job_lock);
2321 pthread_mutex_destroy(&my_obj->clnt_mgr[clnt_idx].lock);
2322 memset(&my_obj->clnt_mgr[clnt_idx], 0, sizeof(mm_jpeg_client_t));