Lines Matching refs:p

289     MppDumpImpl *p = mpp_calloc(MppDumpImpl, 1);  in mpp_dump_init()  local
291 mpp_env_get_u32("mpp_dump_width", &p->dump_width, 0); in mpp_dump_init()
292 mpp_env_get_u32("mpp_dump_height", &p->dump_height, 0); in mpp_dump_init()
293 p->dump_size = p->dump_width * p->dump_height * 3 / 2; in mpp_dump_init()
295 mpp_mutex_init(&p->lock); in mpp_dump_init()
296 p->debug = mpp_debug; in mpp_dump_init()
297 p->tid = syscall(SYS_gettid); in mpp_dump_init()
298 p->log_version = 0; in mpp_dump_init()
299 p->time_base = mpp_time(); in mpp_dump_init()
301 *info = p; in mpp_dump_init()
309 MppDumpImpl *p = (MppDumpImpl *)*info; in mpp_dump_deinit() local
311 MPP_FCLOSE(p->fp_in); in mpp_dump_deinit()
312 MPP_FCLOSE(p->fp_out); in mpp_dump_deinit()
313 MPP_FCLOSE(p->fp_ops); in mpp_dump_deinit()
314 MPP_FREE(p->fp_buf); in mpp_dump_deinit()
316 mpp_mutex_destroy(&p->lock); in mpp_dump_deinit()
324 MppDumpImpl *p = (MppDumpImpl *)info; in mpp_ops_init() local
329 mpp_mutex_lock(&p->lock); in mpp_ops_init()
331 p->type = type; in mpp_ops_init()
332 p->coding = coding; in mpp_ops_init()
335 if (p->debug & MPP_DBG_DUMP_IN) in mpp_ops_init()
336 p->fp_in = try_env_file("mpp_dump_in", dec_pkt_path, p->tid); in mpp_ops_init()
338 if (p->debug & MPP_DBG_DUMP_OUT) { in mpp_ops_init()
339 p->fp_out = try_env_file("mpp_dump_out", dec_frm_path, p->tid); in mpp_ops_init()
340 if (p->dump_size) in mpp_ops_init()
341 p->fp_buf = mpp_malloc(RK_U8, p->dump_size); in mpp_ops_init()
344 if (p->debug & MPP_DBG_DUMP_CFG) in mpp_ops_init()
345 p->fp_ops = try_env_file("mpp_dump_ops", dec_ops_path, p->tid); in mpp_ops_init()
347 if (p->debug & MPP_DBG_DUMP_IN) { in mpp_ops_init()
348 p->fp_in = try_env_file("mpp_dump_in", enc_frm_path, p->tid); in mpp_ops_init()
349 if (p->dump_size) in mpp_ops_init()
350 p->fp_buf = mpp_malloc(RK_U8, p->dump_size); in mpp_ops_init()
353 if (p->debug & MPP_DBG_DUMP_OUT) in mpp_ops_init()
354 p->fp_out = try_env_file("mpp_dump_out", enc_pkt_path, p->tid); in mpp_ops_init()
356 if (p->debug & MPP_DBG_DUMP_CFG) in mpp_ops_init()
357 p->fp_ops = try_env_file("mpp_dump_ops", enc_ops_path, p->tid); in mpp_ops_init()
360 if (p->fp_ops) in mpp_ops_init()
361 ops_log(p->fp_ops, "%d,%s,%d,%d\n", p->idx++, "init", type, coding); in mpp_ops_init()
363 mpp_mutex_unlock(&p->lock); in mpp_ops_init()
370 MppDumpImpl *p = (MppDumpImpl *)info; in mpp_ops_dec_put_pkt() local
371 if (NULL == p || NULL == pkt || NULL == p->fp_in) in mpp_ops_dec_put_pkt()
376 mpp_mutex_lock(&p->lock); in mpp_ops_dec_put_pkt()
378 if (p->fp_in) { in mpp_ops_dec_put_pkt()
379 fwrite(mpp_packet_get_data(pkt), 1, length, p->fp_in); in mpp_ops_dec_put_pkt()
380 fflush(p->fp_in); in mpp_ops_dec_put_pkt()
383 if (p->fp_ops) { in mpp_ops_dec_put_pkt()
384 ops_log(p->fp_ops, "%d,%s,%d,%d\n", p->idx++, "pkt", p->pkt_offset, length); in mpp_ops_dec_put_pkt()
386 p->pkt_offset += length; in mpp_ops_dec_put_pkt()
389 mpp_mutex_unlock(&p->lock); in mpp_ops_dec_put_pkt()
396 MppDumpImpl *p = (MppDumpImpl *)info; in mpp_ops_dec_get_frm() local
398 if (NULL == p || NULL == frame || NULL == p->fp_out) in mpp_ops_dec_get_frm()
401 mpp_mutex_lock(&p->lock); in mpp_ops_dec_get_frm()
409 if (p->fp_ops) { in mpp_ops_dec_get_frm()
410 ops_log(p->fp_ops, "%d,%s,%d,%d,%d,%d,%lld\n", p->idx, "frm", fd, in mpp_ops_dec_get_frm()
416 mpp_mutex_unlock(&p->lock); in mpp_ops_dec_get_frm()
420 dump_frame(p->fp_out, frame, p->fp_buf, p->dump_width, p->dump_height); in mpp_ops_dec_get_frm()
422 if (p->debug & MPP_DBG_DUMP_LOG) { in mpp_ops_dec_get_frm()
429 mpp_mutex_unlock(&p->lock); in mpp_ops_dec_get_frm()
436 MppDumpImpl *p = (MppDumpImpl *)info; in mpp_ops_enc_put_frm() local
438 if (NULL == p || NULL == frame || NULL == p->fp_in) in mpp_ops_enc_put_frm()
441 mpp_mutex_lock(&p->lock); in mpp_ops_enc_put_frm()
443 dump_frame(p->fp_in, frame, p->fp_buf, p->dump_width, p->dump_height); in mpp_ops_enc_put_frm()
445 if (p->debug & MPP_DBG_DUMP_LOG) { in mpp_ops_enc_put_frm()
453 mpp_mutex_unlock(&p->lock); in mpp_ops_enc_put_frm()
460 MppDumpImpl *p = (MppDumpImpl *)info; in mpp_ops_enc_get_pkt() local
462 if (NULL == p || NULL == pkt) in mpp_ops_enc_get_pkt()
466 mpp_mutex_lock(&p->lock); in mpp_ops_enc_get_pkt()
468 if (p->fp_out) { in mpp_ops_enc_get_pkt()
469 fwrite(mpp_packet_get_data(pkt), 1, length, p->fp_out); in mpp_ops_enc_get_pkt()
470 fflush(p->fp_out); in mpp_ops_enc_get_pkt()
473 mpp_mutex_unlock(&p->lock); in mpp_ops_enc_get_pkt()
480 MppDumpImpl *p = (MppDumpImpl *)info; in mpp_ops_ctrl() local
482 if (NULL == p) in mpp_ops_ctrl()
485 mpp_mutex_lock(&p->lock); in mpp_ops_ctrl()
487 if (p->fp_ops) in mpp_ops_ctrl()
488 ops_log(p->fp_ops, "%d,%s,%d\n", p->idx, "ctrl", cmd); in mpp_ops_ctrl()
489 mpp_mutex_unlock(&p->lock); in mpp_ops_ctrl()
496 MppDumpImpl *p = (MppDumpImpl *)info; in mpp_ops_reset() local
498 if (NULL == p) in mpp_ops_reset()
501 mpp_mutex_lock(&p->lock); in mpp_ops_reset()
503 if (p->fp_ops) in mpp_ops_reset()
504 ops_log(p->fp_ops, "%d,%s\n", p->idx, "rst"); in mpp_ops_reset()
505 mpp_mutex_unlock(&p->lock); in mpp_ops_reset()