日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

FFMPEG结构体分析之AVPacket

發布時間:2024/2/28 编程问答 25 豆豆
生活随笔 收集整理的這篇文章主要介紹了 FFMPEG结构体分析之AVPacket 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
AVPacket:存儲一幀壓縮編碼數據 AVPacket 結構體定義在ffmpeg/libavcodec/packet.h中 /*** This structure stores compressed data. It is typically exported by demuxers* and then passed as input to decoders, or received as output from encoders and* then passed to muxers.** For video, it should typically contain one compressed frame. For audio it may* contain several compressed frames. Encoders are allowed to output empty* packets, with no compressed data, containing only side data* (e.g. to update some stream parameters at the end of encoding).** The semantics of data ownership depends on the buf field.* If it is set, the packet data is dynamically allocated and is* valid indefinitely until a call to av_packet_unref() reduces the* reference count to 0.** If the buf field is not set av_packet_ref() would make a copy instead* of increasing the reference count.** The side data is always allocated with av_malloc(), copied by* av_packet_ref() and freed by av_packet_unref().** sizeof(AVPacket) being a part of the public ABI is deprecated. once* av_init_packet() is removed, new packets will only be able to be allocated* with av_packet_alloc(), and new fields may be added to the end of the struct* with a minor bump.** @see av_packet_alloc* @see av_packet_ref* @see av_packet_unref*/ typedef struct AVPacket {/*** A reference to the reference-counted buffer where the packet data is* stored.* May be NULL, then the packet data is not reference-counted.*/AVBufferRef *buf;/*** Presentation timestamp in AVStream->time_base units; the time at which* the decompressed packet will be presented to the user.* Can be AV_NOPTS_VALUE if it is not stored in the file.* pts MUST be larger or equal to dts as presentation cannot happen before* decompression, unless one wants to view hex dumps. Some formats misuse* the terms dts and pts/cts to mean something different. Such timestamps* must be converted to true pts/dts before they are stored in AVPacket.*///顯示時間戳int64_t pts;/*** Decompression timestamp in AVStream->time_base units; the time at which* the packet is decompressed.* Can be AV_NOPTS_VALUE if it is not stored in the file.*///解碼時間戳int64_t dts;//壓縮編碼的數據uint8_t *data;//data的大小int size;//標識該AVPacket所屬的視頻/音頻流int stream_index;/*** A combination of AV_PKT_FLAG values*/int flags;/*** Additional packet data that can be provided by the container.* Packet can contain several types of side information.*/AVPacketSideData *side_data;int side_data_elems;/*** Duration of this packet in AVStream->time_base units, 0 if unknown.* Equals next_pts - this_pts in presentation order.*/int64_t duration;int64_t pos; ///< byte position in stream, -1 if unknown } AVPacket;

跟這個結構體相關的三個函數為:
?

AVPacket *av_packet_alloc(void); 創建一個AVPacket并將其字段設置為默認值。使用av_packet_free()釋放內存 int av_packet_ref(AVPacket *dst, const AVPacket *src); 創建一個src->data的新的引用計數。如果src已經設置了引用計數發(src->buffer不為空),則直接將其引用計數+1;如果src沒有設置引用計數(src->buffer為空),則為dst創建一個新的引用計數buf,并復制src->data到buf->buffer中。最后,復制src的其他字段到dst中。 void av_packet_unref(AVPacket *pkt); 將緩存空間的引用計數-1,并將Packet中的其他字段設為初始值。如果引用計數為0,自動的釋放緩存空間。 void av_packet_free(AVPacket **pkt); 釋放數據包,如果數據包是引用計數的,它將首先被取消引用。

參考:FFmpeg: AVPacket

總結

以上是生活随笔為你收集整理的FFMPEG结构体分析之AVPacket的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。

主站蜘蛛池模板: 久久视频在线观看免费 | 青青草官网 | 国产不卡网 | 丰满大乳奶做爰ⅹxx视频 | 精品久久ai | 99热这里只有精 | 理论片在线观看视频 | 日本美女在线 | 精品国产一区二区在线观看 | 美脚の诱脚舐め脚视频播放 | 韩国美女av | 欧美日韩黄 | 中文字幕――色哟哟 | 天海翼中文字幕 | 亚洲一区福利视频 | 狠久久 | 一区二区三区四区在线免费观看 | 欧美日韩免费观看一区=区三区 | 精品在线小视频 | 精品美女久久久 | 国产精品va无码一区二区三区 | 在线激情小视频 | 国产av一区二区三区传媒 | jizz国产在线观看 | 精品国产一级片 | 午夜视频在线免费 | 在线观看 中文字幕 | 在线亚洲网站 | 天天在线观看 | 欧美成人做爰大片免费看黄石 | 高清久久| 麻豆性视频 | 肉体粗喘娇吟国产91 | 精品在线视频一区 | 一区二区视频网站 | jizz处女| 91成人在线免费 | 亚洲中文字幕一区在线 | 天天操好逼 | 亚洲免费区| 无码一区二区 | 欧美aⅴ视频 | 亚洲天堂激情 | 九一国产在线观看 | 欧美一区二区三区成人久久片 | 亚洲a在线播放 | 欧美1区2区3区4区 | 中文字幕精品一二三四五六七八 | 日日爽爽 | 午夜视频福利在线观看 | 国产在线拍揄自揄拍无码视频 | 韩日av| 情欲少妇人妻100篇 黄色一级片欧美 | 日日干日日草 | 日本免费看 | 欧美日韩国内 | 牛牛影视一区二区三区 | 麻豆av免费在线 | 欧美日韩成人在线播放 | 大度亲吻原声视频在线观看 | 国产理伦 | 亚洲一区欧美二区 | 日本日韩欧美 | 亚洲视频999 | 久久爱一区二区 | 91天天看| 国精产品99永久一区一区 | 在线看片国产 | 久久久久99人妻一区二区三区 | 人妻 日韩精品 中文字幕 | 黑人玩弄人妻一区二区三区影院 | 在线亚洲一区二区 | 用力抵着尿进去了h | 国产美女视频一区二区 | a级片免费播放 | 夜夜添无码一区二区三区 | 玩偶姐姐在线观看免费 | 一色综合 | 日韩在线视屏 | 亚洲青草| 欧美亚洲丝袜 | 国产伦精品一区二区三区网站 | 欧美18一19性内谢 | wwyoujizzcom| 在线天堂网 | 日日夜夜网站 | 精品无码人妻一区二区免费蜜桃 | 国产资源在线免费观看 | 国产黄色大全 | 国产91亚洲 | 亚洲女同二女同志 | 一区二区三区福利 | 国产猛男猛女超爽免费视频 | 一二级毛片 | 色综合久久久久无码专区 | 日日夜夜操av | 国产色无码精品视频国产 | 69av视频在线 | 欧美老少做受xxxx高潮 |