中文亚洲精品无码_熟女乱子伦免费_人人超碰人人爱国产_亚洲熟妇女综合网

當(dāng)前位置: 首頁 > news >正文

自己制作網(wǎng)頁鏈接的軟件企業(yè)網(wǎng)站優(yōu)化公司

自己制作網(wǎng)頁鏈接的軟件,企業(yè)網(wǎng)站優(yōu)化公司,富源縣建設(shè)局網(wǎng)站,三五互聯(lián)做網(wǎng)站怎么樣本章主要介紹AVBSF 文章目錄 結(jié)構(gòu)體定義對外函數(shù)常見的過濾器 從名字我們可以知道這是個(gè)碼流過濾器,我們最常用的是一個(gè)叫做h264_mp4toannexb_bsf的東東 這個(gè)過濾器的作用是把h264以MP4格式的NALU轉(zhuǎn)換為annexb(0x000001) const AVBitStreamF…

本章主要介紹AVBSF

文章目錄

    • 結(jié)構(gòu)體定義
    • 對外函數(shù)
    • 常見的過濾器

從名字我們可以知道這是個(gè)碼流過濾器,我們最常用的是一個(gè)叫做h264_mp4toannexb_bsf的東東
這個(gè)過濾器的作用是把h264以MP4格式的NALU轉(zhuǎn)換為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,
};

結(jié)構(gòu)體定義


/*** @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的上下文,下面的是它的插件回調(diào)函數(shù)


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;

看多了就會(huì)發(fā)現(xiàn)非常相似,基本就一個(gè)套路,一個(gè)上下文結(jié)構(gòu)體,一個(gè)回調(diào)插件結(jié)構(gòu)體,上下文中一個(gè)私有的指針,大小為priv_data_size,所以如果想要實(shí)現(xiàn)插件,簡單的實(shí)現(xiàn)這幾個(gè)回調(diào)函數(shù)就可以了。

對外函數(shù)

核心對外函數(shù)


/*** @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);

其實(shí)這些函數(shù)內(nèi)部也很簡單,主要就是對回調(diào)函數(shù)的封裝。

常見的過濾器

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://m.risenshineclean.com/news/48584.html

相關(guān)文章:

  • 網(wǎng)站做百度推廣為什么沒人咨詢做網(wǎng)站推廣的公司
  • 博物館網(wǎng)站模版搜索引擎營銷分析
  • css3做的牛逼網(wǎng)站免費(fèi)觀看行情軟件網(wǎng)站進(jìn)入
  • 廣州 深圳 外貿(mào)網(wǎng)站建設(shè)搜索引擎在線
  • 網(wǎng)站開發(fā)培訓(xùn)機(jī)構(gòu)百度公司總部地址
  • 微網(wǎng)站模板源代碼sem競價(jià)推廣怎么做
  • 阿里云建站和華為云建站哪個(gè)好互聯(lián)網(wǎng)營銷師培訓(xùn)教材
  • ip做網(wǎng)站地址北京昨天出啥大事了
  • 做同城購物網(wǎng)站賺錢嗎創(chuàng)意營銷點(diǎn)子
  • 如何利用某個(gè)軟件做一個(gè)網(wǎng)站長沙百度搜索排名優(yōu)化
  • 長春網(wǎng)站開發(fā)推薦網(wǎng)絡(luò)營銷案例100例
  • centos lamp wordpress百度seo搜索
  • 內(nèi)江網(wǎng)站建設(shè)0832hdsj長沙疫情最新消息今天封城了
  • 河南做網(wǎng)站哪個(gè)公司好蘋果cms永久免費(fèi)全能建站程序
  • 做網(wǎng)站生意越來越差阜陽seo
  • 重慶專業(yè)的網(wǎng)站建設(shè)網(wǎng)站百度權(quán)重查詢
  • 14版哥斯拉的官方做的宣傳網(wǎng)站營銷策略有哪幾種
  • 網(wǎng)站怎樣做權(quán)重百度賬號(hào)免費(fèi)注冊
  • 大公司做網(wǎng)站怎么創(chuàng)建一個(gè)網(wǎng)站
  • 網(wǎng)站開發(fā)實(shí)例視頻常用的網(wǎng)絡(luò)推廣方法
  • 82端口做網(wǎng)站品牌傳播策劃方案
  • 上海專業(yè)做網(wǎng)站公司電話石家莊網(wǎng)絡(luò)關(guān)鍵詞排名
  • 現(xiàn)在pc網(wǎng)站的標(biāo)準(zhǔn)一般是做多大網(wǎng)絡(luò)營銷的作用
  • 招商加盟網(wǎng)站模板程序百度網(wǎng)站推廣怎么做
  • 那個(gè)網(wǎng)站有免費(fèi)的模板百度搜索指數(shù)查詢
  • mac做網(wǎng)站設(shè)計(jì)全網(wǎng)營銷渠道
  • 安卓系統(tǒng)誰開發(fā)的5年網(wǎng)站seo優(yōu)化公司
  • 為什么做這個(gè)網(wǎng)站項(xiàng)目企業(yè)seo
  • 溫州市建設(shè)工程信息網(wǎng)溫州seo教程
  • 計(jì)算機(jī)課程網(wǎng)站建設(shè)實(shí)訓(xùn)報(bào)告總結(jié)南昌seo搜索排名