Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
77b32b73
Commit
77b32b73
authored
Jun 02, 2011
by
Stefano Sabatini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavfi: apply misc style fixes
Adopt K&R style for overall consistency/readability.
parent
d013c6da
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
19 deletions
+19
-19
avfilter.c
libavfilter/avfilter.c
+7
-7
defaults.c
libavfilter/defaults.c
+11
-11
internal.h
libavfilter/internal.h
+1
-1
No files found.
libavfilter/avfilter.c
View file @
77b32b73
...
@@ -77,8 +77,8 @@ static void store_in_pool(AVFilterBufferRef *ref)
...
@@ -77,8 +77,8 @@ static void store_in_pool(AVFilterBufferRef *ref)
av_assert0
(
ref
->
buf
->
data
[
0
]);
av_assert0
(
ref
->
buf
->
data
[
0
]);
if
(
pool
->
count
==
POOL_SIZE
)
{
if
(
pool
->
count
==
POOL_SIZE
)
{
AVFilterBufferRef
*
ref1
=
pool
->
pic
[
0
];
AVFilterBufferRef
*
ref1
=
pool
->
pic
[
0
];
av_freep
(
&
ref1
->
video
);
av_freep
(
&
ref1
->
video
);
av_freep
(
&
ref1
->
audio
);
av_freep
(
&
ref1
->
audio
);
av_freep
(
&
ref1
->
buf
->
data
[
0
]);
av_freep
(
&
ref1
->
buf
->
data
[
0
]);
...
@@ -89,9 +89,9 @@ static void store_in_pool(AVFilterBufferRef *ref)
...
@@ -89,9 +89,9 @@ static void store_in_pool(AVFilterBufferRef *ref)
pool
->
pic
[
POOL_SIZE
-
1
]
=
NULL
;
pool
->
pic
[
POOL_SIZE
-
1
]
=
NULL
;
}
}
for
(
i
=
0
;
i
<
POOL_SIZE
;
i
++
)
{
for
(
i
=
0
;
i
<
POOL_SIZE
;
i
++
)
{
if
(
!
pool
->
pic
[
i
])
{
if
(
!
pool
->
pic
[
i
])
{
pool
->
pic
[
i
]
=
ref
;
pool
->
pic
[
i
]
=
ref
;
pool
->
count
++
;
pool
->
count
++
;
break
;
break
;
}
}
...
@@ -102,8 +102,8 @@ void avfilter_unref_buffer(AVFilterBufferRef *ref)
...
@@ -102,8 +102,8 @@ void avfilter_unref_buffer(AVFilterBufferRef *ref)
{
{
if
(
!
ref
)
if
(
!
ref
)
return
;
return
;
if
(
!
(
--
ref
->
buf
->
refcount
)){
if
(
!
(
--
ref
->
buf
->
refcount
))
{
if
(
!
ref
->
buf
->
free
)
{
if
(
!
ref
->
buf
->
free
)
{
store_in_pool
(
ref
);
store_in_pool
(
ref
);
return
;
return
;
}
}
...
...
libavfilter/defaults.c
View file @
77b32b73
...
@@ -40,28 +40,28 @@ AVFilterBufferRef *avfilter_default_get_video_buffer(AVFilterLink *link, int per
...
@@ -40,28 +40,28 @@ AVFilterBufferRef *avfilter_default_get_video_buffer(AVFilterLink *link, int per
uint8_t
*
data
[
4
];
uint8_t
*
data
[
4
];
int
i
;
int
i
;
AVFilterBufferRef
*
picref
=
NULL
;
AVFilterBufferRef
*
picref
=
NULL
;
AVFilterPool
*
pool
=
link
->
pool
;
AVFilterPool
*
pool
=
link
->
pool
;
if
(
pool
)
for
(
i
=
0
;
i
<
POOL_SIZE
;
i
++
)
{
if
(
pool
)
for
(
i
=
0
;
i
<
POOL_SIZE
;
i
++
)
{
picref
=
pool
->
pic
[
i
];
picref
=
pool
->
pic
[
i
];
if
(
picref
&&
picref
->
buf
->
format
==
link
->
format
&&
picref
->
buf
->
w
==
w
&&
picref
->
buf
->
h
==
h
)
{
if
(
picref
&&
picref
->
buf
->
format
==
link
->
format
&&
picref
->
buf
->
w
==
w
&&
picref
->
buf
->
h
==
h
)
{
AVFilterBuffer
*
pic
=
picref
->
buf
;
AVFilterBuffer
*
pic
=
picref
->
buf
;
pool
->
pic
[
i
]
=
NULL
;
pool
->
pic
[
i
]
=
NULL
;
pool
->
count
--
;
pool
->
count
--
;
picref
->
video
->
w
=
w
;
picref
->
video
->
w
=
w
;
picref
->
video
->
h
=
h
;
picref
->
video
->
h
=
h
;
picref
->
perms
=
perms
|
AV_PERM_READ
;
picref
->
perms
=
perms
|
AV_PERM_READ
;
picref
->
format
=
link
->
format
;
picref
->
format
=
link
->
format
;
pic
->
refcount
=
1
;
pic
->
refcount
=
1
;
memcpy
(
picref
->
data
,
pic
->
data
,
sizeof
(
picref
->
data
));
memcpy
(
picref
->
data
,
pic
->
data
,
sizeof
(
picref
->
data
));
memcpy
(
picref
->
linesize
,
pic
->
linesize
,
sizeof
(
picref
->
linesize
));
memcpy
(
picref
->
linesize
,
pic
->
linesize
,
sizeof
(
picref
->
linesize
));
return
picref
;
return
picref
;
}
}
}
else
}
else
pool
=
link
->
pool
=
av_mallocz
(
sizeof
(
AVFilterPool
));
pool
=
link
->
pool
=
av_mallocz
(
sizeof
(
AVFilterPool
));
// +2 is needed for swscaler, +16 to be SIMD-friendly
// +2 is needed for swscaler, +16 to be SIMD-friendly
if
((
i
=
av_image_alloc
(
data
,
linesize
,
w
,
h
,
link
->
format
,
16
))
<
0
)
if
((
i
=
av_image_alloc
(
data
,
linesize
,
w
,
h
,
link
->
format
,
16
))
<
0
)
return
NULL
;
return
NULL
;
picref
=
avfilter_get_video_buffer_ref_from_arrays
(
data
,
linesize
,
picref
=
avfilter_get_video_buffer_ref_from_arrays
(
data
,
linesize
,
...
@@ -72,8 +72,8 @@ AVFilterBufferRef *avfilter_default_get_video_buffer(AVFilterLink *link, int per
...
@@ -72,8 +72,8 @@ AVFilterBufferRef *avfilter_default_get_video_buffer(AVFilterLink *link, int per
}
}
memset
(
data
[
0
],
128
,
i
);
memset
(
data
[
0
],
128
,
i
);
picref
->
buf
->
priv
=
pool
;
picref
->
buf
->
priv
=
pool
;
picref
->
buf
->
free
=
NULL
;
picref
->
buf
->
free
=
NULL
;
return
picref
;
return
picref
;
}
}
...
...
libavfilter/internal.h
View file @
77b32b73
...
@@ -31,7 +31,7 @@
...
@@ -31,7 +31,7 @@
typedef
struct
AVFilterPool
{
typedef
struct
AVFilterPool
{
AVFilterBufferRef
*
pic
[
POOL_SIZE
];
AVFilterBufferRef
*
pic
[
POOL_SIZE
];
int
count
;
int
count
;
}
AVFilterPool
;
}
AVFilterPool
;
/**
/**
* Check for the validity of graph.
* Check for the validity of graph.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment