I got the following "could not resovled " error in Nsight on my host machine(Ubuntu 14.04)
Method ‘fetch’ could not be resolved
Method ‘flush’ could not be resolved
Method ‘getConfiguration’ could not be resolved
Method ‘open’ could not be resolved
Method ‘putImage’ could not be resolved
Method ‘setOnKeyboardEventCallback’ could not be resolved
However, on the TX2 side, the compiling succeeded and generated executable file.
I`ve tried clean the whole project,checked include dir & linking library, but no good. It seems that Nsight can find the include file ,but cannot resolve the function.Could you give me some hints?
my code as follows:
include include <unistd.h> include “NVX/nvx.h”
//include “NVX/nvx_opencv_interop.hpp” include “NVX/nvx_timer.hpp” include “OVX/UtilityOVX.hpp” include “NVX/Application.hpp” include “OVX/FrameSourceOVX.hpp” include “OVX/RenderOVX.hpp”
struct EventData
{
EventData(): stop(false) {}
bool stop;
};
void keyboardEventCallback(void* eventData, vx_char key, vx_uint32 /x/, vx_uint32 /y/)
{
EventData* data = static_cast<EventData*>(eventData);
if (key == 27) // escape
{
data->stop = true;
}
}
int main(int argc, char **argv)
{
if (argc == 1)
{
std::cout << “Please specify a video file name…” << std::endl;
return -1;
}
nvxio::Application &app = nvxio::Application::get();
std::vectorstd::string result;
app.setDescription(“This sample demonstrates stabilization of video”);
app.allowPositionalParameters(“Input video file name”, &result);
app.init(argc, argv);
ovxio::ContextGuard context;
{
std::string sourceUri = result[0];
std::unique_ptrovxio::FrameSource frameSource(
ovxio::createDefaultFrameSource(context, sourceUri));
if (!frameSource || !frameSource->open())
{
std::cerr << "Error: Can’t open source URI " << sourceUri << std::endl;
return nvxio::Application::APP_EXIT_CODE_NO_RESOURCE;
}
ovxio::FrameSource::Parameters frameConfig = frameSource->getConfiguration();
vx_image frame = vxCreateImage(context,
frameConfig.frameWidth, frameConfig.frameHeight, VX_DF_IMAGE_RGBX);
std::unique_ptrovxio::Render render(
ovxio::createDefaultRender(context, “Video stabilizer”, frameConfig.frameWidth, frameConfig.frameHeight));
if (!render)
{
std::cerr << “Error: Cannot create render!” << std::endl;
return nvxio::Application::APP_EXIT_CODE_NO_RENDER;
}
EventData eventData;
render->setOnKeyboardEventCallback(keyboardEventCallback, &eventData);
// ImmediateModePyrlk Pyrlk(context);
// ImmediateModeStabilizer stabilizer(context);
// vx_image stabilized_frame;
while(!eventData.stop)
{
ovxio::FrameSource::FrameStatus frameStatus = frameSource->fetch(frame);
if (frameStatus == ovxio::FrameSource::FrameStatus::CLOSED)
{
std::cout << “End of the video file!” << std::endl;
break;
}
NVX_TIMER(total, “TOTAL”);
// stabilized_frame = stabilizer.process(frame);
NVX_TIMEROFF(total);
render->putImage(frame);
if (!render->flush())
{
eventData.stop = true;
}
}
}
return 0;
}