1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

ffmpeg: Support queing filter commands for later times

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2011-08-29 00:07:30 +02:00
parent 3d8176d2f5
commit 50be0b911a

View File

@ -2683,14 +2683,19 @@ static int transcode(AVFormatContext **output_files,
}
if (key == 'c' || key == 'C'){
char ret[4096], target[64], cmd[256], arg[256]={0};
fprintf(stderr, "\nEnter command: <target> <command>[ <argument>]\n");
if(scanf("%4095[^\n\r]%*c", ret) == 1 && sscanf(ret, "%63[^ ] %255[^ ] %255[^\n]", target, cmd, arg) >= 2){
double ts;
fprintf(stderr, "\nEnter command: <target> <time> <command>[ <argument>]\n");
if(scanf("%4095[^\n\r]%*c", ret) == 1 && sscanf(ret, "%63[^ ] %lf %255[^ ] %255[^\n]", target, &ts, cmd, arg) >= 3){
for(i=0;i<nb_ostreams;i++) {
int r;
ost = ost_table[i];
if(ost->graph){
r= avfilter_graph_send_command(ost->graph, target, cmd, arg, ret, sizeof(ret), key == 'c' ? AVFILTER_CMD_FLAG_ONE : 0);
fprintf(stderr, "Command reply for %d: %d, %s\n", i, r, ret);
if(ts<0){
r= avfilter_graph_send_command(ost->graph, target, cmd, arg, ret, sizeof(ret), key == 'c' ? AVFILTER_CMD_FLAG_ONE : 0);
fprintf(stderr, "Command reply for %d: %d, %s\n", i, r, ret);
}else{
r= avfilter_graph_queue_command(ost->graph, target, cmd, arg, 0, ts);
}
}
}
}else{