46 #define BUFFER_DURATION 0
66 int data_size,
int index_pos)
71 unsigned char *data_offset_ptr, *start_ptr;
72 const char *desc, *mimetype;
73 int nb_packets, packet_total_size, packet_max_size,
size, packet_avg_size, i;
89 packet_total_size = 0;
109 packet_avg_size = packet_total_size / nb_packets;
132 if(tag) size += strlen(tag->
value);
147 desc =
"The Audio Stream";
148 mimetype =
"audio/x-pn-realaudio";
149 codec_data_size = 73;
151 desc =
"The Video Stream";
152 mimetype =
"video/x-pn-realvideo";
153 codec_data_size = 34;
157 size = 10 + 9 * 4 + strlen(desc) + strlen(mimetype) + codec_data_size;
183 int coded_frame_size, fscode, sample_rate;
196 switch(sample_rate) {
216 if (coded_frame_size == 557)
268 data_pos = s->
buf_ptr - start_ptr;
270 data_offset_ptr[0] = data_pos >> 24;
271 data_offset_ptr[1] = data_pos >> 16;
272 data_offset_ptr[2] = data_pos >> 8;
273 data_offset_ptr[3] = data_pos;
286 int length,
int key_frame)
364 for(i=0;i<
size;i+=2) {
411 avio_wb16(pb, 0x4000 + packet_number * 126);
433 int data_size, index_pos, i;
439 data_size = index_pos - rm->
data_pos;
464 .mime_type =
"application/vnd.rn-realmedia",
465 .extensions =
"rm,ra",
void * av_malloc(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
static int rm_write_audio(AVFormatContext *s, const uint8_t *buf, int size, int flags)
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
unsigned char * buf_ptr
Current position in the buffer.
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
#define FF_ARRAY_ELEMS(a)
AVDictionaryEntry * av_dict_get(AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags)
Get a dictionary entry with matching key.
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...
void avio_wl32(AVIOContext *s, unsigned int val)
int id
Format-specific stream ID.
AVStream ** streams
A list of all streams in the file.
static void put_str(AVIOContext *s, const char *tag)
static void put_str8(AVIOContext *s, const char *tag)
StreamInfo * audio_stream
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
void avio_write(AVIOContext *s, const unsigned char *buf, int size)
static av_always_inline void ffio_wfourcc(AVIOContext *pb, const uint8_t *s)
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
AVDictionary * metadata
Metadata that applies to the whole file.
void av_free(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc(). ...
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
void av_log(void *avcl, int level, const char *fmt,...)
int flags
A combination of AV_PKT_FLAG values.
AVCodecContext * codec
Codec context associated with this stream.
static void write_packet_header(AVFormatContext *ctx, StreamInfo *stream, int length, int key_frame)
unsigned int nb_streams
Number of elements in AVFormatContext.streams.
int seekable
A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable.
int bit_rate
the average bitrate
int void avio_flush(AVIOContext *s)
int width
picture width / height.
static int rm_write_header(AVFormatContext *s)
static int rm_write_packet(AVFormatContext *s, AVPacket *pkt)
int frame_size
Number of samples per channel in an audio frame.
const AVCodecTag ff_rm_codec_tags[]
enum AVMediaType codec_type
int sample_rate
samples per second
AVIOContext * pb
I/O context.
void avio_w8(AVIOContext *s, int b)
main external API structure.
unsigned int codec_tag
fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
static int rm_write_trailer(AVFormatContext *s)
void avio_wb16(AVIOContext *s, unsigned int val)
const char *const ff_rm_metadata[4]
AVOutputFormat ff_rm_muxer
static int rv10_write_header(AVFormatContext *ctx, int data_size, int index_pos)
int channels
number of audio channels
void * priv_data
Format private data.
static void write_header(FFV1Context *f)
void avio_wb32(AVIOContext *s, unsigned int val)
static int rm_write_video(AVFormatContext *s, const uint8_t *buf, int size, int flags)
This structure stores compressed data.
StreamInfo * video_stream