Skip to content

Commit

Permalink
Fixed optional dependancy on aravis (only needed for GigEVision camer…
Browse files Browse the repository at this point in the history
…a support)
  • Loading branch information
Ross Newman committed Mar 15, 2017
1 parent f9d6b86 commit e0a27bd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
9 changes: 6 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,11 @@ set(
)
endif()

# Aravis setup
include_directories(/usr/local/include/aravis-0.6)
# Aravis setup if installed
if(EXISTS "/usr/local/lib/libaravis-0.6.so")
include_directories(/usr/local/include/aravis-0.6)
set(ARAVIS_LIB aravis-0.6)
endif()

# setup project output paths
set(PROJECT_OUTPUT_DIR ${PROJECT_BINARY_DIR}/${CMAKE_SYSTEM_PROCESSOR})
Expand All @@ -71,7 +74,7 @@ file(GLOB inferenceSources *.cpp *.cu camera/*.cpp cuda/*.cu display/*.cpp)
file(GLOB inferenceIncludes *.h camera/*.h cuda/*.h display/*.h)

cuda_add_library(jetson-inference SHARED ${inferenceSources})
target_link_libraries(jetson-inference nvcaffe_parser nvinfer Qt4::QtGui GL GLEW gstreamer-1.0 gstapp-1.0 aravis-0.6) # gstreamer-0.10 gstbase-0.10 gstapp-0.10
target_link_libraries(jetson-inference nvcaffe_parser nvinfer Qt4::QtGui GL GLEW gstreamer-1.0 gstapp-1.0 ${ARAVIS_LIB}) # gstreamer-0.10 gstbase-0.10 gstapp-0.10


# transfer all headers to the include directory
Expand Down
4 changes: 2 additions & 2 deletions camera/camera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,15 @@ bool camera::ConvertRGBtoRGBA( void* input, void** output )
{
if( CUDA_FAILED(cudaMalloc(&mRGBA, mWidth * mHeight * sizeof(float4))) )
{
printf(LOG_CUDA "gvCamera -- failed to allocate memory for %ux%u RGBA texture\n", mWidth, mHeight);
printf(LOG_CUDA "camera -- failed to allocate memory for %ux%u RGBA texture\n", mWidth, mHeight);
return false;
}
}

// USB webcam is RGB
if( CUDA_FAILED(cudaRGBToRGBAf((uint8_t*)input, (float4*)mRGBA, mWidth, mHeight)) )
{
printf(LOG_CUDA "gvCamera -- conversion cudaRGBToRGBAf failed\n");
printf(LOG_CUDA "camera -- conversion cudaRGBToRGBAf failed (%dx%d)\n", mWidth, mHeight);
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion imagenet-camera/imagenet-camera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ int main( int argc, char** argv )
return 0;
}

printf("\nimagenet-camera: successfully initialized video device (%s%s)\n", VIDEO_SRC_NAME, VIDEO_GV_PIXEL_FORMAT_NAME);
printf("\nimagenet-camera: successfully initialized video device (%s)\n", VIDEO_SRC_NAME);

/*
* create imageNet
Expand Down

0 comments on commit e0a27bd

Please sign in to comment.