yading@11: /* yading@11: * "Real" compatible muxer and demuxer. yading@11: * Copyright (c) 2000, 2001 Fabrice Bellard yading@11: * yading@11: * This file is part of FFmpeg. yading@11: * yading@11: * FFmpeg is free software; you can redistribute it and/or yading@11: * modify it under the terms of the GNU Lesser General Public yading@11: * License as published by the Free Software Foundation; either yading@11: * version 2.1 of the License, or (at your option) any later version. yading@11: * yading@11: * FFmpeg is distributed in the hope that it will be useful, yading@11: * but WITHOUT ANY WARRANTY; without even the implied warranty of yading@11: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU yading@11: * Lesser General Public License for more details. yading@11: * yading@11: * You should have received a copy of the GNU Lesser General Public yading@11: * License along with FFmpeg; if not, write to the Free Software yading@11: * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA yading@11: */ yading@11: yading@11: #ifndef AVFORMAT_RM_H yading@11: #define AVFORMAT_RM_H yading@11: yading@11: #include "avformat.h" yading@11: #include "internal.h" yading@11: yading@11: extern const char * const ff_rm_metadata[4]; yading@11: extern const AVCodecTag ff_rm_codec_tags[]; yading@11: yading@11: typedef struct RMStream RMStream; yading@11: yading@11: RMStream *ff_rm_alloc_rmstream (void); yading@11: void ff_rm_free_rmstream (RMStream *rms); yading@11: yading@11: /*< input format for Realmedia-style RTSP streams */ yading@11: extern AVInputFormat ff_rdt_demuxer; yading@11: yading@11: /** yading@11: * Read the MDPR chunk, which contains stream-specific codec initialization yading@11: * parameters. yading@11: * yading@11: * @param s context containing RMContext and AVIOContext for stream reading yading@11: * @param pb context to read the data from yading@11: * @param st the stream that the MDPR chunk belongs to and where to store the yading@11: * parameters read from the chunk into yading@11: * @param rst real-specific stream information yading@11: * @param codec_data_size size of the MDPR chunk yading@11: * @return 0 on success, errno codes on error yading@11: */ yading@11: int ff_rm_read_mdpr_codecdata (AVFormatContext *s, AVIOContext *pb, yading@11: AVStream *st, RMStream *rst, yading@11: int codec_data_size, const uint8_t *mime); yading@11: yading@11: /** yading@11: * Parse one rm-stream packet from the input bytestream. yading@11: * yading@11: * @param s context containing RMContext and AVIOContext for stream reading yading@11: * @param pb context to read the data from yading@11: * @param st stream to which the packet to be read belongs yading@11: * @param rst Real-specific stream information yading@11: * @param len packet length to read from the input yading@11: * @param pkt packet location to store the parsed packet data yading@11: * @param seq pointer to an integer containing the sequence number, may be yading@11: * updated yading@11: * @param flags the packet flags yading@11: * @param ts timestamp of the current packet yading@11: * @return <0 on error, 0 if a packet was placed in the pkt pointer. A yading@11: * value >0 means that no data was placed in pkt, but that cached yading@11: * data is available by calling ff_rm_retrieve_cache(). yading@11: */ yading@11: int ff_rm_parse_packet (AVFormatContext *s, AVIOContext *pb, yading@11: AVStream *st, RMStream *rst, int len, yading@11: AVPacket *pkt, int *seq, int flags, int64_t ts); yading@11: yading@11: /** yading@11: * Retrieve one cached packet from the rm-context. The real container can yading@11: * store several packets (as interpreted by the codec) in a single container yading@11: * packet, which means the demuxer holds some back when the first container yading@11: * packet is parsed and returned. The result is that rm->audio_pkt_cnt is yading@11: * a positive number, the amount of cached packets. Using this function, each yading@11: * of those packets can be retrieved sequentially. yading@11: * yading@11: * @param s context containing RMContext and AVIOContext for stream reading yading@11: * @param pb context to read the data from yading@11: * @param st stream that this packet belongs to yading@11: * @param rst Real-specific stream information yading@11: * @param pkt location to store the packet data yading@11: * @return the number of samples left for subsequent calls to this same yading@11: * function, or 0 if all samples have been retrieved. yading@11: */ yading@11: int ff_rm_retrieve_cache (AVFormatContext *s, AVIOContext *pb, yading@11: AVStream *st, RMStream *rst, AVPacket *pkt); yading@11: yading@11: #endif /* AVFORMAT_RM_H */