胖熊NET,有趣实用的生活常识!

最新更新文章排行手机版

胖熊NET!

热门搜索:
当前位置: > 母婴

avmask

时间:2024-03-06 07:42:01人气:81作者:用户投稿

本文基于FFmpeg4版本。

1.数据结构定义

structAVFrame定义于<libavutil/frame.h>

structAVFrameframe;

AVFrame中存储的是经过解码后的原始数据。在解码中,AVFrame是解码器的输出;在编码中,AVFrame是编码器的输入。下图中,“decodedframes”的数据类型就是AVFrame:

_____________________\n||||\n|input|demuxer|encodeddata|decoder\n|file|--------->|packets|-----+\n|_______||______________||\nv\n_________\n||\n|decoded|\n|frames|\n|_________|\n______________________|\n|||||\n|output|<--------|encodeddata|<----+\n|file|muxer|packets|encoder\n|________||______________|

AVFrame数据结构非常重要,它的成员非常多,导致数据结构定义篇幅很长。下面引用的数据结构定义中省略冗长的注释以及大部分成员,先总体说明AVFrame的用法,然后再将一些重要成员摘录出来单独进行说明:

/**\n*Thisstructuredescribesdecoded(raw)audioorvideodata.\n*\n*AVFramemustbeallocatedusingav_frame_alloc().Notethatthisonly\n*allocatestheAVFrameitself,thebuffersforthedatamustbemanaged\n*throughothermeans(seebelow).\n*AVFramemustbefreedwithav_frame_free().\n*\n*AVFrameistypicallyallocatedonceandthenreusedmultipletimestohold\n*differentdata(e.g.asingleAVFrametoholdframesreceivedfroma\n*decoder).Insuchacase,av_frame_unref()willfreeanyreferencesheldby\n*theframeandresetittoitsoriginalcleanstatebeforeit\n*isreusedagain.\n*\n*ThedatadescribedbyanAVFrameisusuallyreferencecountedthroughthe\n*AVBufferAPI.TheunderlyingbufferreferencesarestoredinAVFrame.buf/\n*AVFrame.extended_buf.AnAVFrameisconsideredtobereferencecountedifat\n*leastonereferenceisset,i.e.ifAVFrame.buf[0]!=NULL.Insuchacase,\n*everysingledataplanemustbecontainedinoneofthebuffersin\n*AVFrame.buforAVFrame.extended_buf.\n*Theremaybeasinglebufferforallthedata,oroneseparatebufferfor\n*eachplane,oranythinginbetween.\n*\n*sizeof(AVFrame)isnotapartofthepublicABI,sonewfieldsmaybeadded\n*totheendwithaminorbump.\n*\n*FieldscanbeaccessedthroughAVOptions,thenamestringused,matchesthe\n*CstructurefieldnameforfieldsaccessiblethroughAVOptions.TheAVClass\n*forAVFramecanbeobtainedfromavcodec_get_frame_class()\n*/\ntypedefstructAVFrame{\nuint8_t*data[AV_NUM_DATA_POINTERS];\nintlinesize[AV_NUM_DATA_POINTERS];\nuint8_t**extended_data;\nintwidth,height;\nintnb_samples;\nintformat;\nintkey_frame;\nenumAVPictureTypepict_type;\nAVRationalsample_aspect_ratio;\nint64_tpts;\n......\n}AVFrame;\nAVFrame的用法:AVFrame对象必须调用av_frame_alloc()在堆上分配,注意此处指的是AVFrame对象本身,AVFrame对象必须调用av_frame_free()进行销毁。AVFrame中包含的数据缓冲区是AVFrame通常只需分配一次,然后可以多次重用,每次重用前应调用av_frame_unref()将frame复位到原始的干净可用的状态。

下面将一些重要的成员摘录出来进行说明:data

/**\n*pointertothepicture/channelplanes.\n*Thismightbedifferentfromthefirstallocatedbyte\n*\n*Somedecodersaccessareasoutside0,0-width,height,please\n*seeavcodec_align_dimensions2().Somefiltersandswscalecanread\n*upto16bytesbeyondtheplanes,ifthesefiltersaretobeused,\n*then16extrabytesmustbeallocated.\n*\n*NOTE:Exceptforhwaccelformats,pointersnotneededbytheformat\n*MUSTbesettoNULL.\n*/\nuint8_t*data[AV_NUM_DATA_POINTERS];

存储原始帧数据(未编码的原始图像或音频格式,作为解码器的输出或编码器的输入)。data是一个指针数组,数组的每一个元素是一个指针,指向视频中图像的某一plane或音频中某一声道的plane。关于图像plane的详细说明参考“色彩空间与像素格式”,音频plane的详细说明参数“ffplay源码解析6-音频重采样6.1.1节”。下面简单说明:对于packet格式,一幅YUV图像的Y、U、V交织存储在一个plane中,形如YUVYUV...,data[0]指向这个plane;一个双声道的音频帧其左声道L、右声道R交织存储在一个plane中,形如LRLRLR...,data[0]指向这个plane。对于planar格式,一幅YUV图像有Y、U、V三个plane,data[0]指向Yplane,data[1]指向Uplane,data[2]指向Vplane;一个双声道的音频帧有左声道L和右声道R两个plane,data[0]指向Lplane,data[1]指向Rplane。

linesize

/**\n*Forvideo,sizeinbytesofeachpictureline.\n*Foraudio,sizeinbytesofeachplane.\n*\n*Foraudio,onlylinesize[0]maybeset.Forplanaraudio,eachchannel\n*planemustbethesamesize.\n*\n*ForvideothelinesizesshouldbemultiplesoftheCPUsalignment\n*preference,thisis16or32formoderndesktopCPUs.\n*Somecoderequiressuchalignmentothercodecanbeslowerwithout\n*correctalignment,foryetotheritmakesnodifference.\n*\n*@noteThelinesizemaybelargerthanthesizeofusabledata--there\n*maybeextrapaddingpresentforperformancereasons.\n*/\nintlinesize[AV_NUM_DATA_POINTERS];

对于视频来说,linesize是每行图像的大小(字节数)。注意有对齐要求。对于音频来说,linesize是每个plane的大小(字节数)。音频只使用linesize[0]。对于planar音频来说,每个plane的大小必须一样。linesize可能会因性能上的考虑而填充一些额外的数据,因此linesize可能比实际对应的音视频数据尺寸要大。

extended_data

/**\n*pointerstothedataplanes/channels.\n*\n*Forvideo,thisshouldsimplypointtodata[].\n*\n*Forplanaraudio,eachchannelhasaseparatedatapointer,and\n*linesize[0]containsthesizeofeachchannelbuffer.\n*Forpackedaudio,thereisjustonedatapointer,andlinesize[0]\n*containsthetotalsizeofthebufferforallchannels.\n*\n*Note:Bothdataandextended_datashouldalwaysbesetinavalidframe,\n*butforplanaraudiowithmorechannelsthatcanfitindata,\n*extended_datamustbeusedinordertoaccessallchannels.\n*/\nuint8_t**extended_data;

????extended_data是干啥的????对于视频来说,直接指向data[]成员。对于音频来说,packet格式音频只有一个plane,一个音频帧中各个声道的采样点交织存储在此plane中;planar格式音频每个声道一个plane。在多声道planar格式音频中,必须使用extended_data才能访问所有声道,什么意思?在有效的视频/音频frame中,data和extended_data两个成员都必须设置有效值。

width,height

/**\n*@nameVideodimensions\n*Videoframesonly.Thecodeddimensions(inpixels)ofthevideoframe,\n*i.e.thesizeoftherectanglethatcontainssomewell-definedvalues.\n*\n*@noteThepartoftheframeintendedfordisplay/presentationisfurther\n*restrictedbythe@refcropping"Croppingrectangle".\n*@{\n*/\nintwidth,height;

视频帧宽和高(像素)。

nb_samples

/**\n*numberofaudiosamples(perchannel)describedbythisframe\n*/\nintnb_samples;

音频帧中单个声道中包含的采样点数。

format

/**\n*formatoftheframe,-1ifunknownorunset\n*ValuescorrespondtoenumAVPixelFormatforvideoframes,\n*enumAVSampleFormatforaudio)\n*/\nintformat;

帧格式。如果是未知格式或未设置,则值为-1。对于视频帧,此值对应于“enumAVPixelFormat”结构:

enumAVPixelFormat{\nAV_PIX_FMT_NONE=-1,\nAV_PIX_FMT_YUV420P,///<planarYUV4:2:0,12bpp,(1Cr&Cbsampleper2x2Ysamples)\nAV_PIX_FMT_YUYV422,///<packedYUV4:2:2,16bpp,Y0CbY1Cr\nAV_PIX_FMT_RGB24,///<packedRGB8:8:8,24bpp,RGBRGB...\nAV_PIX_FMT_BGR24,///<packedRGB8:8:8,24bpp,BGRBGR...\n......\n}

对于音频帧,此值对应于“enumAVSampleFormat”格式:

enumAVSampleFormat{\nAV_SAMPLE_FMT_NONE=-1,\nAV_SAMPLE_FMT_U8,///<unsigned8bits\nAV_SAMPLE_FMT_S16,///<signed16bits\nAV_SAMPLE_FMT_S32,///<signed32bits\nAV_SAMPLE_FMT_FLT,///<float\nAV_SAMPLE_FMT_DBL,///<double\n\nAV_SAMPLE_FMT_U8P,///<unsigned8bits,planar\nAV_SAMPLE_FMT_S16P,///<signed16bits,planar\nAV_SAMPLE_FMT_S32P,///<signed32bits,planar\nAV_SAMPLE_FMT_FLTP,///<float,planar\nAV_SAMPLE_FMT_DBLP,///<double,planar\nAV_SAMPLE_FMT_S64,///<signed64bits\nAV_SAMPLE_FMT_S64P,///<signed64bits,planar\n\nAV_SAMPLE_FMT_NB///<Numberofsampleformats.DONOTUSEiflinkingdynamically\n};

key_frame

/**\n*1->keyframe,0->not\n*/\nintkey_frame;

视频帧是否是关键帧的标识,1->关键帧,0->非关键帧。

pict_type

/**\n*Picturetypeoftheframe.\n*/\nenumAVPictureTypepict_type;

视频帧类型(I、B、P等)。如下:

/**\n*@}\n*@}\n*@defgrouplavu_pictureImagerelated\n*\n*AVPicturetypes,pixelformatsandbasicimageplanesmanipulation.\n*\n*@{\n*/\n\nenumAVPictureType{\nAV_PICTURE_TYPE_NONE=0,///<Undefined\nAV_PICTURE_TYPE_I,///<Intra\nAV_PICTURE_TYPE_P,///<Predicted\nAV_PICTURE_TYPE_B,///<Bi-dirpredicted\nAV_PICTURE_TYPE_S,///<S(GMC)-VOPMPEG-4\nAV_PICTURE_TYPE_SI,///<SwitchingIntra\nAV_PICTURE_TYPE_SP,///<SwitchingPredicted\nAV_PICTURE_TYPE_BI,///<BItype\n};

sample_aspect_ratio

/**\n*Sampleaspectratioforthevideoframe,0/1ifunknown/unspecified.\n*/\nAVRationalsample_aspect_ratio;

视频帧的宽高比。

pts

/**\n*Presentationtimestampintime_baseunits(timewhenframeshouldbeshowntouser).\n*/\nint64_tpts;

显示时间戳。单位是time_base。

pkt_pts

#ifFF_API_PKT_PTS\n/**\n*PTScopiedfromtheAVPacketthatwasdecodedtoproducethisframe.\n*@deprecatedusetheptsfieldinstead\n*/\nattribute_deprecated\nint64_tpkt_pts;\n#endif

此frame对应的packet中的显示时间戳。是从对应packet(解码生成此frame)中拷贝PTS得到此值。

本文福利,免费领取C++音视频学习资料包+学习路线大纲、技术视频/代码,内容包括(音视频开发,面试题,FFmpeg,webRTC,rtmp,hls,rtsp,ffplay,编解码,推拉流,srs),有需要的可以进企鹅裙927239107领取哦~

avmask

pkt_dts

/**\n*DTScopiedfromtheAVPacketthattriggeredreturningthisframe.(ifframethreadingisn'tused)\n*ThisisalsothePresentationtimeofthisAVFramecalculatedfrom\n*onlyAVPacket.dtsvalueswithoutptsvalues.\n*/\nint64_tpkt_dts;

此frame对应的packet中的解码时间戳。是从对应packet(解码生成此frame)中拷贝DTS得到此值。如果对应的packet中只有dts而未设置pts,则此值也是此frame的pts。

coded_picture_number

/**\n*picturenumberinbitstreamorder\n*/\nintcoded_picture_number;

在编码流中当前图像的序号。

display_picture_number

/**\n*picturenumberindisplayorder\n*/\nintdisplay_picture_number;

在显示序列中当前图像的序号。

interlaced_frame

/**\n*Thecontentofthepictureisinterlaced.\n*/\nintinterlaced_frame;

图像逐行/隔行模式标识。

sample_rate

/**\n*Samplerateoftheaudiodata.\n*/\nintsample_rate;

音频采样率。

channel_layout

/**\n*Channellayoutoftheaudiodata.\n*/\nuint64_tchannel_layout;

音频声道布局。每bit代表一个特定的声道,参考channel_layout.h中的定义,一目了然:

/**\n*@defgroupchannel_masksAudiochannelmasks\n*\n*Achannellayoutisa64-bitsintegerwithabitsetforeverychannel.\n*Thenumberofbitssetmustbeequaltothenumberofchannels.\n*Thevalue0meansthatthechannellayoutisnotknown.\n*@notethisdatastructureisnotpowerfulenoughtohandlechannels\n*combinationsthathavethesamechannelmultipletimes,suchas\n*dual-mono.\n*\n*@{\n*/\n#defineAV_CH_FRONT_LEFT0x00000001\n#defineAV_CH_FRONT_RIGHT0x00000002\n#defineAV_CH_FRONT_CENTER0x00000004\n#defineAV_CH_LOW_FREQUENCY0x00000008\n......\n\n/**\n*@}\n*@defgroupchannel_mask_cAudiochannellayouts\n*@{\n**/\n#defineAV_CH_LAYOUT_MONO(AV_CH_FRONT_CENTER)\n#defineAV_CH_LAYOUT_STEREO(AV_CH_FRONT_LEFT|AV_CH_FRONT_RIGHT)\n#defineAV_CH_LAYOUT_2POINT1(AV_CH_LAYOUT_STEREO|AV_CH_LOW_FREQUENCY)

buf

/**\n*AVBufferreferencesbackingthedataforthisframe.Ifallelementsof\n*thisarrayareNULL,thenthisframeisnotreferencecounted.Thisarray\n*mustbefilledcontiguously--ifbuf[i]isnon-NULLthenbuf[j]must\n*alsobenon-NULLforallj<i.\n*\n*TheremaybeatmostoneAVBufferperdataplane,soforvideothisarray\n*alwayscontainsallthereferences.Forplanaraudiowithmorethan\n*AV_NUM_DATA_POINTERSchannels,theremaybemorebuffersthancanfitin\n*thisarray.ThentheextraAVBufferRefpointersarestoredinthe\n*extended_bufarray.\n*/\nAVBufferRef*buf[AV_NUM_DATA_POINTERS];

此帧的数据可以由AVBufferRef管理,AVBufferRef提供AVBuffer引用机制。这里涉及到缓冲区引用计数概念:AVBuffer是FFmpeg中很常用的一种缓冲区,缓冲区使用引用计数(reference-counted)机制。AVBufferRef则对AVBuffer缓冲区提供了一层封装,最主要的是作引用计数处理,实现了一种安全机制。用户不应直接访问AVBuffer,应通过AVBufferRef来访问AVBuffer,以保证安全。FFmpeg中很多基础的数据结构都包含了AVBufferRef成员,来间接使用AVBuffer缓冲区。

帧的数据缓冲区AVBuffer就是前面的data成员,用户不应直接使用data成员,应通过buf成员间接使用data成员。那extended_data又是做什么的呢????

如果buf[]的所有元素都为NULL,则此帧不会被引用计数。必须连续填充buf[]-如果buf[i]为非NULL,则对于所有j<i,buf[j]也必须为非NULL。每个plane最多可以有一个AVBuffer,一个AVBufferRef指针指向一个AVBuffer,一个AVBuffer引用指的就是一个AVBufferRef指针。对于视频来说,buf[]包含所有AVBufferRef指针。对于具有多于AV_NUM_DATA_POINTERS个声道的planar音频来说,可能buf[]存不下所有的AVBbufferRef指针,多出的AVBufferRef指针存储在extended_buf数组中。

extended_buf&nb_extended_buf

/**\n*ForplanaraudiowhichrequiresmorethanAV_NUM_DATA_POINTERS\n*AVBufferRefpointers,thisarraywillholdallthereferenceswhich\n*cannotfitintoAVFrame.buf.\n*\n*NotethatthisisdifferentfromAVFrame.extended_data,whichalways\n*containsallthepointers.Thisarrayonlycontainstheextrapointers,\n*whichcannotfitintoAVFrame.buf.\n*\n*Thisarrayisalwaysallocatedusingav_malloc()bywhoeverconstructs\n*theframe.Itisfreedinav_frame_unref().\n*/\nAVBufferRef**extended_buf;\n/**\n*Numberofelementsinextended_buf.\n*/\nintnb_extended_buf;

对于具有多于AV_NUM_DATA_POINTERS个声道的planar音频来说,可能buf[]存不下所有的AVBbufferRef指针,多出的AVBufferRef指针存储在extended_buf数组中。注意此处的extended_buf和AVFrame.extended_data的不同,AVFrame.extended_data包含所有指向各plane的指针,而extended_buf只包含AVFrame.buf中装不下的指针。extended_buf是构造frame时av_frame_alloc()中自动调用av_malloc()来分配空间的。调用av_frame_unref会释放掉extended_buf。nb_extended_buf是extended_buf中的元素数目。

best_effort_timestamp

/**\n*frametimestampestimatedusingvariousheuristics,instreamtimebase\n*-encoding:unused\n*-decoding:setbylibavcodec,readbyuser.\n*/\nint64_tbest_effort_timestamp;

pkt_pos

/**\n*reorderedposfromthelastAVPacketthathasbeeninputintothedecoder\n*-encoding:unused\n*-decoding:Readbyuser.\n*/\nint64_tpkt_pos;

记录最后一个扔进解码器的packet在输入文件中的位置偏移量。

pkt_duration

/**\n*durationofthecorrespondingpacket,expressedin\n*AVStream->time_baseunits,0ifunknown.\n*-encoding:unused\n*-decoding:Readbyuser.\n*/\nint64_tpkt_duration;

对应packet的时长,单位是AVStream->time_base。

channels

/**\n*numberofaudiochannels,onlyusedforaudio.\n*-encoding:unused\n*-decoding:Readbyuser.\n*/\nintchannels;

音频声道数量。

pkt_size

/**\n*sizeofthecorrespondingpacketcontainingthecompressed\n*frame.\n*Itissettoanegativevalueifunknown.\n*-encoding:unused\n*-decoding:setbylibavcodec,readbyuser.\n*/\nintpkt_size;

对应packet的大小。

crop_

/**\n*@anchorcropping\n*@nameCropping\n*Videoframesonly.Thenumberofpixelstodiscardfromthethe\n*top/bottom/left/rightborderoftheframetoobtainthesub-rectangleof\n*theframeintendedforpresentation.\n*@{\n*/\nsize_tcrop_top;\nsize_tcrop_bottom;\nsize_tcrop_left;\nsize_tcrop_right;\n/**\n*@}\n*/

用于视频帧图像裁切。四个值分别为从frame的上/下/左/右边界裁切的像素数。

2.相关函数使用说明2.1av_frame_alloc()

/**\n*AllocateanAVFrameandsetitsfieldstodefaultvalues.Theresulting\n*structmustbefreedusingav_frame_free().\n*\n*@returnAnAVFramefilledwithdefaultvaluesorNULLonfailure.\n*\n*@notethisonlyallocatestheAVFrameitself,notthedatabuffers.Those\n*mustbeallocatedthroughothermeans,e.g.withav_frame_get_buffer()or\n*manually.\n*/\nAVFrame*av_frame_alloc(void);

构造一个frame,对象各成员被设为默认值。此函数只分配AVFrame对象本身,而不分配AVFrame中的数据缓冲区。

2.2av_frame_free()

/**\n*Freetheframeandanydynamicallyallocatedobjectsinit,\n*e.g.extended_data.Iftheframeisreferencecounted,itwillbe\n*unreferencedfirst.\n*\n*@paramframeframetobefreed.ThepointerwillbesettoNULL.\n*/\nvoidav_frame_free(AVFrame**frame);

释放一个frame。

2.3av_frame_ref()

/**\n*Setupanewreferencetothedatadescribedbythesourceframe.\n*\n*Copyframepropertiesfromsrctodstandcreateanewreferenceforeach\n*AVBufferReffromsrc.\n*\n*Ifsrcisnotreferencecounted,newbuffersareallocatedandthedatais\n*copied.\n*\n*@warning:dstMUSThavebeeneitherunreferencedwithav_frame_unref(dst),\n*ornewlyallocatedwithav_frame_alloc()beforecallingthis\n*function,orundefinedbehaviorwilloccur.\n*\n*@return0onsuccess,anegativeAVERRORonerror\n*/\nintav_frame_ref(AVFrame*dst,constAVFrame*src);

为src中的数据建立一个新的引用。将src中帧的各属性拷到dst中,并且为src中每个AVBufferRef创建一个新的引用。如果src未使用引用计数,则dst中会分配新的数据缓冲区,将将src中缓冲区的数据拷贝到dst中的缓冲区。

2.4av_frame_clone()

/**\n*Createanewframethatreferencesthesamedataassrc.\n*\n*Thisisashortcutforav_frame_alloc()+av_frame_ref().\n*\n*@returnnewlycreatedAVFrameonsuccess,NULLonerror.\n*/\nAVFrame*av_frame_clone(constAVFrame*src);

创建一个新的frame,新的frame和src使用同一数据缓冲区,缓冲区管理使用引用计数机制。本函数相当于av_frame_alloc()+av_frame_ref()

2.5av_frame_unref()

/**\n*Unreferenceallthebuffersreferencedbyframeandresettheframefields.\n*/\nvoidav_frame_unref(AVFrame*frame);

解除本frame对本frame中所有缓冲区的引用,并复位frame中各成员。

2.6av_frame_move_ref()

/**\n*Moveeverythingcontainedinsrctodstandresetsrc.\n*\n*@warning:dstisnotunreferenced,butdirectlyoverwrittenwithoutreading\n*ordeallocatingitscontents.Callav_frame_unref(dst)manually\n*beforecallingthisfunctiontoensurethatnomemoryisleaked.\n*/\nvoidav_frame_move_ref(AVFrame*dst,AVFrame*src);

将src中所有数据拷贝到dst中,并复位src。为避免内存泄漏,在调用av_frame_move_ref(dst,src)之前应先调用av_frame_unref(dst)。

2.7av_frame_get_buffer()

/**\n*Allocatenewbuffer(s)foraudioorvideodata.\n*\n*Thefollowingfieldsmustbesetonframebeforecallingthisfunction:\n*-format(pixelformatforvideo,sampleformatforaudio)\n*-widthandheightforvideo\n*-nb_samplesandchannel_layoutforaudio\n*\n*ThisfunctionwillfillAVFrame.dataandAVFrame.bufarraysand,if\n*necessary,allocateandfillAVFrame.extended_dataandAVFrame.extended_buf.\n*Forplanarformats,onebufferwillbeallocatedforeachplane.\n*\n*@warning:ifframealreadyhasbeenallocated,callingthisfunctionwill\n*leakmemory.Inaddition,undefinedbehaviorcanoccurincertain\n*cases.\n*\n*@paramframeframeinwhichtostorethenewbuffers.\n*@paramalignRequiredbuffersizealignment.Ifequalto0,alignmentwillbe\n*chosenautomaticallyforthecurrentCPU.Itishighly\n*recommendedtopass0hereunlessyouknowwhatyouaredoing.\n*\n*@return0onsuccess,anegativeAVERRORonerror.\n*/\nintav_frame_get_buffer(AVFrame*frame,intalign);

为音频或视频数据分配新的缓冲区。调用本函数前,帧中的如下成员必须先设置好:

format(视频像素格式或音频采样格式)width、height(视频画面和宽和高)nb_samples、channel_layout(音频单个声道中的采样点数目和声道布局)

本函数会填充AVFrame.data和AVFrame.buf数组,如果有需要,还会分配和填充AVFrame.extended_data和AVFrame.extended_buf。对于planar格式,会为每个plane分配一个缓冲区。

2.8av_frame_copy()

/**\n*Copytheframedatafromsrctodst.\n*\n*Thisfunctiondoesnotallocateanything,dstmustbealreadyinitializedand\n*allocatedwiththesameparametersassrc.\n*\n*Thisfunctiononlycopiestheframedata(i.e.thecontentsofthedata/\n*extendeddataarrays),notanyotherproperties.\n*\n*@return>=0onsuccess,anegativeAVERRORonerror.\n*/\nintav_frame_copy(AVFrame*dst,constAVFrame*src);

将src中的帧数据拷贝到dst中。本函数并不会有任何分配缓冲区的动作,调用此函数前dst必须已经使用了和src同样的参数完成了初始化。本函数只拷贝帧中的数据缓冲区的内容(data/extended_data数组中的内容),而不涉及帧中任何其他的属性。

标签:
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至123@。cc举报,一经查实,本站将立刻删除。