Revision 16415eaf libavfilter/avfilter.h

View differences:

libavfilter/avfilter.h
29 29
typedef struct AVFilterLink    AVFilterLink;
30 30
typedef struct AVFilterPad     AVFilterPad;
31 31

  
32
/**
33
 * A linked list of filters which reference this picture and the permissions
34
 * they each have.  This is needed for the case that filter A requests a buffer
35
 * from filter B.  Filter B gives it a buffer to use with the permissions it
36
 * requested, while reserving more permissions for itself to use when filter A
37
 * eventually passes the buffer to filter B.  However, filter A does not know
38
 * what these permissions are to reinsert them in the reference passed to B,
39
 * filter B can't assume that any picture it is passed is one that it allocated.
40
 *
41
 * Rather than have each filter implement their own code to check for this
42
 * case, we store all the permissions here in the picture structure.
43
 *
44
 * Because the number of filters holding references to any one picture should
45
 * be rather low, this should not be a major source of performance problems.
46
 */
47
typedef struct AVFilterPicPerms
48
{
49
    AVFilterContext *filter;    ///< the filter
50
    int perms;                  ///< the permissions that filter has
51

  
52
    struct AVFilterPicPerms *next;
53
} AVFilterPicPerms;
54

  
55 32
/* TODO: look for other flags which may be useful in this structure (interlace
56 33
 * flags, etc)
57 34
 */
......
67 44
    enum PixelFormat format;    ///< colorspace
68 45

  
69 46
    unsigned refcount;          ///< number of references to this image
70
    AVFilterPicPerms *perms;    ///< list of permissions held by filters
71 47

  
72 48
    /** private data to be used by a custom free function */
73 49
    void *priv;
......
105 81
#define AV_PERM_REUSE    0x08   ///< can output the buffer multiple times
106 82
} AVFilterPicRef;
107 83

  
108
/** Get the permissions the filter has to access the picture. */
109
int avfilter_get_pic_perms(AVFilterPicRef *pic, AVFilterContext *filter);
110

  
111
/** Give the filter more permissions to access the picture */
112
void avfilter_add_pic_perms(AVFilterPicRef *pic, AVFilterContext *filter,
113
                            int perms);
114

  
115 84
/**
116 85
 * Add a new reference to a picture.
117 86
 * @param ref   An existing reference to the picture
118
 * @param ref   If non-NULL, a pointer to the filter to which the permissions
119
 *              to the picture are to be given
120 87
 * @param pmask A bitmask containing the allowable permissions in the new
121 88
 *              reference
122 89
 * @return      A new reference to the picture with the same properties as the
123 90
 *              old, excluding any permissions denied by pmask
124 91
 */
125
AVFilterPicRef *avfilter_ref_pic(AVFilterPicRef *ref, AVFilterContext *filter,
126
                                 int pmask);
92
AVFilterPicRef *avfilter_ref_pic(AVFilterPicRef *ref, int pmask);
127 93

  
128 94
/**
129 95
 * Remove a reference to a picture.  If this is the last reference to the
......
256 222
AVFilterPicRef *avfilter_default_get_video_buffer(AVFilterLink *link,
257 223
                                                  int perms);
258 224

  
259
/** handler for get_video_buffer() which forwards the request down the chain */
260
AVFilterPicRef *avfilter_next_get_video_buffer(AVFilterLink *link, int perms);
261 225
/**
262 226
 * Filter definition.  This defines the pads a filter contains, and all the
263 227
 * callback functions used to interact with the filter.

Also available in: Unified diff