Skip to content

Commit

Permalink
Merge branch 'master' of github.com:gwu-robotics/Pangolin
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenlovegrove committed Dec 10, 2013
2 parents bea4fcd + f149171 commit 579cbf4
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 5 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Expand Up @@ -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()
2 changes: 1 addition & 1 deletion include/pangolin/video/v4l.h
Expand Up @@ -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()
Expand Down
7 changes: 6 additions & 1 deletion src/CMakeLists.txt
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion src/video.cpp
Expand Up @@ -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;

Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/video/v4l.cpp
Expand Up @@ -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();
}

Expand Down

0 comments on commit 579cbf4

Please sign in to comment.