Add device layer
This commit is contained in:
@@ -40,6 +40,14 @@ include(${PRO_DIR}/cmake/Common.cmake)
|
||||
|
||||
set(OUT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/_output")
|
||||
|
||||
include_directories(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
# samples above device layer
|
||||
|
||||
add_subdirectory(device)
|
||||
|
||||
# samples above uvc layer
|
||||
|
||||
add_subdirectory(uvc)
|
||||
|
||||
22
samples/device/CMakeLists.txt
Normal file
22
samples/device/CMakeLists.txt
Normal file
@@ -0,0 +1,22 @@
|
||||
get_filename_component(DIR_NAME ${CMAKE_CURRENT_LIST_DIR} NAME)
|
||||
|
||||
set_outdir(
|
||||
"${OUT_DIR}/lib/${DIR_NAME}"
|
||||
"${OUT_DIR}/lib/${DIR_NAME}"
|
||||
"${OUT_DIR}/bin/${DIR_NAME}"
|
||||
)
|
||||
|
||||
include_directories(
|
||||
${PRO_DIR}/src
|
||||
)
|
||||
|
||||
## camera_d
|
||||
|
||||
add_executable(camera_d camera.cc)
|
||||
target_link_libraries(camera_d mynteye ${OpenCV_LIBS})
|
||||
|
||||
if(OS_WIN)
|
||||
target_compile_definitions(camera_d
|
||||
PUBLIC GLOG_NO_ABBREVIATED_SEVERITIES
|
||||
)
|
||||
endif()
|
||||
13
samples/device/camera.cc
Normal file
13
samples/device/camera.cc
Normal file
@@ -0,0 +1,13 @@
|
||||
#include "glog_init.h" // NOLINT
|
||||
|
||||
#include "device/context.h"
|
||||
|
||||
MYNTEYE_USE_NAMESPACE
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
glog_init _(argc, argv);
|
||||
|
||||
Context context;
|
||||
|
||||
return 0;
|
||||
}
|
||||
30
samples/glog_init.h
Normal file
30
samples/glog_init.h
Normal file
@@ -0,0 +1,30 @@
|
||||
#ifndef MYNTEYE_GLOG_INIT_H_ // NOLINT
|
||||
#define MYNTEYE_GLOG_INIT_H_
|
||||
#pragma once
|
||||
|
||||
#include <glog/logging.h>
|
||||
|
||||
struct glog_init {
|
||||
glog_init(int /*argc*/, char *argv[]) {
|
||||
// FLAGS_logtostderr = true;
|
||||
FLAGS_alsologtostderr = true;
|
||||
FLAGS_colorlogtostderr = true;
|
||||
|
||||
FLAGS_log_dir = ".";
|
||||
FLAGS_max_log_size = 1024;
|
||||
FLAGS_stop_logging_if_full_disk = true;
|
||||
|
||||
FLAGS_v = 2;
|
||||
|
||||
google::InitGoogleLogging(argv[0]);
|
||||
|
||||
VLOG(2) << __func__;
|
||||
}
|
||||
|
||||
~glog_init() {
|
||||
VLOG(2) << __func__;
|
||||
google::ShutdownGoogleLogging();
|
||||
}
|
||||
};
|
||||
|
||||
#endif // MYNTEYE_GLOG_INIT_H_ NOLINT
|
||||
@@ -10,13 +10,13 @@ include_directories(
|
||||
${PRO_DIR}/src
|
||||
)
|
||||
|
||||
## camera
|
||||
## camera_u
|
||||
|
||||
add_executable(camera camera.cc)
|
||||
target_link_libraries(camera mynteye ${OpenCV_LIBS})
|
||||
add_executable(camera_u camera.cc)
|
||||
target_link_libraries(camera_u mynteye ${OpenCV_LIBS})
|
||||
|
||||
if(OS_WIN)
|
||||
target_compile_definitions(camera
|
||||
target_compile_definitions(camera_u
|
||||
PUBLIC GLOG_NO_ABBREVIATED_SEVERITIES
|
||||
)
|
||||
endif()
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#include <glog/logging.h>
|
||||
|
||||
#include <opencv2/highgui/highgui.hpp>
|
||||
#include <opencv2/imgproc/imgproc.hpp>
|
||||
|
||||
@@ -14,28 +12,7 @@
|
||||
#include "internal/types.h"
|
||||
#include "uvc/uvc.h"
|
||||
|
||||
struct glog_init {
|
||||
glog_init(int /*argc*/, char *argv[]) {
|
||||
// FLAGS_logtostderr = true;
|
||||
FLAGS_alsologtostderr = true;
|
||||
FLAGS_colorlogtostderr = true;
|
||||
|
||||
FLAGS_log_dir = ".";
|
||||
FLAGS_max_log_size = 1024;
|
||||
FLAGS_stop_logging_if_full_disk = true;
|
||||
|
||||
// FLAGS_v = 2;
|
||||
|
||||
google::InitGoogleLogging(argv[0]);
|
||||
|
||||
VLOG(2) << __func__;
|
||||
}
|
||||
|
||||
~glog_init() {
|
||||
VLOG(2) << __func__;
|
||||
google::ShutdownGoogleLogging();
|
||||
}
|
||||
};
|
||||
#include "glog_init.h" // NOLINT
|
||||
|
||||
struct frame {
|
||||
const void *data = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user