Browse Source

Remove redundant functions

Filip Klembara 4 years ago
parent
commit
256170adfe
2 changed files with 0 additions and 82 deletions
  1. 0 22
      include/rtc/rtc.h
  2. 0 60
      src/capi.cpp

+ 0 - 22
include/rtc/rtc.h

@@ -235,16 +235,6 @@ RTC_EXPORT int rtcSetH264PacketizationHandler(int tr, uint32_t ssrc, const char
 RTC_EXPORT int rtcSetOpusPacketizationHandler(int tr, uint32_t ssrc, const char * cname, uint8_t payloadType, uint32_t clockRate, uint16_t * _sequenceNumber, uint32_t * _timestamp);
 RTC_EXPORT int rtcSetOpusPacketizationHandler(int tr, uint32_t ssrc, const char * cname, uint8_t payloadType, uint32_t clockRate, uint16_t * _sequenceNumber, uint32_t * _timestamp);
 
 
 
 
-/// Set onOpen callback for track with given id
-/// @param id Track identifier
-/// @param cb OnOpen callback
-int rtcSetTrackOpenCallback(int id, rtcOpenCallbackFunc cb);
-
-/// Set onClosed callback for track with given id
-/// @param id Track identifier
-/// @param cb OnClosed callback
-int rtcSetTrackClosedCallback(int id, rtcClosedCallbackFunc cb);
-
 /// Set start time for RTP stream
 /// Set start time for RTP stream
 /// @param startTime_s Start time in seconds
 /// @param startTime_s Start time in seconds
 /// @param timeIntervalSince1970 Set true if `startTime_s` is time interval since 1970, false if `startTime_s` is time interval since 1900
 /// @param timeIntervalSince1970 Set true if `startTime_s` is time interval since 1970, false if `startTime_s` is time interval since 1900
@@ -292,18 +282,6 @@ int rtcGetPreviousTrackSenderReportTimestamp(int id, uint32_t * timestamp);
 /// @param id Track id
 /// @param id Track id
 int rtcSetNeedsToSendRTCPSR(int id);
 int rtcSetNeedsToSendRTCPSR(int id);
 
 
-/// Sends data
-/// @param id Track id
-/// @param data Data buffer
-/// @param size Size
-/// @returns Data size
-int rtcTrackSend(int id, const uint8_t *data, int size);
-
-/// Add callback for received binary data (string data is ignored)
-/// @param tr Track id
-/// @param cb callback
-RTC_EXPORT int rtcSetTrackOnReceiveCallback(int tr, rtcMessageCallbackFunc cb);
-
 #endif // RTC_ENABLE_MEDIA
 #endif // RTC_ENABLE_MEDIA
 
 
 // WebSocket
 // WebSocket

+ 0 - 60
src/capi.cpp

@@ -576,52 +576,6 @@ int rtcSetOpusPacketizationHandler(int tr, uint32_t ssrc, const char * cname, ui
     });
     });
 }
 }
 
 
-
-int rtcSetTrackOpenCallback(int id, rtcOpenCallbackFunc cb) {
-    return WRAP({
-        auto track = getTrack(id);
-        if(cb) {
-            track->onOpen([id, cb]() {
-                if (auto ptr = getUserPointer(id)) {
-                    cb(id, *ptr);
-                }
-            });
-        } else {
-            track->onOpen(nullptr);
-        }
-    });
-}
-
-int rtcSetTrackClosedCallback(int id, rtcClosedCallbackFunc cb) {
-    return WRAP({
-        auto track = getTrack(id);
-        if (cb) {
-            track->onClosed([id, cb]() {
-                if (auto ptr = getUserPointer(id)) {
-                    cb(id, *ptr);
-                }
-            });
-        } else {
-            track->onClosed(nullptr);
-        }
-    });
-}
-
-int rtcSetTrackOnReceiveCallback(int id, rtcMessageCallbackFunc cb) {
-    return WRAP({
-        auto track = getTrack(id);
-        if (cb) {
-        track->onMessage([id, cb](binary data) {
-            if (auto ptr = getUserPointer(id)) {
-                cb(id, reinterpret_cast<const char *>(data.data()), int(data.size()), *ptr);
-            }
-        }, nullptr);
-        } else {
-            track->onMessage(nullptr);
-        }
-    });
-}
-
 int rtcSetRTPConfigurationStartTime(int id, double startTime_s, bool timeIntervalSince1970, const uint32_t * _timestamp) {
 int rtcSetRTPConfigurationStartTime(int id, double startTime_s, bool timeIntervalSince1970, const uint32_t * _timestamp) {
     return WRAP({
     return WRAP({
         auto config = getRTPConfig(id);
         auto config = getRTPConfig(id);
@@ -693,20 +647,6 @@ int rtcSetNeedsToSendRTCPSR(int id) {
     });
     });
 }
 }
 
 
-int rtcTrackSend(int id, const uint8_t *data, int size) {
-    return WRAP({
-        auto track = getTrack(id);
-
-        if (!data && size != 0) {
-            throw std::invalid_argument("Unexpected null pointer for data");
-        }
-
-        auto b = reinterpret_cast<const byte *>(data);
-        track->send(binary(b, b + size));
-        return size;
-    });
-}
-
 #endif // RTC_ENABLE_MEDIA
 #endif // RTC_ENABLE_MEDIA
 
 
 int rtcAddTrack(int pc, const char *mediaDescriptionSdp) {
 int rtcAddTrack(int pc, const char *mediaDescriptionSdp) {