rtpenc.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*
  2. * RTP muxer definitions
  3. * Copyright (c) 2002 Fabrice Bellard
  4. *
  5. * This file is part of Libav.
  6. *
  7. * Libav 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. * Libav 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 Libav; 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. * Number of bytes used for H.264 NAL length, if the MP4 syntax is used
  50. * (1, 2 or 4)
  51. */
  52. int nal_length_size;
  53. };
  54. typedef struct RTPMuxContext RTPMuxContext;
  55. void ff_rtp_send_data(AVFormatContext *s1, const uint8_t *buf1, int len, int m);
  56. void ff_rtp_send_h264(AVFormatContext *s1, const uint8_t *buf1, int size);
  57. void ff_rtp_send_h263(AVFormatContext *s1, const uint8_t *buf1, int size);
  58. void ff_rtp_send_aac(AVFormatContext *s1, const uint8_t *buff, int size);
  59. void ff_rtp_send_amr(AVFormatContext *s1, const uint8_t *buff, int size);
  60. void ff_rtp_send_mpegvideo(AVFormatContext *s1, const uint8_t *buf1, int size);
  61. void ff_rtp_send_xiph(AVFormatContext *s1, const uint8_t *buff, int size);
  62. void ff_rtp_send_vp8(AVFormatContext *s1, const uint8_t *buff, int size);
  63. #endif /* AVFORMAT_RTPENC_H */