Skip to content

Commit

Permalink
Merge pull request #254 from lgarbarini/logan/videostreaming-fix
Browse files Browse the repository at this point in the history
FIX: Video streaming build fixes
  • Loading branch information
adamrankin authored Jul 12, 2022
2 parents 523957b + 35d71b9 commit fa831f8
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
6 changes: 4 additions & 2 deletions Examples/VideoStreaming/VideoClient.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ int main(int argc, char* argv[])
igtl::MessageHeader::Pointer headerMsg;
headerMsg = igtl::MessageHeader::New();
headerMsg->InitPack();
int rs = socket->Receive(headerMsg->GetPackPointer(), headerMsg->GetPackSize());
bool timeout(false);
igtlUint64 rs = socket->Receive(headerMsg->GetPackPointer(), headerMsg->GetPackSize(), timeout);
if (rs == 0)
{
std::cerr << "Connection closed." << std::endl;
Expand Down Expand Up @@ -156,7 +157,8 @@ int ReceiveVideoData(igtl::ClientSocket::Pointer& socket, igtl::MessageHeader::P
videoMsg->AllocatePack();

// Receive body from the socket
socket->Receive(videoMsg->GetPackBodyPointer(), videoMsg->GetPackBodySize());
bool timeout(false);
socket->Receive(videoMsg->GetPackBodyPointer(), videoMsg->GetPackBodySize(), timeout);

// Deserialize the transform data
// If you want to skip CRC check, call Unpack() without argument.
Expand Down
6 changes: 4 additions & 2 deletions Examples/VideoStreaming/VideoMetaClient.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ int main(int argc, char* argv[])
igtl::MessageHeader::Pointer headerMsg;
headerMsg = igtl::MessageHeader::New();
headerMsg->InitPack();
int rs = socket->Receive(headerMsg->GetPackPointer(), headerMsg->GetPackSize());
bool timeout(false);
igtlUint64 rs = socket->Receive(headerMsg->GetPackPointer(), headerMsg->GetPackSize(), timeout);
if (rs == 0)
{
std::cerr << "Connection closed." << std::endl;
Expand Down Expand Up @@ -118,7 +119,8 @@ int ReceiveVideoMeta(igtl::ClientSocket::Pointer& socket, igtl::MessageHeader::P
videoMeta->AllocatePack();

// Receive transform data from the socket
socket->Receive(videoMeta->GetPackBodyPointer(), videoMeta->GetPackBodySize());
bool timeout(false);
socket->Receive(videoMeta->GetPackBodyPointer(), videoMeta->GetPackBodySize(), timeout);

// Deserialize the transform data
// If you want to skip CRC check, call Unpack() without argument.
Expand Down
3 changes: 2 additions & 1 deletion Examples/VideoStreaming/VideoMetaServer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ int main(int argc, char* argv[])
headerMsg->InitPack();

// Receive generic header from the socket
int rs = socket->Receive(headerMsg->GetPackPointer(), headerMsg->GetPackSize());
bool timeout(false);
igtlUint64 rs = socket->Receive(headerMsg->GetPackPointer(), headerMsg->GetPackSize(), timeout);
if (rs == 0)
{
socket->CloseSocket();
Expand Down
3 changes: 2 additions & 1 deletion Examples/VideoStreaming/VideoServer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ int main(int argc, char* argv[])
headerMsg->InitPack();

// Receive generic header from the socket
int rs = socket->Receive(headerMsg->GetPackPointer(), headerMsg->GetPackSize());
bool timeout(false);
igtlUint64 rs = socket->Receive(headerMsg->GetPackPointer(), headerMsg->GetPackSize(), timeout);
if (rs <= 0)
{
if (threadID >= 0)
Expand Down
2 changes: 1 addition & 1 deletion SuperBuild/External_openh264.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ IF(OpenH264_FOUND)
ELSE()
# OpenIGTLink has not been built yet, so download and build it as an external project
MESSAGE(STATUS "Downloading openh264 from https://github.com/cisco/openh264.git.")
SET (OpenH264_INCLUDE_DIR "${CMAKE_BINARY_DIR}/Deps/openh264/codec/api/svc" CACHE PATH "H264 source directory" FORCE)
SET (OpenH264_INCLUDE_DIR "${CMAKE_BINARY_DIR}/Deps/openh264/codec/api/wels" CACHE PATH "H264 source directory" FORCE)
SET (OpenH264_LIBRARY_DIR "${CMAKE_BINARY_DIR}/Deps/openh264" CACHE PATH "H264 source directory" FORCE)
if(NOT CMAKE_SYSTEM_NAME STREQUAL "Windows")
ExternalProject_Add(OpenH264
Expand Down

0 comments on commit fa831f8

Please sign in to comment.