• Home
  • Raw
  • Download

Lines Matching full:os

80     OutputStream *os = opaque;  in ism_write()  local
81 if (os->out) in ism_write()
82 ffurl_write(os->out, buf, buf_size); in ism_write()
83 if (os->out2) in ism_write()
84 ffurl_write(os->out2, buf, buf_size); in ism_write()
85 os->cur_pos += buf_size; in ism_write()
86 if (os->cur_pos >= os->tail_pos) in ism_write()
87 os->tail_pos = os->cur_pos; in ism_write()
93 OutputStream *os = opaque; in ism_seek() local
97 if (os->tail_out) { in ism_seek()
98 ffurl_closep(&os->out); in ism_seek()
99 ffurl_closep(&os->out2); in ism_seek()
100 os->out = os->tail_out; in ism_seek()
101 os->tail_out = NULL; in ism_seek()
103 if (offset >= os->cur_start_pos) { in ism_seek()
104 if (os->out) in ism_seek()
105 ffurl_seek(os->out, offset - os->cur_start_pos, SEEK_SET); in ism_seek()
106 os->cur_pos = offset; in ism_seek()
109 for (i = os->nb_fragments - 1; i >= 0; i--) { in ism_seek()
110 Fragment *frag = os->fragments[i]; in ism_seek()
114 os->tail_out = os->out; in ism_seek()
116 ret = ffurl_open_whitelist(&os->out, frag->file, AVIO_FLAG_WRITE, in ism_seek()
117 …&os->ctx->interrupt_callback, &opts, os->ctx->protocol_whitelist, os->ctx->protocol_blacklist, NUL… in ism_seek()
120 os->out = os->tail_out; in ism_seek()
121 os->tail_out = NULL; in ism_seek()
125 ffurl_open_whitelist(&os->out2, frag->infofile, AVIO_FLAG_WRITE, in ism_seek()
126 …&os->ctx->interrupt_callback, &opts, os->ctx->protocol_whitelist, os->ctx->protocol_blacklist, NUL… in ism_seek()
128 ffurl_seek(os->out, offset - frag->start_pos, SEEK_SET); in ism_seek()
129 if (os->out2) in ism_seek()
130 ffurl_seek(os->out2, offset - frag->start_pos, SEEK_SET); in ism_seek()
131 os->cur_pos = offset; in ism_seek()
138 static void get_private_data(OutputStream *os) in get_private_data() argument
140 AVCodecParameters *par = os->ctx->streams[0]->codecpar; in get_private_data()
151 os->private_str = av_mallocz(2*size + 1); in get_private_data()
152 if (!os->private_str) in get_private_data()
155 snprintf(&os->private_str[2*i], 3, "%02x", ptr[i]); in get_private_data()
168 OutputStream *os = &c->streams[i]; in ism_free() local
169 ffurl_closep(&os->out); in ism_free()
170 ffurl_closep(&os->out2); in ism_free()
171 ffurl_closep(&os->tail_out); in ism_free()
172 if (os->ctx && os->ctx->pb) in ism_free()
173 avio_context_free(&os->ctx->pb); in ism_free()
174 avformat_free_context(os->ctx); in ism_free()
175 av_freep(&os->private_str); in ism_free()
176 for (j = 0; j < os->nb_fragments; j++) in ism_free()
177 av_freep(&os->fragments[j]); in ism_free()
178 av_freep(&os->fragments); in ism_free()
183 static void output_chunk_list(OutputStream *os, AVIOContext *out, int final, int skip, int window_s… in output_chunk_list() argument
186 if (os->nb_fragments <= 0) in output_chunk_list()
188 if (os->fragments[0]->n > 0) in output_chunk_list()
193 start = FFMAX(os->nb_fragments - skip - window_size, 0); in output_chunk_list()
194 for (i = start; i < os->nb_fragments - skip; i++) { in output_chunk_list()
195 Fragment *frag = os->fragments[i]; in output_chunk_list()
220 OutputStream *os = &c->streams[i]; in write_manifest() local
221 if (os->nb_fragments > 0) { in write_manifest()
222 Fragment *last = os->fragments[os->nb_fragments - 1]; in write_manifest()
226 video_chunks = os->nb_fragments; in write_manifest()
229 audio_chunks = os->nb_fragments; in write_manifest()
249 OutputStream *os = &c->streams[i]; in write_manifest() local
253 …, s->streams[i]->codecpar->bit_rate, os->fourcc, s->streams[i]->codecpar->width, s->streams[i]->co… in write_manifest()
263 OutputStream *os = &c->streams[i]; in write_manifest() local
268 … index, s->streams[i]->codecpar->bit_rate, os->fourcc, s->streams[i]->codecpar->sample_rate, in write_manifest()
269 … s->streams[i]->codecpar->ch_layout.nb_channels, os->packet_size, os->audio_tag, os->private_str); in write_manifest()
303 OutputStream *os = &c->streams[i]; in ism_write_header() local
311 snprintf(os->dirname, sizeof(os->dirname), "%s/QualityLevels(Tmp_%d)", s->url, i); in ism_write_header()
313 …snprintf(os->dirname, sizeof(os->dirname), "%s/QualityLevels(%"PRId64")", s->url, s->streams[i]->c… in ism_write_header()
316 if (mkdir(os->dirname, 0777) == -1 && errno != EEXIST) { in ism_write_header()
321 os->ctx = ctx = avformat_alloc_context(); in ism_write_header()
337 … ctx->pb = avio_alloc_context(os->iobuf, sizeof(os->iobuf), 1, os, NULL, ism_write, ism_seek); in ism_write_header()
353 os->stream_type_tag = "video"; in ism_write_header()
355 os->fourcc = "H264"; in ism_write_header()
357 os->fourcc = "WVC1"; in ism_write_header()
364 os->stream_type_tag = "audio"; in ism_write_header()
366 os->fourcc = "AACL"; in ism_write_header()
367 os->audio_tag = 0xff; in ism_write_header()
369 os->fourcc = "WMAP"; in ism_write_header()
370 os->audio_tag = 0x0162; in ism_write_header()
375 os->packet_size = st->codecpar->block_align ? st->codecpar->block_align : 4; in ism_write_header()
377 get_private_data(os); in ism_write_header()
441 static int add_fragment(OutputStream *os, const char *file, const char *infofile, int64_t start_tim… in add_fragment() argument
445 if (os->nb_fragments >= os->fragments_size) { in add_fragment()
446 os->fragments_size = (os->fragments_size + 1) * 2; in add_fragment()
447 if ((err = av_reallocp_array(&os->fragments, sizeof(*os->fragments), in add_fragment()
448 os->fragments_size)) < 0) { in add_fragment()
449 os->fragments_size = 0; in add_fragment()
450 os->nb_fragments = 0; in add_fragment()
463 frag->n = os->fragment_index; in add_fragment()
464 os->fragments[os->nb_fragments++] = frag; in add_fragment()
465 os->fragment_index++; in add_fragment()
502 OutputStream *os = &c->streams[i]; in ism_flush() local
506 if (!os->packets_written) in ism_flush()
509 snprintf(filename, sizeof(filename), "%s/temp", os->dirname); in ism_flush()
510 …ret = ffurl_open_whitelist(&os->out, filename, AVIO_FLAG_WRITE, &s->interrupt_callback, NULL, s->p… in ism_flush()
513 os->cur_start_pos = os->tail_pos; in ism_flush()
514 av_write_frame(os->ctx, NULL); in ism_flush()
515 avio_flush(os->ctx->pb); in ism_flush()
516 os->packets_written = 0; in ism_flush()
517 if (!os->out || os->tail_out) in ism_flush()
520 ffurl_closep(&os->out); in ism_flush()
521 size = os->tail_pos - os->cur_start_pos; in ism_flush()
535 memcpy(curr_dirname, os->dirname, sizeof(os->dirname)); in ism_flush()
536 …snprintf(os->dirname, sizeof(os->dirname), "%s/QualityLevels(%"PRId64")", s->url, s->streams[i]->c… in ism_flush()
537 snprintf(filename, sizeof(filename), "%s/temp", os->dirname); in ism_flush()
540 if ((ret = ff_rename((const char*)curr_dirname, os->dirname, s)) < 0) in ism_flush()
544 …_filename, sizeof(header_filename), "%s/FragmentInfo(%s=%"PRIu64")", os->dirname, os->stream_type_… in ism_flush()
545 …get_filename, sizeof(target_filename), "%s/Fragments(%s=%"PRIu64")", os->dirname, os->stream_type_… in ism_flush()
550 add_fragment(os, target_filename, header_filename, start_ts, duration, in ism_flush()
551 os->cur_start_pos, size); in ism_flush()
556 OutputStream *os = &c->streams[i]; in ism_flush() local
558 … int remove = os->nb_fragments - c->window_size - c->extra_window_size - c->lookahead_count; in ism_flush()
560 remove = os->nb_fragments; in ism_flush()
563 unlink(os->fragments[j]->file); in ism_flush()
564 unlink(os->fragments[j]->infofile); in ism_flush()
565 av_freep(&os->fragments[j]); in ism_flush()
567 os->nb_fragments -= remove; in ism_flush()
568 … memmove(os->fragments, os->fragments + remove, os->nb_fragments * sizeof(*os->fragments)); in ism_flush()
571 rmdir(os->dirname); in ism_flush()
585 OutputStream *os = &c->streams[pkt->stream_index]; in ism_write_packet() local
595 pkt->flags & AV_PKT_FLAG_KEY && os->packets_written) { in ism_write_packet()
602 os->packets_written++; in ism_write_packet()
603 return ff_write_chained(os->ctx, 0, pkt, s, 0); in ism_write_packet()