diff options
author | Josh Blum <josh@joshknows.com> | 2010-04-08 10:57:16 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-04-08 10:57:16 -0700 |
commit | d743784919b362d93e6408f05bdef6e543e3fc7e (patch) | |
tree | 41bd275d4cb06c5d56a1858c3023ce4498381042 /host/lib/transport/gen_vrt.py | |
parent | b66a74ff1f629af714e26040b410d472c08be522 (diff) | |
download | uhd-d743784919b362d93e6408f05bdef6e543e3fc7e.tar.gz uhd-d743784919b362d93e6408f05bdef6e543e3fc7e.tar.bz2 uhd-d743784919b362d93e6408f05bdef6e543e3fc7e.zip |
converted timespec to use nanoseconds for fractional part
Diffstat (limited to 'host/lib/transport/gen_vrt.py')
-rwxr-xr-x | host/lib/transport/gen_vrt.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/host/lib/transport/gen_vrt.py b/host/lib/transport/gen_vrt.py index 918de3ad7..bc6635d78 100755 --- a/host/lib/transport/gen_vrt.py +++ b/host/lib/transport/gen_vrt.py @@ -54,7 +54,8 @@ void vrt::pack( size_t &num_header_words32, //output size_t num_payload_words32, //input size_t &num_packet_words32, //output - size_t packet_count //input + size_t packet_count, //input + double tick_rate //input ){ boost::uint32_t vrt_hdr_flags; @@ -91,7 +92,7 @@ void vrt::pack( #if $pred & $tsf_p header_buff[$num_header_words] = htonl(0); #set $num_header_words += 1 - header_buff[$num_header_words] = htonl(metadata.time_spec.ticks); + header_buff[$num_header_words] = htonl(metadata.time_spec.get_ticks(tick_rate)); #set $num_header_words += 1 #set $flags |= (0x1 << 20); #end if @@ -127,7 +128,8 @@ void vrt::unpack( size_t &num_header_words32, //output size_t &num_payload_words32, //output size_t num_packet_words32, //input - size_t &packet_count //output + size_t &packet_count, //output + double tick_rate //input ){ //clear the metadata metadata = rx_metadata_t(); @@ -180,7 +182,7 @@ void vrt::unpack( #set $set_has_time_spec = True #end if #set $num_header_words += 1 - metadata.time_spec.ticks = ntohl(header_buff[$num_header_words]); + metadata.time_spec.set_ticks(ntohl(header_buff[$num_header_words]), tick_rate); #set $num_header_words += 1 #end if ########## Trailer ########## |