00001 /* 00002 * RTP muxer definitions 00003 * Copyright (c) 2002 Fabrice Bellard 00004 * 00005 * This file is part of FFmpeg. 00006 * 00007 * FFmpeg is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU Lesser General Public 00009 * License as published by the Free Software Foundation; either 00010 * version 2.1 of the License, or (at your option) any later version. 00011 * 00012 * FFmpeg is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 * Lesser General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU Lesser General Public 00018 * License along with FFmpeg; if not, write to the Free Software 00019 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00020 */ 00021 #ifndef AVFORMAT_RTPENC_H 00022 #define AVFORMAT_RTPENC_H 00023 00024 #include "avformat.h" 00025 #include "rtp.h" 00026 00027 struct RTPMuxContext { 00028 AVFormatContext *ic; 00029 AVStream *st; 00030 int payload_type; 00031 uint32_t ssrc; 00032 uint16_t seq; 00033 uint32_t timestamp; 00034 uint32_t base_timestamp; 00035 uint32_t cur_timestamp; 00036 int max_payload_size; 00037 int num_frames; 00038 00039 /* rtcp sender statistics receive */ 00040 int64_t last_rtcp_ntp_time; // TODO: move into statistics 00041 int64_t first_rtcp_ntp_time; // TODO: move into statistics 00042 00043 /* rtcp sender statistics */ 00044 unsigned int packet_count; // TODO: move into statistics (outgoing) 00045 unsigned int octet_count; // TODO: move into statistics (outgoing) 00046 unsigned int last_octet_count; // TODO: move into statistics (outgoing) 00047 int first_packet; 00048 /* buffer for output */ 00049 uint8_t *buf; 00050 uint8_t *buf_ptr; 00051 00052 int max_frames_per_packet; 00053 }; 00054 00055 typedef struct RTPMuxContext RTPMuxContext; 00056 00057 void ff_rtp_send_data(AVFormatContext *s1, const uint8_t *buf1, int len, int m); 00058 00059 void ff_rtp_send_h264(AVFormatContext *s1, const uint8_t *buf1, int size); 00060 void ff_rtp_send_aac(AVFormatContext *s1, const uint8_t *buff, int size); 00061 void ff_rtp_send_mpegvideo(AVFormatContext *s1, const uint8_t *buf1, int size); 00062 00063 #endif /* AVFORMAT_RTPENC_H */