Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print to stderr instead of stdout #15

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
7 changes: 4 additions & 3 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 @@ -585,6 +585,7 @@ nvmpictx* nvmpi_create_decoder(nvCodingType codingType, nvPixFormat pixFormat, n
ctx->dmaBufferFileDescriptor[index]=0;
ctx->numberCaptureBuffers=0;
ctx->dec_capture_loop = std::thread(dec_capture_loop_fcn,ctx);
pthread_setname_np(ctx->dec_capture_loop.native_handle(), "dec_capture");

return ctx;
}
Expand Down Expand Up @@ -628,15 +629,15 @@ 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 false;
}

if (v4l2_buf.m.planes[0].bytesused == 0)
{
ctx->eos=true;
std::cout << "Input file read complete" << std::endl;
std::cerr << "Input file read complete" << std::endl;
}

return 0;
Expand Down
2 changes: 1 addition & 1 deletion 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; \
}

using namespace std;
Expand Down