[FFmpeg-devel] [RFC/PATCH 3/8] hwaccel: add init/close methods

Gwenole Beauchesne gbeauchesne
Mon Sep 20 11:30:45 CEST 2010


Hi,

On Tue, 7 Sep 2010, Michael Niedermayer wrote:

> On Mon, Sep 06, 2010 at 01:15:30AM +0300, Felipe Contreras wrote:
>> Will be needed by tidsp.
>>
>> Signed-off-by: Felipe Contreras <felipe.contreras at gmail.com>
>> ---

I had the following. I will try to update the patch. Ideally, "open" would 
have been better (vs. "close") but IIRC it might be #define'd by some 
system headers.

+    /**
+     * Called in codec initialization.
+     *
+     * This is used to initialize the AVCodecContext.hwaccel_context
+     * hardware accelerator context.
+     *
+     * @param avctx the codec context
+     * @return zero if successful, a negative value otherwise
+     */
+    int (*init)(AVCodecContext *avctx);
+
+    /**
+     * Called in codec finalization.
+     *
+     * This is used to clean-up any data from the hardware accelerator
+     * context. Should this function be implemented, it shall reset
+     * AVCodecContext.hwaccel_context to NULL.
+     *
+     * @param avctx the codec context
+     * @return zero if successful, a negative value otherwise
+     */
+    int (*close)(AVCodecContext *avctx);



More information about the ffmpeg-devel mailing list