You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 line
1.2KB

  1. #ifndef rtp_sender_h
  2. #define rtp_sender_h
  3. #include <stdio.h>
  4. #include <stdint.h>
  5. #ifdef __cplusplus
  6. extern "C" {
  7. #endif
  8. struct rtp_sender_t
  9. {
  10. void* encoder;
  11. void* rtp;
  12. int payload;
  13. char encoding[16];
  14. uint16_t seq;
  15. uint32_t ssrc;
  16. uint32_t timestamp;
  17. uint32_t frequency; // default video: 90000
  18. uint32_t bandwidth; // default video: 2Mb, audio: 128Kb
  19. uint8_t buffer[2 * 1024]; // for sdp and rtp packet
  20. /// @return 0-ok, other-error
  21. int (*onpacket)(void* param, const void *packet, int bytes, uint32_t timestamp, int flags);
  22. void (*onbye)(void* param); // rtcp bye msg
  23. void* param;
  24. };
  25. /// @param[in] proto RTP/AVP, see more @librtsp/include/sdp-utils.h
  26. int rtp_sender_init_video(struct rtp_sender_t* s, const char* proto, unsigned short port, int payload, const char* encoding, int frequence, const void* extra, size_t bytes);
  27. int rtp_sender_init_audio(struct rtp_sender_t* s, const char* proto, unsigned short port, int payload, const char* encoding, int sample_rate, int channel_count, const void* extra, size_t bytes);
  28. int rtp_sender_destroy(struct rtp_sender_t* s);
  29. #ifdef __cplusplus
  30. }
  31. #endif
  32. #endif /* rtp_sender_h */