v01
This commit is contained in:
53
thirdparty/Pangolin/tools/VideoViewer/CMakeLists.txt
vendored
Normal file
53
thirdparty/Pangolin/tools/VideoViewer/CMakeLists.txt
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
# Find Pangolin (https://github.com/stevenlovegrove/Pangolin)
|
||||
find_package(Pangolin 0.4 REQUIRED)
|
||||
include_directories(${Pangolin_INCLUDE_DIRS})
|
||||
|
||||
add_executable(VideoViewer main.cpp)
|
||||
target_link_libraries(VideoViewer ${Pangolin_LIBRARIES})
|
||||
|
||||
|
||||
# Make file association
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux" AND ${CMAKE_MAJOR_VERSION} VERSION_GREATER "2.9.9" )
|
||||
file( GENERATE
|
||||
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/pango.desktop"
|
||||
CONTENT
|
||||
"[Desktop Entry]
|
||||
Version=1.0
|
||||
Type=Application
|
||||
Categories=AudioVideo;Player;Video;
|
||||
Name=PangoVideoViewer
|
||||
GenericName=Video Viewer
|
||||
Comment=View images and video
|
||||
Exec=$<TARGET_FILE:VideoViewer> %U
|
||||
TryExec=$<TARGET_FILE:VideoViewer>
|
||||
Icon=application-x-pango
|
||||
Terminal=false
|
||||
StartupNotify=false
|
||||
MimeType=application/x-pango;image/x-portable-graymap;image/x-portable-pixmap;image/x-tga;image/tiff;image/jpeg;image/png;"
|
||||
)
|
||||
|
||||
add_custom_target(
|
||||
register-mime-info-videoviewer
|
||||
COMMAND mkdir -p $ENV{HOME}/.local/share/mime/packages/
|
||||
COMMAND mkdir -p $ENV{HOME}/.local/share/applications/
|
||||
COMMAND mkdir -p $ENV{HOME}/.local/share/icons/hicolor/scalable/mimetypes/
|
||||
COMMAND cp "${CMAKE_CURRENT_SOURCE_DIR}/application-x-pango.xml" $ENV{HOME}/.local/share/mime/packages/
|
||||
COMMAND cp "${CMAKE_CURRENT_SOURCE_DIR}/application-x-pango.svg" $ENV{HOME}/.local/share/icons/hicolor/scalable/mimetypes/
|
||||
COMMAND cp "${CMAKE_CURRENT_BINARY_DIR}/pango.desktop" $ENV{HOME}/.local/share/applications/
|
||||
COMMAND gtk-update-icon-cache $ENV{HOME}/.local/share/icons/hicolor -f -t
|
||||
COMMAND update-mime-database $ENV{HOME}/.local/share/mime
|
||||
COMMAND update-desktop-database $ENV{HOME}/.local/share/applications
|
||||
DEPENDS VideoViewer
|
||||
VERBATIM
|
||||
)
|
||||
endif()
|
||||
|
||||
|
||||
#######################################################
|
||||
## Install
|
||||
|
||||
install(TARGETS VideoViewer
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib
|
||||
)
|
||||
424
thirdparty/Pangolin/tools/VideoViewer/application-x-pango.svg
vendored
Normal file
424
thirdparty/Pangolin/tools/VideoViewer/application-x-pango.svg
vendored
Normal file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 199 KiB |
10
thirdparty/Pangolin/tools/VideoViewer/application-x-pango.xml
vendored
Normal file
10
thirdparty/Pangolin/tools/VideoViewer/application-x-pango.xml
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
|
||||
<mime-type type="application/x-pango">
|
||||
<comment>Pangolin Video File</comment>
|
||||
<icon name="application-x-pango"/>
|
||||
<glob-deleteall/>
|
||||
<glob pattern="*.pango"/>
|
||||
<glob pattern="*.oni"/>
|
||||
</mime-type>
|
||||
</mime-info>
|
||||
51
thirdparty/Pangolin/tools/VideoViewer/main.cpp
vendored
Normal file
51
thirdparty/Pangolin/tools/VideoViewer/main.cpp
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
#include <pangolin/pangolin.h>
|
||||
#include <pangolin/tools/video_viewer.h>
|
||||
|
||||
int main( int argc, char* argv[] )
|
||||
{
|
||||
const std::string dflt_output_uri = "pango:[unique_filename]//video.pango";
|
||||
|
||||
if( argc > 1 ) {
|
||||
const std::string input_uri = std::string(argv[1]);
|
||||
const std::string output_uri = (argc > 2) ? std::string(argv[2]) : dflt_output_uri;
|
||||
try{
|
||||
pangolin::RunVideoViewerUI(input_uri, output_uri);
|
||||
} catch (const pangolin::VideoException& e) {
|
||||
std::cout << e.what() << std::endl;
|
||||
}
|
||||
}else{
|
||||
const std::string input_uris[] = {
|
||||
"dc1394:[fps=30,dma=10,size=640x480,iso=400]//0",
|
||||
"convert:[fmt=RGB24]//v4l:///dev/video0",
|
||||
"convert:[fmt=RGB24]//v4l:///dev/video1",
|
||||
"openni:[img1=rgb]//",
|
||||
"test:[size=160x120,n=1,fmt=RGB24]//"
|
||||
""
|
||||
};
|
||||
|
||||
std::cout << "Usage : VideoViewer [video-uri]" << std::endl << std::endl;
|
||||
std::cout << "Where video-uri describes a stream or file resource, e.g." << std::endl;
|
||||
std::cout << "\tfile:[realtime=1]///home/user/video/movie.pvn" << std::endl;
|
||||
std::cout << "\tfile:///home/user/video/movie.avi" << std::endl;
|
||||
std::cout << "\tfiles:///home/user/seqiemce/foo*.jpeg" << std::endl;
|
||||
std::cout << "\tdc1394:[fmt=RGB24,size=640x480,fps=30,iso=400,dma=10]//0" << std::endl;
|
||||
std::cout << "\tdc1394:[fmt=FORMAT7_1,size=640x480,pos=2+2,iso=400,dma=10]//0" << std::endl;
|
||||
std::cout << "\tv4l:///dev/video0" << std::endl;
|
||||
std::cout << "\tconvert:[fmt=RGB24]//v4l:///dev/video0" << std::endl;
|
||||
std::cout << "\tmjpeg://http://127.0.0.1/?action=stream" << std::endl;
|
||||
std::cout << "\topenni:[img1=rgb]//" << std::endl;
|
||||
std::cout << std::endl;
|
||||
|
||||
// Try to open some video device
|
||||
for(int i=0; !input_uris[i].empty(); ++i )
|
||||
{
|
||||
try{
|
||||
pango_print_info("Trying: %s\n", input_uris[i].c_str());
|
||||
pangolin::RunVideoViewerUI(input_uris[i], dflt_output_uri);
|
||||
return 0;
|
||||
}catch(const pangolin::VideoException&) { }
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user