Unified · Split
| @@ -1638,7 +1638,7 @@ static int output_packet(AVInputStream *ist, int ist_index, · 1637 unmodified lines | ||
| 1638 | 1638 | av_vsrc_buffer_add_frame2(ost->input_video_filter, &picture, |
| 1639 | 1639 | ist->pts, |
| 1640 | 1640 | sar, ist->st->codec->width, ist->st->codec->height, |
| 1641 | − ist->st->codec->pix_fmt, "0:0"); //TODO user setable params | |
| 1641 | + ist->st->codec->pix_fmt, ""); //TODO user setable params | |
| 1642 | 1642 | } |
| 1643 | 1643 | } |
| 1644 | 1644 | } |
| @@ -35,6 +35,7 @@ typedef struct { · 34 unmodified lines | ||
| 35 | 35 | enum PixelFormat pix_fmt; |
| 36 | 36 | AVRational time_base; ///< time_base to set in the output link |
| 37 | 37 | AVRational pixel_aspect; |
| 38 | + char sws_param[256]; | |
| 38 | 39 | } BufferSourceContext; |
| 39 | 40 | |
| 40 | 41 | int av_vsrc_buffer_add_frame2(AVFilterContext *buffer_filter, AVFrame *frame, |
| @@ -53,6 +54,10 @@ int av_vsrc_buffer_add_frame2(AVFilterContext *buffer_filter, AVFrame *frame, · 12 unmodified lines | ||
| 53 | 54 | //return -1; |
| 54 | 55 | } |
| 55 | 56 | |
| 57 | + if(!c->sws_param[0]){ | |
| 58 | + snprintf(c->sws_param, 255, "%d:%d:%s", c->w, c->h, sws_param); | |
| 59 | + } | |
| 60 | + | |
| 56 | 61 | if(width != c->w || height != c->h || pix_fmt != c->pix_fmt){ |
| 57 | 62 | AVFilterContext *scale= buffer_filter->outputs[0]->dst; |
| 58 | 63 | AVFilterLink *link; |
| @@ -67,7 +72,7 @@ int av_vsrc_buffer_add_frame2(AVFilterContext *buffer_filter, AVFrame *frame, · 8 unmodified lines | ||
| 67 | 72 | if(avfilter_open(&scale, f, "Input equalizer") < 0) |
| 68 | 73 | return -1; |
| 69 | 74 | |
| 70 | − if((ret=avfilter_init_filter(scale, sws_param, NULL))<0){ | |
| 75 | + if((ret=avfilter_init_filter(scale, c->sws_param, NULL))<0){ | |
| 71 | 76 | avfilter_free(scale); |
| 72 | 77 | return ret; |
| 73 | 78 | } |