Skip to content
Snippets Groups Projects
Commit 21a8f92b authored by Nicolas Pope's avatar Nicolas Pope
Browse files

More code tidy

parent c1059f11
No related branches found
No related tags found
1 merge request!316Resolves #343 GUI and Frame Refactor
Pipeline #28217 failed
...@@ -436,7 +436,7 @@ set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) ...@@ -436,7 +436,7 @@ set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
add_subdirectory(components/common/cpp) add_subdirectory(components/common/cpp)
add_subdirectory(applications/calibration) #add_subdirectory(applications/calibration)
add_subdirectory(components/codecs) add_subdirectory(components/codecs)
add_subdirectory(components/structures) add_subdirectory(components/structures)
add_subdirectory(components/net) add_subdirectory(components/net)
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
#include <ftl/rgbd/capabilities.hpp> #include <ftl/rgbd/capabilities.hpp>
#include <chrono> #include <chrono>
#include <loguru.hpp>
using ftl::gui2::Camera; using ftl::gui2::Camera;
using ftl::codecs::Channel; using ftl::codecs::Channel;
using ftl::rgbd::Capability; using ftl::rgbd::Capability;
......
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
#include "../widgets/popupbutton.hpp" #include "../widgets/popupbutton.hpp"
#include <loguru.hpp>
using ftl::gui2::Camera; using ftl::gui2::Camera;
using ftl::gui2::FixedWindow; using ftl::gui2::FixedWindow;
using ftl::gui2::MediaPanel; using ftl::gui2::MediaPanel;
......
#include "camera3d.hpp" #include "camera3d.hpp"
#include "../modules/camera.hpp" #include "../modules/camera.hpp"
#include <loguru.hpp>
using ftl::gui2::CameraView3D; using ftl::gui2::CameraView3D;
// ============================================================================= // =============================================================================
......
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
#include <vector> #include <vector>
#include <cmath> #include <cmath>
#define LOGURU_REPLACE_GLOG 1 //#define LOGURU_REPLACE_GLOG 1
#include <loguru.hpp> //#include <loguru.hpp>
namespace ftl { namespace ftl {
namespace audio { namespace audio {
...@@ -102,7 +102,6 @@ class FixedBuffer : public ftl::audio::Buffer<T> { ...@@ -102,7 +102,6 @@ class FixedBuffer : public ftl::audio::Buffer<T> {
void reset() override { void reset() override {
Buffer<T>::reset(); Buffer<T>::reset();
write_position_ = 0; //int(this->cur_delay_); write_position_ = 0; //int(this->cur_delay_);
LOG(INFO) << "RESET AUDIO: " << write_position_;
read_position_ = 0; read_position_ = 0;
} }
......
#include <ftl/codecs/nvidia_encoder.hpp> #include <ftl/codecs/nvidia_encoder.hpp>
#include <loguru.hpp> //#include <loguru.hpp>
#include <ftl/timer.hpp> #include <ftl/timer.hpp>
#include <ftl/codecs/codecs.hpp> #include <ftl/codecs/codecs.hpp>
#include <ftl/cuda_util.hpp> #include <ftl/cuda_util.hpp>
...@@ -144,7 +144,7 @@ static bool validate(const cv::cuda::GpuMat &in, ftl::codecs::Packet &pkt) { ...@@ -144,7 +144,7 @@ static bool validate(const cv::cuda::GpuMat &in, ftl::codecs::Packet &pkt) {
} }
if (pkt.codec == codec_t::H264 && in.type() == CV_32F) { if (pkt.codec == codec_t::H264 && in.type() == CV_32F) {
LOG(ERROR) << "Lossy compression not supported with H264 currently"; //LOG(ERROR) << "Lossy compression not supported with H264 currently";
return false; return false;
} }
...@@ -153,12 +153,12 @@ static bool validate(const cv::cuda::GpuMat &in, ftl::codecs::Packet &pkt) { ...@@ -153,12 +153,12 @@ static bool validate(const cv::cuda::GpuMat &in, ftl::codecs::Packet &pkt) {
} }
if (in.empty()) { if (in.empty()) {
LOG(WARNING) << "No data"; //LOG(WARNING) << "No data";
return false; return false;
} }
if (in.type() != CV_32F && in.type() != CV_8UC4) { if (in.type() != CV_32F && in.type() != CV_8UC4) {
LOG(ERROR) << "Input type does not match given format"; //LOG(ERROR) << "Input type does not match given format";
pkt.flags = 0; pkt.flags = 0;
return false; return false;
} }
...@@ -199,7 +199,7 @@ bool NvidiaEncoder::encode(const cv::cuda::GpuMat &in, ftl::codecs::Packet &pkt) ...@@ -199,7 +199,7 @@ bool NvidiaEncoder::encode(const cv::cuda::GpuMat &in, ftl::codecs::Packet &pkt)
was_reset_ = false; was_reset_ = false;
if (cs == 0 || cs >= ftl::codecs::kVideoBufferSize) { if (cs == 0 || cs >= ftl::codecs::kVideoBufferSize) {
LOG(ERROR) << "Could not encode video frame"; //LOG(ERROR) << "Could not encode video frame";
return false; return false;
} else { } else {
return true; return true;
...@@ -211,7 +211,7 @@ bool NvidiaEncoder::_createEncoder(const cv::cuda::GpuMat &in, const ftl::codecs ...@@ -211,7 +211,7 @@ bool NvidiaEncoder::_createEncoder(const cv::cuda::GpuMat &in, const ftl::codecs
if (nvenc_ && (params == params_)) return true; if (nvenc_ && (params == params_)) return true;
uint64_t bitrate = calculateBitrate(in.cols*in.rows, float(pkt.bitrate)/255.0f) * pkt.frame_count; uint64_t bitrate = calculateBitrate(in.cols*in.rows, float(pkt.bitrate)/255.0f) * pkt.frame_count;
LOG(INFO) << "Calculated bitrate " << ((params.is_float) ? "(float)" : "(rgb)") << ": " << bitrate; //LOG(INFO) << "Calculated bitrate " << ((params.is_float) ? "(float)" : "(rgb)") << ": " << bitrate;
params_ = params; params_ = params;
...@@ -226,7 +226,7 @@ bool NvidiaEncoder::_createEncoder(const cv::cuda::GpuMat &in, const ftl::codecs ...@@ -226,7 +226,7 @@ bool NvidiaEncoder::_createEncoder(const cv::cuda::GpuMat &in, const ftl::codecs
cuCtxGetCurrent(&cudaContext); cuCtxGetCurrent(&cudaContext);
if (nvenc_) { if (nvenc_) {
LOG(INFO) << "Destroying old NVENC encoder"; //LOG(INFO) << "Destroying old NVENC encoder";
std::vector<std::vector<uint8_t>> tmp; std::vector<std::vector<uint8_t>> tmp;
nvenc_->EndEncode(tmp); nvenc_->EndEncode(tmp);
nvenc_->DestroyEncoder(); nvenc_->DestroyEncoder();
...@@ -299,7 +299,7 @@ bool NvidiaEncoder::_createEncoder(const cv::cuda::GpuMat &in, const ftl::codecs ...@@ -299,7 +299,7 @@ bool NvidiaEncoder::_createEncoder(const cv::cuda::GpuMat &in, const ftl::codecs
//LOG(ERROR) << "Could not create video encoder"; //LOG(ERROR) << "Could not create video encoder";
return false; return false;
} else { } else {
LOG(INFO) << "NVENC encoder created"; //LOG(INFO) << "NVENC encoder created";
//nvenc_->SetIOCudaStreams(cv::cuda::StreamAccessor::getStream(stream_), cv::cuda::StreamAccessor::getStream(stream_)); //nvenc_->SetIOCudaStreams(cv::cuda::StreamAccessor::getStream(stream_), cv::cuda::StreamAccessor::getStream(stream_));
......
...@@ -19,7 +19,9 @@ check_function_exists(uriParseSingleUriA HAVE_URIPARSESINGLE) ...@@ -19,7 +19,9 @@ check_function_exists(uriParseSingleUriA HAVE_URIPARSESINGLE)
add_library(ftlcommon ${COMMONSRC}) add_library(ftlcommon ${COMMONSRC})
if (NOT WIN32)
target_compile_options(ftlcommon PUBLIC $<$<COMPILE_LANGUAGE:CXX>:-fPIC>) target_compile_options(ftlcommon PUBLIC $<$<COMPILE_LANGUAGE:CXX>:-fPIC>)
endif()
target_include_directories(ftlcommon PUBLIC target_include_directories(ftlcommon PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
#ifndef _FTL_RGBD_MIDDLEBURY_SOURCE_HPP_ #ifndef _FTL_RGBD_MIDDLEBURY_SOURCE_HPP_
#define _FTL_RGBD_MIDDLEBURY_SOURCE_HPP_ #define _FTL_RGBD_MIDDLEBURY_SOURCE_HPP_
#include <loguru.hpp> //#include <loguru.hpp>
#include "../../basesource.hpp" #include "../../basesource.hpp"
#include <ftl/cuda_common.hpp> #include <ftl/cuda_common.hpp>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment