Browse Source

Removed C API functions related to packetizer start time

Paul-Louis Ageneau 2 years ago
parent
commit
d263b4b5b7
2 changed files with 7 additions and 47 deletions
  1. 0 16
      include/rtc/rtc.h
  2. 7 31
      src/capi.cpp

+ 0 - 16
include/rtc/rtc.h

@@ -292,13 +292,6 @@ typedef struct {
 
 
 } rtcPacketizationHandlerInit;
 } rtcPacketizationHandlerInit;
 
 
-typedef struct {
-	double seconds;     // Start time in seconds
-	bool since1970;     // true if seconds since 1970
-	                    // false if seconds since 1900
-	uint32_t timestamp; // Start timestamp
-} rtcStartTime;
-
 typedef struct {
 typedef struct {
 	uint32_t ssrc;
 	uint32_t ssrc;
 	const char *name;    // optional
 	const char *name;    // optional
@@ -318,12 +311,6 @@ RTC_EXPORT int rtcChainRtcpSrReporter(int tr);
 // Chain RtcpNackResponder to handler chain for given track
 // Chain RtcpNackResponder to handler chain for given track
 RTC_EXPORT int rtcChainRtcpNackResponder(int tr, unsigned int maxStoredPacketsCount);
 RTC_EXPORT int rtcChainRtcpNackResponder(int tr, unsigned int maxStoredPacketsCount);
 
 
-/// Set start time for RTP stream
-RTC_EXPORT int rtcSetRtpConfigurationStartTime(int id, const rtcStartTime *startTime);
-
-// Start stats recording for RTCP Sender Reporter
-RTC_EXPORT int rtcStartRtcpSenderReporterRecording(int id);
-
 // Transform seconds to timestamp using track's clock rate, result is written to timestamp
 // Transform seconds to timestamp using track's clock rate, result is written to timestamp
 RTC_EXPORT int rtcTransformSecondsToTimestamp(int id, double seconds, uint32_t *timestamp);
 RTC_EXPORT int rtcTransformSecondsToTimestamp(int id, double seconds, uint32_t *timestamp);
 
 
@@ -333,9 +320,6 @@ RTC_EXPORT int rtcTransformTimestampToSeconds(int id, uint32_t timestamp, double
 // Get current timestamp, result is written to timestamp
 // Get current timestamp, result is written to timestamp
 RTC_EXPORT int rtcGetCurrentTrackTimestamp(int id, uint32_t *timestamp);
 RTC_EXPORT int rtcGetCurrentTrackTimestamp(int id, uint32_t *timestamp);
 
 
-// Get start timestamp for track identified by given id, result is written to timestamp
-RTC_EXPORT int rtcGetTrackStartTimestamp(int id, uint32_t *timestamp);
-
 // Set RTP timestamp for track identified by given id
 // Set RTP timestamp for track identified by given id
 RTC_EXPORT int rtcSetTrackRtpTimestamp(int id, uint32_t timestamp);
 RTC_EXPORT int rtcSetTrackRtpTimestamp(int id, uint32_t timestamp);
 
 

+ 7 - 31
src/capi.cpp

@@ -300,9 +300,11 @@ createRtpPacketizationConfig(const rtcPacketizationHandlerInit *init) {
 	if (!init->cname)
 	if (!init->cname)
 		throw std::invalid_argument("Unexpected null pointer for cname");
 		throw std::invalid_argument("Unexpected null pointer for cname");
 
 
-	return std::make_shared<RtpPacketizationConfig>(init->ssrc, init->cname, init->payloadType,
-	                                                init->clockRate, init->sequenceNumber,
-	                                                init->timestamp);
+	auto config = std::make_shared<RtpPacketizationConfig>(init->ssrc, init->cname,
+	                                                       init->payloadType, init->clockRate);
+	config->sequenceNumber = init->sequenceNumber;
+	config->timestamp = init->timestamp;
+	return config;
 }
 }
 
 
 #endif // RTC_ENABLE_MEDIA
 #endif // RTC_ENABLE_MEDIA
@@ -1162,24 +1164,6 @@ int rtcChainRtcpNackResponder(int tr, unsigned int maxStoredPacketsCount) {
 	});
 	});
 }
 }
 
 
-int rtcSetRtpConfigurationStartTime(int id, const rtcStartTime *startTime) {
-	return wrap([&] {
-		auto config = getRtpConfig(id);
-		auto epoch = startTime->since1970 ? RtpPacketizationConfig::EpochStart::T1970
-		                                  : RtpPacketizationConfig::EpochStart::T1900;
-		config->setStartTime(startTime->seconds, epoch, startTime->timestamp);
-		return RTC_ERR_SUCCESS;
-	});
-}
-
-int rtcStartRtcpSenderReporterRecording(int id) {
-	return wrap([id] {
-		auto sender = getRtcpSrReporter(id);
-		sender->startRecording();
-		return RTC_ERR_SUCCESS;
-	});
-}
-
 int rtcTransformSecondsToTimestamp(int id, double seconds, uint32_t *timestamp) {
 int rtcTransformSecondsToTimestamp(int id, double seconds, uint32_t *timestamp) {
 	return wrap([&] {
 	return wrap([&] {
 		auto config = getRtpConfig(id);
 		auto config = getRtpConfig(id);
@@ -1204,14 +1188,6 @@ int rtcGetCurrentTrackTimestamp(int id, uint32_t *timestamp) {
 	});
 	});
 }
 }
 
 
-int rtcGetTrackStartTimestamp(int id, uint32_t *timestamp) {
-	return wrap([&] {
-		auto config = getRtpConfig(id);
-		*timestamp = config->startTimestamp;
-		return RTC_ERR_SUCCESS;
-	});
-}
-
 int rtcSetTrackRtpTimestamp(int id, uint32_t timestamp) {
 int rtcSetTrackRtpTimestamp(int id, uint32_t timestamp) {
 	return wrap([&] {
 	return wrap([&] {
 		auto config = getRtpConfig(id);
 		auto config = getRtpConfig(id);
@@ -1220,10 +1196,10 @@ int rtcSetTrackRtpTimestamp(int id, uint32_t timestamp) {
 	});
 	});
 }
 }
 
 
-int rtcGetPreviousTrackSenderReportTimestamp(int id, uint32_t *timestamp) {
+int rtcGetLastTrackSenderReportTimestamp(int id, uint32_t *timestamp) {
 	return wrap([&] {
 	return wrap([&] {
 		auto sender = getRtcpSrReporter(id);
 		auto sender = getRtcpSrReporter(id);
-		*timestamp = sender->previousReportedTimestamp;
+		*timestamp = sender->lastReportedTimestamp();
 		return RTC_ERR_SUCCESS;
 		return RTC_ERR_SUCCESS;
 	});
 	});
 }
 }