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/avfilter.h (1 of 4 files). Show all

Unified · Split

libavfilter/avfilter.h+24−1
@@ -29,7 +29,7 @@ · 28 unmodified lines
2929 #include "libavutil/rational.h"
3030
3131 #define LIBAVFILTER_VERSION_MAJOR 2
32−#define LIBAVFILTER_VERSION_MINOR 35
32+#define LIBAVFILTER_VERSION_MINOR 36
3333 #define LIBAVFILTER_VERSION_MICRO 0
3434
3535 #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
@@ -552,6 +552,20 @@ typedef struct AVFilter { · 516 unmodified lines
552552 * NULL_IF_CONFIG_SMALL() macro to define it.
553553 */
554554 const char *description;
555+
556+ /**
557+ * Make the filter instance process a command.
558+ *
559+ * @param cmd the command to process, for handling simplicity all commands must be alphanumeric only
560+ * @param arg the argument for the command
561+ * @param res a buffer with size res_size where the filter(s) can return a response. This must not change when the command is not supported.
562+ * @param flags if AVFILTER_CMD_FLAG_FAST is set and the command would be
563+ * timeconsuming then a filter should treat it like an unsupported command
564+ *
565+ * @returns >=0 on success otherwise an error code.
566+ * AVERROR(ENOSYS) on unsupported commands
567+ */
568+ int (*process_command)(AVFilterContext *, const char *cmd, const char *arg, char *res, int res_len, int flags);
555569 } AVFilter;
556570
557571 /** An instance of a filter */
@@ -791,6 +805,15 @@ void avfilter_end_frame(AVFilterLink *link); · 233 unmodified lines
791805 */
792806 void avfilter_draw_slice(AVFilterLink *link, int y, int h, int slice_dir);
793807
808+#define AVFILTER_CMD_FLAG_ONE 1 ///< Stop once a filter understood the command (for target=all for example), fast filters are favored automatically
809+#define AVFILTER_CMD_FLAG_FAST 2 ///< Only execute command when its fast (like a video out that supports contrast adjustment in hw)
810+
811+/**
812+ * Make the filter instance process a command.
813+ * It is recommanded to use avfilter_graph_send_command().
814+ */
815+int avfilter_process_command(AVFilterContext *filter, const char *cmd, const char *arg, char *res, int res_len, int flags);
816+
794817 /**
795818 * Send a buffer of audio samples to the next filter.
796819 *

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