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.

38 line
1.4KB

  1. #ifndef _rtp_demuxer_h_
  2. #define _rtp_demuxer_h_
  3. #include <stdint.h>
  4. #if defined(__cplusplus)
  5. extern "C" {
  6. #endif
  7. struct rtp_demuxer_t;
  8. /// @param[in] param rtp_demuxer_create input param
  9. /// @param[in] packet rtp payload data
  10. /// @param[in] bytes rtp payload length in byte
  11. /// @param[in] timestamp rtp timestamp(relation at sample rate)
  12. /// @param[in] flags rtp packet flags, RTP_PAYLOAD_FLAG_PACKET_xxx, see more @rtp-payload.h
  13. /// @return 0-ok, other-error
  14. typedef int (*rtp_demuxer_onpacket)(void* param, const void *packet, int bytes, uint32_t timestamp, int flags);
  15. /// @param[in] jitter rtp reorder jitter(ms), e.g. 200(ms)
  16. /// @param[in] frequency audio/video sample rate, e.g. video 90000, audio 48000
  17. /// @param[in] payload rtp payload id, see more @rtp-profile.h
  18. /// @param[in] encoding rtp payload encoding, see more @rtp-profile.h
  19. struct rtp_demuxer_t* rtp_demuxer_create(int jitter, int frequency, int payload, const char* encoding, rtp_demuxer_onpacket onpkt, void* param);
  20. int rtp_demuxer_destroy(struct rtp_demuxer_t** rtp);
  21. /// @param[in] data a rtp/rtcp packet
  22. /// @return >0-rtcp message, 0-ok, <0-error
  23. int rtp_demuxer_input(struct rtp_demuxer_t* rtp, const void* data, int bytes);
  24. /// @return >0-rtcp report length, 0-don't need send rtcp
  25. int rtp_demuxer_rtcp(struct rtp_demuxer_t* rtp, void* buf, int len);
  26. #if defined(__cplusplus)
  27. }
  28. #endif
  29. #endif /* _rtp_demuxer_h_ */