
use otool -L to check any homebrew install dependencies...
replace them using
-	install_name_tool -id
-	install_name_tool -change
each of these dlyb must be checked and added to the MacnicaPlugin/Lib/
libboost_atomic
libboost_chrono
libboost_date_time
libboost_filesystem
libboost_random
libboost_regex
libboost_system
libboost_thread
libcpprest.2.10
libcrypto.3
libicudata.77.1
libicui18n.77.1
libicuuc.77.1
libm2s
libmep100DevCon
libmep100HpsClient
libssl.3

if new dependencies are added you will have to add them too.

renaming:
- from "libm2s.dylib.2.30.4" to "libm2s.dylib"
- from "libmep100DevCon.dylib.1.0.1" to "libmep100DevCon.dylib" 		(/usr/local/lib)
- from "libmep100HpsClient.dylib.1.0.1" to "libmep100HpsClient.dylib"

copy from /opt/homebrew/Cellar/cpprestsdk/2.10.19_2/lib/libcpprest.2.10.dylib	to SMSMacnicaPlugin/Lib/libcpprest.2.10.dylib
copy from /opt/homebrew/Cellar/boost/1.88.0/libboost_atomic.dylib	 			to SMSMacnicaPlugin/Lib/libboost_atomic.dylib
copy from /opt/homebrew/Cellar/boost/1.88.0/libboost_chrono.dylib				to SMSMacnicaPlugin/Lib/libboost_chrono.dylib
copy from /opt/homebrew/Cellar/boost/1.88.0/libboost_date_time.dylib			to SMSMacnicaPlugin/Lib/libboost_date_time.dylib
copy from /opt/homebrew/Cellar/boost/1.88.0/libboost_filesystem.dylib			to SMSMacnicaPlugin/Lib/libboost_filesystem.dylib
copy from /opt/homebrew/Cellar/boost/1.88.0/libboost_random.dylib				to SMSMacnicaPlugin/Lib/libboost_random.dylib
copy from /opt/homebrew/Cellar/boost/1.88.0/libboost_regex.dylib				to SMSMacnicaPlugin/Lib/libboost_regex.dylib
copy from /opt/homebrew/Cellar/boost/1.88.0/libboost_system.dylib				to SMSMacnicaPlugin/Lib/libboost_system.dylib
copy from /opt/homebrew/Cellar/boost/1.88.0/libboost_thread.dylib				to SMSMacnicaPlugin/Lib/libboost_thread.dylib

copy from /opt/homebrew/Cellar/icu4c@77/77.1/lib/libicudata.77.1.dylib			to SMSMacnicaPlugin/Lib/libicudata.77.1.dylib
copy from /opt/homebrew/Cellar/icu4c@77/77.1/lib/libicui18n.77.1.dylib			to SMSMacnicaPlugin/Lib/libicui18n.77.1.dylib
copy from /opt/homebrew/Cellar/icu4c@77/77.1/lib/libicuuc.77.1.dylib			to SMSMacnicaPlugin/Lib/libicuuc.77.1.dylib
copy from /opt/homebrew/Cellar/openssl@3/3.4.1/lib/libcrypto.3.dylib			to SMSMacnicaPlugin/Lib/libcrypto.3.dylib
copy from /opt/homebrew/Cellar/openssl@3/3.4.1/lib/libssl.3.dylib				to SMSMacnicaPlugin/Lib/libssl.3.dylib
 

install_name_tool -id @rpath/libcrypto.3.dylib /Volumes/Developer/svn/SMSIOLib/SMSMacnicaPlugin/trunk/SMSMacnicaPlugin/SMSMacnicaPlugin/Lib/libcrypto.3.dylib
install_name_tool -change /opt/homebrew/Cellar/openssl@3/3.4.1/lib/libcrypto.3.dylib @loader_path/libcrypto.3.dylib /Volumes/Developer/svn/SMSIOLib/SMSMacnicaPlugin/trunk/SMSMacnicaPlugin/SMSMacnicaPlugin/Lib/libcrypto.3.dylib
install_name_tool -change /opt/homebrew/Cellar/openssl@3/3.4.1/lib/libcrypto.3.dylib @loader_path/libcrypto.3.dylib /Volumes/Developer/svn/SMSIOLib/SMSMacnicaPlugin/trunk/SMSMacnicaPlugin/SMSMacnicaPlugin/Lib/libssl.3.dylib

install_name_tool -id @rpath/libssl.3.dylib /Volumes/Developer/svn/SMSIOLib/SMSMacnicaPlugin/trunk/SMSMacnicaPlugin/SMSMacnicaPlugin/Lib/libssl.3.dylib

install_name_tool -id @rpath/libcpprest.2.10.dylib /Volumes/Developer/svn/SMSIOLib/SMSMacnicaPlugin/trunk/SMSMacnicaPlugin/SMSMacnicaPlugin/Lib/libcpprest.2.10.dylib
install_name_tool -id @rpath/libboost_atomic.dylib /Volumes/Developer/svn/SMSIOLib/SMSMacnicaPlugin/trunk/SMSMacnicaPlugin/SMSMacnicaPlugin/Lib/libboost_atomic.dylib
install_name_tool -id @rpath/libboost_chrono.dylib /Volumes/Developer/svn/SMSIOLib/SMSMacnicaPlugin/trunk/SMSMacnicaPlugin/SMSMacnicaPlugin/Lib/libboost_chrono.dylib
install_name_tool -id @rpath/libboost_date_time.dylib /Volumes/Developer/svn/SMSIOLib/SMSMacnicaPlugin/trunk/SMSMacnicaPlugin/SMSMacnicaPlugin/Lib/libboost_date_time.dylib
install_name_tool -id @rpath/libboost_filesystem.dylib /Volumes/Developer/svn/SMSIOLib/SMSMacnicaPlugin/trunk/SMSMacnicaPlugin/SMSMacnicaPlugin/Lib/libboost_filesystem.dylib
install_name_tool -id @rpath/libboost_random.dylib /Volumes/Developer/svn/SMSIOLib/SMSMacnicaPlugin/trunk/SMSMacnicaPlugin/SMSMacnicaPlugin/Lib/libboost_random.dylib
install_name_tool -id @rpath/libboost_regex.dylib /Volumes/Developer/svn/SMSIOLib/SMSMacnicaPlugin/trunk/SMSMacnicaPlugin/SMSMacnicaPlugin/Lib/libboost_regex.dylib
install_name_tool -id @rpath/libboost_system.dylib /Volumes/Developer/svn/SMSIOLib/SMSMacnicaPlugin/trunk/SMSMacnicaPlugin/SMSMacnicaPlugin/Lib/libboost_system.dylib
install_name_tool -id @rpath/libboost_thread.dylib /Volumes/Developer/svn/SMSIOLib/SMSMacnicaPlugin/trunk/SMSMacnicaPlugin/SMSMacnicaPlugin/Lib/libboost_thread.dylib
install_name_tool -id @rpath/libicudata.77.1.dylib /Volumes/Developer/svn/SMSIOLib/SMSMacnicaPlugin/trunk/SMSMacnicaPlugin/SMSMacnicaPlugin/Lib/libicudata.77.1.dylib 
install_name_tool -id @rpath/libicui18n.77.1.dylib /Volumes/Developer/svn/SMSIOLib/SMSMacnicaPlugin/trunk/SMSMacnicaPlugin/SMSMacnicaPlugin/Lib/libicui18n.77.1.dylib 
install_name_tool -id @rpath/libicuuc.77.1.dylib /Volumes/Developer/svn/SMSIOLib/SMSMacnicaPlugin/trunk/SMSMacnicaPlugin/SMSMacnicaPlugin/Lib/libicuuc.77.1.dylib 

install_name_tool -change /opt/homebrew/opt/icu4c@77/lib/libicudata.77.dylib @loader_path/libicudata.77.1.dylib /Volumes/Developer/svn/SMSIOLib/SMSMacnicaPlugin/trunk/SMSMacnicaPlugin/SMSMacnicaPlugin/Lib/libboost_regex.dylib
install_name_tool -change /opt/homebrew/opt/icu4c@77/lib/libicui18n.77.dylib @loader_path/libicui18n.77.1.dylib /Volumes/Developer/svn/SMSIOLib/SMSMacnicaPlugin/trunk/SMSMacnicaPlugin/SMSMacnicaPlugin/Lib/libboost_regex.dylib
install_name_tool -change /opt/homebrew/opt/icu4c@77/lib/libicuuc.77.dylib @loader_path/libicuuc.77.1.dylib /Volumes/Developer/svn/SMSIOLib/SMSMacnicaPlugin/trunk/SMSMacnicaPlugin/SMSMacnicaPlugin/Lib/libboost_regex.dylib
	
	
install_name_tool -change /opt/homebrew/opt/cpprestsdk/lib/libcpprest.2.10.dylib @rpath/libcpprest.2.10.dylib /Volumes/Developer/svn/SMSIOLib/SMSMacnicaPlugin/trunk/SMSMacnicaPlugin/SMSMacnicaPlugin/Lib/libmep100HpsClient.dylib
install_name_tool -change /opt/homebrew/opt/openssl@3/lib/libcrypto.3.dylib @rpath/libcrypto.3.dylib /Volumes/Developer/svn/SMSIOLib/SMSMacnicaPlugin/trunk/SMSMacnicaPlugin/SMSMacnicaPlugin/Lib/libmep100HpsClient.dylib
install_name_tool -change /opt/homebrew/opt/openssl@3/lib/libssl.3.dylib @rpath/libssl.3.dylib /Volumes/Developer/svn/SMSIOLib/SMSMacnicaPlugin/trunk/SMSMacnicaPlugin/SMSMacnicaPlugin/Lib/libmep100HpsClient.dylib

install_name_tool -change /opt/homebrew/opt/boost/lib/libboost_random.dylib @loader_path/libboost_random.dylib /Volumes/Developer/svn/SMSIOLib/SMSMacnicaPlugin/trunk/SMSMacnicaPlugin/SMSMacnicaPlugin/Lib/libcpprest.2.10.dylib
install_name_tool -change /opt/homebrew/opt/boost/lib/libboost_thread.dylib @loader_path/libboost_thread.dylib /Volumes/Developer/svn/SMSIOLib/SMSMacnicaPlugin/trunk/SMSMacnicaPlugin/SMSMacnicaPlugin/Lib/libcpprest.2.10.dylib
install_name_tool -change /opt/homebrew/opt/boost/lib/libboost_filesystem.dylib @loader_path/libboost_filesystem.dylib /Volumes/Developer/svn/SMSIOLib/SMSMacnicaPlugin/trunk/SMSMacnicaPlugin/SMSMacnicaPlugin/Lib/libcpprest.2.10.dylib
install_name_tool -change /opt/homebrew/opt/boost/lib/libboost_chrono.dylib @loader_path/libboost_chrono.dylib /Volumes/Developer/svn/SMSIOLib/SMSMacnicaPlugin/trunk/SMSMacnicaPlugin/SMSMacnicaPlugin/Lib/libcpprest.2.10.dylib
install_name_tool -change /opt/homebrew/opt/boost/lib/libboost_system.dylib @loader_path/libboost_system.dylib /Volumes/Developer/svn/SMSIOLib/SMSMacnicaPlugin/trunk/SMSMacnicaPlugin/SMSMacnicaPlugin/Lib/libcpprest.2.10.dylib
install_name_tool -change /opt/homebrew/opt/boost/lib/libboost_atomic.dylib @loader_path/libboost_atomic.dylib /Volumes/Developer/svn/SMSIOLib/SMSMacnicaPlugin/trunk/SMSMacnicaPlugin/SMSMacnicaPlugin/Lib/libcpprest.2.10.dylib
install_name_tool -change /opt/homebrew/opt/boost/lib/libboost_date_time.dylib @loader_path/libboost_date_time.dylib /Volumes/Developer/svn/SMSIOLib/SMSMacnicaPlugin/trunk/SMSMacnicaPlugin/SMSMacnicaPlugin/Lib/libcpprest.2.10.dylib
install_name_tool -change /opt/homebrew/opt/boost/lib/libboost_regex.dylib @loader_path/libboost_regex.dylib /Volumes/Developer/svn/SMSIOLib/SMSMacnicaPlugin/trunk/SMSMacnicaPlugin/SMSMacnicaPlugin/Lib/libcpprest.2.10.dylib
	
otool -L /Volumes/Developer/svn/SMSIOLib/SMSMacnicaPlugin/trunk/SMSMacnicaPlugin/SMSMacnicaPlugin/Lib/libcpprest.2.10.dylib 
/Volumes/Developer/svn/SMSIOLib/SMSMacnicaPlugin/trunk/SMSMacnicaPlugin/SMSMacnicaPlugin/Lib/libcpprest.2.10.dylib:
	@rpath/libcpprest.2.10.dylib (compatibility version 2.10.0, current version 0.0.0)
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 3208.0.0)
	/System/Library/Frameworks/Security.framework/Versions/A/Security (compatibility version 1.0.0, current version 61439.60.117)
	/opt/homebrew/opt/openssl@3/lib/libssl.3.dylib (compatibility version 3.0.0, current version 3.0.0)
	/opt/homebrew/opt/openssl@3/lib/libcrypto.3.dylib (compatibility version 3.0.0, current version 3.0.0)



Homebrew
% wich brew
/usr/local/bin/brew -> terminal is using intel homebrew
we want to use arm version of home brew... 
% echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
% source ~/.zprofile -> source ~/.zprofile tells your current shell to reload and run the commands in your ~/.zprofile file immediately, in this same shell process.
% wich brew
/opt/homebrew/bin/brew -> terminal is now using arm version of homebrew
Compress /usr/local/Homebrew and rename it
'/usr/local/Homebrew (intel).zip'

Conan
% which conan
/opt/homebrew/bin/conan -> (! must not be in /usr/local/bin/brew -> check HomeBrew section above)
if you have no path: -> conan not installed -> % brew install conan@2

Once installed:
% conan profile detect --force -> will create a default profile
% conan profile list
should show default
% conan profile show -pr default	-> show your current profile (verify arch is not x86_64. should be armv8)


NMOS

xcrun --sdk macosx --show-sdk-version
result= 26.2

open /Users/valentintruant/.conan2/profiles/default and add 
"
os=Macos
os.sdk=macosx
os.sdk_version=...
"
replace ... by result of xcrun

open 'xxx/m2s/nmos/cmake_top/release/conanfile.txt'
modify zlib version to 1.3.1
and and CMakeToolchain

[requires]
zlib/1.3.1

[generators]
CMakeDeps
CMakeToolchain

terminal: 
cd xxx/m2s/nmos/cmake_top/release/
conan cache clean --build --source --download --temp
conan remove --confirm 'boost/*'

SDKPATH="$(xcrun --sdk macosx --show-sdk-path)"

/* create a file name conan_install.sh and paste this
conan install . -of build \
  -s:h build_type=Debug -s:h os.sdk=macosx -s:h os.sdk_version=26.0 \
  -s:b os.sdk=macosx -s:b os.sdk_version=26.0 \
  -c tools.apple:sdk_path="$SDKPATH" \
  -b missing -c tools.cmake.cmaketoolchain:generator=Ninja
  */
 
 ./conan_install.h
 
copy /Volumes/Developer/SDKs/Macnica/December/PCKG_001840A_M2S_SDK_MEP100_Edition_macOS_Rev3.30.3/m2s/nmos/cmake_top/release/build_patched.sh to your new version directory
perl -pi -e 's/\$LD_LIBRARY_PATH/\${LD_LIBRARY_PATH:-}/g; s/\$DYLD_LIBRARY_PATH/\${DYLD_LIBRARY_PATH:-}/g' ./build_patched.sh
 
brew install pkg-config gstreamer
./build_patched.sh -x

nmos project will be 
/Volumes/Developer/SDKs/Macnica/December/PCKG_001840A_M2S_SDK_MEP100_Edition_macOS_Rev3.30.3/m2s/nmos/cmake_top/release/build_xcode/macnica-nmos-node.xcodeproj

open project.pbxproj
replace /usr/local/lib/libmep100HpsClient.dylib
with /Volumes/Developer/svn/SMSIOLib/SMSMacnicaPlugin/trunk/SMSMacnicaPlugin/SMSMacnicaPlugin/Lib/libmep100HpsClient.dylib

brew install json-c

under build settings of SMSMacnicaPlugin
CLANG_CXX_LIBRARY	libc++

side notes:
maceth0: macnica ethernet 0
maceth1: macnica ethernet 1
mactun: tunnel interface ?

mai_num: Media access interface number. (I suppose it is the card number. always 0 for now)


AMWA (Advanced Media Workflow Association)
NMOS: Networked Media Open Specifications
RDS: Registry and Discovery Specifications
IS-xx for Interface Specification

	•	IS-04 – Discovery & Registration (Registry is a centralized (or distributed) database where Nodes register themselves.à)
	•	IS-05 – Connection Management 	(telling a Receiver which Sender it should connect to.)
	•	IS-08 – Audio Channel Mapping (e.g., re-mapping channels from 5.1, stereo, commentary)
	•	IS-09 – System Parameters (e.g., PTP domain info, network info)
	•	IS-10 – Authorization (security model for NMOS APIs)


PTP: Precision Time Protocol (IEEE-1588)

m2s_ptp_sm_t: macnica ptp state machine.

int32_t currentLocalOffset
	•	Current offset (in seconds) between local time and PTP master time.
	•	Example: if your local system is running UTC+2, currentLocalOffset = +7200.

int32_t jumpSeconds
	•	Size of the next time jump that must be applied (in seconds).
	•	Used when DST starts/stops (+3600/–3600), or when inserting/removing a leap second (+1/–1).

uint64_t timeOfNextJump
	•	Absolute PTP time when the next jump should occur.
	•	Example: “at 2025-03-30 01:00:00 UTC, add 3600s for DST.”

uint64_t timeOfNextJam
	•	“Jam” usually means a hard re-alignment of the clock.
	•	This could be when the device decides it must abruptly resync to the master rather than gradually slewing.
	•	This field is the timestamp when such a jam is scheduled.

uint64_t timeOfPreviousJam
	•	The last time a jam actually occurred.
	•	Useful for diagnostics or for logic like “don’t jam too often.”

int32_t previousJamLocalOffset
	•	The local offset that was in effect just before the last jam.
	•	Helps compute the delta applied, or for rollback/debug.

bool isDaylightSavingAtNextJump
	•	True if the next jump is due to daylight saving time change.

bool isLeapSecondAtNextJump
	•	True if the next jump is due to a leap second insertion/removal.
	•	E.g. when UTC goes from 23:59:59 → 23:59:60 → 00:00:00.

bool isDropFrame
	•	True if the current timecode should be interpreted as drop-frame (SMPTE 12M style).
	•	Drop-frame is used in NTSC video (29.97 fps) to keep timecode aligned with clock time.
	•	The PTP state machine needs this so generated timecodes are continuous and match real time.

bool isExternalReference
	•	True if the clock is locked to an external source (blackburst, tri-level sync, GPS, etc.) rather than purely network PTP.
	•	PTP software must handle differently when external ref is active (it may not discipline the clock itself but just monitor).



1. Julian Date (JD) first
	•	Astronomers invented the Julian Date: it counts the number of days (and fractions of days) since a reference point far in the past: noon UTC on January 1, 4713 BC in the Julian calendar.
	•	Example:
	•	Jan 1, 2000, 12:00 UTC = JD 2451545.0

2. Why Modified?

The Julian Date numbers are huge (in the millions), which is awkward in practical systems (databases, telemetry, timecode, etc.).
So scientists defined the Modified Julian Date as:

MJD = JD - 2400000.5
	•	Subtracting 2,400,000.5 shifts the starting point to midnight UTC on November 17, 1858.
	•	The “.5” is there so MJD starts at midnight instead of noon.
	•	Result: the numbers are smaller (5 digits instead of 7), and start at the beginning of a day.
