Lines Matching refs:stream
74 StreamInfo *stream;
96 StreamInfo *stream = &rm->streams[i];
97 bit_rate += stream->bit_rate;
98 if (stream->packet_max_size > packet_max_size)
99 packet_max_size = stream->packet_max_size;
100 nb_packets += stream->nb_packets;
101 packet_total_size += stream->packet_total_size;
103 v = av_rescale_q_rnd(stream->total_frames, (AVRational){1000, 1}, stream->frame_rate, AV_ROUND_ZERO);
146 stream = &rm->streams[i];
148 if (stream->par->codec_type == AVMEDIA_TYPE_AUDIO) {
163 avio_wb16(s, i); /* stream number */
164 avio_wb32(s, stream->bit_rate); /* max bit rate */
165 avio_wb32(s, stream->bit_rate); /* avg bit rate */
166 avio_wb32(s, stream->packet_max_size); /* max packet size */
167 if (stream->nb_packets > 0)
168 packet_avg_size = stream->packet_total_size /
169 stream->nb_packets;
176 if (!(s->seekable & AVIO_SEEKABLE_NORMAL) || !stream->total_frames)
179 avio_wb32(s, av_rescale_q_rnd(stream->total_frames, (AVRational){1000, 1}, stream->frame_rate, AV_ROUND_ZERO));
184 if (stream->par->codec_type == AVMEDIA_TYPE_AUDIO) {
186 int frame_size = av_get_audio_frame_duration2(stream->par, 0);
187 sample_rate = stream->par->sample_rate;
188 coded_frame_size = (stream->par->bit_rate *
195 avio_wb32(s, 0x01b53530); /* stream length */
223 avio_wb32(s, stream->par->bit_rate / 8 * 60); /* bytes per minute */
224 avio_wb32(s, stream->par->bit_rate / 8 * 60); /* bytes per minute */
229 avio_wb16(s, stream->par->sample_rate); /* sample rate */
231 avio_wb16(s, stream->par->ch_layout.nb_channels);
233 if (stream->par->codec_tag) {
235 avio_wl32(s, stream->par->codec_tag);
248 if(stream->par->codec_id == AV_CODEC_ID_RV10)
252 avio_wb16(s, stream->par->width);
253 avio_wb16(s, stream->par->height);
255 if (stream->frame_rate.num / stream->frame_rate.den > 65535) {
256 av_log(s, AV_LOG_ERROR, "Frame rate %d is too high\n", stream->frame_rate.num / stream->frame_rate.den);
260 avio_wb16(s, stream->frame_rate.num / stream->frame_rate.den); /* frames per seconds ? */
262 avio_wb16(s, stream->frame_rate.num / stream->frame_rate.den); /* unknown meaning */
268 if(stream->par->codec_id == AV_CODEC_ID_RV10)
283 /* data stream */
293 static void write_packet_header(AVFormatContext *ctx, StreamInfo *stream,
299 stream->nb_packets++;
300 stream->packet_total_size += length;
301 if (length > stream->packet_max_size)
302 stream->packet_max_size = length;
306 avio_wb16(s, stream->num); /* stream number */
307 timestamp = av_rescale_q_rnd(stream->nb_frames, (AVRational){1000, 1}, stream->frame_rate, AV_ROUND_ZERO);
316 StreamInfo *stream;
331 stream = &rm->streams[n];
332 memset(stream, 0, sizeof(StreamInfo));
333 stream->num = n;
334 stream->bit_rate = par->bit_rate;
335 stream->par = par;
339 rm->audio_stream = stream;
341 stream->frame_rate = (AVRational){par->sample_rate, frame_size};
343 stream->packet_max_size = 1024;
344 stream->nb_packets = 0;
345 stream->total_frames = stream->nb_packets;
348 rm->video_stream = stream;
350 stream->frame_rate = av_inv_q(st->time_base);
352 stream->packet_max_size = 4096;
353 stream->nb_packets = 0;
354 stream->total_frames = stream->nb_packets;
370 StreamInfo *stream = rm->audio_stream;
373 write_packet_header(s, stream, size, !!(flags & AV_PKT_FLAG_KEY));
375 if (stream->par->codec_id == AV_CODEC_ID_AC3) {
384 stream->nb_frames++;
392 StreamInfo *stream = rm->video_stream;
403 write_packet_header(s, stream, size + 7 + (size >= 0x4000)*4, key_frame);
420 avio_w8(pb, stream->nb_frames & 0xff);
424 stream->nb_frames++;