diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-08-29 00:06:16 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-08-29 20:16:10 +0200 |
commit | 3d8176d2f5766eb6c10f9c99ffd9efc1f682459e (patch) | |
tree | fa18c69718307589fb841a1f47cc8e7345642ab1 /libavfilter/avfiltergraph.c | |
parent | f782ce3b4d832372000f33e816758ac7aa3af429 (diff) | |
download | ffmpeg-3d8176d2f5766eb6c10f9c99ffd9efc1f682459e.tar.gz |
avfilter: Add avfilter_graph_que_command()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavfilter/avfiltergraph.c')
-rw-r--r-- | libavfilter/avfiltergraph.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/libavfilter/avfiltergraph.c b/libavfilter/avfiltergraph.c index f9ae1cd1ef..430f0d1699 100644 --- a/libavfilter/avfiltergraph.c +++ b/libavfilter/avfiltergraph.c @@ -283,3 +283,28 @@ int avfilter_graph_send_command(AVFilterGraph *graph, const char *target, const return r; } + +int avfilter_graph_queue_command(AVFilterGraph *graph, const char *target, const char *command, const char *arg, int flags, double ts) +{ + int i; + + if(!graph) + return 0; + + for (i = 0; i < graph->filter_count; i++) { + AVFilterContext *filter = graph->filters[i]; + if(filter && (!strcmp(target, "all") || !strcmp(target, filter->name) || !strcmp(target, filter->filter->name))){ + AVFilterCommand **que = &filter->command_queue; + while(*que) que = &(*que)->next; + *que= av_mallocz(sizeof(AVFilterCommand)); + (*que)->command = av_strdup(command); + (*que)->arg = av_strdup(arg); + (*que)->time = ts; + (*que)->flags = flags; + if(flags & AVFILTER_CMD_FLAG_ONE) + return 0; + } + } + + return 0; +} |