在ffmpeg官方论团中找到的第四篇教程中,在decode_thread函数中多了些一些没见过的函数,现在补充如下:
1:struct AVIOInterruptCB:
头文件:#include <
avio.h>
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.
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
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;
}
* 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;
}