I refer to samples/00_video_decode to write a video decoding display thread, the code can be normal decoding and display, the thread can create multiple (multi-channel decoding), but when I destroy the resources, and then re-create, will block to Query_and_set_capture function ctx->conv->capture_plane.qBuffer(v4l2_buf, NULL);
I have been troubleshooting and have not found the reason for a long time. Please give me some advice
thanks a lot.
Here is part of the code
#include "NvApplicationProfiler.h"
#include "NvUtils.h"
#include <errno.h>
#include <fstream>
#include <iostream>
#include <linux/videodev2.h>
#include <malloc.h>
#include <pthread.h>
#include <string.h>
#include <unistd.h>
#include "NvVideoDecoder.h"
#include "NvVideoConverter.h"
#include "NvEglRenderer.h"
#include <queue>
#include <fstream>
#include <pthread.h>
#include <fcntl.h>
#include "pthread_mmapi_dec_app.h"
#include "suma_osa_thr.h"
#include "davinci_base.h"
#include "pthread_base.h"
#include "suma_trace_log.h"
#include "suma_api.h"
#include "suma_osa.h"
#define TEST_ERROR(cond, str, label) if(cond) { \
cerr << str << endl; \
goto label; }
#define CHUNK_SIZE 1000000
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
#define IS_NAL_UNIT_START(buffer_ptr) (!buffer_ptr[0] && !buffer_ptr[1] && \
!buffer_ptr[2] && (buffer_ptr[3] == 1))
#define IS_NAL_UNIT_START1(buffer_ptr) (!buffer_ptr[0] && !buffer_ptr[1] && \
(buffer_ptr[2] == 1))
/* report level and macro */
#define RPT_ERR (1) /* error, system error */
#define RPT_WRN (2) /* warning, maybe wrong, maybe OK */
#define RPT_INF (3) /* important information */
#define RPT_DBG (4) /* debug information */
#ifndef S_SPLINT_S /* FIXME */
#define RPTERR(fmt, ...) if(RPT_ERR <= rpt_lvl) fprintf(stderr, "%s: %s: %d: err: " fmt "\n", __FILE__, __func__, __LINE__, ##__VA_ARGS__)
#define RPTWRN(fmt, ...) if(RPT_WRN <= rpt_lvl) fprintf(stderr, "%s: %s: %d: wrn: " fmt "\n", __FILE__, __func__, __LINE__, ##__VA_ARGS__)
#define RPTINF(fmt, ...) if(RPT_INF <= rpt_lvl) fprintf(stderr, "%s: %s: %d: inf: " fmt "\n", __FILE__, __func__, __LINE__, ##__VA_ARGS__)
#define RPTDBG(fmt, ...) if(RPT_DBG <= rpt_lvl) fprintf(stderr, "%s: %s: %d: dbg: " fmt "\n", __FILE__, __func__, __LINE__, ##__VA_ARGS__)
static int rpt_lvl = RPT_WRN; /* report level: ERR, WRN, INF, DBG */
#else
#define RPTERR(fmt...)
#define RPTWRN(fmt...)
#define RPTINF(fmt...)
#define RPTDBG(fmt...)
#endif
#ifndef OFFSET
#define OFFSET(structure, member) ((int) &(((structure *) 0) -> member))
#endif
#define MMAPI_DEC_STACK_SIZE 10*1024*1024
#define MODULE_NAME "nv_mmapi_dec"
#define MMAPI_DEC_OUTPUT_PLANE_BUFFER_NUM 10
typedef struct
{
NvVideoDecoder *dec;
NvVideoConverter *conv;
uint32_t decoder_pixfmt;
NvEglRenderer *renderer;
bool disable_rendering;
bool fullscreen;
uint32_t window_height;
uint32_t window_width;
uint32_t window_x;
uint32_t window_y;
uint32_t out_pixfmt;
float fps;
bool disable_dpb;
bool input_nalu;
bool stats;
bool enable_metadata;
enum v4l2_skip_frames_type skip_frames;
std::queue < NvBuffer * > *conv_output_plane_buf_queue;
pthread_mutex_t queue_lock;
pthread_cond_t queue_cond;
pthread_t dec_capture_loop;
bool got_error;
bool got_eos;
int chn_id;
} nv_mmapi_dec_context_t;
using namespace std;
typedef struct
{
TASK_COMMON_MEMBERS
suma_ipc_handle ipc_in_es;
int channel;
}nv_mmapi_dec_obj;
params_def nv_mmapi_dec_dynamic_params_def[] = {
{OFFSET(struct nv_mmapi_dec_dynamic_params, ctrl), PT_VAR_INT | PT_MALLOC_FREE, sizeof(int), FUNC_CLOSE, FUNC_OPEN},
{OFFSET(struct nv_mmapi_dec_dynamic_params, decode_type), PT_VAR_INT| PT_MALLOC_FREE, sizeof(int), NV_MMAPI_DECODE_H265, NV_MMAPI_DECODE_H264},
{OFFSET(struct nv_mmapi_dec_dynamic_params, bitrate), PT_VAR_INT| READONLY, sizeof(int), 0, 10000},
{OFFSET(struct nv_mmapi_dec_dynamic_params, fps), PT_VAR_INT| READONLY, sizeof(int), 0, 10000},
{OFFSET(struct nv_mmapi_dec_dynamic_params, window_x), PT_VAR_INT| PT_MALLOC_FREE, sizeof(int), 0, 10000},
{OFFSET(struct nv_mmapi_dec_dynamic_params, window_y), PT_VAR_INT| PT_MALLOC_FREE, sizeof(int), 0, 10000},
{OFFSET(struct nv_mmapi_dec_dynamic_params, window_width), PT_VAR_INT| PT_MALLOC_FREE, sizeof(int), 0, 10000},
{OFFSET(struct nv_mmapi_dec_dynamic_params, window_height), PT_VAR_INT| PT_MALLOC_FREE, sizeof(int), 0, 10000},
{0, 0, 0, 0, 0}
};
const nv_mmapi_dec_dynamic_params glb_nv_mmapi_dec_dynamic_params_default =
{
FUNC_OPEN,
NV_MMAPI_DECODE_H265,
0,
0,
0,
0,
0,
0,
};
static void nv_mmapi_dec_pthread(nv_mmapi_dec_handle h);
static void
abort(nv_mmapi_dec_context_t *ctx)
{
ctx->got_error = true;
ctx->dec->abort();
if (ctx->conv)
{
ctx->conv->abort();
pthread_cond_broadcast(&ctx->queue_cond);
}
}
static bool
conv0_output_dqbuf_thread_callback(struct v4l2_buffer *v4l2_buf,
NvBuffer * buffer, NvBuffer * shared_buffer,
void *arg)
{
nv_mmapi_dec_context_t *ctx = (nv_mmapi_dec_context_t *) arg;
struct v4l2_buffer dec_capture_ret_buffer;
struct v4l2_plane planes[MAX_PLANES];
if (!v4l2_buf)
{
cerr << "Error while dequeueing conv output plane buffer" << endl;
abort(ctx);
return false;
}
if (v4l2_buf->m.planes[0].bytesused == 0)
{
return false;
}
memset(&dec_capture_ret_buffer, 0, sizeof(dec_capture_ret_buffer));
memset(planes, 0, sizeof(planes));
dec_capture_ret_buffer.index = shared_buffer->index;
dec_capture_ret_buffer.m.planes = planes;
pthread_mutex_lock(&ctx->queue_lock);
ctx->conv_output_plane_buf_queue->push(buffer);
// Return the buffer dequeued from converter output plane
// back to decoder capture plane
if (ctx->dec->capture_plane.qBuffer(dec_capture_ret_buffer, NULL) < 0)
{
abort(ctx);
return false;
}
pthread_cond_broadcast(&ctx->queue_cond);
pthread_mutex_unlock(&ctx->queue_lock);
return true;
}
static bool
conv0_capture_dqbuf_thread_callback(struct v4l2_buffer *v4l2_buf,
NvBuffer * buffer, NvBuffer * shared_buffer,
void *arg)
{
nv_mmapi_dec_context_t *ctx = (nv_mmapi_dec_context_t *) arg;
if (!v4l2_buf)
{
cerr << "Error while dequeueing conv capture plane buffer" << endl;
abort(ctx);
return false;
}
if (v4l2_buf->m.planes[0].bytesused == 0)
{
return false;
}
if (!ctx->stats && !ctx->disable_rendering)
{
ctx->renderer->render(buffer->planes[0].fd);
}
if (ctx->conv->capture_plane.qBuffer(*v4l2_buf, NULL) < 0)
{
return false;
}
return true;
}
static void
nv_mmapi_init_args(nv_mmapi_dec_context_t * ctx, nv_mmapi_dec_dynamic_params *params)
{
memset(ctx, 0, sizeof(nv_mmapi_dec_context_t));
ctx->fullscreen = false;
ctx->window_x = params->window_x;
ctx->window_y = params->window_y;
ctx->window_height = params->window_height;
ctx->window_width = params->window_width;
ctx->out_pixfmt = 1;
ctx->decoder_pixfmt = params->decode_type == NV_MMAPI_DECODE_H265 ? V4L2_PIX_FMT_H265 : V4L2_PIX_FMT_H264;
ctx->fps = 25.0;
ctx->got_eos = false;
ctx->got_error = false;
printf("decode ctrl %d, fmt %s, x %d, y %d, w %d, h %d, fps %f\n",
params->ctrl,
params->decode_type == NV_MMAPI_DECODE_H265 ? "H265" : "H264",
ctx->window_x,
ctx->window_y,
ctx->window_width,
ctx->window_height,
ctx->fps
);
ctx->conv_output_plane_buf_queue = new queue < NvBuffer * >;
pthread_mutex_init(&ctx->queue_lock, NULL);
pthread_cond_init(&ctx->queue_cond, NULL);
}
static void
read_decoder_input_nalu(NvBuffer * buffer,
uint8_t *nal_buffer, int nal_size)
{
// Length is the size of the buffer in bytes
char *buffer_ptr = (char *) buffer->planes[0].data;
// Length is the size of the buffer in bytes
int bytes_to_copy = MIN(CHUNK_SIZE, nal_size);
memcpy(buffer_ptr, nal_buffer, bytes_to_copy);
// It is necessary to set bytesused properly, so that decoder knows how
// many bytes in the buffer are valid
buffer->planes[0].bytesused = bytes_to_copy;
}
static int
sendEOStoConverter(nv_mmapi_dec_context_t *ctx)
{
printf("%s, %d\n",__func__,__LINE__);
// Check if converter is running
if (ctx->conv->output_plane.getStreamStatus())
{
printf("%s, %d\n",__func__,__LINE__);
NvBuffer *conv_buffer;
struct v4l2_buffer v4l2_buf;
struct v4l2_plane planes[MAX_PLANES];
memset(&v4l2_buf, 0, sizeof(v4l2_buf));
memset(&planes, 0, sizeof(planes));
v4l2_buf.m.planes = planes;
pthread_mutex_lock(&ctx->queue_lock);
while (ctx->conv_output_plane_buf_queue->empty())
{
pthread_cond_wait(&ctx->queue_cond, &ctx->queue_lock);
}
conv_buffer = ctx->conv_output_plane_buf_queue->front();
ctx->conv_output_plane_buf_queue->pop();
pthread_mutex_unlock(&ctx->queue_lock);
v4l2_buf.index = conv_buffer->index;
printf("%s, %d\n",__func__,__LINE__);
// Queue EOS buffer on converter output plane
return ctx->conv->output_plane.qBuffer(v4l2_buf, NULL);
}
return 0;
}
static void
query_and_set_capture(nv_mmapi_dec_context_t * ctx)
{
NvVideoDecoder *dec = ctx->dec;
struct v4l2_format format;
struct v4l2_crop crop;
int32_t min_dec_capture_buffers;
int ret = 0;
int error = 0;
uint32_t window_width;
uint32_t window_height;
char renderer_name[512];
// Get capture plane format from the decoder. This may change after
// an resolution change event
ret = dec->capture_plane.getFormat(format);
TEST_ERROR(ret < 0,
"Error: Could not get format from decoder capture plane", error);
// Get the display resolution from the decoder
ret = dec->capture_plane.getCrop(crop);
TEST_ERROR(ret < 0,
"Error: Could not get crop from decoder capture plane", error);
cout << "Video Resolution: " << crop.c.width << "x" << crop.c.height
<< endl;
// For file write, first deinitialize output and capture planes
// of video converter and then use the new resolution from
// decoder event resolution change
/*
if (ctx->conv)
{
ret = sendEOStoConverter(ctx);
TEST_ERROR(ret < 0,
"Error while queueing EOS buffer on converter output",
error);
printf("%s, %d\n",__func__,__LINE__);
ctx->conv->capture_plane.waitForDQThread(2000);
printf("%s, %d\n",__func__,__LINE__);
ctx->conv->output_plane.deinitPlane();
printf("%s, %d\n",__func__,__LINE__);
ctx->conv->capture_plane.deinitPlane();
printf("%s, %d\n",__func__,__LINE__);
while(!ctx->conv_output_plane_buf_queue->empty())
{
ctx->conv_output_plane_buf_queue->pop();
}
}
*/
printf("%s, %d\n",__func__,__LINE__);
if (!ctx->disable_rendering)
{
// Destroy the old instance of renderer as resolution might have changed
delete ctx->renderer;
if (ctx->fullscreen)
{
// Required for fullscreen
window_width = window_height = 0;
}
else if (ctx->window_width && ctx->window_height)
{
// As specified by user on commandline
window_width = ctx->window_width;
window_height = ctx->window_height;
}
else
{
// Resolution got from the decoder
window_width = crop.c.width;
window_height = crop.c.height;
}
//sprintf(renderer_name, "renderer%d", ctx->chn_id);
// If height or width are set to zero, EglRenderer creates a fullscreen
// window
ctx->renderer =
NvEglRenderer::createEglRenderer("renderer0", window_width,
window_height, ctx->window_x,
ctx->window_y);
TEST_ERROR(!ctx->renderer,
"Error in setting up renderer. "
"Check if X is running or run with --disable-rendering",
error);
ctx->renderer->setFPS(ctx->fps);
printf("set FPS %f\n", ctx->fps);
}
// deinitPlane unmaps the buffers and calls REQBUFS with count 0
dec->capture_plane.deinitPlane();
// Not necessary to call VIDIOC_S_FMT on decoder capture plane.
// But decoder setCapturePlaneFormat function updates the class variables
ret = dec->setCapturePlaneFormat(format.fmt.pix_mp.pixelformat,
format.fmt.pix_mp.width,
format.fmt.pix_mp.height);
TEST_ERROR(ret < 0, "Error in setting decoder capture plane format", error);
// Get the minimum buffers which have to be requested on the capture plane
ret = dec->getMinimumCapturePlaneBuffers(min_dec_capture_buffers);
TEST_ERROR(ret < 0,
"Error while getting value of minimum capture plane buffers",
error);
printf("%s, %d, min_dec_capture_buffers %d\n",__func__,__LINE__, min_dec_capture_buffers);
// Request (min + 5) buffers, export and map buffers
ret =
dec->capture_plane.setupPlane(V4L2_MEMORY_MMAP,
min_dec_capture_buffers + 5, false,
false);
TEST_ERROR(ret < 0, "Error in decoder capture plane setup", error);
printf("%s, %d, dec cap plane buffs %d\n",__func__,__LINE__, min_dec_capture_buffers + 5);
if (ctx->conv)
{
printf("%s, %d\n",__func__,__LINE__);
ret = ctx->conv->setOutputPlaneFormat(format.fmt.pix_mp.pixelformat,
format.fmt.pix_mp.width,
format.fmt.pix_mp.height,
V4L2_NV_BUFFER_LAYOUT_BLOCKLINEAR);
TEST_ERROR(ret < 0, "Error in converter output plane set format",
error);
printf("%s, %d\n",__func__,__LINE__);
ret = ctx->conv->setCapturePlaneFormat((ctx->out_pixfmt == 1 ?
V4L2_PIX_FMT_NV12M :
V4L2_PIX_FMT_YUV420M),
crop.c.width,
crop.c.height,
V4L2_NV_BUFFER_LAYOUT_PITCH);
TEST_ERROR(ret < 0, "Error in converter capture plane set format",
error);
printf("%s, %d\n",__func__,__LINE__);
ret = ctx->conv->setCropRect(0, 0, crop.c.width, crop.c.height);
TEST_ERROR(ret < 0, "Error while setting crop rect", error);
printf("%s, %d\n",__func__,__LINE__);
ret =
ctx->conv->output_plane.setupPlane(V4L2_MEMORY_DMABUF,
dec->capture_plane.
getNumBuffers(), false, false);
TEST_ERROR(ret < 0, "Error in converter output plane setup", error);
printf("%s, %d, conv out bufs %d\n",__func__,__LINE__, dec->capture_plane.getNumBuffers());
ret =
ctx->conv->capture_plane.setupPlane(V4L2_MEMORY_MMAP,
dec->capture_plane.
getNumBuffers(), true, false);
TEST_ERROR(ret < 0, "Error in converter capture plane setup", error);
printf("%s, %d, conv cap bufs %d\n",__func__,__LINE__, dec->capture_plane.getNumBuffers());
ret = ctx->conv->output_plane.setStreamStatus(true);
TEST_ERROR(ret < 0, "Error in converter output plane streamon", error);
ret = ctx->conv->capture_plane.setStreamStatus(true);
TEST_ERROR(ret < 0, "Error in converter output plane streamoff", error);
printf("%s, %d\n",__func__,__LINE__);
// Add all empty conv output plane buffers to conv_output_plane_buf_queue
for (uint32_t i = 0; i < ctx->conv->output_plane.getNumBuffers(); i++)
{
ctx->conv_output_plane_buf_queue->push(ctx->conv->output_plane.getNthBuffer(i));
}
printf("%s, %d\n",__func__,__LINE__);
printf("conv cap buffers %d\n", ctx->conv->capture_plane.getNumBuffers());
for (uint32_t i = 0; i < ctx->conv->capture_plane.getNumBuffers(); i++)
{
struct v4l2_buffer v4l2_buf;
struct v4l2_plane planes[MAX_PLANES];
memset(&v4l2_buf, 0, sizeof(v4l2_buf));
memset(planes, 0, sizeof(planes));
v4l2_buf.index = i;
v4l2_buf.m.planes = planes;
printf("%s, %d i %d\n",__func__,__LINE__, i);
ret = ctx->conv->capture_plane.qBuffer(v4l2_buf, NULL);
TEST_ERROR(ret < 0, "Error Qing buffer at converter capture plane",
error);
}
printf("%s, %d\n",__func__,__LINE__);
ctx->conv->output_plane.startDQThread(ctx);
printf("%s, %d\n",__func__,__LINE__);
ctx->conv->capture_plane.startDQThread(ctx);
printf("%s, %d\n",__func__,__LINE__);
}
printf("%s, %d\n",__func__,__LINE__);
// Capture plane STREAMON
ret = dec->capture_plane.setStreamStatus(true);
TEST_ERROR(ret < 0, "Error in decoder capture plane streamon", error);
printf("%s, %d\n",__func__,__LINE__);
// Enqueue all the empty capture plane buffers
for (uint32_t i = 0; i < dec->capture_plane.getNumBuffers(); i++)
{
struct v4l2_buffer v4l2_buf;
struct v4l2_plane planes[MAX_PLANES];
memset(&v4l2_buf, 0, sizeof(v4l2_buf));
memset(planes, 0, sizeof(planes));
v4l2_buf.index = i;
v4l2_buf.m.planes = planes;
ret = dec->capture_plane.qBuffer(v4l2_buf, NULL);
TEST_ERROR(ret < 0, "Error Qing buffer at output plane", error);
}
cout << "Query and set capture successful" << endl;
return;
printf("%s, %d\n",__func__,__LINE__);
error:
if (error)
{
abort(ctx);
cerr << "Error in " << __func__ << endl;
}
}
static void *
dec_capture_loop_fcn(void *arg)
{
nv_mmapi_dec_context_t *ctx = (nv_mmapi_dec_context_t *) arg;
NvVideoDecoder *dec = ctx->dec;
struct v4l2_event ev;
int ret;
uint32_t timer_now, timer_last;
cout << "Starting decoder capture loop thread" << endl;
// Need to wait for the first Resolution change event, so that
// the decoder knows the stream resolution and can allocate appropriate
// buffers when we call REQBUFS
do
{
if (ctx->got_eos)
{
RPTWRN("exit waiting event loop");
break;
}
ret = dec->dqEvent(ev, 2000);
if (ret < 0)
{
if (errno == EAGAIN)
{
cerr <<
"Timed out waiting for first V4L2_EVENT_RESOLUTION_CHANGE"
<< endl;
continue;
}
else
{
cerr << "Error in dequeueing decoder event" << endl;
}
abort(ctx);
break;
}
}
while (ev.type != V4L2_EVENT_RESOLUTION_CHANGE);
// query_and_set_capture acts on the resolution change event
if (!ctx->got_error)
query_and_set_capture(ctx);
// Exit on error or EOS which is signalled in main()
while (!(ctx->got_error || dec->isInError() || ctx->got_eos))
{
NvBuffer *dec_buffer;
// Check for Resolution change again
ret = dec->dqEvent(ev, false);
if (ret == 0)
{
switch (ev.type)
{
case V4L2_EVENT_RESOLUTION_CHANGE:
query_and_set_capture(ctx);
continue;
}
}
while ((dec->capture_plane.getNumQueuedBuffers() > 0) && !ctx->got_eos)
{
struct v4l2_buffer v4l2_buf;
struct v4l2_plane planes[MAX_PLANES];
memset(&v4l2_buf, 0, sizeof(v4l2_buf));
memset(planes, 0, sizeof(planes));
v4l2_buf.m.planes = planes;
// Dequeue a filled buffer
ret = dec->capture_plane.dqBuffer(v4l2_buf, &dec_buffer, NULL, 0);
if (ret)
{
if (errno == EAGAIN)
{
usleep(1000);
}
else
{
abort(ctx);
cerr << "Error while calling dequeue at capture plane" <<
endl;
}
break;
}
#if 0
// EglRenderer requires the fd of the 0th plane to render the buffer
ctx->renderer->render(dec_buffer->planes[0].fd);
timer_now = suma_getCurTimeInMsec();
RPTDBG("render time delta %u\n",timer_now - timer_last);
timer_last = timer_now;
// Not writing to file
// Queue the buffer back once it has been used.
if (dec->capture_plane.qBuffer(v4l2_buf, NULL) < 0)
{
abort(ctx);
cerr <<
"Error while queueing buffer at decoder capture plane"
<< endl;
break;
}
#else
NvBuffer *conv_buffer;
struct v4l2_buffer conv_output_buffer;
struct v4l2_plane conv_planes[MAX_PLANES];
memset(&conv_output_buffer, 0, sizeof(conv_output_buffer));
memset(conv_planes, 0, sizeof(conv_planes));
conv_output_buffer.m.planes = conv_planes;
// Get an empty conv output plane buffer from conv_output_plane_buf_queue
pthread_mutex_lock(&ctx->queue_lock);
while (ctx->conv_output_plane_buf_queue->empty())
{
pthread_cond_wait(&ctx->queue_cond, &ctx->queue_lock);
}
conv_buffer = ctx->conv_output_plane_buf_queue->front();
ctx->conv_output_plane_buf_queue->pop();
pthread_mutex_unlock(&ctx->queue_lock);
conv_output_buffer.index = conv_buffer->index;
if (ctx->conv->output_plane.
qBuffer(conv_output_buffer, dec_buffer) < 0)
{
abort(ctx);
cerr <<
"Error while queueing buffer at converter output plane"
<< endl;
break;
}
#endif
}
}
// Send EOS to converter
if (ctx->conv)
{
if (sendEOStoConverter(ctx) < 0)
{
cerr << "Error while queueing EOS buffer on converter output"
<< endl;
}
}
cout << "Exiting decoder capture loop thread" << endl;
return NULL;
}
nv_mmapi_dec_handle
nv_mmapi_dec_create(nv_mmapi_dec_static_params *static_params, nv_mmapi_dec_dynamic_params *dynamic_params)
{
nv_mmapi_dec_obj *obj = NULL;
nv_mmapi_dec_dynamic_params *params = NULL;
obj = (nv_mmapi_dec_obj *)pthread_base_create(MODULE_NAME, sizeof(*obj));
if(NULL == obj || NULL == static_params)
{
RPTERR(" creat NULL pointer");
return NULL;
}
/*static params init*/
obj->ipc_in_es = static_params->ipc_in_es;
obj->channel= static_params->channel;
//dynamic param table init
obj->tab = nv_mmapi_dec_dynamic_params_def;
obj->params_nums = sizeof(nv_mmapi_dec_dynamic_params_def) /(sizeof(params_def)) - 1 ;
params = (nv_mmapi_dec_dynamic_params *)calloc(1,sizeof(*params));
if(NULL == params)
{
RPTERR("params create NULL pointer");
pthread_base_delete(obj);
return NULL;
}
if(dynamic_params == NULL)
{
memcpy(params,&glb_nv_mmapi_dec_dynamic_params_default,sizeof(nv_mmapi_dec_dynamic_params));
}
else
{
memcpy(params,dynamic_params,sizeof(nv_mmapi_dec_dynamic_params));
}
obj->params = params;
obj->thread_func = (SUMA_ThrEntryFunc)nv_mmapi_dec_pthread;
obj->stack_size = MMAPI_DEC_STACK_SIZE;
return (nv_mmapi_dec_handle)obj;
}
static void nv_mmapi_dec_pthread(nv_mmapi_dec_handle h)
{
nv_mmapi_dec_obj *handle = (nv_mmapi_dec_obj *)h;
nv_mmapi_dec_dynamic_params *params = (nv_mmapi_dec_dynamic_params *)handle->params;
nv_mmapi_dec_context_t ctx;
char decname[512];
char convname[512];
int ret = 0;
uint32_t frame_cnt;
log_level = LOG_LEVEL_DEBUG;
suma_ipc_handle ipc_in_es;
heap_buf_handle heap_buf = NULL;
int heap_buf_size = 0;
uint8_t * heap_buf_ptr = NULL;
ipc_in_es = handle->ipc_in_es;
handle->exit_done_flg = FALSE;
handle->exit_ctl = FALSE;
while(!handle->exit_ctl )
{
handle->start_stop_rst = DEF_REMAIN;
RPTWRN("enter start_stop_rst");
while(!handle->start_stop_rst)
{
//start
//init sources,
nv_mmapi_init_args(&ctx, params);
ctx.chn_id = handle->channel;
frame_cnt = 0;
handle->malloc_free_rst = DEF_REMAIN;
RPTWRN("enter malloc_free_rst");
while(!handle->malloc_free_rst)
{
//malloc
//create dec,sub thread
// Create a decoder
sprintf(decname, "dec%d", handle->channel);
ctx.dec = NvVideoDecoder::createVideoDecoder(decname, NULL);//, O_NONBLOCK);
TEST_ERROR(!ctx.dec, "Could not create decoder", cleanup);
// Subscribe to Resolution change event
ret = ctx.dec->subscribeEvent(V4L2_EVENT_RESOLUTION_CHANGE, 0, 0);
TEST_ERROR(ret < 0, "Could not subscribe to V4L2_EVENT_RESOLUTION_CHANGE", cleanup);
// Set format on the output plane
ret = ctx.dec->setOutputPlaneFormat(ctx.decoder_pixfmt, CHUNK_SIZE);
TEST_ERROR(ret < 0, "Could not set output plane format", cleanup);
// V4L2_CID_MPEG_VIDEO_DISABLE_DPB should be set after output plane
// set format
ret = ctx.dec->disableDPB();
TEST_ERROR(ret < 0, "Error in decoder disableDPB", cleanup);
// Query, Export and Map the output plane buffers so that we can read
// encoded data into the buffers
ret = ctx.dec->output_plane.setupPlane(V4L2_MEMORY_MMAP, MMAPI_DEC_OUTPUT_PLANE_BUFFER_NUM, true, false);
TEST_ERROR(ret < 0, "Error while setting up output plane", cleanup);
// Create converter to convert from BL to PL for writing raw video
// to file
sprintf(convname, "conv%d", handle->channel);
ctx.conv = NvVideoConverter::createVideoConverter(convname);
TEST_ERROR(!ctx.conv, "Could not create video converter", cleanup);
ctx.conv->output_plane.
setDQThreadCallback(conv0_output_dqbuf_thread_callback);
ctx.conv->capture_plane.
setDQThreadCallback(conv0_capture_dqbuf_thread_callback);
//Set output plane stream ON
ret = ctx.dec->output_plane.setStreamStatus(true);
TEST_ERROR(ret < 0, "Error in output plane stream on", cleanup);
//create a render task thread
pthread_attr_t attr;
struct sched_param param;
pthread_attr_init(&attr);
pthread_attr_setschedpolicy(&attr, SCHED_FIFO);
pthread_attr_getschedparam(&attr, ¶m);
param.sched_priority = 90;
pthread_attr_setschedparam(&attr, ¶m);
pthread_create(&ctx.dec_capture_loop, &attr, dec_capture_loop_fcn, &ctx);
if (handle->ipc_in_es)
suma_ipc_flush(handle->ipc_in_es);
struct v4l2_buffer v4l2_buf;
struct v4l2_plane planes[MAX_PLANES];
NvBuffer *buffer;
handle->real_time_rst = DEF_REMAIN;
RPTWRN("enter real_time_rst");
while(!handle->real_time_rst)
{
/*
if(params->ctrl == FUNC_CLOSE)
{
suma_ipc_flush(handle->ipc_in_es);
suma_mssleep(50);
continue;
}
*/
//mmapi dec process
//send es data to dec
if(0 < suma_ipc_get_nums(ipc_in_es))
{
suma_ipc_get(ipc_in_es, &heap_buf);
heap_buf_size = heap_buf_get_usedsize((heap_buf_handle)heap_buf);
heap_buf_ptr = (uint8_t *)heap_buf_get_useptr((heap_buf_handle)heap_buf);
memset(&v4l2_buf, 0, sizeof(v4l2_buf));
memset(planes, 0, sizeof(planes));
v4l2_buf.m.planes = planes;
if(frame_cnt < ctx.dec->output_plane.getNumBuffers())
{
buffer = ctx.dec->output_plane.getNthBuffer(frame_cnt);
v4l2_buf.index = frame_cnt;
frame_cnt++;
}
else
{
ret = ctx.dec->output_plane.dqBuffer(v4l2_buf, &buffer, NULL, -1);
if (ret < 0)
{
cerr << "Error DQing buffer at output plane" << endl;
abort(&ctx);
break;
}
}
//copy es data to buffer
read_decoder_input_nalu(buffer, heap_buf_ptr, heap_buf_size);
v4l2_buf.m.planes[0].bytesused = buffer->planes[0].bytesused;
ret = ctx.dec->output_plane.qBuffer(v4l2_buf, NULL);
if (ret < 0)
{
cerr << "Error Qing buffer at output plane" << endl;
abort(&ctx);
break;
}
suma_ipc_release(ipc_in_es, heap_buf);
}
else
{
suma_mssleep(10);
}
}
RPTWRN("<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< chn[%d] quit real_time_rst", handle->channel);
if (ctx.renderer)
{
ctx.renderer->setFPS(100.0);
suma_mssleep(500);
}
//exit realtime
ctx.dec->output_plane.setStreamStatus(false);
RPTWRN("set dec->output_plane stream off");
ctx.dec->capture_plane.setStreamStatus(false);
RPTWRN("set dec->capture_plane stream off");
//ctx.conv->output_plane.setStreamStatus(false);
//RPTWRN("set conv->output_plane stream off");
//ctx.conv->capture_plane.setStreamStatus(false);
//RPTWRN("set conv->capture_plane stream off");
// Signal EOS to the decoder capture loop
ctx.got_eos = true;
suma_mssleep(100);
RPTWRN("Signal EOS to the decoder capture loop");
// After sending EOS, all the buffers from output plane should be dequeued.
// and after that capture plane loop should be signalled to stop.
while (ctx.dec->output_plane.getNumQueuedBuffers() > 0 &&
!ctx.got_error && !ctx.dec->isInError())
{
struct v4l2_buffer v4l2_buf;
struct v4l2_plane planes[MAX_PLANES];
memset(&v4l2_buf, 0, sizeof(v4l2_buf));
memset(planes, 0, sizeof(planes));
v4l2_buf.m.planes = planes;
ret = ctx.dec->output_plane.dqBuffer(v4l2_buf, NULL, NULL, -1);
if (ret < 0)
{
cerr << "Error DQing buffer at output plane" << endl;
abort(&ctx);
break;
}
}
RPTWRN("all the buffers from output plane be dequeued");
if (ctx.conv)
{
ctx.conv->capture_plane.waitForDQThread(2000);
}
}
//exit malloc free
//delete dec and renderer
cleanup:
RPTWRN("before pthread_join dec_capture_loop");
if (ctx.dec_capture_loop)
{
suma_mssleep(100);
pthread_join(ctx.dec_capture_loop, NULL);
}
if (ctx.dec && ctx.dec->isInError())
{
cerr << "Decoder is in error" << endl;
}
if (ctx.got_error)
{
}
RPTWRN("decoder destructor cleanup");
// The decoder destructor does all the cleanup i.e set streamoff on output and capture planes,
// unmap buffers, tell decoder to deallocate buffer (reqbufs ioctl with counnt = 0),
// and finally call v4l2_close on the fd.
delete ctx.dec;
RPTWRN("decoder all cleanup done");
delete ctx.conv;
RPTWRN("converter all cleanup done");
// Similarly, EglRenderer destructor does all the cleanup
delete ctx.renderer;
delete ctx.conv_output_plane_buf_queue;
RPTWRN("ch[%d] dec & renderer cleanup done >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ", handle->channel);
//suma_mssleep(1000);
}
//exit start stop
}
RPTWRN("mmapi_dec_pthread is exit");
handle->exit_done_flg = TRUE;
return;
}
The following is the printed information
pthread_mmapi_dec_app.cpp: nv_mmapi_dec_pthread: 919: wrn: <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< chn[0] quit real_time_rst
[LOG_LEVEL_DEBUG] (NvEglRenderer.cpp:267) <renderer0> :Rendered fd=1184
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:258) <conv0> :Capture Plane:Qed buffer 7
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:152) <conv0> :Capture Plane:DQed buffer 8
[LOG_LEVEL_DEBUG] (NvEglRenderer.cpp:364) <renderer0> :Rendering fd=1185
[LOG_LEVEL_DEBUG] (NvEglRenderer.cpp:267) <renderer0> :Rendered fd=1185
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:258) <conv0> :Capture Plane:Qed buffer 8
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:152) <conv0> :Capture Plane:DQed buffer 0
[LOG_LEVEL_DEBUG] (NvEglRenderer.cpp:364) <renderer0> :Rendering fd=1177
[LOG_LEVEL_DEBUG] (NvEglRenderer.cpp:267) <renderer0> :Rendered fd=1177
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:258) <conv0> :Capture Plane:Qed buffer 0
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:152) <dec0> :Capture Plane:DQed buffer 0
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:468) [LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:258) <conv0> :Output Plane:Qed buffer 1
[LOG_LEVEL_ERROR] (NvV4l2ElementPlane.cpp:167) <<dec0> :Output Plane:STREAMOFF successful
dec0> Capture Plane:Error while DQing buffer: pthread_mmapi_dec_app.cpp: nv_mmapi_dec_pthread: 928: wrn: set dec->output_plane stream off
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:468) <dec0> :Capture Plane:STREAMOFF successfulResource temporarily unavailable
pthread_mmapi_dec_app.cpp: nv_mmapi_dec_pthread: 930: wrn: set dec->capture_plane stream off
sendEOStoConverter, 284
sendEOStoConverter, 289
sendEOStoConverter, 308
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:258) <conv0> :Output Plane:Qed buffer 2
Exiting decoder capture loop thread
[LOG_LEVEL_ERROR] (NvV4l2Element.cpp:106) <dec1> Error while DQing event: [LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:152) <Resource temporarily unavailable[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:152) conv0> :Capture Plane:DQed buffer 1
<conv0> :Output Plane:DQed buffer 1
[LOG_LEVEL_DEBUG] (NvEglRenderer.cpp:364) <renderer0> :Rendering fd=[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:258) <dec0> :Capture Plane:
1178
Timed out waiting for first V4L2_EVENT_RESOLUTION_CHANGE
Qed buffer 0
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:152) <conv0> :Output Plane:DQed buffer 2
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:764) <conv0> :Output Plane:Exiting DQthread
[LOG_LEVEL_DEBUG] (NvEglRenderer.cpp:267) <renderer0> :Rendered fd=1178
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:258) <conv0> :Capture Plane:Qed buffer 1
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:152) <conv0> :Capture Plane:DQed buffer 2
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:764) <conv0> :Capture Plane:Exiting DQthread
pthread_mmapi_dec_app.cpp: nv_mmapi_dec_pthread: 939: wrn: Signal EOS to the decoder capture loop
pthread_mmapi_dec_app.cpp: nv_mmapi_dec_pthread: 961: wrn: all the buffers from output plane be dequeued
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:832) <conv0> :Capture Plane:Stopped DQ Thread
pthread_mmapi_dec_app.cpp: nv_mmapi_dec_pthread: 973: wrn: before pthread_join dec_capture_loop
pthread_mmapi_dec_app.cpp: nv_mmapi_dec_pthread: 989: wrn: decoder destructor cleanup
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:447) <dec0> :Output Plane:Already in STREAMOFF
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:832) <dec0> :Output Plane:Stopped DQ Thread
[LOG_LEVEL_DEBUG] (NvBuffer.cpp:201) <Buffer> Buffer 0 unmapped
[LOG_LEVEL_DEBUG] (NvBuffer.cpp:201) <Buffer> Buffer 1 unmapped
[LOG_LEVEL_DEBUG] (NvBuffer.cpp:201) <Buffer> Buffer 2 unmapped
[LOG_LEVEL_DEBUG] (NvBuffer.cpp:201) <Buffer> Buffer 3 unmapped
[LOG_LEVEL_DEBUG] (NvBuffer.cpp:201) <Buffer> Buffer 4 unmapped
[LOG_LEVEL_DEBUG] (NvBuffer.cpp:201) <Buffer> Buffer 5 unmapped
[LOG_LEVEL_DEBUG] (NvBuffer.cpp:201) <Buffer> Buffer 6 unmapped
[LOG_LEVEL_DEBUG] (NvBuffer.cpp:201) <Buffer> Buffer 7 unmapped
[LOG_LEVEL_DEBUG] (NvBuffer.cpp:201) <Buffer> Buffer 8 unmapped
[LOG_LEVEL_DEBUG] (NvBuffer.cpp:201) <Buffer> Buffer 9 unmapped
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:434) <dec0> :Output Plane:Reqbuf returned 0 buffers
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:373) <dec0> :Output Plane:deinit successful
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:447) <dec0> :Capture Plane:Already in STREAMOFF
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:832) <dec0> :Capture Plane:Stopped DQ Thread
[LOG_LEVEL_WARN] (NvBuffer.cpp:188) <Buffer> Cannot Unmap Buffer 0. Only mapped MMAP buffer can be unmapped
[LOG_LEVEL_WARN] (NvBuffer.cpp:188) <Buffer> Cannot Unmap Buffer 1. Only mapped MMAP buffer can be unmapped
[LOG_LEVEL_WARN] (NvBuffer.cpp:188) <Buffer> Cannot Unmap Buffer 2. Only mapped MMAP buffer can be unmapped
[LOG_LEVEL_WARN] (NvBuffer.cpp:188) <Buffer> Cannot Unmap Buffer 3. Only mapped MMAP buffer can be unmapped
[LOG_LEVEL_WARN] (NvBuffer.cpp:188) <Buffer> Cannot Unmap Buffer 4. Only mapped MMAP buffer can be unmapped
[LOG_LEVEL_WARN] (NvBuffer.cpp:188) <Buffer> Cannot Unmap Buffer 5. Only mapped MMAP buffer can be unmapped
[LOG_LEVEL_WARN] (NvBuffer.cpp:188) <Buffer> Cannot Unmap Buffer 6. Only mapped MMAP buffer can be unmapped
[LOG_LEVEL_WARN] (NvBuffer.cpp:188) <Buffer> Cannot Unmap Buffer 7. Only mapped MMAP buffer can be unmapped
[LOG_LEVEL_WARN] (NvBuffer.cpp:188) <Buffer> Cannot Unmap Buffer 8. Only mapped MMAP buffer can be unmapped
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:434) <dec0> :Capture Plane:Reqbuf returned 0 buffers
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:373) <dec0> :Capture Plane:deinit successful
TVMR: TVMRFrameStatusReporting: 6067: Closing TVMR Frame Status Thread -------------
TVMR: TVMRVPRFloorSizeSettingThread: 5885: Closing TVMRVPRFloorSizeSettingThread -------------
TVMR: TVMRFrameDelivery: 5917: Closing TVMR Frame Delivery Thread -------------
TVMR: NvMMLiteTVMRDecBlockClose: 7740: Done
[LOG_LEVEL_DEBUG] (NvV4l2Element.cpp:87) <V4l2Element> Device closed, fd = 158
pthread_mmapi_dec_app.cpp: nv_mmapi_dec_pthread: 994: wrn: decoder all cleanup done
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:468) <conv0> :Output Plane:STREAMOFF successful
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:832) <conv0> :Output Plane:Stopped DQ Thread
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:434) <conv0> :Output Plane:Reqbuf returned 0 buffers
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:373) <conv0> :Output Plane:deinit successful
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:468) <conv0> :Capture Plane:STREAMOFF successful
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:832) <conv0> :Capture Plane:Stopped DQ Thread
[LOG_LEVEL_DEBUG] (NvBuffer.cpp:201) <Buffer> Buffer 0 unmapped
[LOG_LEVEL_DEBUG] (NvBuffer.cpp:201) <Buffer> Buffer 1 unmapped
[LOG_LEVEL_DEBUG] (NvBuffer.cpp:201) <Buffer> Buffer 2 unmapped
[LOG_LEVEL_DEBUG] (NvBuffer.cpp:201) <Buffer> Buffer 3 unmapped
[LOG_LEVEL_DEBUG] (NvBuffer.cpp:201) <Buffer> Buffer 4 unmapped
[LOG_LEVEL_DEBUG] (NvBuffer.cpp:201) <Buffer> Buffer 5 unmapped
[LOG_LEVEL_DEBUG] (NvBuffer.cpp:201) <Buffer> Buffer 6 unmapped
[LOG_LEVEL_DEBUG] (NvBuffer.cpp:201) <Buffer> Buffer 7 unmapped
[LOG_LEVEL_DEBUG] (NvBuffer.cpp:201) <Buffer> Buffer 8 unmapped
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:434) <conv0> :Capture Plane:Reqbuf returned 0 buffers
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:373) <conv0> :Capture Plane:deinit successful
[LOG_LEVEL_DEBUG] (NvV4l2Element.cpp:87) <V4l2Element> Device closed, fd = 166
pthread_mmapi_dec_app.cpp: nv_mmapi_dec_pthread: 997: wrn: converter all cleanup done
[LOG_LEVEL_DEBUG] (NvEglRenderer.cpp:273) <renderer0> :Stopped render thread
pthread_mmapi_dec_app.cpp: nv_mmapi_dec_pthread: 1003: wrn: ch[0] dec & renderer cleanup done >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
decode ctrl 0, fmt H265, x 0, y 0, w 960, h 540, fps 25.000000
pthread_mmapi_dec_app.cpp: nv_mmapi_dec_pthread: 786: wrn: enter malloc_free_rst
Failed to query video capabilities: Bad address
[LOG_LEVEL_DEBUG] (NvV4l2Element.cpp:62) <dec0> :Opened, fd = 158
[LOG_LEVEL_DEBUG] (NvV4l2Element.cpp:215) <dec0> :Successfully subscribed to event 5
NvMMLiteOpen : Block : BlockType = 279
TVMR: NvMMLiteTVMRDecBlockOpen: 7580: NvMMLiteBlockOpen
NvMMLiteBlockCreate : Block : BlockType = 279
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:291) <dec0> :Output Plane:VIDIOC_S_FMT at capture plane successful
[LOG_LEVEL_DEBUG] (NvV4l2Element.cpp:177) <dec0> :Set controls
[LOG_LEVEL_DEBUG] (NvVideoDecoder.cpp:161) <dec0> :Disabling decoder DPB: success
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:434) <dec0> :Output Plane:Reqbuf returned 10 buffers
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:543) <dec0> :Output Plane:QueryBuf for 0th buffer successful
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:581) <dec0> :Output Plane:ExportBuf successful for Buffer 0, Plane 0, fd = 1028
[LOG_LEVEL_DEBUG] (NvBuffer.cpp:175) <Buffer> Mapped buffer 0, plane 0 to
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:543) <dec0> :Output Plane:QueryBuf for 1th buffer successful
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:581) <dec0> :Output Plane:ExportBuf successful for Buffer 1, Plane 0, fd = 1030
[LOG_LEVEL_DEBUG] (NvBuffer.cpp:175) <Buffer> Mapped buffer 1, plane 0 to
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:543) <dec0> :Output Plane:QueryBuf for 2th buffer successful
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:581) <dec0> :Output Plane:ExportBuf successful for Buffer 2, Plane 0, fd = 1033
[LOG_LEVEL_DEBUG] (NvBuffer.cpp:175) <Buffer> Mapped buffer 2, plane 0 to
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:543) <dec0> :Output Plane:QueryBuf for 3th buffer successful
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:581) <dec0> :Output Plane:ExportBuf successful for Buffer 3, Plane 0, fd = 1035
[LOG_LEVEL_DEBUG] (NvBuffer.cpp:175) <Buffer> Mapped buffer 3, plane 0 to
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:543) <dec0> :Output Plane:QueryBuf for 4th buffer successful
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:581) <dec0> :Output Plane:ExportBuf successful for Buffer 4, Plane 0, fd = 1037
[LOG_LEVEL_DEBUG] (NvBuffer.cpp:175) <Buffer> Mapped buffer 4, plane 0 to
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:543) <dec0> :Output Plane:QueryBuf for 5th buffer successful
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:581) <dec0> :Output Plane:ExportBuf successful for Buffer 5, Plane 0, fd = 1039
[LOG_LEVEL_DEBUG] (NvBuffer.cpp:175) <Buffer> Mapped buffer 5, plane 0 to
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:543) <dec0> :Output Plane:QueryBuf for 6th buffer successful
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:581) <dec0> :Output Plane:ExportBuf successful for Buffer 6, Plane 0, fd = 1040
[LOG_LEVEL_DEBUG] (NvBuffer.cpp:175) <Buffer> Mapped buffer 6, plane 0 to
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:543) <dec0> :Output Plane:QueryBuf for 7th buffer successful
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:581) <dec0> :Output Plane:ExportBuf successful for Buffer 7, Plane 0, fd = 1041
[LOG_LEVEL_DEBUG] (NvBuffer.cpp:175) <Buffer> Mapped buffer 7, plane 0 to
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:543) <dec0> :Output Plane:QueryBuf for 8th buffer successful
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:581) <dec0> :Output Plane:ExportBuf successful for Buffer 8, Plane 0, fd = 1042
[LOG_LEVEL_DEBUG] (NvBuffer.cpp:175) <Buffer> Mapped buffer 8, plane 0 to
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:543) <dec0> :Output Plane:QueryBuf for 9th buffer successful
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:581) <dec0> :Output Plane:ExportBuf successful for Buffer 9, Plane 0, fd = 1043
[LOG_LEVEL_DEBUG] (NvBuffer.cpp:175) <Buffer> Mapped buffer 9, plane 0 to
Failed to query video capabilities: Bad address
[LOG_LEVEL_DEBUG] (NvV4l2Element.cpp:62) <conv0> :Opened, fd = 166
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:468) <dec0> :Output Plane:STREAMON successful
Starting decoder capture loop thread
pthread_mmapi_dec_app.cpp: nv_mmapi_dec_pthread: 854: wrn: enter real_time_rst
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:258) <dec0> :Output Plane:Qed buffer 0
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:258) <dec0> :Output Plane:Qed buffer 1
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:258) <dec0> :Output Plane:Qed buffer 2
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:258) <dec0> :Output Plane:Qed buffer 3
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:258) <dec0> :Output Plane:Qed buffer 4
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:258) <dec0> :Output Plane:Qed buffer 5
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:258) <dec0> :Output Plane:Qed buffer 6
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:258) <dec0> :Output Plane:Qed buffer 7
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:258) <dec0> :Output Plane:Qed buffer 8
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:258) <dec0> :Output Plane:Qed buffer 9
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:152) <dec0> :Output Plane:DQed buffer 0
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:258) <dec0> :Output Plane:Qed buffer 0
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:152) <dec0> :Output Plane:DQed buffer 1
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:258) <dec0> :Output Plane:Qed buffer 1
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:152) <dec0> :Output Plane:DQed buffer 2
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:258) <dec0> :Output Plane:Qed buffer 2
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:152) <dec0> :Output Plane:DQed buffer 3
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:258) <dec0> :Output Plane:Qed buffer 3
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:152) <dec0> :Output Plane:DQed buffer 4
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:258) <dec0> :Output Plane:Qed buffer 4
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:152) <dec0> :Output Plane:DQed buffer 5
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:258) <dec0> :Output Plane:Qed buffer 5
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:152) <dec0> :Output Plane:DQed buffer 6
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:258) <dec0> :Output Plane:Qed buffer 6
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:152) <dec0> :Output Plane:DQed buffer 7
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:258) <dec0> :Output Plane:Qed buffer 7
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:152) <dec0> :Output Plane:DQed buffer 8
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:258) <dec0> :Output Plane:Qed buffer 8
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:152) <dec0> :Output Plane:DQed buffer 9
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:258) <dec0> :Output Plane:Qed buffer 9
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:152) <dec0> :Output Plane:DQed buffer 0
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:258) <dec0> :Output Plane:Qed buffer 0
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:152) <dec0> :Output Plane:DQed buffer 1
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:258) <dec0> :Output Plane:Qed buffer 1
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:152) <dec0> :Output Plane:DQed buffer 2
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:258) <dec0> :Output Plane:Qed buffer 2
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:152) <dec0> :Output Plane:DQed buffer 3
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:258) <dec0> :Output Plane:Qed buffer 3
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:152) <dec0> :Output Plane:DQed buffer 4
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:258) <dec0> :Output Plane:Qed buffer 4
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:152) <dec0> :Output Plane:DQed buffer 5
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:258) <dec0> :Output Plane:Qed buffer 5
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:152) <dec0> :Output Plane:DQed buffer 6
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:258) <dec0> :Output Plane:Qed buffer 6
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:152) <dec0> :Output Plane:DQed buffer 7
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:258) <dec0> :Output Plane:Qed buffer 7
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:152) <dec0> :Output Plane:DQed buffer 8
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:258) <dec0> :Output Plane:Qed buffer 8
TVMR: cbBeginSequence: 1166: BeginSequence 1920x1088, bVPR = 0, fFrameRate = 0.000000
TVMR: BitDepthLuma = 8, BitDepthChroma = 8
TVMR: LowCorner Frequency = 0
TVMR: cbBeginSequence: 1545: DecodeBuffers = 3, pnvsi->eCodec = 10, codec = 9
TVMR: cbBeginSequence: 1606: Display Resolution : (1920x1080)
TVMR: cbBeginSequence: 1607: Display Aspect Ratio : (1920x1080)
TVMR: cbBeginSequence: 1649: ColorFormat : 5
TVMR: cbBeginSequence:1660 ColorSpace = NvColorSpace_YCbCr709
TVMR: cbBeginSequence: 1790: SurfaceLayout = 3
TVMR: cbBeginSequence: 1868: NumOfSurfaces = 4, InteraceStream = 0, InterlaceEnabled = 0, bSecure = 0, MVC = 0 Semiplanar = 1, bReinit = 1, BitDepthForSurface = 8 LumaBitDepth = 8, ChromaBitDepth = 8, ChromaFormat = 5
[LOG_LEVEL_DEBUG] (NvV4l2Element.cpp:102) <dec0> :DQed event 5
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:273) <dec0> :Capture Plane:Getting format: success
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:309) <dec0> :Capture Plane:Getting crop params: success
Video Resolution: 1920x1080
query_and_set_capture, 371
[LOG_LEVEL_ERROR] (NvEglRenderer.cpp:109) <renderer0> Setting Screen width 960 height 540
[LOG_LEVEL_DEBUG] (NvEglRenderer.cpp:111) <renderer0> :Display opened successfully 545259573536
[LOG_LEVEL_DEBUG] (NvEglRenderer.cpp:199) <renderer0> :Egl Got display 2
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:152) <dec0> :Output Plane:DQed buffer 9
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:258) <dec0> :Output Plane:Qed buffer 9
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:152) <dec0> :Output Plane:DQed buffer 0
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:258) <dec0> :Output Plane:Qed buffer 0
[LOG_LEVEL_DEBUG] (NvEglRenderer.cpp:216) <renderer0> :Got numconfigs as 1
[LOG_LEVEL_DEBUG] (NvEglRenderer.cpp:667) <renderer0> :Shaders intialized
[LOG_LEVEL_DEBUG] (NvEglRenderer.cpp:253) <renderer0> :Starting render thread
[LOG_LEVEL_DEBUG] (NvEglRenderer.cpp:148) <renderer0> :Renderer started successfully
set FPS 25.000000
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:447) <dec0> :Capture Plane:Already in STREAMOFF
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:832) <dec0> :Capture Plane:Stopped DQ Thread
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:434) <dec0> :Capture Plane:Reqbuf returned 0 buffers
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:373) <dec0> :Capture Plane:deinit successful
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:291) <dec0> :Capture Plane:VIDIOC_S_FMT at capture plane successful
[LOG_LEVEL_DEBUG] (NvV4l2Element.cpp:158) <dec0> :Got value 4 for control 9963815
[LOG_LEVEL_DEBUG] (NvVideoDecoder.cpp:188) <dec0> :Getting decoder minimum capture plane buffers (4): success
query_and_set_capture, 427, min_dec_capture_buffers 4
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:434) <dec0> :Capture Plane:Reqbuf returned 9 buffers
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:543) <dec0> :Capture Plane:QueryBuf for 0th buffer successful
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:581) <dec0> :Capture Plane:ExportBuf successful for Buffer 0, Plane 0, fd = 32507006
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:581) <dec0> :Capture Plane:ExportBuf successful for Buffer 0, Plane 1, fd = 32507007
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:543) <dec0> :Capture Plane:QueryBuf for 1th buffer successful
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:581) <dec0> :Capture Plane:ExportBuf successful for Buffer 1, Plane 0, fd = 32507008
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:581) <dec0> :Capture Plane:ExportBuf successful for Buffer 1, Plane 1, fd = 32507009
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:543) <dec0> :Capture Plane:QueryBuf for 2th buffer successful
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:581) <dec0> :Capture Plane:ExportBuf successful for Buffer 2, Plane 0, fd = 32507010
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:581) <dec0> :Capture Plane:ExportBuf successful for Buffer 2, Plane 1, fd = 32507011
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:543) <dec0> :Capture Plane:QueryBuf for 3th buffer successful
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:581) <dec0> :Capture Plane:ExportBuf successful for Buffer 3, Plane 0, fd = 32507012
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:581) <dec0> :Capture Plane:ExportBuf successful for Buffer 3, Plane 1, fd = 32507013
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:543) <dec0> :Capture Plane:QueryBuf for 4th buffer successful
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:581) <dec0> :Capture Plane:ExportBuf successful for Buffer 4, Plane 0, fd = 32507014
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:581) <dec0> :Capture Plane:ExportBuf successful for Buffer 4, Plane 1, fd = 32507015
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:543) <dec0> :Capture Plane:QueryBuf for 5th buffer successful
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:581) <dec0> :Capture Plane:ExportBuf successful for Buffer 5, Plane 0, fd = 32507016
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:581) <dec0> :Capture Plane:ExportBuf successful for Buffer 5, Plane 1, fd = 32507017
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:543) <dec0> :Capture Plane:QueryBuf for 6th buffer successful
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:581) <dec0> :Capture Plane:ExportBuf successful for Buffer 6, Plane 0, fd = 32507018
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:581) <dec0> :Capture Plane:ExportBuf successful for Buffer 6, Plane 1, fd = 32507019
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:543) <dec0> :Capture Plane:QueryBuf for 7th buffer successful
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:581) <dec0> :Capture Plane:ExportBuf successful for Buffer 7, Plane 0, fd = 32507020
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:581) <dec0> :Capture Plane:ExportBuf successful for Buffer 7, Plane 1, fd = 32507021
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:543) <dec0> :Capture Plane:QueryBuf for 8th buffer successful
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:581) <dec0> :Capture Plane:ExportBuf successful for Buffer 8, Plane 0, fd = 32507022
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:581) <dec0> :Capture Plane:ExportBuf successful for Buffer 8, Plane 1, fd = 32507023
query_and_set_capture, 434, dec cap plane buffs 9
query_and_set_capture, 438
[LOG_LEVEL_DEBUG] (NvV4l2Element.cpp:177) <conv0> :Set controls
[LOG_LEVEL_DEBUG] (NvVideoConverter.cpp:200) <conv0> :Setting output plane buffer layout to 1: success
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:291) <conv0> :Output Plane:VIDIOC_S_FMT at capture plane successful
[LOG_LEVEL_DEBUG] (NvVideoConverter.cpp:143) <conv0> :Setting output plane format: success
query_and_set_capture, 445
[LOG_LEVEL_DEBUG] (NvV4l2Element.cpp:177) <conv0> :Set controls
[LOG_LEVEL_DEBUG] (NvVideoConverter.cpp:220) <conv0> :Setting capture plane buffer layout to 0: success
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:291) <conv0> :Capture Plane:VIDIOC_S_FMT at capture plane successful
[LOG_LEVEL_DEBUG] (NvVideoConverter.cpp:114) <conv0> :Setting capture plane format: success
query_and_set_capture, 455
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:335) <conv0> :Capture Plane:Setting selection: success
[LOG_LEVEL_DEBUG] (NvVideoConverter.cpp:296) <conv0> :Setting crop rectangle to left=0, top=0, width=1920, height=1080: success
query_and_set_capture, 459
libv4l2_nvvidconv (1):(765) (INFO) : Allocating (9) OUTPUT PLANE BUFFERS Layout=1
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:434) <conv0> :Output Plane:Reqbuf returned 9 buffers
query_and_set_capture, 466, conv out bufs 9
libv4l2_nvvidconv (1):(775) (INFO) : Allocating (9) CAPTURE PLANE BUFFERS Layout=0
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:434) <conv0> :Capture Plane:Reqbuf returned 9 buffers
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:543) <conv0> :Capture Plane:QueryBuf for 0th buffer successful
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:581) <conv0> :Capture Plane:ExportBuf successful for Buffer 0, Plane 0, fd = 1177
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:581) <conv0> :Capture Plane:ExportBuf successful for Buffer 0, Plane 1, fd = 1177
[LOG_LEVEL_DEBUG] (NvBuffer.cpp:175) <Buffer> Mapped buffer 0, plane 0 to
[LOG_LEVEL_DEBUG] (NvBuffer.cpp:175) <Buffer> Mapped buffer 0, plane 1 to
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:543) <conv0> :Capture Plane:QueryBuf for 1th buffer successful
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:581) <conv0> :Capture Plane:ExportBuf successful for Buffer 1, Plane 0, fd = 1178
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:581) <conv0> :Capture Plane:ExportBuf successful for Buffer 1, Plane 1, fd = 1178
[LOG_LEVEL_DEBUG] (NvBuffer.cpp:175) <Buffer> Mapped buffer 1, plane 0 to
[LOG_LEVEL_DEBUG] (NvBuffer.cpp:175) <Buffer> Mapped buffer 1, plane 1 to
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:543) <conv0> :Capture Plane:QueryBuf for 2th buffer successful
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:581) <conv0> :Capture Plane:ExportBuf successful for Buffer 2, Plane 0, fd = 1179
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:581) <conv0> :Capture Plane:ExportBuf successful for Buffer 2, Plane 1, fd = 1179
[LOG_LEVEL_DEBUG] (NvBuffer.cpp:175) <Buffer> Mapped buffer 2, plane 0 to
[LOG_LEVEL_DEBUG] (NvBuffer.cpp:175) <Buffer> Mapped buffer 2, plane 1 to
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:543) <conv0> :Capture Plane:QueryBuf for 3th buffer successful
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:581) <conv0> :Capture Plane:ExportBuf successful for Buffer 3, Plane 0, fd = 1180
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:581) <conv0> :Capture Plane:ExportBuf successful for Buffer 3, Plane 1, fd = 1180
[LOG_LEVEL_DEBUG] (NvBuffer.cpp:175) <Buffer> Mapped buffer 3, plane 0 to
[LOG_LEVEL_DEBUG] (NvBuffer.cpp:175) <Buffer> Mapped buffer 3, plane 1 to
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:543) <conv0> :Capture Plane:QueryBuf for 4th buffer successful
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:581) <conv0> :Capture Plane:ExportBuf successful for Buffer 4, Plane 0, fd = 1181
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:581) <conv0> :Capture Plane:ExportBuf successful for Buffer 4, Plane 1, fd = 1181
[LOG_LEVEL_DEBUG] (NvBuffer.cpp:175) <Buffer> Mapped buffer 4, plane 0 to
[LOG_LEVEL_DEBUG] (NvBuffer.cpp:175) <Buffer> Mapped buffer 4, plane 1 to
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:543) <conv0> :Capture Plane:QueryBuf for 5th buffer successful
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:581) <conv0> :Capture Plane:ExportBuf successful for Buffer 5, Plane 0, fd = 1182
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:581) <conv0> :Capture Plane:ExportBuf successful for Buffer 5, Plane 1, fd = 1182
[LOG_LEVEL_DEBUG] (NvBuffer.cpp:175) <Buffer> Mapped buffer 5, plane 0 to
[LOG_LEVEL_DEBUG] (NvBuffer.cpp:175) <Buffer> Mapped buffer 5, plane 1 to
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:543) <conv0> :Capture Plane:QueryBuf for 6th buffer successful
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:581) <conv0> :Capture Plane:ExportBuf successful for Buffer 6, Plane 0, fd = 1183
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:581) <conv0> :Capture Plane:ExportBuf successful for Buffer 6, Plane 1, fd = 1183
[LOG_LEVEL_DEBUG] (NvBuffer.cpp:175) <Buffer> Mapped buffer 6, plane 0 to
[LOG_LEVEL_DEBUG] (NvBuffer.cpp:175) <Buffer> Mapped buffer 6, plane 1 to
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:543) <conv0> :Capture Plane:QueryBuf for 7th buffer successful
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:581) <conv0> :Capture Plane:ExportBuf successful for Buffer 7, Plane 0, fd = 1184
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:581) <conv0> :Capture Plane:ExportBuf successful for Buffer 7, Plane 1, fd = 1184
[LOG_LEVEL_DEBUG] (NvBuffer.cpp:175) <Buffer> Mapped buffer 7, plane 0 to
[LOG_LEVEL_DEBUG] (NvBuffer.cpp:175) <Buffer> Mapped buffer 7, plane 1 to
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:543) <conv0> :Capture Plane:QueryBuf for 8th buffer successful
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:581) <conv0> :Capture Plane:ExportBuf successful for Buffer 8, Plane 0, fd = 1185
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:581) <conv0> :Capture Plane:ExportBuf successful for Buffer 8, Plane 1, fd = 1185
[LOG_LEVEL_DEBUG] (NvBuffer.cpp:175) <Buffer> Mapped buffer 8, plane 0 to
[LOG_LEVEL_DEBUG] (NvBuffer.cpp:175) <Buffer> Mapped buffer 8, plane 1 to
query_and_set_capture, 473, conv cap bufs 9
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:468) <conv0> :Output Plane:STREAMON successful
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:468) <conv0> :Capture Plane:STREAMON successful
query_and_set_capture, 480
query_and_set_capture, 487
conv cap buffers 9
query_and_set_capture, 500 i 0
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:152) <dec0> :Output Plane:DQed buffer 1
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:258) <dec0> :Output Plane:Qed buffer 1
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:152) <dec0> :Output Plane:DQed buffer 2
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:258) <dec0> :Output Plane:Qed buffer 2
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:152) <dec0> :Output Plane:DQed buffer 3
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:258) <dec0> :Output Plane:Qed buffer 3
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:152) <dec0> :Output Plane:DQed buffer 4
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:258) <dec0> :Output Plane:Qed buffer 4
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:152) <dec0> :Output Plane:DQed buffer 5
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:258) <dec0> :Output Plane:Qed buffer 5
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:152) <dec0> :Output Plane:DQed buffer 6
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:258) <dec0> :Output Plane:Qed buffer 6
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:152) <dec0> :Output Plane:DQed buffer 7
[LOG_LEVEL_DEBUG] (NvV4l2ElementPlane.cpp:258) <dec0> :Output Plane:Qed buffer 7
[LOG_LEVEL_ERROR] (NvV4l2Element.cpp:106) <dec1> Error while DQing event: Resource temporarily unavailable
Timed out waiting for first V4L2_EVENT_RESOLUTION_CHANGE