History

vsrc_buffer: Set output size Signed-off-by: Michael Niedermayer <michaelni@gmx.at>

Michael Niedermayer committed 15 years ago

Commit a38cdfd1 parent ad0193b2 files · +7 −2Browse files

Unified · Split

2 files
  1. ffmpeg.c +1 −1
  2. libavfilter/vsrc_buffer.c +6 −1
ffmpeg.c+1−1
@@ -1638,7 +1638,7 @@ static int output_packet(AVInputStream *ist, int ist_index, · 1637 unmodified lines
16381638 av_vsrc_buffer_add_frame2(ost->input_video_filter, &picture,
16391639 ist->pts,
16401640 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
16421642 }
16431643 }
16441644 }
libavfilter/vsrc_buffer.c+6−1
@@ -35,6 +35,7 @@ typedef struct { · 34 unmodified lines
3535 enum PixelFormat pix_fmt;
3636 AVRational time_base; ///< time_base to set in the output link
3737 AVRational pixel_aspect;
38+ char sws_param[256];
3839 } BufferSourceContext;
3940
4041 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
5354 //return -1;
5455 }
5556
57+ if(!c->sws_param[0]){
58+ snprintf(c->sws_param, 255, "%d:%d:%s", c->w, c->h, sws_param);
59+ }
60+
5661 if(width != c->w || height != c->h || pix_fmt != c->pix_fmt){
5762 AVFilterContext *scale= buffer_filter->outputs[0]->dst;
5863 AVFilterLink *link;
@@ -67,7 +72,7 @@ int av_vsrc_buffer_add_frame2(AVFilterContext *buffer_filter, AVFrame *frame, · 8 unmodified lines
6772 if(avfilter_open(&scale, f, "Input equalizer") < 0)
6873 return -1;
6974
70− if((ret=avfilter_init_filter(scale, sws_param, NULL))<0){
75+ if((ret=avfilter_init_filter(scale, c->sws_param, NULL))<0){
7176 avfilter_free(scale);
7277 return ret;
7378 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t