Skip to content

Commit

Permalink
change flag name
Browse files Browse the repository at this point in the history
  • Loading branch information
mchanan committed Dec 23, 2019
1 parent ece4044 commit c3579d1
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/ethernet/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
6 changes: 4 additions & 2 deletions src/ethernet/ethernet-device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -168,15 +170,15 @@ void rs2::ethernet_device::pull_from_queue(int stream_index)
//const std::lock_guard<std::mutex> 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));
} else {
// other -> color
#endif
memcpy(last_frame[stream_index].pixels, frame->m_buffer, frame->m_size);
#ifdef COMPRESS_FRAMES
#ifdef COMPRESSION
}
#endif
// delete frame;
Expand Down
4 changes: 2 additions & 2 deletions tools/rs-server/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions tools/rs-server/RsSource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ void RsDeviceSource::doGetNextFrame()
void RsDeviceSource::deliverRSFrame()
{
*/
#ifdef COMPRESS_FRAMES
#ifdef COMPRESSION
IcompressFrame* iCompress = compressFrameFactory::create(zipMethod::gzip);
#endif
if (!isCurrentlyAwaitingData())
Expand All @@ -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:
Expand Down

0 comments on commit c3579d1

Please sign in to comment.