Go to the documentation of this file.
47 #define BUFFER_DURATION 0
49 #define MAX_HEADER_SIZE (7 + 4 + 12)
51 #define MAX_PACKET_SIZE (UINT16_MAX - MAX_HEADER_SIZE)
71 int data_size,
int index_pos)
76 const char *
desc, *mimetype;
77 int nb_packets, packet_total_size, packet_max_size,
size, packet_avg_size,
i;
92 packet_total_size = 0;
112 packet_avg_size = packet_total_size / nb_packets;
150 desc =
"The Audio Stream";
151 mimetype =
"audio/x-pn-realaudio";
152 codec_data_size = 73;
154 desc =
"The Video Stream";
155 mimetype =
"video/x-pn-realvideo";
156 codec_data_size = 34;
160 size = 10 + 9 * 4 + strlen(
desc) + strlen(mimetype) + codec_data_size;
186 int coded_frame_size, fscode, sample_rate;
200 switch(sample_rate) {
220 if (coded_frame_size == 557)
279 if (
avio_seek(
s, data_offset, SEEK_SET) >= 0) {
295 int length,
int key_frame)
321 if (
s->nb_streams > 2) {
326 for(n=0;n<
s->nb_streams;n++) {
330 s->streams[n]->id = n;
331 par =
s->streams[n]->codecpar;
378 for (
i = 0;
i <
size;
i += 2) {
441 int data_size, index_pos,
i;
447 data_size = index_pos - rm->
data_pos;
456 for(
i=0;
i<
s->nb_streams;
i++)
472 .p.mime_type =
"application/vnd.rn-realmedia",
473 .p.extensions =
"rm,ra",
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
static void put_str8(AVIOContext *s, const char *tag)
enum AVMediaType codec_type
General type of the encoded data.
static av_always_inline void ffio_wfourcc(AVIOContext *pb, const uint8_t *s)
This struct describes the properties of an encoded stream.
@ AV_ROUND_ZERO
Round toward zero.
uint32_t codec_tag
Additional information about the codec (corresponds to the AVI FOURCC).
int nb_channels
Number of channels in this layout.
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
static int rm_write_header(AVFormatContext *s)
StreamInfo * video_stream
static int rv10_write_header(AVFormatContext *ctx, int data_size, int index_pos)
const char *const ff_rm_metadata[4]
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
AVDictionary * metadata
Metadata that applies to the whole file.
#define FF_ARRAY_ELEMS(a)
AVDictionaryEntry * av_dict_get(const AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags)
Get a dictionary entry with matching key.
StreamInfo * audio_stream
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented.
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
static int rm_write_trailer(AVFormatContext *s)
const AVCodecTag ff_rm_codec_tags[]
Rational number (pair of numerator and denominator).
AVIOContext * pb
I/O context.
static int rm_write_video(AVFormatContext *s, const uint8_t *buf, int size, int flags)
void avio_w8(AVIOContext *s, int b)
AVChannelLayout ch_layout
Audio only.
int sample_rate
Audio only.
unsigned int nb_streams
Number of elements in AVFormatContext.streams.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
int av_get_audio_frame_duration2(AVCodecParameters *par, int frame_bytes)
This function is the same as av_get_audio_frame_duration(), except it works with AVCodecParameters in...
void avio_write(AVIOContext *s, const unsigned char *buf, int size)
void avio_wb32(AVIOContext *s, unsigned int val)
void avio_wl32(AVIOContext *s, unsigned int val)
int flags
A combination of AV_PKT_FLAG values.
#define i(width, name, range_min, range_max)
static av_always_inline AVRational av_inv_q(AVRational q)
Invert a rational.
static void write_packet_header(AVFormatContext *ctx, StreamInfo *stream, int length, int key_frame)
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
#define AVIO_SEEKABLE_NORMAL
Seeking works like for a local file.
static void put_str(AVIOContext *s, const char *tag)
static int rm_write_packet(AVFormatContext *s, AVPacket *pkt)
const FFOutputFormat ff_rm_muxer
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
This structure stores compressed data.
void avio_wb16(AVIOContext *s, unsigned int val)
#define flags(name, subs,...)
static int rm_write_audio(AVFormatContext *s, const uint8_t *buf, int size, int flags)
int64_t bit_rate
The average bitrate of the encoded data (in bits per second).
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
void * priv_data
Format private data.
int64_t av_rescale_q_rnd(int64_t a, AVRational bq, AVRational cq, enum AVRounding rnd)
Rescale a 64-bit integer by 2 rational numbers with specified rounding.