From c3579d193726a1bd7b72678d8d3e97fef7008180 Mon Sep 17 00:00:00 2001 From: mchanan Date: Mon, 23 Dec 2019 12:01:19 +0200 Subject: [PATCH] change flag name --- src/ethernet/CMakeLists.txt | 4 ++-- src/ethernet/ethernet-device.cpp | 6 ++++-- tools/rs-server/CMakeLists.txt | 4 ++-- tools/rs-server/RsSource.cpp | 6 +++--- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/ethernet/CMakeLists.txt b/src/ethernet/CMakeLists.txt index d098dc48d9..e48da84cf5 100644 --- a/src/ethernet/CMakeLists.txt +++ b/src/ethernet/CMakeLists.txt @@ -57,8 +57,8 @@ target_link_libraries(${PROJECT_NAME} ${ZLIB_LIBRARIES} ) -if(COMPRESS_FRAMES) - add_definitions(-DCOMPRESS_FRAMES) +if(COMPRESSION) + add_definitions(-DCOMPRESSION) endif() target_include_directories(${PROJECT_NAME} PUBLIC "rtsp_client/*.h") diff --git a/src/ethernet/ethernet-device.cpp b/src/ethernet/ethernet-device.cpp index 05efd051e2..3d1e9d256f 100644 --- a/src/ethernet/ethernet-device.cpp +++ b/src/ethernet/ethernet-device.cpp @@ -34,7 +34,9 @@ void sig_handler(int signo) rs2::ethernet_device::ethernet_device() { dev = rs2_create_software_device(NULL); +#ifdef COMPRESSION idecomress = decompressFrameFactory::create(zipMethod::gzip); +#endif } rs2::ethernet_device::ethernet_device(std::string url) : ethernet_device() @@ -168,7 +170,7 @@ void rs2::ethernet_device::pull_from_queue(int stream_index) //const std::lock_guard lock(mtx); Frame* frame = frame_queues[stream_index].front(); frame_queues[stream_index].pop(); -#ifdef COMPRESS_FRAMES +#ifdef COMPRESSION if (stream_index == 0) { // depth idecomress->decompressFrame((unsigned char *)frame->m_buffer, frame->m_size, (unsigned char*)(last_frame[stream_index].pixels)); @@ -176,7 +178,7 @@ void rs2::ethernet_device::pull_from_queue(int stream_index) // other -> color #endif memcpy(last_frame[stream_index].pixels, frame->m_buffer, frame->m_size); -#ifdef COMPRESS_FRAMES +#ifdef COMPRESSION } #endif // delete frame; diff --git a/tools/rs-server/CMakeLists.txt b/tools/rs-server/CMakeLists.txt index 0e63ff29fb..974cd7c1a6 100644 --- a/tools/rs-server/CMakeLists.txt +++ b/tools/rs-server/CMakeLists.txt @@ -47,8 +47,8 @@ find_package(ZLIB REQUIRED) target_link_libraries(rs-server ${DEPENDENCIES} realsense2 ${ZLIB_LIBRARIES}) -if(COMPRESS_FRAMES) - add_definitions(-DCOMPRESS_FRAMES) +if(COMPRESSION) + add_definitions(-DCOMPRESSION) endif() set_target_properties (rs-server PROPERTIES diff --git a/tools/rs-server/RsSource.cpp b/tools/rs-server/RsSource.cpp index 2b002f84d4..aa0f30185a 100644 --- a/tools/rs-server/RsSource.cpp +++ b/tools/rs-server/RsSource.cpp @@ -103,7 +103,7 @@ void RsDeviceSource::doGetNextFrame() void RsDeviceSource::deliverRSFrame() { */ -#ifdef COMPRESS_FRAMES +#ifdef COMPRESSION IcompressFrame* iCompress = compressFrameFactory::create(zipMethod::gzip); #endif if (!isCurrentlyAwaitingData()) @@ -129,14 +129,14 @@ void RsDeviceSource::deliverRSFrame() gettimeofday(&fPresentationTime, NULL); // If you have a more accurate time - e.g., from an encoder - then use that instead. //// memmove(fTo, frame.get_data(), fFrameSize); //// unsigned char b[640*480*2]; -#ifdef COMPRESS_FRAMES +#ifdef COMPRESSION if(fParams.sensorID == 0) { iCompress->compressFrame(fbuf, fFrameSize, fTo); } else { #endif memmove(fTo, fbuf, 640*480*2); -#ifdef COMPRESS_FRAMES +#ifdef COMPRESSION } #endif // After delivering the data, inform the reader that it is now available: