Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

66 lines
2.7KB

  1. #ifndef _rtp_internal_h_
  2. #define _rtp_internal_h_
  3. #include "rtp.h"
  4. #include "rtp-header.h"
  5. #include "rtcp-header.h"
  6. #include "rtp-member.h"
  7. #include "rtp-member-list.h"
  8. #include <stdlib.h>
  9. #include <string.h>
  10. #include <assert.h>
  11. #define MIN(a, b) ((a) < (b) ? (a) : (b))
  12. #define MAX(a, b) ((a) > (b) ? (a) : (b))
  13. struct rtp_context
  14. {
  15. struct rtp_event_t handler;
  16. void* cbparam;
  17. void *members; // rtp source list
  18. void *senders; // rtp sender list
  19. struct rtp_member *self;
  20. // RTP/RTCP
  21. int avg_rtcp_size;
  22. int rtcp_bw;
  23. int rtcp_cycle; // for RTCP SDES
  24. int frequence;
  25. int init;
  26. int role;
  27. };
  28. struct rtp_member* rtp_sender_fetch(struct rtp_context *ctx, uint32_t ssrc);
  29. struct rtp_member* rtp_member_fetch(struct rtp_context *ctx, uint32_t ssrc);
  30. int rtcp_input_rtp(struct rtp_context *ctx, const void* data, int bytes);
  31. int rtcp_input_rtcp(struct rtp_context *ctx, const void* data, int bytes);
  32. int rtcp_rr_pack(struct rtp_context *ctx, uint8_t* data, int bytes);
  33. int rtcp_sr_pack(struct rtp_context *ctx, uint8_t* data, int bytes);
  34. int rtcp_sdes_pack(struct rtp_context *ctx, uint8_t* data, int bytes);
  35. int rtcp_bye_pack(struct rtp_context *ctx, uint8_t* data, int bytes);
  36. int rtcp_app_pack(struct rtp_context *ctx, uint8_t* ptr, int bytes, const char name[4], const void* app, int len);
  37. int rtcp_rtpfb_pack(struct rtp_context* ctx, uint8_t* data, int bytes, enum rtcp_rtpfb_type_t id, const rtcp_rtpfb_t* rtpfb);
  38. int rtcp_psfb_pack(struct rtp_context* ctx, uint8_t* data, int bytes, enum rtcp_psfb_type_t id, const rtcp_psfb_t* psfb);
  39. int rtcp_xr_pack(struct rtp_context* ctx, uint8_t* data, int bytes, enum rtcp_xr_type_t id, const rtcp_xr_t* xr);
  40. void rtcp_rr_unpack(struct rtp_context *ctx, const rtcp_header_t *header, const uint8_t* data, size_t bytes);
  41. void rtcp_sr_unpack(struct rtp_context *ctx, const rtcp_header_t *header, const uint8_t* data, size_t bytes);
  42. void rtcp_sdes_unpack(struct rtp_context *ctx, const rtcp_header_t *header, const uint8_t* data, size_t bytes);
  43. void rtcp_bye_unpack(struct rtp_context *ctx, const rtcp_header_t *header, const uint8_t* data, size_t bytes);
  44. void rtcp_app_unpack(struct rtp_context *ctx, const rtcp_header_t *header, const uint8_t* data, size_t bytes);
  45. void rtcp_rtpfb_unpack(struct rtp_context* ctx, const rtcp_header_t* header, const uint8_t* data, size_t bytes);
  46. void rtcp_psfb_unpack(struct rtp_context* ctx, const rtcp_header_t* header, const uint8_t* data, size_t bytes);
  47. void rtcp_xr_unpack(struct rtp_context* ctx, const rtcp_header_t* header, const uint8_t* data, size_t bytes);
  48. int rtcp_report_block(struct rtp_member* sender, uint8_t* ptr, int bytes);
  49. uint64_t rtpclock(void);
  50. uint64_t ntp2clock(uint64_t ntp);
  51. uint64_t clock2ntp(uint64_t clock);
  52. uint32_t rtp_ssrc(void);
  53. #endif /* !_rtp_internal_h_ */