rtc.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /**
  2. * Copyright (c) 2019 Paul-Louis Ageneau
  3. *
  4. * This library is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Lesser General Public
  6. * License as published by the Free Software Foundation; either
  7. * version 2.1 of the License, or (at your option) any later version.
  8. *
  9. * This library is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * Lesser General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Lesser General Public
  15. * License along with this library; if not, write to the Free Software
  16. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  17. */
  18. #ifdef __cplusplus
  19. extern "C" {
  20. #endif
  21. // libdatachannel rtc C API
  22. int rtcCreatePeerConnection(const char **iceServers, int iceServersCount);
  23. void rtcDeletePeerConnection(int pc);
  24. int rtcCreateDataChannel(int pc, const char *label);
  25. void rtcDeleteDataChannel(int dc);
  26. void rtcSetDataChannelCallback(int pc, void (*dataChannelCallback)(int, void *));
  27. void rtcSetLocalDescriptionCallback(int pc, void (*descriptionCallback)(const char *, const char *,
  28. void *));
  29. void rtcSetLocalCandidateCallback(int pc,
  30. void (*candidateCallback)(const char *, const char *, void *));
  31. void rtcSetRemoteDescription(int pc, const char *sdp, const char *type);
  32. void rtcAddRemoteCandidate(int pc, const char *candidate, const char *mid);
  33. int rtcGetDataChannelLabel(int dc, char *data, int size);
  34. void rtcSetOpenCallback(int dc, void (*openCallback)(void *));
  35. void rtcSetErrorCallback(int dc, void (*errorCallback)(const char *, void *));
  36. void rtcSetMessageCallback(int dc, void (*messageCallback)(const char *, int, void *));
  37. int rtcSendMessage(int dc, const char *data, int size);
  38. void rtcSetUserPointer(int i, void *ptr);
  39. #ifdef __cplusplus
  40. } // extern "C"
  41. #endif