Skip to content
Browse files

Merge branch 'master' of github.com:gwu-robotics/Pangolin

  • Loading branch information...
2 parents bea4fcd + f149171 commit 579cbf4c9cba2ac1cb5e064c7fca9c7aeed2bf18 @stevenlovegrove committed
Showing with 12 additions and 5 deletions.
  1. +1 −0 CMakeLists.txt
  2. +1 −1 include/pangolin/video/v4l.h
  3. +6 −1 src/CMakeLists.txt
  4. +2 −1 src/video.cpp
  5. +2 −2 src/video/v4l.cpp
View
1 CMakeLists.txt
@@ -49,5 +49,6 @@ add_custom_target(uninstall
add_subdirectory("src")
if(BUILD_EXAMPLES)
+ set(Pangolin_DIR ${Pangolin_BINARY_DIR}/src)
add_subdirectory(examples)
endif()
View
2 include/pangolin/video/v4l.h
@@ -51,7 +51,7 @@ struct buffer {
class V4lVideo : public VideoInterface
{
public:
- V4lVideo(const char* dev_name, io_method io = IO_METHOD_MMAP);
+ V4lVideo(const char* dev_name, io_method io = IO_METHOD_MMAP, unsigned iwidth=0, unsigned iheight=0);
~V4lVideo();
//! Implement VideoInput::Start()
View
7 src/CMakeLists.txt
@@ -294,7 +294,12 @@ configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}Config.cmake.in
${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${PROJECT_NAME}Config.cmake @ONLY )
# Add package to CMake package registery for use from the build tree
-export( PACKAGE ${PROJECT_NAME} )
+option( EXPORT_${PROJECT_NAME}
+ "Should the ${PROJECT_NAME} package be exported for use by other software" ON )
+
+if( EXPORT_${PROJECT_NAME} )
+ export( PACKAGE ${PROJECT_NAME} )
+endif()
#######################################################
## Install headers / targets
View
3 src/video.cpp
@@ -270,6 +270,7 @@ VideoInterface* OpenVideo(std::string str_uri)
#ifdef HAVE_V4L
if(!uri.scheme.compare("v4l")) {
const std::string smethod = uri.Get<std::string>("method","mmap");
+ const ImageDim desired_dim = uri.Get<ImageDim>("size", ImageDim(0,0));
io_method method = IO_METHOD_MMAP;
@@ -281,7 +282,7 @@ VideoInterface* OpenVideo(std::string str_uri)
method = IO_METHOD_USERPTR;
}
- video = new V4lVideo(uri.url.c_str(), method);
+ video = new V4lVideo(uri.url.c_str(), method, desired_dim.x, desired_dim.y );
}else
#endif // HAVE_V4L
#ifdef HAVE_DC1394
View
4 src/video/v4l.cpp
@@ -71,11 +71,11 @@ inline std::string V4lToString(int32_t v)
return std::string(cc);
}
-V4lVideo::V4lVideo(const char* dev_name, io_method io)
+V4lVideo::V4lVideo(const char* dev_name, io_method io, unsigned iwidth, unsigned iheight)
: io(io), fd(-1), buffers(0), n_buffers(0), running(false)
{
open_device(dev_name);
- init_device(dev_name,0,0,0);
+ init_device(dev_name,iwidth,iheight,0);
Start();
}

0 comments on commit 579cbf4

Please sign in to comment.
Something went wrong with that request. Please try again.