ffmpeg的tutorial中文版学习笔记(四)(新版函数额外补充)

来源:互联网 发布:谷歌全球域名 编辑:程序博客网 时间:2024/06/03 21:10
在ffmpeg官方论团中找到的第四篇教程中,在decode_thread函数中多了些一些没见过的函数,现在补充如下:
1:struct AVIOInterruptCB:
头文件:#include <avio.h>  

成员变量:

int(* callback )(void *) void * opaque

Detailed Description

Callback for checking whether to abort blocking functions.

AVERROR_EXIT is returned in this case by the interrupted function. During blocking operations, callback is called with opaque as parameter. If the callback returns 1, the blocking operation will be aborted.

No members can be added to this struct without a major bump, if new elements have been added after this struct in AVFormatContext or AVIOContext.

Definition at line 51 of file avio.h.


2:int avio_open2(AVIOContext ** s,  const char * url,  int flags,  const AVIOInterruptCB * int_cb,  AVDictionary ** options  ) 

Create and initialize a AVIOContext for accessing the resource indicated by url.

Note
When the resource indicated by url has been opened in read+write mode, the AVIOContext can be used only for writing.
Parameters
sUsed to return the pointer to the created AVIOContext. In case of failure the pointed to value is set to NULL.urlresource to accessflagsflags which control how the resource indicated by url is to be openedint_cban interrupt callback to be used at the protocols leveloptionsA dictionary filled with protocol-private options. On return this parameter will be destroyed and replaced with a dict containing options that were not found. May be NULL.
Returns
>= 0 in case of success, a negative value corresponding to an AVERROR code in case of failure

Definition at line 875 of file aviobuf.c.


3: av_q2d 函数
/**
* Convert rational to double.
* @param a rational to convert
* @return (double) a
*/
static inline double av_q2d(AVRational a){
    return a.num / (double) a.den;
}
0 0
原创粉丝点击