mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-01-26 01:03:07 +00:00
Pass the inputs and outputs of avfilter_parse_graph() with a AVFilterInOut linked list
Commited in SoC by Vitor Sessak on 2008-04-23 20:40:49 Originally committed as revision 13338 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
d835680e3c
commit
6a0c770b21
@ -23,6 +23,7 @@
|
|||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
#include "graphparser.h"
|
||||||
#include "avfilter.h"
|
#include "avfilter.h"
|
||||||
#include "avfiltergraph.h"
|
#include "avfiltergraph.h"
|
||||||
|
|
||||||
@ -149,24 +150,6 @@ static void parse_link_name(const char **buf, char **name, AVClass *log_ctx)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
enum LinkType {
|
|
||||||
LinkTypeIn,
|
|
||||||
LinkTypeOut,
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A linked-list of the inputs/outputs of the filter chain.
|
|
||||||
*/
|
|
||||||
typedef struct AVFilterInOut {
|
|
||||||
enum LinkType type;
|
|
||||||
const char *name;
|
|
||||||
AVFilterContext *filter;
|
|
||||||
int pad_idx;
|
|
||||||
|
|
||||||
struct AVFilterInOut *next;
|
|
||||||
} AVFilterInOut;
|
|
||||||
|
|
||||||
static void free_inout(AVFilterInOut *head)
|
static void free_inout(AVFilterInOut *head)
|
||||||
{
|
{
|
||||||
while(head) {
|
while(head) {
|
||||||
@ -363,28 +346,14 @@ static int parse_outputs(const char **buf, AVFilterInOut **currInputs,
|
|||||||
* Parse a string describing a filter graph.
|
* Parse a string describing a filter graph.
|
||||||
*/
|
*/
|
||||||
int avfilter_parse_graph(AVFilterGraph *graph, const char *filters,
|
int avfilter_parse_graph(AVFilterGraph *graph, const char *filters,
|
||||||
AVFilterContext *in, int inpad,
|
AVFilterInOut *inouts, AVClass *log_ctx)
|
||||||
AVFilterContext *out, int outpad,
|
|
||||||
AVClass *log_ctx)
|
|
||||||
{
|
{
|
||||||
int index = 0;
|
int index = 0;
|
||||||
char chr = 0;
|
char chr = 0;
|
||||||
int pad = 0;
|
int pad = 0;
|
||||||
|
|
||||||
AVFilterInOut *currInputs = NULL;
|
AVFilterInOut *currInputs = NULL;
|
||||||
AVFilterInOut *openLinks = av_malloc(sizeof(AVFilterInOut));
|
AVFilterInOut *openLinks = inouts;
|
||||||
|
|
||||||
openLinks->name = "in";
|
|
||||||
openLinks->filter = in;
|
|
||||||
openLinks->type = LinkTypeOut;
|
|
||||||
openLinks->pad_idx = inpad;
|
|
||||||
openLinks->next = av_malloc(sizeof(AVFilterInOut));
|
|
||||||
|
|
||||||
openLinks->next->name = "out";
|
|
||||||
openLinks->next->filter = out;
|
|
||||||
openLinks->next->type = LinkTypeIn;
|
|
||||||
openLinks->next->pad_idx = outpad;
|
|
||||||
openLinks->next->next = NULL;
|
|
||||||
|
|
||||||
do {
|
do {
|
||||||
AVFilterContext *filter;
|
AVFilterContext *filter;
|
||||||
|
@ -25,6 +25,23 @@
|
|||||||
#include "avfilter.h"
|
#include "avfilter.h"
|
||||||
#include "avfiltergraph.h"
|
#include "avfiltergraph.h"
|
||||||
|
|
||||||
|
enum LinkType {
|
||||||
|
LinkTypeIn,
|
||||||
|
LinkTypeOut,
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A linked-list of the inputs/outputs of the filter chain.
|
||||||
|
*/
|
||||||
|
typedef struct AVFilterInOut {
|
||||||
|
enum LinkType type;
|
||||||
|
const char *name;
|
||||||
|
AVFilterContext *filter;
|
||||||
|
int pad_idx;
|
||||||
|
|
||||||
|
struct AVFilterInOut *next;
|
||||||
|
} AVFilterInOut;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add to a graph a graph described by a string.
|
* Add to a graph a graph described by a string.
|
||||||
* @param graph the filter graph where to link the parsed graph context
|
* @param graph the filter graph where to link the parsed graph context
|
||||||
@ -36,8 +53,6 @@
|
|||||||
* @return zero on success, -1 on error
|
* @return zero on success, -1 on error
|
||||||
*/
|
*/
|
||||||
int avfilter_parse_graph(AVFilterGraph *graph, const char *filters,
|
int avfilter_parse_graph(AVFilterGraph *graph, const char *filters,
|
||||||
AVFilterContext *in, int inpad,
|
AVFilterInOut *inouts, AVClass *log_ctx);
|
||||||
AVFilterContext *out, int outpad,
|
|
||||||
AVClass *log_ctx);
|
|
||||||
|
|
||||||
#endif /* FFMPEG_GRAPHPARSER_H */
|
#endif /* FFMPEG_GRAPHPARSER_H */
|
||||||
|
Loading…
Reference in New Issue
Block a user