History

avfilter: Add command passing support

Michael Niedermayer committed 15 years ago

Commit 1e5014c1 parent 4becc864 files · +83 −1Browse files

Showing the changes to libavfilter/avfiltergraph.c (1 of 4 files). Show all

Unified · Split

libavfilter/avfiltergraph.c+30−0
@@ -253,3 +253,33 @@ int avfilter_graph_config(AVFilterGraph *graphctx, void *log_ctx) · 252 unmodified lines
253253
254254 return 0;
255255 }
256+
257+int avfilter_graph_send_command(AVFilterGraph *graph, const char *target, const char *cmd, const char *arg, char *res, int res_len, int flags)
258+{
259+ int i, r = AVERROR(ENOSYS);
260+
261+ if(!graph)
262+ return r;
263+
264+ if((flags & AVFILTER_CMD_FLAG_ONE) && !(flags & AVFILTER_CMD_FLAG_FAST)) {
265+ r=avfilter_graph_send_command(graph, target, cmd, arg, res, res_len, flags | AVFILTER_CMD_FLAG_FAST);
266+ if(r != AVERROR(ENOSYS))
267+ return r;
268+ }
269+
270+ if(res_len && res)
271+ res[0]= 0;
272+
273+ for (i = 0; i < graph->filter_count; i++) {
274+ AVFilterContext *filter = graph->filters[i];
275+ if(!strcmp(target, "all") || !strcmp(target, filter->name) || !strcmp(target, filter->filter->name)){
276+ r = avfilter_process_command(filter, cmd, arg, res, res_len, flags);
277+ if(r != AVERROR(ENOSYS)) {
278+ if((flags & AVFILTER_CMD_FLAG_ONE) || r<0)
279+ return r;
280+ }
281+ }
282+ }
283+
284+ return r;
285+}

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