首页 > 其他分享 >ffmpeg Code behaviour

ffmpeg Code behaviour

时间:2024-11-10 11:30:09浏览次数:1  
标签:libraries code ffmpeg may library should behaviour Code must

Correctness
The code must be valid. It must not crash, abort, access invalid pointers, leak memory, cause data races or signed integer overflow, or otherwise cause undefined behaviour. Error codes should be checked and, when applicable, forwarded to the caller.

Thread- and library-safety
Our libraries may be called by multiple independent callers in the same process. These calls may happen from any number of threads and the different call sites may not be aware of each other - e.g. a user program may be calling our libraries directly, and use one or more libraries that also call our libraries. The code must behave correctly under such conditions.

Robustness
The code must treat as untrusted any bytestream received from a caller or read from a file, network, etc. It must not misbehave when arbitrary data is sent to it - typically it should print an error message and return AVERROR_INVALIDDATA on encountering invalid input data.

Memory allocation
The code must use the av_malloc() family of functions from libavutil/mem.h to perform all memory allocation, except in special cases (e.g. when interacting with an external library that requires a specific allocator to be used).

All allocations should be checked and AVERROR(ENOMEM) returned on failure. A common mistake is that error paths leak memory - make sure that does not happen.

stdio
Our libraries must not access the stdio streams stdin/stdout/stderr directly (e.g. via printf() family of functions), as that is not library-safe. For logging, use av_log().

https://www.octfgroup.com/

标签:libraries,code,ffmpeg,may,library,should,behaviour,Code,must
From: https://www.cnblogs.com/sathcal/p/18537793

相关文章

  • ffmpeg Patches/Committing
    LicensesforpatchesmustbecompatiblewithFFmpeg.ContributionsshouldbelicensedundertheLGPL2.1,includingan"oranylaterversion"clause,or,ifyoupreferagift-stylelicense,theISCorMITlicense.GPL2includingan"orany......
  • ffmpeg RFC call
    IntheRFCmode,onepersonfromtheTCpostsonthemailinglistthetechnicalquestionandwillrequestinputfromthecommunity.Themailwillhavethefollowingspecification:aprecisetitleaspecifictag[TCRFC]atop-levelemailcontainaprecise......
  • ffmpeg Decisions
    ThedecisionsfromtheTCwillbesentonthemailinglist,withthe[TC]tag.Internally,theTCshouldtakedecisionswithamajority,orusingranked-choicevoting.EachTCmembermustvoteonsuchdecisionaccordingtowhatis,intheirview,bestfor......
  • ffmpeg Community Committee
    TheCommunityCommittee(CC)isheretoarbitrageandmakedecisionswheninter-personalconflictsoccurintheproject.Itwilldecidequicklyandtakeactions,forthesakeoftheproject.TheCCcanremoveprivilegesofoffendingmembers,includingrem......
  • ffmpeg Code of Conduct
    Befriendlyandrespectfultowardsothersandthirdparties.Treatothersthewayyouyourselfwanttobetreated.Beconsiderate.Noteveryonesharesthesameviewpointandprioritiesasyoudo.Differentopinionsandinterpretationshelptheproject.Lo......
  • ffmpeg Introduction
    ThistextisconcernedwiththedevelopmentofFFmpegitself.InformationonusingtheFFmpeglibrariesinotherprogramscanbefoundelsewhere,e.g.in:theinstalledheaderfilestheDoxygendocumentationgeneratedfromtheheaderstheexamplesunderdoc......
  • leecode40.组合总和||
     这题个人感觉很难,一开始按照正常的组合写法没有考虑到去重问题,根据以往写三四数之和的经验,对数组进行了排序,再进行去重逻辑的编写才得以通关,详细去重可以去看看代码随想录,甚至有使用到used数组讲解树枝和数层的去重classSolution{private:vector<vector<int>>resul......
  • ffmpeg Coding Rules SIMD/DSP
    AsmoderncompilersareunabletogenerateefficientSIMDorotherperformance-criticalDSPcodefromplainC,handwrittenassemblyisused.Usuallysuchcodeisisolatedinaseparatefunction.Thenthestandardapproachiswritingmultipleversionsoft......
  • ffmpeg Video and Audio file format conversion
    Anysupportedfileformatandprotocolcanserveasinputtoffmpeg:Examples:YoucanuseYUVfilesasinput:ffmpeg-i/tmp/test%d.Y/tmp/out.mpgItwillusethefiles:/tmp/test0.Y,/tmp/test0.U,/tmp/test0.V,/tmp/test1.Y,/tmp/test1.U,/tmp/test1.V,etc......
  • ffmpeg General Assembly
    TheensembleofactivemembersiscalledtheGeneralAssembly(GA).TheGeneralAssemblyissovereignandlegitimateforallitsdecisionsregardingtheFFmpegproject.TheGeneralAssemblyismadeupofactivecontributors.Contributorsareconsidered&q......