当前位置: 首页 > news >正文

php做的网站怎么打开网络运营是什么意思

php做的网站怎么打开,网络运营是什么意思,微信上的网站怎么做的,做电影网站的服务器本章主要介绍AVBSF 文章目录 结构体定义对外函数常见的过滤器 从名字我们可以知道这是个码流过滤器,我们最常用的是一个叫做h264_mp4toannexb_bsf的东东 这个过滤器的作用是把h264以MP4格式的NALU转换为annexb(0x000001) const AVBitStreamF…

本章主要介绍AVBSF

文章目录

    • 结构体定义
    • 对外函数
    • 常见的过滤器

从名字我们可以知道这是个码流过滤器,我们最常用的是一个叫做h264_mp4toannexb_bsf的东东
这个过滤器的作用是把h264以MP4格式的NALU转换为annexb(0x000001)

const AVBitStreamFilter ff_h264_mp4toannexb_bsf = {.name           = "h264_mp4toannexb",.priv_data_size = sizeof(H264BSFContext),.init           = h264_mp4toannexb_init,.filter         = h264_mp4toannexb_filter,.flush          = h264_mp4toannexb_flush,.codec_ids      = codec_ids,
};

结构体定义


/*** @addtogroup lavc_core* @{*//*** The bitstream filter state.** This struct must be allocated with av_bsf_alloc() and freed with* av_bsf_free().** The fields in the struct will only be changed (by the caller or by the* filter) as described in their documentation, and are to be considered* immutable otherwise.*/
typedef struct AVBSFContext {/*** A class for logging and AVOptions*/const AVClass *av_class;/*** The bitstream filter this context is an instance of.*/const struct AVBitStreamFilter *filter;/*** Opaque filter-specific private data. If filter->priv_class is non-NULL,* this is an AVOptions-enabled struct.*/void *priv_data;/*** Parameters of the input stream. This field is allocated in* av_bsf_alloc(), it needs to be filled by the caller before* av_bsf_init().*/AVCodecParameters *par_in;/*** Parameters of the output stream. This field is allocated in* av_bsf_alloc(), it is set by the filter in av_bsf_init().*/AVCodecParameters *par_out;/*** The timebase used for the timestamps of the input packets. Set by the* caller before av_bsf_init().*/AVRational time_base_in;/*** The timebase used for the timestamps of the output packets. Set by the* filter in av_bsf_init().*/AVRational time_base_out;
} AVBSFContext;

上面是bsf的上下文,下面的是它的插件回调函数


typedef struct AVBitStreamFilter {const char *name;/*** A list of codec ids supported by the filter, terminated by* AV_CODEC_ID_NONE.* May be NULL, in that case the bitstream filter works with any codec id.*/const enum AVCodecID *codec_ids;/*** A class for the private data, used to declare bitstream filter private* AVOptions. This field is NULL for bitstream filters that do not declare* any options.** If this field is non-NULL, the first member of the filter private data* must be a pointer to AVClass, which will be set by libavcodec generic* code to this class.*/const AVClass *priv_class;/****************************************************************** No fields below this line are part of the public API. They* may not be used outside of libavcodec and can be changed and* removed at will.* New public fields should be added right above.******************************************************************/int priv_data_size;int (*init)(AVBSFContext *ctx);int (*filter)(AVBSFContext *ctx, AVPacket *pkt);void (*close)(AVBSFContext *ctx);void (*flush)(AVBSFContext *ctx);
} AVBitStreamFilter;

看多了就会发现非常相似,基本就一个套路,一个上下文结构体,一个回调插件结构体,上下文中一个私有的指针,大小为priv_data_size,所以如果想要实现插件,简单的实现这几个回调函数就可以了。

对外函数

核心对外函数


/*** @return a bitstream filter with the specified name or NULL if no such*         bitstream filter exists.*/
const AVBitStreamFilter *av_bsf_get_by_name(const char *name);/*** Iterate over all registered bitstream filters.** @param opaque a pointer where libavcodec will store the iteration state. Must*               point to NULL to start the iteration.** @return the next registered bitstream filter or NULL when the iteration is*         finished*/
const AVBitStreamFilter *av_bsf_iterate(void **opaque);/*** Allocate a context for a given bitstream filter. The caller must fill in the* context parameters as described in the documentation and then call* av_bsf_init() before sending any data to the filter.** @param filter the filter for which to allocate an instance.* @param ctx a pointer into which the pointer to the newly-allocated context*            will be written. It must be freed with av_bsf_free() after the*            filtering is done.** @return 0 on success, a negative AVERROR code on failure*/
int av_bsf_alloc(const AVBitStreamFilter *filter, AVBSFContext **ctx);/*** Prepare the filter for use, after all the parameters and options have been* set.*/
int av_bsf_init(AVBSFContext *ctx);/*** Submit a packet for filtering.** After sending each packet, the filter must be completely drained by calling* av_bsf_receive_packet() repeatedly until it returns AVERROR(EAGAIN) or* AVERROR_EOF.** @param pkt the packet to filter. The bitstream filter will take ownership of* the packet and reset the contents of pkt. pkt is not touched if an error occurs.* If pkt is empty (i.e. NULL, or pkt->data is NULL and pkt->side_data_elems zero),* it signals the end of the stream (i.e. no more non-empty packets will be sent;* sending more empty packets does nothing) and will cause the filter to output* any packets it may have buffered internally.** @return 0 on success. AVERROR(EAGAIN) if packets need to be retrieved from the* filter (using av_bsf_receive_packet()) before new input can be consumed. Another* negative AVERROR value if an error occurs.*/
int av_bsf_send_packet(AVBSFContext *ctx, AVPacket *pkt);/*** Retrieve a filtered packet.** @param[out] pkt this struct will be filled with the contents of the filtered*                 packet. It is owned by the caller and must be freed using*                 av_packet_unref() when it is no longer needed.*                 This parameter should be "clean" (i.e. freshly allocated*                 with av_packet_alloc() or unreffed with av_packet_unref())*                 when this function is called. If this function returns*                 successfully, the contents of pkt will be completely*                 overwritten by the returned data. On failure, pkt is not*                 touched.** @return 0 on success. AVERROR(EAGAIN) if more packets need to be sent to the* filter (using av_bsf_send_packet()) to get more output. AVERROR_EOF if there* will be no further output from the filter. Another negative AVERROR value if* an error occurs.** @note one input packet may result in several output packets, so after sending* a packet with av_bsf_send_packet(), this function needs to be called* repeatedly until it stops returning 0. It is also possible for a filter to* output fewer packets than were sent to it, so this function may return* AVERROR(EAGAIN) immediately after a successful av_bsf_send_packet() call.*/
int av_bsf_receive_packet(AVBSFContext *ctx, AVPacket *pkt);/*** Reset the internal bitstream filter state. Should be called e.g. when seeking.*/
void av_bsf_flush(AVBSFContext *ctx);/*** Free a bitstream filter context and everything associated with it; write NULL* into the supplied pointer.*/
void av_bsf_free(AVBSFContext **ctx);

其实这些函数内部也很简单,主要就是对回调函数的封装。

常见的过滤器

extern const AVBitStreamFilter ff_aac_adtstoasc_bsf;
extern const AVBitStreamFilter ff_av1_frame_merge_bsf;
extern const AVBitStreamFilter ff_av1_frame_split_bsf;
extern const AVBitStreamFilter ff_av1_metadata_bsf;
extern const AVBitStreamFilter ff_chomp_bsf;
extern const AVBitStreamFilter ff_dump_extradata_bsf;
extern const AVBitStreamFilter ff_dca_core_bsf;
extern const AVBitStreamFilter ff_eac3_core_bsf;
extern const AVBitStreamFilter ff_extract_extradata_bsf;
extern const AVBitStreamFilter ff_filter_units_bsf;
extern const AVBitStreamFilter ff_h264_metadata_bsf;
extern const AVBitStreamFilter ff_h264_mp4toannexb_bsf;
extern const AVBitStreamFilter ff_h264_redundant_pps_bsf;
extern const AVBitStreamFilter ff_hapqa_extract_bsf;
extern const AVBitStreamFilter ff_hevc_metadata_bsf;
extern const AVBitStreamFilter ff_hevc_mp4toannexb_bsf;
extern const AVBitStreamFilter ff_imx_dump_header_bsf;
extern const AVBitStreamFilter ff_mjpeg2jpeg_bsf;
extern const AVBitStreamFilter ff_mjpega_dump_header_bsf;
extern const AVBitStreamFilter ff_mp3_header_decompress_bsf;
extern const AVBitStreamFilter ff_mpeg2_metadata_bsf;
extern const AVBitStreamFilter ff_mpeg4_unpack_bframes_bsf;
extern const AVBitStreamFilter ff_mov2textsub_bsf;
extern const AVBitStreamFilter ff_noise_bsf;
extern const AVBitStreamFilter ff_null_bsf;
extern const AVBitStreamFilter ff_opus_metadata_bsf;
extern const AVBitStreamFilter ff_pcm_rechunk_bsf;
extern const AVBitStreamFilter ff_prores_metadata_bsf;
extern const AVBitStreamFilter ff_remove_extradata_bsf;
extern const AVBitStreamFilter ff_setts_bsf;
extern const AVBitStreamFilter ff_text2movsub_bsf;
extern const AVBitStreamFilter ff_trace_headers_bsf;
extern const AVBitStreamFilter ff_truehd_core_bsf;
extern const AVBitStreamFilter ff_vp9_metadata_bsf;
extern const AVBitStreamFilter ff_vp9_raw_reorder_bsf;
extern const AVBitStreamFilter ff_vp9_superframe_bsf;
extern const AVBitStreamFilter ff_vp9_superframe_split_bsf;
http://www.tj-hxxt.cn/news/32253.html

相关文章:

  • 现在淘客做网站还行吗seo优化顾问服务阿亮
  • 二手书网站开发的必要性sem优化推广
  • 福建富通建设有限公司网站百度平台客服
  • 企业网站中( )是第一位的。国家反诈中心app下载
  • 建设部网站官网挂证通报搜索引擎有哪些网站
  • 网络维护专业抚州网站seo
  • 网站首页psd谷歌seo优化
  • 山东住房与城乡建设网站工作手机
  • 网站图片上的分享怎么做百度推广app下载安卓版
  • 网站二级目录互联网品牌的快速推广
  • 做amazon当地电信屏蔽了网站京东seo搜索优化
  • 山西城乡建设网站网络营销的方式都有哪些
  • 织梦网站开发兼职新媒体营销推广公司
  • 介绍一个电影的网站模板下载中国网络优化公司排名
  • 一手楼房可以做哪个网站怎么把产品推广到各大平台
  • 网站只用css做tab切换腾讯企点客服
  • 广告图案大全图片河南靠谱seo地址
  • 武汉seo管理网站优化搜索排名
  • Wordpress电脑版需要下载吗泰州seo外包
  • 做淘客网站 知乎网站seo方案案例
  • 欧莱雅网站建设与推广方案地推项目平台
  • 织梦做的网站打开慢企业网站
  • 杭州网站建设费用网站分析工具
  • wordpress08影视站佛山旺道seo优化
  • 卯兔科技网站建设正规赚佣金的平台
  • 网站做推广百度好还是360好kol推广是什么意思
  • 郑州做网站推广地址青岛网络推广公司排名
  • 咋么做网站在电脑上民生热点新闻
  • 青岛网站设计哪家seo关键词工具
  • 微信公共平台wordpressseo搜索引擎优化工资