ffmpeg的tutorial中文版學習筆記(四)(新版函數額外補充)

在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
s Used to return the pointer to the created AVIOContext. In case of failure the pointed to value is set to NULL.
url resource to access
flags flags which control how the resource indicated by url is to be opened
int_cb an interrupt callback to be used at the protocols level
options A 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;
}


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章