yading@11
|
1 /*
|
yading@11
|
2 * "Real" compatible muxer and demuxer.
|
yading@11
|
3 * Copyright (c) 2000, 2001 Fabrice Bellard
|
yading@11
|
4 *
|
yading@11
|
5 * This file is part of FFmpeg.
|
yading@11
|
6 *
|
yading@11
|
7 * FFmpeg is free software; you can redistribute it and/or
|
yading@11
|
8 * modify it under the terms of the GNU Lesser General Public
|
yading@11
|
9 * License as published by the Free Software Foundation; either
|
yading@11
|
10 * version 2.1 of the License, or (at your option) any later version.
|
yading@11
|
11 *
|
yading@11
|
12 * FFmpeg is distributed in the hope that it will be useful,
|
yading@11
|
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
yading@11
|
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
yading@11
|
15 * Lesser General Public License for more details.
|
yading@11
|
16 *
|
yading@11
|
17 * You should have received a copy of the GNU Lesser General Public
|
yading@11
|
18 * License along with FFmpeg; if not, write to the Free Software
|
yading@11
|
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
yading@11
|
20 */
|
yading@11
|
21
|
yading@11
|
22 #ifndef AVFORMAT_RM_H
|
yading@11
|
23 #define AVFORMAT_RM_H
|
yading@11
|
24
|
yading@11
|
25 #include "avformat.h"
|
yading@11
|
26 #include "internal.h"
|
yading@11
|
27
|
yading@11
|
28 extern const char * const ff_rm_metadata[4];
|
yading@11
|
29 extern const AVCodecTag ff_rm_codec_tags[];
|
yading@11
|
30
|
yading@11
|
31 typedef struct RMStream RMStream;
|
yading@11
|
32
|
yading@11
|
33 RMStream *ff_rm_alloc_rmstream (void);
|
yading@11
|
34 void ff_rm_free_rmstream (RMStream *rms);
|
yading@11
|
35
|
yading@11
|
36 /*< input format for Realmedia-style RTSP streams */
|
yading@11
|
37 extern AVInputFormat ff_rdt_demuxer;
|
yading@11
|
38
|
yading@11
|
39 /**
|
yading@11
|
40 * Read the MDPR chunk, which contains stream-specific codec initialization
|
yading@11
|
41 * parameters.
|
yading@11
|
42 *
|
yading@11
|
43 * @param s context containing RMContext and AVIOContext for stream reading
|
yading@11
|
44 * @param pb context to read the data from
|
yading@11
|
45 * @param st the stream that the MDPR chunk belongs to and where to store the
|
yading@11
|
46 * parameters read from the chunk into
|
yading@11
|
47 * @param rst real-specific stream information
|
yading@11
|
48 * @param codec_data_size size of the MDPR chunk
|
yading@11
|
49 * @return 0 on success, errno codes on error
|
yading@11
|
50 */
|
yading@11
|
51 int ff_rm_read_mdpr_codecdata (AVFormatContext *s, AVIOContext *pb,
|
yading@11
|
52 AVStream *st, RMStream *rst,
|
yading@11
|
53 int codec_data_size, const uint8_t *mime);
|
yading@11
|
54
|
yading@11
|
55 /**
|
yading@11
|
56 * Parse one rm-stream packet from the input bytestream.
|
yading@11
|
57 *
|
yading@11
|
58 * @param s context containing RMContext and AVIOContext for stream reading
|
yading@11
|
59 * @param pb context to read the data from
|
yading@11
|
60 * @param st stream to which the packet to be read belongs
|
yading@11
|
61 * @param rst Real-specific stream information
|
yading@11
|
62 * @param len packet length to read from the input
|
yading@11
|
63 * @param pkt packet location to store the parsed packet data
|
yading@11
|
64 * @param seq pointer to an integer containing the sequence number, may be
|
yading@11
|
65 * updated
|
yading@11
|
66 * @param flags the packet flags
|
yading@11
|
67 * @param ts timestamp of the current packet
|
yading@11
|
68 * @return <0 on error, 0 if a packet was placed in the pkt pointer. A
|
yading@11
|
69 * value >0 means that no data was placed in pkt, but that cached
|
yading@11
|
70 * data is available by calling ff_rm_retrieve_cache().
|
yading@11
|
71 */
|
yading@11
|
72 int ff_rm_parse_packet (AVFormatContext *s, AVIOContext *pb,
|
yading@11
|
73 AVStream *st, RMStream *rst, int len,
|
yading@11
|
74 AVPacket *pkt, int *seq, int flags, int64_t ts);
|
yading@11
|
75
|
yading@11
|
76 /**
|
yading@11
|
77 * Retrieve one cached packet from the rm-context. The real container can
|
yading@11
|
78 * store several packets (as interpreted by the codec) in a single container
|
yading@11
|
79 * packet, which means the demuxer holds some back when the first container
|
yading@11
|
80 * packet is parsed and returned. The result is that rm->audio_pkt_cnt is
|
yading@11
|
81 * a positive number, the amount of cached packets. Using this function, each
|
yading@11
|
82 * of those packets can be retrieved sequentially.
|
yading@11
|
83 *
|
yading@11
|
84 * @param s context containing RMContext and AVIOContext for stream reading
|
yading@11
|
85 * @param pb context to read the data from
|
yading@11
|
86 * @param st stream that this packet belongs to
|
yading@11
|
87 * @param rst Real-specific stream information
|
yading@11
|
88 * @param pkt location to store the packet data
|
yading@11
|
89 * @return the number of samples left for subsequent calls to this same
|
yading@11
|
90 * function, or 0 if all samples have been retrieved.
|
yading@11
|
91 */
|
yading@11
|
92 int ff_rm_retrieve_cache (AVFormatContext *s, AVIOContext *pb,
|
yading@11
|
93 AVStream *st, RMStream *rst, AVPacket *pkt);
|
yading@11
|
94
|
yading@11
|
95 #endif /* AVFORMAT_RM_H */
|