mirror of
https://github.com/followmsi/android_hardware_qcom_media.git
synced 2024-10-31 22:47:35 +00:00
mm-video-v4l2: vdec: Fix sanity check in log_output_buffers.
Refactor sanity check in log_output_buffers. Change-Id: I4126fde80556551d17cd79a52e011daf4c5e4328
This commit is contained in:
parent
42db0ef27e
commit
232da1544d
1 changed files with 6 additions and 7 deletions
|
@ -2042,7 +2042,10 @@ int omx_vdec::log_output_buffers(OMX_BUFFERHEADERTYPE *buffer) {
|
|||
int buf_index = 0;
|
||||
char *temp = NULL;
|
||||
|
||||
if (m_debug.out_buffer_log && !m_debug.outfile && buffer->nFilledLen) {
|
||||
if (!(m_debug.out_buffer_log || m_debug.out_meta_buffer_log) || !buffer || !buffer->nFilledLen)
|
||||
return 0;
|
||||
|
||||
if (m_debug.out_buffer_log && !m_debug.outfile) {
|
||||
snprintf(m_debug.outfile_name, OMX_MAX_STRINGNAME_SIZE, "%s/output_%d_%d_%p.yuv",
|
||||
m_debug.log_loc, drv_ctx.video_resolution.frame_width, drv_ctx.video_resolution.frame_height, this);
|
||||
m_debug.outfile = fopen (m_debug.outfile_name, "ab");
|
||||
|
@ -2053,8 +2056,7 @@ int omx_vdec::log_output_buffers(OMX_BUFFERHEADERTYPE *buffer) {
|
|||
}
|
||||
}
|
||||
|
||||
if (m_debug.out_meta_buffer_log && !m_debug.out_ymeta_file && !m_debug.out_uvmeta_file
|
||||
&& buffer->nFilledLen) {
|
||||
if (m_debug.out_meta_buffer_log && !m_debug.out_ymeta_file && !m_debug.out_uvmeta_file) {
|
||||
snprintf(m_debug.out_ymetafile_name, OMX_MAX_STRINGNAME_SIZE, "%s/output_%d_%d_%p.ymeta",
|
||||
m_debug.log_loc, drv_ctx.video_resolution.frame_width, drv_ctx.video_resolution.frame_height, this);
|
||||
snprintf(m_debug.out_uvmetafile_name, OMX_MAX_STRINGNAME_SIZE, "%s/output_%d_%d_%p.uvmeta",
|
||||
|
@ -2069,9 +2071,6 @@ int omx_vdec::log_output_buffers(OMX_BUFFERHEADERTYPE *buffer) {
|
|||
}
|
||||
}
|
||||
|
||||
if ((!m_debug.outfile && !m_debug.out_ymeta_file) || !buffer || !buffer->nFilledLen)
|
||||
return 0;
|
||||
|
||||
buf_index = buffer - m_out_mem_ptr;
|
||||
temp = (char *)drv_ctx.ptr_outputbuffer[buf_index].bufferaddr;
|
||||
|
||||
|
@ -2117,7 +2116,7 @@ int omx_vdec::log_output_buffers(OMX_BUFFERHEADERTYPE *buffer) {
|
|||
temp += uv_meta_stride;
|
||||
}
|
||||
}
|
||||
} else if (drv_ctx.output_format == VDEC_YUV_FORMAT_NV12) {
|
||||
} else if (m_debug.outfile && drv_ctx.output_format == VDEC_YUV_FORMAT_NV12) {
|
||||
int stride = drv_ctx.video_resolution.stride;
|
||||
int scanlines = drv_ctx.video_resolution.scan_lines;
|
||||
if (m_smoothstreaming_mode) {
|
||||
|
|
Loading…
Reference in a new issue