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
1638 av_vsrc_buffer_add_frame2(ost->input_video_filter, &picture,1638 av_vsrc_buffer_add_frame2(ost->input_video_filter, &picture,
1639 ist->pts,1639 ist->pts,
1640 sar, ist->st->codec->width, ist->st->codec->height,1640 sar, ist->st->codec->width, ist->st->codec->height,
1641 ist->st->codec->pix_fmt, "0:0"); //TODO user setable params1641 ist->st->codec->pix_fmt, ""); //TODO user setable params
1642 }1642 }
1643 }1643 }
1644 }1644 }
libavfilter/vsrc_buffer.c+6−1
@@ -35,6 +35,7 @@ typedef struct { · 34 unmodified lines
35 enum PixelFormat pix_fmt;35 enum PixelFormat pix_fmt;
36 AVRational time_base; ///< time_base to set in the output link36 AVRational time_base; ///< time_base to set in the output link
37 AVRational pixel_aspect;37 AVRational pixel_aspect;
38 char sws_param[256];
38} BufferSourceContext;39} BufferSourceContext;
39 40
40int av_vsrc_buffer_add_frame2(AVFilterContext *buffer_filter, AVFrame *frame,41int 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 //return -1;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 if(width != c->w || height != c->h || pix_fmt != c->pix_fmt){61 if(width != c->w || height != c->h || pix_fmt != c->pix_fmt){
57 AVFilterContext *scale= buffer_filter->outputs[0]->dst;62 AVFilterContext *scale= buffer_filter->outputs[0]->dst;
58 AVFilterLink *link;63 AVFilterLink *link;
@@ -67,7 +72,7 @@ int av_vsrc_buffer_add_frame2(AVFilterContext *buffer_filter, AVFrame *frame, · 8 unmodified lines
67 if(avfilter_open(&scale, f, "Input equalizer") < 0)72 if(avfilter_open(&scale, f, "Input equalizer") < 0)
68 return -1;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 avfilter_free(scale);76 avfilter_free(scale);
72 return ret;77 return ret;
73 }78 }

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