Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/NVMPI_frameBuf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ bool NVMPI_frameBuf::alloc(NvBufferCreateParams& input_params)
ret = NvBufSurf::NvAllocate(&input_params, 1, &dst_dma_fd);
if(ret<0)
{
std::cout << "Failed to allocate buffer" << std::endl;
std::cerr << "Failed to allocate buffer" << std::endl;
return false;
}

ret = NvBufSurfaceFromFd(dst_dma_fd, (void**)(&dst_dma_surface));
if(ret<0)
{
std::cout << "Failed to get surface for buffer" << std::endl;
std::cerr << "Failed to get surface for buffer" << std::endl;
NvBufferDestroy(dst_dma_fd);
dst_dma_fd = -1;
return false;
Expand All @@ -24,7 +24,7 @@ bool NVMPI_frameBuf::alloc(NvBufferCreateParams& input_params)
ret = NvBufferCreateEx(&dst_dma_fd, &input_params);
if(ret<0)
{
std::cout << "Failed to allocate buffer" << std::endl;
std::cerr << "Failed to allocate buffer" << std::endl;
return false;
}
#endif
Expand All @@ -40,7 +40,7 @@ bool NVMPI_frameBuf::destroy()
ret = NvBufferDestroy(dst_dma_fd);
if(ret<0)
{
std::cout << "Failed to Destroy NvBuffer" << std::endl;
std::cerr << "Failed to Destroy NvBuffer" << std::endl;
return false;
}
dst_dma_fd = -1;
Expand Down
8 changes: 4 additions & 4 deletions src/nvmpi_dec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#define TEST_ERROR(condition, message, errorCode) \
if (condition) \
{ \
std::cout<< message; \
std::cerr<< message; \
}

using namespace std;
Expand Down Expand Up @@ -634,7 +634,7 @@ int nvmpi_decoder_put_packet(nvmpictx* ctx,nvPacket* packet)
ret = ctx->dec->output_plane.dqBuffer(v4l2_buf, &nvBuffer, NULL, -1);
if (ret < 0)
{
cout << "Error DQing buffer at output plane" << std::endl;
cerr << "Error DQing buffer at output plane" << std::endl;
return -1;
}
}
Expand All @@ -650,7 +650,7 @@ int nvmpi_decoder_put_packet(nvmpictx* ctx,nvPacket* packet)
ret = ctx->dec->output_plane.qBuffer(v4l2_buf, NULL);
if (ret < 0)
{
std::cout << "Error Qing buffer at output plane" << std::endl;
std::cerr << "Error Qing buffer at output plane" << std::endl;
ctx->index--;
return -2;
}
Expand Down Expand Up @@ -686,7 +686,7 @@ int copyNvBufToFrame(nvmpictx* ctx, NVMPI_frameBuf *nvmpiBuf, nvFrame* frame)
#endif
if(ret != 0)
{
printf("NvBufferMap failed \n");
fprintf(stderr, "NvBufferMap failed \n");
return ret;
}

Expand Down
8 changes: 4 additions & 4 deletions src/nvmpi_enc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#define TEST_ERROR(condition, message, errorCode) \
if (condition) \
{ \
std::cout<< message; \
std::cerr<< message; \
}

#define OUTPLANE_MEMTYPE_MMAP 0
Expand Down Expand Up @@ -67,7 +67,7 @@ static bool encoder_capture_plane_dq_callback(struct v4l2_buffer *v4l2_buf, NvBu

if (v4l2_buf == NULL)
{
cout << "Error while dequeing buffer from output plane" << endl;
cerr << "Error while dequeing buffer from output plane" << endl;
return false;
}

Expand All @@ -88,7 +88,7 @@ static bool encoder_capture_plane_dq_callback(struct v4l2_buffer *v4l2_buf, NvBu
{
//TODO wait for user to read buffer. make send_frame return AVERROR(EAGAIN) until avcodec_receive_packet() is called
//TODO pass warning to avlog
printf("[libnvmpi][W]: EAGAIN. User must read output. nvmpi encoder packet memory pool is empty! Packet will be dropped. There may be artifacts in the output video.\n");
fprintf(stderr, "[libnvmpi][W]: EAGAIN. User must read output. nvmpi encoder packet memory pool is empty! Packet will be dropped. There may be artifacts in the output video.\n");
}
else
{
Expand Down Expand Up @@ -572,7 +572,7 @@ int nvmpi_encoder_put_frame(nvmpictx* ctx,nvFrame* frame)
ret = ctx->enc->output_plane.dqBuffer(v4l2_buf, &nvBuffer, NULL, -1);
if (ret < 0)
{
cout << "Error DQing buffer at output plane" << std::endl;
cerr << "Error DQing buffer at output plane" << std::endl;
return false;
}
}
Expand Down