aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVitor Sessak <vitor1001@gmail.com>2008-02-15 21:38:10 +0000
committerVitor Sessak <vitor1001@gmail.com>2008-02-15 21:38:10 +0000
commit269b9847ab4022568a86e54e76bdc1f7dcb1b2a0 (patch)
tree7340f5c097f2599ef942329a4519ba6f8b04579e
parenta4af86c878102f4e85043552c053ce38c0717424 (diff)
downloadffmpeg-269b9847ab4022568a86e54e76bdc1f7dcb1b2a0.tar.gz
Revert braindead linked list of permissions
Commited in SoC by Bobby Bingham on 2007-08-17 22:44:03 Originally committed as revision 12010 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavfilter/avfilter.c59
1 files changed, 5 insertions, 54 deletions
diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index 9d53f8d138..f6695997cb 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -35,67 +35,19 @@ static AVFilter **filters = NULL;
#define link_dpad(link) link->dst-> input_pads[link->dstpad]
#define link_spad(link) link->src->output_pads[link->srcpad]
-/**
- * helper function to get a pointer to the structure telling the permissions
- * the filter has on the given picture, or to create the structure if it
- * does not yet exist.
- */
-static AVFilterPicPerms *get_perms(AVFilterPic *pic, AVFilterContext *filter)
-{
- AVFilterPicPerms *ret;
-
- for(ret = pic->perms; ret; ret = ret->next)
- if(ret->filter == filter)
- return ret;
-
- ret = av_malloc(sizeof(AVFilterPicPerms));
- ret->filter = filter;
- ret->perms = 0;
- ret->next = pic->perms;
- pic->perms = ret;
-
- return ret;
-}
-
-int avfilter_get_pic_perms(AVFilterPicRef *pic, AVFilterContext *filter)
-{
- return get_perms(pic->pic, filter)->perms;
-}
-
-void avfilter_add_pic_perms(AVFilterPicRef *pic, AVFilterContext *filter,
- int perms)
+AVFilterPicRef *avfilter_ref_pic(AVFilterPicRef *ref, int pmask)
{
- get_perms(pic->pic, filter)->perms |= perms;
-}
-
-AVFilterPicRef *avfilter_ref_pic(AVFilterPicRef *ref, AVFilterContext *filter,
- int pmask)
-{
- AVFilterPicPerms *pic_perms;
AVFilterPicRef *ret = av_malloc(sizeof(AVFilterPicRef));
memcpy(ret, ref, sizeof(AVFilterPicRef));
ret->perms &= pmask;
ret->pic->refcount ++;
-
- if(filter) {
- pic_perms = get_perms(ref->pic, filter);
- pic_perms->perms |= ret->perms;
- }
-
return ret;
}
void avfilter_unref_pic(AVFilterPicRef *ref)
{
- AVFilterPicPerms *perms;
-
- if(-- ref->pic->refcount == 0) {
- for(; ref->pic->perms; ref->pic->perms = perms) {
- perms = ref->pic->perms->next;
- av_free(ref->pic->perms);
- }
+ if(-- ref->pic->refcount == 0)
ref->pic->free(ref->pic);
- }
av_free(ref);
}
@@ -208,7 +160,6 @@ int avfilter_request_frame(AVFilterLink *link)
* forcing the source filter to do it? */
void avfilter_start_frame(AVFilterLink *link, AVFilterPicRef *picref)
{
- int perms = get_perms(picref->pic, link->dst)->perms;
void (*start_frame)(AVFilterLink *, AVFilterPicRef *);
start_frame = link_dpad(link).start_frame;
@@ -216,11 +167,11 @@ void avfilter_start_frame(AVFilterLink *link, AVFilterPicRef *picref)
start_frame = avfilter_default_start_frame;
/* prepare to copy the picture if it has insufficient permissions */
- if((link_dpad(link).min_perms & perms) != link_dpad(link).min_perms ||
- link_dpad(link).rej_perms & perms) {
+ if((link_dpad(link).min_perms & picref->perms) != link_dpad(link).min_perms ||
+ link_dpad(link).rej_perms & picref->perms) {
av_log(link->dst, AV_LOG_INFO,
"frame copy needed (have perms %x, need %x, reject %x)\n",
- perms,
+ picref->perms,
link_dpad(link).min_perms, link_dpad(link).rej_perms);
link->cur_pic = avfilter_default_get_video_buffer(link, link_dpad(link).min_perms);