MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / build_feed_streams

Function build_feed_streams

ffserver.c:3645–3797  ·  view source on GitHub ↗

compute the needed AVStream for each feed */

Source from the content-addressed store, hash-verified

3643
3644/* compute the needed AVStream for each feed */
3645static void build_feed_streams(void)
3646{
3647 FFStream *stream, *feed;
3648 int i;
3649
3650 /* gather all streams */
3651 for(stream = first_stream; stream != NULL; stream = stream->next) {
3652 feed = stream->feed;
3653 if (feed) {
3654 if (!stream->is_feed) {
3655 /* we handle a stream coming from a feed */
3656 for(i=0;i<stream->nb_streams;i++)
3657 stream->feed_streams[i] = add_av_stream(feed, stream->streams[i]);
3658 }
3659 }
3660 }
3661
3662 /* gather all streams */
3663 for(stream = first_stream; stream != NULL; stream = stream->next) {
3664 feed = stream->feed;
3665 if (feed) {
3666 if (stream->is_feed) {
3667 for(i=0;i<stream->nb_streams;i++)
3668 stream->feed_streams[i] = i;
3669 }
3670 }
3671 }
3672
3673 /* create feed files if needed */
3674 for(feed = first_feed; feed != NULL; feed = feed->next_feed) {
3675 int fd;
3676
3677 if (url_exist(feed->feed_filename)) {
3678 /* See if it matches */
3679 AVFormatContext *s;
3680 int matches = 0;
3681
3682 if (av_open_input_file(&s, feed->feed_filename, NULL, FFM_PACKET_SIZE, NULL) >= 0) {
3683 /* Now see if it matches */
3684 if (s->nb_streams == feed->nb_streams) {
3685 matches = 1;
3686 for(i=0;i<s->nb_streams;i++) {
3687 AVStream *sf, *ss;
3688 sf = feed->streams[i];
3689 ss = s->streams[i];
3690
3691 if (sf->index != ss->index ||
3692 sf->id != ss->id) {
3693 http_log("Index & Id do not match for stream %d (%s)\n",
3694 i, feed->feed_filename);
3695 matches = 0;
3696 } else {
3697 AVCodecContext *ccf, *ccs;
3698
3699 ccf = sf->codec;
3700 ccs = ss->codec;
3701#define CHECK_CODEC(x) (ccf->x != ccs->x)
3702

Callers 1

mainFunction · 0.85

Calls 12

add_av_streamFunction · 0.85
url_existFunction · 0.85
av_open_input_fileFunction · 0.85
http_logFunction · 0.85
av_close_input_fileFunction · 0.85
url_fopenFunction · 0.85
av_set_parametersFunction · 0.85
av_write_headerFunction · 0.85
av_freepFunction · 0.85
url_fcloseFunction · 0.85
ffm_read_write_indexFunction · 0.85
closeFunction · 0.85

Tested by

no test coverage detected