[vlc-commits] [Git][videolan/vlc][master] core: rename NTPtime64 to vlc_ntp_time

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Thu Jul 6 20:50:41 UTC 2023



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
416e3d12 by Marvin Scholz at 2023-07-06T20:32:36+00:00
core: rename NTPtime64 to vlc_ntp_time

This function name did not follow any conventions used throughout
the codebase, so take the chance that we break API/ABI in 4.x to
rename it before we have to keep it around even longer if we don't
do it now.

- - - - -


7 changed files:

- include/vlc_tick.h
- modules/stream_out/rtcp.c
- modules/stream_out/sdp_helper.c
- src/check_symbols
- src/libvlccore.sym
- src/misc/mtime.c
- src/posix/rand.c


Changes:

=====================================
include/vlc_tick.h
=====================================
@@ -306,7 +306,9 @@ VLC_API vlc_tick_t date_Decrement(date_t *restrict date, uint32_t count);
 /** @} */
 
 /**
- * @return NTP 64-bits timestamp in host byte order.
+ * Gets the current wallclock time as 64-bit NTP timestamp.
+ * 
+ * \return NTP 64-bits timestamp in host byte order
  */
-VLC_API uint64_t NTPtime64( void );
+VLC_API uint64_t vlc_ntp_time( void );
 #endif /* !__VLC_MTIME_ */


=====================================
modules/stream_out/rtcp.c
=====================================
@@ -141,7 +141,7 @@ rtcp_sender_t *OpenRTCP (vlc_object_t *obj, int rtp_fd, int proto,
     ptr[1] = 200; /* payload type: Sender Report */
     SetWBE (ptr + 2, 6); /* length = 6 (7 double words) */
     memset (ptr + 4, 0, 4); /* SSRC unknown yet */
-    SetQWBE (ptr + 8, NTPtime64 ());
+    SetQWBE (ptr + 8, vlc_ntp_time ());
     memset (ptr + 16, 0, 12); /* timestamp and counters */
     ptr += 28;
 
@@ -180,7 +180,7 @@ void CloseRTCP (rtcp_sender_t *rtcp)
         return;
 
     uint8_t *ptr = rtcp->payload;
-    uint64_t now64 = NTPtime64 ();
+    uint64_t now64 = vlc_ntp_time ();
     SetQWBE (ptr + 8, now64); /* Update the Sender Report timestamp */
 
     /* Bye */
@@ -216,7 +216,7 @@ void SendRTCP (rtcp_sender_t *restrict rtcp, const block_t *rtp)
 
     uint8_t *ptr = rtcp->payload;
     uint32_t last = GetDWBE (ptr + 8); // last RTCP SR send time
-    uint64_t now64 = NTPtime64 ();
+    uint64_t now64 = vlc_ntp_time ();
     if ((now64 >> 32) < (last + 5))
         return; // no more than one SR every 5 seconds
 


=====================================
modules/stream_out/sdp_helper.c
=====================================
@@ -110,7 +110,7 @@ int vlc_sdp_Start(struct vlc_memstream *restrict stream,
     if (AddressToSDP(addr, addrlen, connection) == NULL)
         goto error;
     {
-        const uint_fast64_t now = NTPtime64();
+        const uint_fast64_t now = vlc_ntp_time();
         char hostname[256];
 
         gethostname(hostname, sizeof (hostname));


=====================================
src/check_symbols
=====================================
@@ -23,7 +23,6 @@ cat libvlccore.sym | grep -v \
 	-e '^date_' -e '^plane_' \
 	-e '^utf8_' -e '^xml_' \
 	-e '^[A-Z][a-z]*Charset$' \
-	-e '^NTPtime64$' \
 		&& exit 1
 
 echo "None found."


=====================================
src/libvlccore.sym
=====================================
@@ -287,6 +287,7 @@ vlc_memstream_putc
 vlc_memstream_puts
 vlc_memstream_vprintf
 vlc_memstream_printf
+vlc_ntp_time
 vlc_Log
 vlc_LogSet
 vlc_vaLog
@@ -311,7 +312,6 @@ net_OpenDgram
 net_Read
 net_SetCSCov
 net_Write
-NTPtime64
 picture_AttachAncillary
 picture_AttachNewAncillary
 picture_BlendSubpicture


=====================================
src/misc/mtime.c
=====================================
@@ -128,7 +128,7 @@ vlc_tick_t date_Decrement( date_t *p_date, uint32_t i_nb_samples )
     return p_date->date;
 }
 
-uint64_t NTPtime64(void)
+uint64_t vlc_ntp_time(void)
 {
     struct timespec ts;
 


=====================================
src/posix/rand.c
=====================================
@@ -79,7 +79,7 @@ void vlc_rand_bytes (void *buf, size_t len)
     static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
     static uint64_t counter = 0;
 
-    uint64_t stamp = NTPtime64 ();
+    uint64_t stamp = vlc_ntp_time ();
 
     while (len > 0)
     {



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/416e3d12c85a82fdddac78b05f07b28fd449b5f8

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/416e3d12c85a82fdddac78b05f07b28fd449b5f8
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list