rtpenc.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * RTP muxer definitions
  3. * Copyright (c) 2002 Fabrice Bellard
  4. *
  5. * This file is part of FFmpeg.
  6. *
  7. * FFmpeg is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU Lesser General Public
  9. * License as published by the Free Software Foundation; either
  10. * version 2.1 of the License, or (at your option) any later version.
  11. *
  12. * FFmpeg is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Lesser General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Lesser General Public
  18. * License along with FFmpeg; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  20. */
  21. #ifndef AVFORMAT_RTPENC_H
  22. #define AVFORMAT_RTPENC_H
  23. #include "avformat.h"
  24. #include "rtp.h"
  25. struct RTPMuxContext {
  26. AVFormatContext *ic;
  27. AVStream *st;
  28. int payload_type;
  29. uint32_t ssrc;
  30. uint16_t seq;
  31. uint32_t timestamp;
  32. uint32_t base_timestamp;
  33. uint32_t cur_timestamp;
  34. int max_payload_size;
  35. int num_frames;
  36. /* rtcp sender statistics receive */
  37. int64_t last_rtcp_ntp_time; // TODO: move into statistics
  38. int64_t first_rtcp_ntp_time; // TODO: move into statistics
  39. /* rtcp sender statistics */
  40. unsigned int packet_count; // TODO: move into statistics (outgoing)
  41. unsigned int octet_count; // TODO: move into statistics (outgoing)
  42. unsigned int last_octet_count; // TODO: move into statistics (outgoing)
  43. int first_packet;
  44. /* buffer for output */
  45. uint8_t *buf;
  46. uint8_t *buf_ptr;
  47. int max_frames_per_packet;
  48. };
  49. typedef struct RTPMuxContext RTPMuxContext;
  50. void ff_rtp_send_data(AVFormatContext *s1, const uint8_t *buf1, int len, int m);
  51. void ff_rtp_send_h264(AVFormatContext *s1, const uint8_t *buf1, int size);
  52. void ff_rtp_send_aac(AVFormatContext *s1, const uint8_t *buff, int size);
  53. void ff_rtp_send_mpegvideo(AVFormatContext *s1, const uint8_t *buf1, int size);
  54. #endif /* AVFORMAT_RTPENC_H */