History

lavfi: use min_perms and rej_perms for out pads.

There are several reasons for doing that: 1. It documents the code for the reader and helps find inconsistencies and bugs. 2. For rej_perms, it guarantees the change will be done even if the output reference can be created by several code paths. 3. It can be used to predict cases where a copy will, or will not happen and optimize buffer allocation (for example not request a rare direct-rendering buffer from a device sink if it will be copied anyway). Note that a filter is still allowed to manage the permissions on its own without using these fields.

Nicolas George committed 14 years ago

Commit 271ddb11 parent 67a804b3 files · +19 −3Browse files

Showing the changes to libavfilter/avfilter.h (1 of 3 files). Show all

Unified · Split

libavfilter/avfilter.h+9−2
@@ -240,22 +240,29 @@ struct AVFilterPad { · 239 unmodified lines
240240 enum AVMediaType type;
241241
242242 /**
243+ * Input pads:
243244 * Minimum required permissions on incoming buffers. Any buffer with
244245 * insufficient permissions will be automatically copied by the filter
245246 * system to a new buffer which provides the needed access permissions.
246247 *
247− * Input pads only.
248+ * Output pads:
249+ * Guaranteed permissions on outgoing buffers. Any buffer pushed on the
250+ * link must have at least these permissions; this fact is checked by
251+ * asserts. It can be used to optimize buffer allocation.
248252 */
249253 int min_perms;
250254
251255 /**
256+ * Input pads:
252257 * Permissions which are not accepted on incoming buffers. Any buffer
253258 * which has any of these permissions set will be automatically copied
254259 * by the filter system to a new buffer which does not have those
255260 * permissions. This can be used to easily disallow buffers with
256261 * AV_PERM_REUSE.
257262 *
258− * Input pads only.
263+ * Output pads:
264+ * Permissions which are automatically removed on outgoing buffers. It
265+ * can be used to optimize buffer allocation.
259266 */
260267 int rej_perms;
261268

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