Originally committed as revision 18824 to svn://svn.ffmpeg.org/ffmpeg/trunk
Unified · Split
| @@ -50,7 +50,7 @@ typedef struct AVFilterPad AVFilterPad; · 49 unmodified lines | |||
| 50 | * flags, etc) | 50 | * flags, etc) |
| 51 | */ | 51 | */ |
| 52 | /** | 52 | /** |
| 53 | * A reference-counted picture data type used by the filter system. Filters | 53 | * A reference-counted picture data type used by the filter system. Filters |
| 54 | * should not store pointers to this structure directly, but instead use the | 54 | * should not store pointers to this structure directly, but instead use the |
| 55 | * AVFilterPicRef structure below. | 55 | * AVFilterPicRef structure below. |
| 56 | */ | 56 | */ |
| @@ -66,7 +66,7 @@ typedef struct AVFilterPic · 9 unmodified lines | |||
| 66 | void *priv; | 66 | void *priv; |
| 67 | /** | 67 | /** |
| 68 | * A pointer to the function to deallocate this image if the default | 68 | * A pointer to the function to deallocate this image if the default |
| 69 | * function is not sufficient. This could, for example, add the memory | 69 | * function is not sufficient. This could, for example, add the memory |
| 70 | * back into a memory pool to be reused later without the overhead of | 70 | * back into a memory pool to be reused later without the overhead of |
| 71 | * reallocating it from scratch. | 71 | * reallocating it from scratch. |
| 72 | */ | 72 | */ |
| @@ -74,9 +74,9 @@ typedef struct AVFilterPic · 1 unmodified line | |||
| 74 | } AVFilterPic; | 74 | } AVFilterPic; |
| 75 | 75 | ||
| 76 | /** | 76 | /** |
| 77 | * A reference to an AVFilterPic. Since filters can manipulate the origin of | 77 | * A reference to an AVFilterPic. Since filters can manipulate the origin of |
| 78 | * a picture to, for example, crop image without any memcpy, the picture origin | 78 | * a picture to, for example, crop image without any memcpy, the picture origin |
| 79 | * and dimensions are per-reference properties. Linesize is also useful for | 79 | * and dimensions are per-reference properties. Linesize is also useful for |
| 80 | * image flipping, frame to field filters, etc, and so is also per-reference. | 80 | * image flipping, frame to field filters, etc, and so is also per-reference. |
| 81 | * | 81 | * |
| 82 | * TODO: add anything necessary for frame reordering | 82 | * TODO: add anything necessary for frame reordering |
| @@ -244,20 +244,20 @@ void avfilter_formats_changeref(AVFilterFormats **oldref, · 161 unmodified lines | |||
| 244 | struct AVFilterPad | 244 | struct AVFilterPad |
| 245 | { | 245 | { |
| 246 | /** | 246 | /** |
| 247 | * Pad name. The name is unique among inputs and among outputs, but an | 247 | * Pad name. The name is unique among inputs and among outputs, but an |
| 248 | * input may have the same name as an output. This may be NULL if this | 248 | * input may have the same name as an output. This may be NULL if this |
| 249 | * pad has no need to ever be referenced by name. | 249 | * pad has no need to ever be referenced by name. |
| 250 | */ | 250 | */ |
| 251 | const char *name; | 251 | const char *name; |
| 252 | 252 | ||
| 253 | /** | 253 | /** |
| 254 | * AVFilterPad type. Only video supported now, hopefully someone will | 254 | * AVFilterPad type. Only video supported now, hopefully someone will |
| 255 | * add audio in the future. | 255 | * add audio in the future. |
| 256 | */ | 256 | */ |
| 257 | enum CodecType type; | 257 | enum CodecType type; |
| 258 | 258 | ||
| 259 | /** | 259 | /** |
| 260 | * Minimum required permissions on incoming buffers. Any buffer with | 260 | * Minimum required permissions on incoming buffers. Any buffer with |
| 261 | * insufficient permissions will be automatically copied by the filter | 261 | * insufficient permissions will be automatically copied by the filter |
| 262 | * system to a new buffer which provides the needed access permissions. | 262 | * system to a new buffer which provides the needed access permissions. |
| 263 | * | 263 | * |
| @@ -266,10 +266,10 @@ struct AVFilterPad · 2 unmodified lines | |||
| 266 | int min_perms; | 266 | int min_perms; |
| 267 | 267 | ||
| 268 | /** | 268 | /** |
| 269 | * Permissions which are not accepted on incoming buffers. Any buffer | 269 | * Permissions which are not accepted on incoming buffers. Any buffer |
| 270 | * which has any of these permissions set will be automatically copied | 270 | * which has any of these permissions set will be automatically copied |
| 271 | * by the filter system to a new buffer which does not have those | 271 | * by the filter system to a new buffer which does not have those |
| 272 | * permissions. This can be used to easily disallow buffers with | 272 | * permissions. This can be used to easily disallow buffers with |
| 273 | * AV_PERM_REUSE. | 273 | * AV_PERM_REUSE. |
| 274 | * | 274 | * |
| 275 | * Input pads only. | 275 | * Input pads only. |
| @@ -277,7 +277,7 @@ struct AVFilterPad · 1 unmodified line | |||
| 277 | int rej_perms; | 277 | int rej_perms; |
| 278 | 278 | ||
| 279 | /** | 279 | /** |
| 280 | * Callback called before passing the first slice of a new frame. If | 280 | * Callback called before passing the first slice of a new frame. If |
| 281 | * NULL, the filter layer will default to storing a reference to the | 281 | * NULL, the filter layer will default to storing a reference to the |
| 282 | * picture inside the link structure. | 282 | * picture inside the link structure. |
| 283 | * | 283 | * |
| @@ -286,7 +286,7 @@ struct AVFilterPad · 2 unmodified lines | |||
| 286 | void (*start_frame)(AVFilterLink *link, AVFilterPicRef *picref); | 286 | void (*start_frame)(AVFilterLink *link, AVFilterPicRef *picref); |
| 287 | 287 | ||
| 288 | /** | 288 | /** |
| 289 | * Callback function to get a buffer. If NULL, the filter system will | 289 | * Callback function to get a buffer. If NULL, the filter system will |
| 290 | * handle buffer requests. | 290 | * handle buffer requests. |
| 291 | * | 291 | * |
| 292 | * Input video pads only. | 292 | * Input video pads only. |
| @@ -294,7 +294,7 @@ struct AVFilterPad · 1 unmodified line | |||
| 294 | AVFilterPicRef *(*get_video_buffer)(AVFilterLink *link, int perms); | 294 | AVFilterPicRef *(*get_video_buffer)(AVFilterLink *link, int perms); |
| 295 | 295 | ||
| 296 | /** | 296 | /** |
| 297 | * Callback called after the slices of a frame are completely sent. If | 297 | * Callback called after the slices of a frame are completely sent. If |
| 298 | * NULL, the filter layer will default to releasing the reference stored | 298 | * NULL, the filter layer will default to releasing the reference stored |
| 299 | * in the link structure during start_frame(). | 299 | * in the link structure during start_frame(). |
| 300 | * | 300 | * |
| @@ -303,7 +303,7 @@ struct AVFilterPad · 2 unmodified lines | |||
| 303 | void (*end_frame)(AVFilterLink *link); | 303 | void (*end_frame)(AVFilterLink *link); |
| 304 | 304 | ||
| 305 | /** | 305 | /** |
| 306 | * Slice drawing callback. This is where a filter receives video data | 306 | * Slice drawing callback. This is where a filter receives video data |
| 307 | * and should do its processing. | 307 | * and should do its processing. |
| 308 | * | 308 | * |
| 309 | * Input video pads only. | 309 | * Input video pads only. |
| @@ -311,7 +311,7 @@ struct AVFilterPad · 1 unmodified line | |||
| 311 | void (*draw_slice)(AVFilterLink *link, int y, int height); | 311 | void (*draw_slice)(AVFilterLink *link, int y, int height); |
| 312 | 312 | ||
| 313 | /** | 313 | /** |
| 314 | * Frame poll callback. This returns the number of immediately available | 314 | * Frame poll callback. This returns the number of immediately available |
| 315 | * frames. It should return a positive value if the next request_frame() | 315 | * frames. It should return a positive value if the next request_frame() |
| 316 | * is guaranteed to return one frame (with no delay). | 316 | * is guaranteed to return one frame (with no delay). |
| 317 | * | 317 | * |
| @@ -322,8 +322,8 @@ struct AVFilterPad · 4 unmodified lines | |||
| 322 | int (*poll_frame)(AVFilterLink *link); | 322 | int (*poll_frame)(AVFilterLink *link); |
| 323 | 323 | ||
| 324 | /** | 324 | /** |
| 325 | * Frame request callback. A call to this should result in at least one | 325 | * Frame request callback. A call to this should result in at least one |
| 326 | * frame being output over the given link. This should return zero on | 326 | * frame being output over the given link. This should return zero on |
| 327 | * success, and another value on error. | 327 | * success, and another value on error. |
| 328 | * | 328 | * |
| 329 | * Output video pads only. | 329 | * Output video pads only. |
| @@ -334,7 +334,7 @@ struct AVFilterPad · 4 unmodified lines | |||
| 334 | * Link configuration callback. | 334 | * Link configuration callback. |
| 335 | * | 335 | * |
| 336 | * For output pads, this should set the link properties such as | 336 | * For output pads, this should set the link properties such as |
| 337 | * width/height. This should NOT set the format property - that is | 337 | * width/height. This should NOT set the format property - that is |
| 338 | * negotiated between filters by the filter system using the | 338 | * negotiated between filters by the filter system using the |
| 339 | * query_formats() callback before this function is called. | 339 | * query_formats() callback before this function is called. |
| 340 | * | 340 | * |
| @@ -370,7 +370,7 @@ void avfilter_set_common_formats(AVFilterContext *ctx, AVFilterFormats *formats) · 29 unmodified lines | |||
| 370 | int avfilter_default_query_formats(AVFilterContext *ctx); | 370 | int avfilter_default_query_formats(AVFilterContext *ctx); |
| 371 | 371 | ||
| 372 | /** | 372 | /** |
| 373 | * Filter definition. This defines the pads a filter contains, and all the | 373 | * Filter definition. This defines the pads a filter contains, and all the |
| 374 | * callback functions used to interact with the filter. | 374 | * callback functions used to interact with the filter. |
| 375 | */ | 375 | */ |
| 376 | typedef struct | 376 | typedef struct |
| @@ -380,16 +380,16 @@ typedef struct · 3 unmodified lines | |||
| 380 | int priv_size; ///< size of private data to allocate for the filter | 380 | int priv_size; ///< size of private data to allocate for the filter |
| 381 | 381 | ||
| 382 | /** | 382 | /** |
| 383 | * Filter initialization function. Args contains the user-supplied | 383 | * Filter initialization function. Args contains the user-supplied |
| 384 | * parameters. FIXME: maybe an AVOption-based system would be better? | 384 | * parameters. FIXME: maybe an AVOption-based system would be better? |
| 385 | * opaque is data provided by the code requesting creation of the filter, | 385 | * opaque is data provided by the code requesting creation of the filter, |
| 386 | * and is used to pass data to the filter. | 386 | * and is used to pass data to the filter. |
| 387 | */ | 387 | */ |
| 388 | int (*init)(AVFilterContext *ctx, const char *args, void *opaque); | 388 | int (*init)(AVFilterContext *ctx, const char *args, void *opaque); |
| 389 | 389 | ||
| 390 | /** | 390 | /** |
| 391 | * Filter uninitialization function. Should deallocate any memory held | 391 | * Filter uninitialization function. Should deallocate any memory held |
| 392 | * by the filter, release any picture references, etc. This does not need | 392 | * by the filter, release any picture references, etc. This does not need |
| 393 | * to deallocate the AVFilterContext->priv memory itself. | 393 | * to deallocate the AVFilterContext->priv memory itself. |
| 394 | */ | 394 | */ |
| 395 | void (*uninit)(AVFilterContext *ctx); | 395 | void (*uninit)(AVFilterContext *ctx); |
| @@ -428,9 +428,9 @@ struct AVFilterContext · 32 unmodified lines | |||
| 428 | }; | 428 | }; |
| 429 | 429 | ||
| 430 | /** | 430 | /** |
| 431 | * A link between two filters. This contains pointers to the source and | 431 | * A link between two filters. This contains pointers to the source and |
| 432 | * destination filters between which this link exists, and the indexes of | 432 | * destination filters between which this link exists, and the indexes of |
| 433 | * the pads involved. In addition, this link also contains the parameters | 433 | * the pads involved. In addition, this link also contains the parameters |
| 434 | * which have been negotiated and agreed upon between the filter, such as | 434 | * which have been negotiated and agreed upon between the filter, such as |
| 435 | * image dimensions, format, etc. | 435 | * image dimensions, format, etc. |
| 436 | */ | 436 | */ |
| @@ -463,9 +463,9 @@ struct AVFilterLink · 26 unmodified lines | |||
| 463 | 463 | ||
| 464 | /** | 464 | /** |
| 465 | * The picture reference currently being sent across the link by the source | 465 | * The picture reference currently being sent across the link by the source |
| 466 | * filter. This is used internally by the filter system to allow | 466 | * filter. This is used internally by the filter system to allow |
| 467 | * automatic copying of pictures which do not have sufficient permissions | 467 | * automatic copying of pictures which do not have sufficient permissions |
| 468 | * for the destination. This should not be accessed directly by the | 468 | * for the destination. This should not be accessed directly by the |
| 469 | * filters. | 469 | * filters. |
| 470 | */ | 470 | */ |
| 471 | AVFilterPicRef *srcpic; | 471 | AVFilterPicRef *srcpic; |
| @@ -497,7 +497,7 @@ int avfilter_config_links(AVFilterContext *filter); · 25 unmodified lines | |||
| 497 | * @param link the output link to the filter from which the picture will | 497 | * @param link the output link to the filter from which the picture will |
| 498 | * be requested | 498 | * be requested |
| 499 | * @param perms the required access permissions | 499 | * @param perms the required access permissions |
| 500 | * @return A reference to the picture. This must be unreferenced with | 500 | * @return A reference to the picture. This must be unreferenced with |
| 501 | * avfilter_unref_pic when you are finished with it. | 501 | * avfilter_unref_pic when you are finished with it. |
| 502 | */ | 502 | */ |
| 503 | AVFilterPicRef *avfilter_get_video_buffer(AVFilterLink *link, int perms); | 503 | AVFilterPicRef *avfilter_get_video_buffer(AVFilterLink *link, int perms); |
| @@ -520,9 +520,9 @@ int avfilter_poll_frame(AVFilterLink *link); · 16 unmodified lines | |||
| 520 | /** | 520 | /** |
| 521 | * Notifies the next filter of the start of a frame. | 521 | * Notifies the next filter of the start of a frame. |
| 522 | * @param link the output link the frame will be sent over | 522 | * @param link the output link the frame will be sent over |
| 523 | * @param picref A reference to the frame about to be sent. The data for this | 523 | * @param picref A reference to the frame about to be sent. The data for this |
| 524 | * frame need only be valid once draw_slice() is called for that | 524 | * frame need only be valid once draw_slice() is called for that |
| 525 | * portion. The receiving filter will free this reference when | 525 | * portion. The receiving filter will free this reference when |
| 526 | * it no longer needs it. | 526 | * it no longer needs it. |
| 527 | */ | 527 | */ |
| 528 | void avfilter_start_frame(AVFilterLink *link, AVFilterPicRef *picref); | 528 | void avfilter_start_frame(AVFilterLink *link, AVFilterPicRef *picref); |
| @@ -541,10 +541,10 @@ void avfilter_end_frame(AVFilterLink *link); · 12 unmodified lines | |||
| 541 | */ | 541 | */ |
| 542 | void avfilter_draw_slice(AVFilterLink *link, int y, int h); | 542 | void avfilter_draw_slice(AVFilterLink *link, int y, int h); |
| 543 | 543 | ||
| 544 | /** Initialize the filter system. Registers all builtin filters */ | 544 | /** Initialize the filter system. Registers all builtin filters */ |
| 545 | void avfilter_register_all(void); | 545 | void avfilter_register_all(void); |
| 546 | 546 | ||
| 547 | /** Uninitialize the filter system. Unregisters all filters */ | 547 | /** Uninitialize the filter system. Unregisters all filters */ |
| 548 | void avfilter_uninit(void); | 548 | void avfilter_uninit(void); |
| 549 | 549 | ||
| 550 | /** | 550 | /** |
| @@ -567,8 +567,8 @@ AVFilter *avfilter_get_by_name(const char *name); · 16 unmodified lines | |||
| 567 | /** | 567 | /** |
| 568 | * Creates a filter instance. | 568 | * Creates a filter instance. |
| 569 | * @param filter the filter to create an instance of | 569 | * @param filter the filter to create an instance of |
| 570 | * @param inst_name Name to give to the new instance. Can be NULL for none. | 570 | * @param inst_name Name to give to the new instance. Can be NULL for none. |
| 571 | * @return Pointer to the new instance on success. NULL on failure. | 571 | * @return Pointer to the new instance on success. NULL on failure. |
| 572 | */ | 572 | */ |
| 573 | AVFilterContext *avfilter_open(AVFilter *filter, const char *inst_name); | 573 | AVFilterContext *avfilter_open(AVFilter *filter, const char *inst_name); |
| 574 | 574 | ||
| @@ -577,7 +577,7 @@ AVFilterContext *avfilter_open(AVFilter *filter, const char *inst_name); · 2 unmodified lines | |||
| 577 | * @param filter the filter to initialize | 577 | * @param filter the filter to initialize |
| 578 | * @param args A string of parameters to use when initializing the filter. | 578 | * @param args A string of parameters to use when initializing the filter. |
| 579 | * The format and meaning of this string varies by filter. | 579 | * The format and meaning of this string varies by filter. |
| 580 | * @param opaque Any extra non-string data needed by the filter. The meaning | 580 | * @param opaque Any extra non-string data needed by the filter. The meaning |
| 581 | * of this parameter varies by filter. | 581 | * of this parameter varies by filter. |
| 582 | * @return zero on success | 582 | * @return zero on success |
| 583 | */ | 583 | */ |
| @@ -602,7 +602,7 @@ int avfilter_insert_filter(AVFilterLink *link, AVFilterContext *filt, · 18 unmodified lines | |||
| 602 | 602 | ||
| 603 | /** | 603 | /** |
| 604 | * Inserts a new pad. | 604 | * Inserts a new pad. |
| 605 | * @param idx Insertion point. Pad is inserted at the end if this point | 605 | * @param idx Insertion point. Pad is inserted at the end if this point |
| 606 | * is beyond the end of the list of pads. | 606 | * is beyond the end of the list of pads. |
| 607 | * @param count Pointer to the number of pads in the list | 607 | * @param count Pointer to the number of pads in the list |
| 608 | * @param padidx_off Offset within an AVFilterLink structure to the element | 608 | * @param padidx_off Offset within an AVFilterLink structure to the element |