0004-Make-libcamera-vid-run-normally.patch 380 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578
  1. From 1ef1752d44921737247635ba028821332d053aef Mon Sep 17 00:00:00 2001
  2. From: "zejian.su" <zejian.su@starfivetech.com>
  3. Date: Mon, 6 Nov 2023 13:43:41 +0800
  4. Subject: [PATCH] Make libcamera-vid run normally
  5. ---
  6. core/libcamera_encoder.hpp | 1 +
  7. core/video_options.hpp | 20 +-
  8. encoder/CMakeLists.txt | 7 +-
  9. encoder/encoder.cpp | 6 +-
  10. encoder/h265_encoder.cpp | 422 ++++++
  11. encoder/h265_encoder.hpp | 78 ++
  12. encoder/include/khronos/OMX_Audio.h | 1310 ++++++++++++++++++
  13. encoder/include/khronos/OMX_Component.h | 569 ++++++++
  14. encoder/include/khronos/OMX_ComponentExt.h | 61 +
  15. encoder/include/khronos/OMX_ContentPipe.h | 193 +++
  16. encoder/include/khronos/OMX_Core.h | 1422 ++++++++++++++++++++
  17. encoder/include/khronos/OMX_CoreExt.h | 73 +
  18. encoder/include/khronos/OMX_IVCommon.h | 993 ++++++++++++++
  19. encoder/include/khronos/OMX_Image.h | 328 +++++
  20. encoder/include/khronos/OMX_ImageExt.h | 55 +
  21. encoder/include/khronos/OMX_Index.h | 260 ++++
  22. encoder/include/khronos/OMX_IndexExt.h | 105 ++
  23. encoder/include/khronos/OMX_Other.h | 366 +++++
  24. encoder/include/khronos/OMX_Types.h | 361 +++++
  25. encoder/include/khronos/OMX_Video.h | 1141 ++++++++++++++++
  26. encoder/include/khronos/OMX_VideoExt.h | 401 ++++++
  27. encoder/mjpeg_encoder.cpp | 19 +-
  28. encoder/yuv420_encoder.cpp | 80 ++
  29. encoder/yuv420_encoder.hpp | 41 +
  30. 24 files changed, 8296 insertions(+), 16 deletions(-)
  31. create mode 100755 encoder/h265_encoder.cpp
  32. create mode 100755 encoder/h265_encoder.hpp
  33. create mode 100755 encoder/include/khronos/OMX_Audio.h
  34. create mode 100755 encoder/include/khronos/OMX_Component.h
  35. create mode 100755 encoder/include/khronos/OMX_ComponentExt.h
  36. create mode 100755 encoder/include/khronos/OMX_ContentPipe.h
  37. create mode 100755 encoder/include/khronos/OMX_Core.h
  38. create mode 100755 encoder/include/khronos/OMX_CoreExt.h
  39. create mode 100755 encoder/include/khronos/OMX_IVCommon.h
  40. create mode 100755 encoder/include/khronos/OMX_Image.h
  41. create mode 100755 encoder/include/khronos/OMX_ImageExt.h
  42. create mode 100755 encoder/include/khronos/OMX_Index.h
  43. create mode 100755 encoder/include/khronos/OMX_IndexExt.h
  44. create mode 100755 encoder/include/khronos/OMX_Other.h
  45. create mode 100755 encoder/include/khronos/OMX_Types.h
  46. create mode 100755 encoder/include/khronos/OMX_Video.h
  47. create mode 100755 encoder/include/khronos/OMX_VideoExt.h
  48. create mode 100755 encoder/yuv420_encoder.cpp
  49. create mode 100755 encoder/yuv420_encoder.hpp
  50. diff --git a/core/libcamera_encoder.hpp b/core/libcamera_encoder.hpp
  51. index 892b153..293cc58 100644
  52. --- a/core/libcamera_encoder.hpp
  53. +++ b/core/libcamera_encoder.hpp
  54. @@ -16,6 +16,7 @@
  55. typedef std::function<void(void *, size_t, int64_t, bool)> EncodeOutputReadyCallback;
  56. typedef std::function<void(libcamera::ControlList &)> MetadataReadyCallback;
  57. +
  58. class LibcameraEncoder : public LibcameraApp
  59. {
  60. public:
  61. diff --git a/core/video_options.hpp b/core/video_options.hpp
  62. index 395d0a8..b3f9469 100644
  63. --- a/core/video_options.hpp
  64. +++ b/core/video_options.hpp
  65. @@ -23,17 +23,13 @@ struct VideoOptions : public Options
  66. // clang-format off
  67. options_.add_options()
  68. ("bitrate,b", value<uint32_t>(&bitrate)->default_value(0),
  69. - "Set the video bitrate for encoding, in bits/second (h264 only)")
  70. - ("profile", value<std::string>(&profile),
  71. - "Set the encoding profile (h264 only)")
  72. - ("level", value<std::string>(&level),
  73. - "Set the encoding level (h264 only)")
  74. + "Set the video bitrate for encoding, in bits/second (h265 only)")
  75. ("intra,g", value<unsigned int>(&intra)->default_value(0),
  76. - "Set the intra frame period (h264 only)")
  77. + "Set the intra frame period (h265 only)")
  78. ("inline", value<bool>(&inline_headers)->default_value(false)->implicit_value(true),
  79. - "Force PPS/SPS header with every I frame (h264 only)")
  80. - ("codec", value<std::string>(&codec)->default_value("h264"),
  81. - "Set the codec to use, either h264, "
  82. + "Force PPS/SPS header with every I frame (h265 only)")
  83. + ("codec", value<std::string>(&codec)->default_value("h265"),
  84. + "Set the codec to use, either h265, "
  85. #if LIBAV_PRESENT
  86. "libav, "
  87. #endif
  88. @@ -123,14 +119,14 @@ struct VideoOptions : public Options
  89. width = 640;
  90. if (height == 0)
  91. height = 480;
  92. - if (strcasecmp(codec.c_str(), "h264") == 0)
  93. - codec = "h264";
  94. - else if (strcasecmp(codec.c_str(), "libav") == 0)
  95. + if (strcasecmp(codec.c_str(), "libav") == 0)
  96. codec = "libav";
  97. else if (strcasecmp(codec.c_str(), "yuv420") == 0)
  98. codec = "yuv420";
  99. else if (strcasecmp(codec.c_str(), "mjpeg") == 0)
  100. codec = "mjpeg";
  101. + else if (strcasecmp(codec.c_str(), "h265") == 0)
  102. + codec = "h265";
  103. else
  104. throw std::runtime_error("unrecognised codec " + codec);
  105. if (strcasecmp(initial.c_str(), "pause") == 0)
  106. diff --git a/encoder/CMakeLists.txt b/encoder/CMakeLists.txt
  107. index a426a45..4f36270 100644
  108. --- a/encoder/CMakeLists.txt
  109. +++ b/encoder/CMakeLists.txt
  110. @@ -6,9 +6,12 @@ if (NOT DEFINED ENABLE_LIBAV)
  111. set(ENABLE_LIBAV 1)
  112. endif()
  113. +find_library(SF_OMX_IL_LIBRARY sf-omx-il REQUIRED)
  114. +include_directories(./include/khronos)
  115. +
  116. set(LIBAV_PRESENT 0)
  117. -set(SRC encoder.cpp null_encoder.cpp h264_encoder.cpp mjpeg_encoder.cpp)
  118. -set(TARGET_LIBS images)
  119. +set(SRC encoder.cpp null_encoder.cpp h264_encoder.cpp mjpeg_encoder.cpp h265_encoder.cpp yuv420_encoder.cpp)
  120. +set(TARGET_LIBS images sf-omx-il)
  121. if (ENABLE_LIBAV)
  122. message(STATUS "Checking for libavcodec")
  123. diff --git a/encoder/encoder.cpp b/encoder/encoder.cpp
  124. index a0622ed..ce47d97 100644
  125. --- a/encoder/encoder.cpp
  126. +++ b/encoder/encoder.cpp
  127. @@ -11,6 +11,8 @@
  128. #include "h264_encoder.hpp"
  129. #include "mjpeg_encoder.hpp"
  130. #include "null_encoder.hpp"
  131. +#include "h265_encoder.hpp"
  132. +#include "yuv420_encoder.hpp"
  133. #if LIBAV_PRESENT
  134. #include "libav_encoder.hpp"
  135. @@ -19,7 +21,7 @@
  136. Encoder *Encoder::Create(VideoOptions const *options, const StreamInfo &info)
  137. {
  138. if (strcasecmp(options->codec.c_str(), "yuv420") == 0)
  139. - return new NullEncoder(options);
  140. + return new YUV420Encoder(options);
  141. else if (strcasecmp(options->codec.c_str(), "h264") == 0)
  142. return new H264Encoder(options, info);
  143. #if LIBAV_PRESENT
  144. @@ -28,5 +30,7 @@ Encoder *Encoder::Create(VideoOptions const *options, const StreamInfo &info)
  145. #endif
  146. else if (strcasecmp(options->codec.c_str(), "mjpeg") == 0)
  147. return new MjpegEncoder(options);
  148. + else if (strcasecmp(options->codec.c_str(), "h265") == 0)
  149. + return new H265Encoder(options, info);
  150. throw std::runtime_error("Unrecognised codec " + options->codec);
  151. }
  152. diff --git a/encoder/h265_encoder.cpp b/encoder/h265_encoder.cpp
  153. new file mode 100755
  154. index 0000000..37c3b15
  155. --- /dev/null
  156. +++ b/encoder/h265_encoder.cpp
  157. @@ -0,0 +1,422 @@
  158. +/* SPDX-License-Identifier: BSD-2-Clause */
  159. +/*
  160. + * Copyright (C) 2023, Starfive Technology Co., Ltd.
  161. + *
  162. + * h265_encoder.cpp - h265 video encoder.
  163. + */
  164. +
  165. +#include <fcntl.h>
  166. +#include <poll.h>
  167. +#include <sys/ioctl.h>
  168. +#include <sys/mman.h>
  169. +#include <sys/msg.h>
  170. +
  171. +#include <linux/videodev2.h>
  172. +
  173. +#include <chrono>
  174. +#include <iostream>
  175. +
  176. +#include "h265_encoder.hpp"
  177. +
  178. +#define OMX_INIT_STRUCTURE(a) \
  179. + memset(&(a), 0, sizeof(a)); \
  180. + (a).nSize = sizeof(a); \
  181. + (a).nVersion.nVersion = 1; \
  182. + (a).nVersion.s.nVersionMajor = 1; \
  183. + (a).nVersion.s.nVersionMinor = 1; \
  184. + (a).nVersion.s.nRevision = 1; \
  185. + (a).nVersion.s.nStep = 1
  186. +
  187. +typedef struct Message
  188. +{
  189. + long msg_type;
  190. + OMX_S32 msg_flag;
  191. + OMX_BUFFERHEADERTYPE *pBuffer;
  192. +} Message;
  193. +
  194. +static OMX_ERRORTYPE eventHandler(
  195. + OMX_HANDLETYPE hComponent,
  196. + OMX_PTR pAppData,
  197. + OMX_EVENTTYPE eEvent,
  198. + OMX_U32 nData1,
  199. + OMX_U32 nData2,
  200. + OMX_PTR pEventData)
  201. +{
  202. + H265Encoder::EncodeContext *pEncodeContext = (H265Encoder::EncodeContext *)pAppData;
  203. +
  204. + switch (eEvent)
  205. + {
  206. + case OMX_EventPortSettingsChanged:
  207. + {
  208. + OMX_PARAM_PORTDEFINITIONTYPE pOutputPortDefinition;
  209. + OMX_INIT_STRUCTURE(pOutputPortDefinition);
  210. + pOutputPortDefinition.nPortIndex = 1;
  211. + OMX_GetParameter(pEncodeContext->hComponentEncoder, OMX_IndexParamPortDefinition, &pOutputPortDefinition);
  212. + OMX_U32 nOutputBufferSize = pOutputPortDefinition.nBufferSize;
  213. + OMX_U32 nOutputBufferCount = pOutputPortDefinition.nBufferCountMin;
  214. +
  215. + LOG(2, "enable output port and alloc buffer");
  216. + OMX_SendCommand(pEncodeContext->hComponentEncoder, OMX_CommandPortEnable, 1, NULL);
  217. +
  218. + for (OMX_U32 i = 0; i < nOutputBufferCount; i++)
  219. + {
  220. + OMX_BUFFERHEADERTYPE *pBuffer = NULL;
  221. + OMX_AllocateBuffer(hComponent, &pBuffer, 1, NULL, nOutputBufferSize);
  222. + pEncodeContext->pOutputBufferArray[i] = pBuffer;
  223. + OMX_FillThisBuffer(hComponent, pBuffer);
  224. + }
  225. + }
  226. + break;
  227. + case OMX_EventBufferFlag:
  228. + {
  229. + Message data;
  230. + data.msg_type = 1;
  231. + data.msg_flag = -1;
  232. + if (msgsnd(pEncodeContext->msgid, (void *)&data, sizeof(data) - sizeof(data.msg_type), 0) == -1)
  233. + {
  234. + LOG_ERROR("msgsnd failed");
  235. + }
  236. + }
  237. + break;
  238. + case OMX_EventCmdComplete:
  239. + {
  240. + switch ((OMX_COMMANDTYPE)(nData1))
  241. + {
  242. + case OMX_CommandStateSet:
  243. + {
  244. + pEncodeContext->comState = (OMX_STATETYPE)(nData2);
  245. + }
  246. + break;
  247. + case OMX_CommandPortDisable:
  248. + {
  249. + if (nData2 == 1)
  250. + pEncodeContext->disableEVnt = OMX_TRUE;
  251. + }
  252. + break;
  253. + default:
  254. + break;
  255. + }
  256. + }
  257. + break;
  258. + case OMX_EventError:
  259. + {
  260. + LOG_ERROR("receive err event " + std::to_string(nData1) + std::to_string(nData2));
  261. + pEncodeContext->justQuit = OMX_TRUE;
  262. + }
  263. + break;
  264. + default:
  265. + break;
  266. + }
  267. + return OMX_ErrorNone;
  268. +}
  269. +
  270. +static OMX_ERRORTYPE fillOutputBufferDoneHandler(
  271. + OMX_HANDLETYPE hComponent,
  272. + OMX_PTR pAppData,
  273. + OMX_BUFFERHEADERTYPE *pBuffer)
  274. +{
  275. + H265Encoder::EncodeContext *pEncodeContext = (H265Encoder::EncodeContext *)pAppData;
  276. +
  277. + Message data;
  278. + data.msg_type = 1;
  279. + if (pBuffer->nFlags & OMX_BUFFERFLAG_EOS)
  280. + {
  281. + data.msg_flag = -1;
  282. + }
  283. + else
  284. + {
  285. + data.msg_flag = 1;
  286. + data.pBuffer = pBuffer;
  287. + }
  288. + if (msgsnd(pEncodeContext->msgid, (void *)&data, sizeof(data) - sizeof(data.msg_type), 0) == -1)
  289. + {
  290. + LOG_ERROR("msgsnd failed");
  291. + }
  292. +
  293. + return OMX_ErrorNone;
  294. +}
  295. +
  296. +static OMX_ERRORTYPE emptyBufferDoneHandler(
  297. + OMX_HANDLETYPE hComponent,
  298. + OMX_PTR pAppData,
  299. + OMX_BUFFERHEADERTYPE *pBuffer)
  300. +{
  301. + H265Encoder::EncodeContext *pEncodeContext = (H265Encoder::EncodeContext *)pAppData;
  302. + Message data;
  303. + data.msg_type = 1;
  304. + data.msg_flag = 0;
  305. + data.pBuffer = pBuffer;
  306. + if (msgsnd(pEncodeContext->msgid, (void *)&data, sizeof(data) - sizeof(data.msg_type), 0) == -1)
  307. + {
  308. + LOG_ERROR("msgsnd failed");
  309. + }
  310. +
  311. + return OMX_ErrorNone;
  312. +}
  313. +
  314. +void H265Encoder::initOMX()
  315. +{
  316. + if(encoderCxt.hComponentEncoder)
  317. + {
  318. + OMX_FreeHandle(encoderCxt.hComponentEncoder);
  319. + encoderCxt.hComponentEncoder = 0;
  320. + OMX_Deinit();
  321. + }
  322. +
  323. + int ret = OMX_Init();
  324. + if(OMX_ErrorNone != ret)
  325. + throw std::runtime_error("run OMX_Init failed. ret is " + std::to_string(ret));
  326. +}
  327. +
  328. +void H265Encoder::configOMX(StreamInfo const &info)
  329. +{
  330. + // Config callbacks
  331. + OMX_CALLBACKTYPE &callbacks = callbacks_;
  332. + callbacks.EventHandler = eventHandler;
  333. + callbacks.FillBufferDone = fillOutputBufferDoneHandler;
  334. + callbacks.EmptyBufferDone = emptyBufferDoneHandler;
  335. +
  336. + // Get OMX handle
  337. + OMX_HANDLETYPE hComponentEncoder = NULL;
  338. + {
  339. + char encName[] = "OMX.sf.video_encoder.hevc";
  340. +
  341. + OMX_GetHandle(&hComponentEncoder, encName, &encoderCxt, &callbacks);
  342. + if(!hComponentEncoder)
  343. + throw std::runtime_error("Can not get OMX handle.");
  344. + }
  345. + encoderCxt.hComponentEncoder = hComponentEncoder;
  346. +
  347. + // Config input
  348. + OMX_PARAM_PORTDEFINITIONTYPE pInputPortDefinition;
  349. + OMX_INIT_STRUCTURE(pInputPortDefinition);
  350. + pInputPortDefinition.nPortIndex = 0;
  351. + OMX_GetParameter(hComponentEncoder, OMX_IndexParamPortDefinition, &pInputPortDefinition);
  352. + pInputPortDefinition.format.video.nFrameWidth = info.width;
  353. + pInputPortDefinition.format.video.nFrameHeight = info.height;
  354. + pInputPortDefinition.format.video.eColorFormat = OMX_COLOR_FormatYUV420SemiPlanar;
  355. + pInputPortDefinition.format.video.xFramerate = encoderCxt.nFrameRate;
  356. + OMX_SetParameter(hComponentEncoder, OMX_IndexParamPortDefinition, &pInputPortDefinition);
  357. + OMX_GetParameter(hComponentEncoder, OMX_IndexParamPortDefinition, &pInputPortDefinition);
  358. +
  359. + // Config output
  360. + OMX_PARAM_PORTDEFINITIONTYPE pOutputPortDefinition;
  361. + OMX_INIT_STRUCTURE(pOutputPortDefinition);
  362. + pOutputPortDefinition.nPortIndex = 1;
  363. + OMX_GetParameter(hComponentEncoder, OMX_IndexParamPortDefinition, &pOutputPortDefinition);
  364. + pOutputPortDefinition.format.video.nFrameWidth = info.width;
  365. + pOutputPortDefinition.format.video.nFrameHeight = info.height;
  366. + pOutputPortDefinition.format.video.nBitrate = encoderCxt.nBitrate;
  367. + OMX_SetParameter(hComponentEncoder, OMX_IndexParamPortDefinition, &pOutputPortDefinition);
  368. +
  369. + if(encoderCxt.nNumPFrame)
  370. + {
  371. + OMX_VIDEO_PARAM_HEVCTYPE hevcType;
  372. + OMX_INIT_STRUCTURE(hevcType);
  373. + hevcType.nPortIndex = 1;
  374. + OMX_GetParameter(hComponentEncoder, static_cast<OMX_INDEXTYPE>(OMX_IndexParamVideoHevc), &hevcType);
  375. + hevcType.nKeyFrameInterval = encoderCxt.nNumPFrame;
  376. + OMX_SetParameter(hComponentEncoder, static_cast<OMX_INDEXTYPE>(OMX_IndexParamVideoHevc), &hevcType);
  377. + }
  378. +
  379. + // Allocate input buffer
  380. + OMX_SendCommand(hComponentEncoder, OMX_CommandPortDisable, 1, NULL);
  381. + LOG(1, "wait for output port disable");
  382. + while (!encoderCxt.disableEVnt && !encoderCxt.justQuit);
  383. + if (encoderCxt.justQuit)
  384. + {
  385. + freeResource();
  386. + return;
  387. + }
  388. + LOG(1, "output port disabled");
  389. +
  390. + OMX_SendCommand(hComponentEncoder, OMX_CommandStateSet, OMX_StateIdle, NULL);
  391. +
  392. + OMX_U32 nInputBufferSize = pInputPortDefinition.nBufferSize;
  393. + OMX_U32 nInputBufferCount = pInputPortDefinition.nBufferCountActual;
  394. + for (OMX_U32 i = 0; i < nInputBufferCount; i++)
  395. + {
  396. + OMX_BUFFERHEADERTYPE *pBuffer = NULL;
  397. + OMX_AllocateBuffer(hComponentEncoder, &pBuffer, 0, NULL, nInputBufferSize);
  398. + encoderCxt.pInputBufferArray[i] = pBuffer;
  399. + input_buffers_available_.push(pBuffer);
  400. + }
  401. + encoderCxt.nInputBufferCount = nInputBufferCount;
  402. +
  403. + LOG(1, "wait for Component idle");
  404. + while (encoderCxt.comState != OMX_StateIdle && !encoderCxt.justQuit);
  405. + if (encoderCxt.justQuit)
  406. + {
  407. + freeResource();
  408. + return;
  409. + }
  410. + LOG(1, "Component in idle");
  411. +}
  412. +
  413. +H265Encoder::H265Encoder(VideoOptions const *options, StreamInfo const &info)
  414. + : Encoder(options)
  415. +{
  416. + memset(&encoderCxt, 0, sizeof(EncodeContext));
  417. +
  418. + // Apply any options->
  419. + encoderCxt.nBitrate = options->bitrate ? options->bitrate : 3000000;
  420. + encoderCxt.nNumPFrame = options->intra ? options->intra - 1 : 14;
  421. + encoderCxt.nFrameRate = 30;
  422. + encoderCxt.nFrameBufferSize = info.width * info.height * 3 / 2;
  423. +
  424. + encoderCxt.disableEVnt = OMX_FALSE;
  425. + encoderCxt.justQuit = OMX_FALSE;
  426. +
  427. + OMX_S32 msgid = -1;
  428. + msgid = msgget(IPC_PRIVATE, 0666 | IPC_CREAT);
  429. + if (msgid < 0)
  430. + throw std::runtime_error("get ipc_id error");
  431. + encoderCxt.msgid = msgid;
  432. +
  433. + // Initialize OMX
  434. + initOMX();
  435. +
  436. + // Config OMX
  437. + configOMX(info);
  438. +
  439. + abortOutput_ = false;
  440. + output_thread_ = std::thread(&H265Encoder::outputThread, this);
  441. + abortPoll_ = false;
  442. + poll_thread_ = std::thread(&H265Encoder::pollThread, this);
  443. +}
  444. +
  445. +H265Encoder::~H265Encoder()
  446. +{
  447. + freeResource();
  448. +
  449. + abortPoll_ = true;
  450. +
  451. + Message data;
  452. + data.msg_type = 1;
  453. + data.msg_flag = -1;
  454. + if (msgsnd(encoderCxt.msgid, (void *)&data, sizeof(data) - sizeof(data.msg_type), 0) == -1)
  455. + {
  456. + LOG_ERROR("msgsnd failed");
  457. + }
  458. +
  459. + poll_thread_.join();
  460. + abortOutput_ = true;
  461. + output_thread_.join();
  462. +}
  463. +
  464. +void H265Encoder::freeResource()
  465. +{
  466. + if (encoderCxt.comState == OMX_StateExecuting)
  467. + {
  468. + OMX_SendCommand(encoderCxt.hComponentEncoder, OMX_CommandStateSet, OMX_StateIdle, NULL);
  469. + LOG(1, "wait for Component idle");
  470. + while (encoderCxt.comState != OMX_StateIdle && !encoderCxt.justQuit);
  471. + LOG(1, "Component in idle");
  472. + }
  473. +
  474. + if(encoderCxt.hComponentEncoder)
  475. + {
  476. + OMX_FreeHandle(encoderCxt.hComponentEncoder);
  477. + OMX_Deinit();
  478. + }
  479. +}
  480. +
  481. +void H265Encoder::EncodeBuffer(int fd, size_t size, void *mem, StreamInfo const &info, int64_t timestamp_us)
  482. +{
  483. + OMX_BUFFERHEADERTYPE *pInputBuffer = nullptr;
  484. + {
  485. + std::lock_guard<std::mutex> lock(input_buffers_available_mutex_);
  486. + if (input_buffers_available_.empty())
  487. + throw std::runtime_error("no buffers available to queue codec input");
  488. +
  489. + pInputBuffer = input_buffers_available_.front();
  490. + input_buffers_available_.pop();
  491. +
  492. + output_timestamps_.push(timestamp_us);
  493. + }
  494. +
  495. + memcpy(pInputBuffer->pBuffer, mem, encoderCxt.nFrameBufferSize);
  496. + pInputBuffer->nFlags = 0x10;
  497. + pInputBuffer->nFilledLen = encoderCxt.nFrameBufferSize;
  498. +
  499. + input_done_callback_(nullptr);
  500. +
  501. + OMX_EmptyThisBuffer(encoderCxt.hComponentEncoder, pInputBuffer);
  502. +}
  503. +
  504. +void H265Encoder::pollThread()
  505. +{
  506. + LOG(1, "start process");
  507. + OMX_SendCommand(encoderCxt.hComponentEncoder, OMX_CommandStateSet, OMX_StateExecuting, NULL);
  508. +
  509. + Message data;
  510. + while (OMX_TRUE)
  511. + {
  512. + ssize_t ret = msgrcv(encoderCxt.msgid, (void *)&data, BUFSIZ, 0, 0);
  513. + if (ret == -1)
  514. + throw std::runtime_error("msgrcv failed with errno: " + std::to_string(errno));
  515. +
  516. + switch (data.msg_flag)
  517. + {
  518. + case 0:
  519. + {
  520. + std::lock_guard<std::mutex> lock(input_buffers_available_mutex_);
  521. + input_buffers_available_.push(data.pBuffer);
  522. + }
  523. + break;
  524. + case 1:
  525. + {
  526. + {
  527. + std::lock_guard<std::mutex> lock(output_mutex_);
  528. + output_queue_.push(data.pBuffer);
  529. + output_cond_var_.notify_one();
  530. + }
  531. + }
  532. + break;
  533. + case -1:
  534. + {
  535. + if(abortPoll_)
  536. + return;
  537. + }
  538. + break;
  539. + default:
  540. + break;
  541. + }
  542. + if(abortPoll_)
  543. + return;
  544. + }
  545. +}
  546. +
  547. +void H265Encoder::outputThread()
  548. +{
  549. + while (true)
  550. + {
  551. + int64_t timestamp = 0;
  552. + OMX_BUFFERHEADERTYPE *pBuffer = nullptr;
  553. + {
  554. + std::unique_lock<std::mutex> lock(output_mutex_);
  555. + if (output_queue_.empty())
  556. + {
  557. + if(abortOutput_)
  558. + return;
  559. + else
  560. + output_cond_var_.wait_for(lock, 200ms);
  561. + } else
  562. + {
  563. + pBuffer = output_queue_.front();
  564. + output_queue_.pop();
  565. + if(!output_timestamps_.empty())
  566. + {
  567. + timestamp = output_timestamps_.front();
  568. + output_timestamps_.pop();
  569. + }
  570. + }
  571. + }
  572. +
  573. + if(pBuffer)
  574. + {
  575. + output_ready_callback_(pBuffer->pBuffer, pBuffer->nFilledLen, timestamp, true);
  576. + OMX_FillThisBuffer(encoderCxt.hComponentEncoder, pBuffer);
  577. + }
  578. + }
  579. +}
  580. \ No newline at end of file
  581. diff --git a/encoder/h265_encoder.hpp b/encoder/h265_encoder.hpp
  582. new file mode 100755
  583. index 0000000..a1844cb
  584. --- /dev/null
  585. +++ b/encoder/h265_encoder.hpp
  586. @@ -0,0 +1,78 @@
  587. +/* SPDX-License-Identifier: BSD-2-Clause */
  588. +/*
  589. + * Copyright (C) 2023, Starfive Technology Co., Ltd.
  590. + *
  591. + * h265_encoder.hpp - h265 video encoder.
  592. + */
  593. +
  594. +#pragma once
  595. +
  596. +#include <condition_variable>
  597. +#include <mutex>
  598. +#include <queue>
  599. +#include <thread>
  600. +
  601. +#include "encoder.hpp"
  602. +
  603. +#include <OMX_Core.h>
  604. +#include <OMX_Component.h>
  605. +#include <OMX_Video.h>
  606. +#include <OMX_VideoExt.h>
  607. +#include <OMX_IndexExt.h>
  608. +
  609. +class H265Encoder : public Encoder
  610. +{
  611. +public:
  612. + H265Encoder(VideoOptions const *options, StreamInfo const &info);
  613. + ~H265Encoder();
  614. + // Encode the given DMABUF.
  615. + void EncodeBuffer(int fd, size_t size, void *mem, StreamInfo const &info, int64_t timestamp_us) override;
  616. +
  617. + struct EncodeContext
  618. + {
  619. + OMX_HANDLETYPE hComponentEncoder;
  620. + OMX_U32 nFrameBufferSize;
  621. + OMX_U32 nBitrate;
  622. + OMX_U32 nFrameRate;
  623. + OMX_U32 nNumPFrame;
  624. + OMX_STATETYPE comState;
  625. + OMX_U32 nInputBufferCount;
  626. + OMX_BUFFERHEADERTYPE *pInputBufferArray[64];
  627. + OMX_BUFFERHEADERTYPE *pOutputBufferArray[64];
  628. + int msgid;
  629. +
  630. + OMX_BOOL disableEVnt;
  631. + OMX_BOOL justQuit;
  632. + };
  633. +private:
  634. + struct EncodeContext encoderCxt;
  635. +
  636. + void initOMX();
  637. + void configOMX(StreamInfo const &info);
  638. + void freeResource();
  639. +
  640. + OMX_CALLBACKTYPE callbacks_;
  641. +
  642. + std::mutex input_buffers_available_mutex_;
  643. + std::queue<OMX_BUFFERHEADERTYPE *> input_buffers_available_;
  644. +
  645. + std::mutex output_mutex_;
  646. + std::queue<int64_t> output_timestamps_;
  647. +
  648. + // This thread just sits waiting for the encoder to finish stuff. It will either:
  649. + // * receive "output" buffers (codec inputs), which we must return to the caller
  650. + // * receive encoded buffers, which we pass to the application.
  651. + void pollThread();
  652. + std::thread poll_thread_;
  653. +
  654. + // Handle the output buffers in another thread so as not to block the encoder. The
  655. + // application can take its time, after which we return this buffer to the encoder for
  656. + // re-use.
  657. + void outputThread();
  658. + std::thread output_thread_;
  659. + std::queue<OMX_BUFFERHEADERTYPE *> output_queue_;
  660. +
  661. + bool abortPoll_;
  662. + std::condition_variable output_cond_var_;
  663. + bool abortOutput_;
  664. +};
  665. diff --git a/encoder/include/khronos/OMX_Audio.h b/encoder/include/khronos/OMX_Audio.h
  666. new file mode 100755
  667. index 0000000..7205319
  668. --- /dev/null
  669. +++ b/encoder/include/khronos/OMX_Audio.h
  670. @@ -0,0 +1,1310 @@
  671. +/*
  672. + * Copyright (c) 2008 The Khronos Group Inc.
  673. + *
  674. + * Permission is hereby granted, free of charge, to any person obtaining
  675. + * a copy of this software and associated documentation files (the
  676. + * "Software"), to deal in the Software without restriction, including
  677. + * without limitation the rights to use, copy, modify, merge, publish,
  678. + * distribute, sublicense, and/or sell copies of the Software, and to
  679. + * permit persons to whom the Software is furnished to do so, subject
  680. + * to the following conditions:
  681. + * The above copyright notice and this permission notice shall be included
  682. + * in all copies or substantial portions of the Software.
  683. + *
  684. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  685. + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  686. + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  687. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
  688. + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  689. + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  690. + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  691. + *
  692. + */
  693. +
  694. +/** @file OMX_Audio.h - OpenMax IL version 1.1.2
  695. + * The structures needed by Audio components to exchange
  696. + * parameters and configuration data with the componenmilts.
  697. + */
  698. +
  699. +#ifndef OMX_Audio_h
  700. +#define OMX_Audio_h
  701. +
  702. +#ifdef __cplusplus
  703. +extern "C" {
  704. +#endif /* __cplusplus */
  705. +
  706. +
  707. +/* Each OMX header must include all required header files to allow the
  708. + * header to compile without errors. The includes below are required
  709. + * for this header file to compile successfully
  710. + */
  711. +
  712. +#include <OMX_Core.h>
  713. +
  714. +/** @defgroup midi MIDI
  715. + * @ingroup audio
  716. + */
  717. +
  718. +/** @defgroup effects Audio effects
  719. + * @ingroup audio
  720. + */
  721. +
  722. +/** @defgroup audio OpenMAX IL Audio Domain
  723. + * Structures for OpenMAX IL Audio domain
  724. + * @{
  725. + */
  726. +
  727. +/** Enumeration used to define the possible audio codings.
  728. + * If "OMX_AUDIO_CodingUnused" is selected, the coding selection must
  729. + * be done in a vendor specific way. Since this is for an audio
  730. + * processing element this enum is relevant. However, for another
  731. + * type of component other enums would be in this area.
  732. + */
  733. +typedef enum OMX_AUDIO_CODINGTYPE {
  734. + OMX_AUDIO_CodingUnused = 0, /**< Placeholder value when coding is N/A */
  735. + OMX_AUDIO_CodingAutoDetect, /**< auto detection of audio format */
  736. + OMX_AUDIO_CodingPCM, /**< Any variant of PCM coding */
  737. + OMX_AUDIO_CodingADPCM, /**< Any variant of ADPCM encoded data */
  738. + OMX_AUDIO_CodingAMR, /**< Any variant of AMR encoded data */
  739. + OMX_AUDIO_CodingGSMFR, /**< Any variant of GSM fullrate (i.e. GSM610) */
  740. + OMX_AUDIO_CodingGSMEFR, /**< Any variant of GSM Enhanced Fullrate encoded data*/
  741. + OMX_AUDIO_CodingGSMHR, /**< Any variant of GSM Halfrate encoded data */
  742. + OMX_AUDIO_CodingPDCFR, /**< Any variant of PDC Fullrate encoded data */
  743. + OMX_AUDIO_CodingPDCEFR, /**< Any variant of PDC Enhanced Fullrate encoded data */
  744. + OMX_AUDIO_CodingPDCHR, /**< Any variant of PDC Halfrate encoded data */
  745. + OMX_AUDIO_CodingTDMAFR, /**< Any variant of TDMA Fullrate encoded data (TIA/EIA-136-420) */
  746. + OMX_AUDIO_CodingTDMAEFR, /**< Any variant of TDMA Enhanced Fullrate encoded data (TIA/EIA-136-410) */
  747. + OMX_AUDIO_CodingQCELP8, /**< Any variant of QCELP 8kbps encoded data */
  748. + OMX_AUDIO_CodingQCELP13, /**< Any variant of QCELP 13kbps encoded data */
  749. + OMX_AUDIO_CodingEVRC, /**< Any variant of EVRC encoded data */
  750. + OMX_AUDIO_CodingSMV, /**< Any variant of SMV encoded data */
  751. + OMX_AUDIO_CodingG711, /**< Any variant of G.711 encoded data */
  752. + OMX_AUDIO_CodingG723, /**< Any variant of G.723 dot 1 encoded data */
  753. + OMX_AUDIO_CodingG726, /**< Any variant of G.726 encoded data */
  754. + OMX_AUDIO_CodingG729, /**< Any variant of G.729 encoded data */
  755. + OMX_AUDIO_CodingAAC, /**< Any variant of AAC encoded data */
  756. + OMX_AUDIO_CodingMP3, /**< Any variant of MP3 encoded data */
  757. + OMX_AUDIO_CodingSBC, /**< Any variant of SBC encoded data */
  758. + OMX_AUDIO_CodingVORBIS, /**< Any variant of VORBIS encoded data */
  759. + OMX_AUDIO_CodingWMA, /**< Any variant of WMA encoded data */
  760. + OMX_AUDIO_CodingRA, /**< Any variant of RA encoded data */
  761. + OMX_AUDIO_CodingMIDI, /**< Any variant of MIDI encoded data */
  762. + OMX_AUDIO_CodingKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  763. + OMX_AUDIO_CodingVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  764. + OMX_AUDIO_CodingMax = 0x7FFFFFFF
  765. +} OMX_AUDIO_CODINGTYPE;
  766. +
  767. +
  768. +/** The PortDefinition structure is used to define all of the parameters
  769. + * necessary for the compliant component to setup an input or an output audio
  770. + * path. If additional information is needed to define the parameters of the
  771. + * port (such as frequency), additional structures must be sent such as the
  772. + * OMX_AUDIO_PARAM_PCMMODETYPE structure to supply the extra parameters for the port.
  773. + */
  774. +typedef struct OMX_AUDIO_PORTDEFINITIONTYPE {
  775. + OMX_STRING cMIMEType; /**< MIME type of data for the port */
  776. + OMX_NATIVE_DEVICETYPE pNativeRender; /** < platform specific reference
  777. + for an output device,
  778. + otherwise this field is 0 */
  779. + OMX_BOOL bFlagErrorConcealment; /**< Turns on error concealment if it is
  780. + supported by the OMX component */
  781. + OMX_AUDIO_CODINGTYPE eEncoding; /**< Type of data expected for this
  782. + port (e.g. PCM, AMR, MP3, etc) */
  783. +} OMX_AUDIO_PORTDEFINITIONTYPE;
  784. +
  785. +
  786. +/** Port format parameter. This structure is used to enumerate
  787. + * the various data input/output format supported by the port.
  788. + */
  789. +typedef struct OMX_AUDIO_PARAM_PORTFORMATTYPE {
  790. + OMX_U32 nSize; /**< size of the structure in bytes */
  791. + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  792. + OMX_U32 nPortIndex; /**< Indicates which port to set */
  793. + OMX_U32 nIndex; /**< Indicates the enumeration index for the format from 0x0 to N-1 */
  794. + OMX_AUDIO_CODINGTYPE eEncoding; /**< Type of data expected for this port (e.g. PCM, AMR, MP3, etc) */
  795. +} OMX_AUDIO_PARAM_PORTFORMATTYPE;
  796. +
  797. +
  798. +/** PCM mode type */
  799. +typedef enum OMX_AUDIO_PCMMODETYPE {
  800. + OMX_AUDIO_PCMModeLinear = 0, /**< Linear PCM encoded data */
  801. + OMX_AUDIO_PCMModeALaw, /**< A law PCM encoded data (G.711) */
  802. + OMX_AUDIO_PCMModeMULaw, /**< Mu law PCM encoded data (G.711) */
  803. + OMX_AUDIO_PCMModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  804. + OMX_AUDIO_PCMModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  805. + OMX_AUDIO_PCMModeMax = 0x7FFFFFFF
  806. +} OMX_AUDIO_PCMMODETYPE;
  807. +
  808. +
  809. +typedef enum OMX_AUDIO_CHANNELTYPE {
  810. + OMX_AUDIO_ChannelNone = 0x0, /**< Unused or empty */
  811. + OMX_AUDIO_ChannelLF = 0x1, /**< Left front */
  812. + OMX_AUDIO_ChannelRF = 0x2, /**< Right front */
  813. + OMX_AUDIO_ChannelCF = 0x3, /**< Center front */
  814. + OMX_AUDIO_ChannelLS = 0x4, /**< Left surround */
  815. + OMX_AUDIO_ChannelRS = 0x5, /**< Right surround */
  816. + OMX_AUDIO_ChannelLFE = 0x6, /**< Low frequency effects */
  817. + OMX_AUDIO_ChannelCS = 0x7, /**< Back surround */
  818. + OMX_AUDIO_ChannelLR = 0x8, /**< Left rear. */
  819. + OMX_AUDIO_ChannelRR = 0x9, /**< Right rear. */
  820. + OMX_AUDIO_ChannelKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  821. + OMX_AUDIO_ChannelVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  822. + OMX_AUDIO_ChannelMax = 0x7FFFFFFF
  823. +} OMX_AUDIO_CHANNELTYPE;
  824. +
  825. +#define OMX_AUDIO_MAXCHANNELS 16 /**< maximum number distinct audio channels that a buffer may contain */
  826. +#define OMX_MIN_PCMPAYLOAD_MSEC 5 /**< Minimum audio buffer payload size for uncompressed (PCM) audio */
  827. +
  828. +/** PCM format description */
  829. +typedef struct OMX_AUDIO_PARAM_PCMMODETYPE {
  830. + OMX_U32 nSize; /**< Size of this structure, in Bytes */
  831. + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  832. + OMX_U32 nPortIndex; /**< port that this structure applies to */
  833. + OMX_U32 nChannels; /**< Number of channels (e.g. 2 for stereo) */
  834. + OMX_NUMERICALDATATYPE eNumData; /**< indicates PCM data as signed or unsigned */
  835. + OMX_ENDIANTYPE eEndian; /**< indicates PCM data as little or big endian */
  836. + OMX_BOOL bInterleaved; /**< True for normal interleaved data; false for
  837. + non-interleaved data (e.g. block data) */
  838. + OMX_U32 nBitPerSample; /**< Bit per sample */
  839. + OMX_U32 nSamplingRate; /**< Sampling rate of the source data. Use 0 for
  840. + variable or unknown sampling rate. */
  841. + OMX_AUDIO_PCMMODETYPE ePCMMode; /**< PCM mode enumeration */
  842. + OMX_AUDIO_CHANNELTYPE eChannelMapping[OMX_AUDIO_MAXCHANNELS]; /**< Slot i contains channel defined by eChannelMap[i] */
  843. +
  844. +} OMX_AUDIO_PARAM_PCMMODETYPE;
  845. +
  846. +
  847. +/** Audio channel mode. This is used by both AAC and MP3, although the names are more appropriate
  848. + * for the MP3. For example, JointStereo for MP3 is CouplingChannels for AAC.
  849. + */
  850. +typedef enum OMX_AUDIO_CHANNELMODETYPE {
  851. + OMX_AUDIO_ChannelModeStereo = 0, /**< 2 channels, the bitrate allocation between those
  852. + two channels changes accordingly to each channel information */
  853. + OMX_AUDIO_ChannelModeJointStereo, /**< mode that takes advantage of what is common between
  854. + 2 channels for higher compression gain */
  855. + OMX_AUDIO_ChannelModeDual, /**< 2 mono-channels, each channel is encoded with half
  856. + the bitrate of the overall bitrate */
  857. + OMX_AUDIO_ChannelModeMono, /**< Mono channel mode */
  858. + OMX_AUDIO_ChannelModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  859. + OMX_AUDIO_ChannelModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  860. + OMX_AUDIO_ChannelModeMax = 0x7FFFFFFF
  861. +} OMX_AUDIO_CHANNELMODETYPE;
  862. +
  863. +
  864. +typedef enum OMX_AUDIO_MP3STREAMFORMATTYPE {
  865. + OMX_AUDIO_MP3StreamFormatMP1Layer3 = 0, /**< MP3 Audio MPEG 1 Layer 3 Stream format */
  866. + OMX_AUDIO_MP3StreamFormatMP2Layer3, /**< MP3 Audio MPEG 2 Layer 3 Stream format */
  867. + OMX_AUDIO_MP3StreamFormatMP2_5Layer3, /**< MP3 Audio MPEG2.5 Layer 3 Stream format */
  868. + OMX_AUDIO_MP3StreamFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  869. + OMX_AUDIO_MP3StreamFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  870. + OMX_AUDIO_MP3StreamFormatMax = 0x7FFFFFFF
  871. +} OMX_AUDIO_MP3STREAMFORMATTYPE;
  872. +
  873. +/** MP3 params */
  874. +typedef struct OMX_AUDIO_PARAM_MP3TYPE {
  875. + OMX_U32 nSize; /**< size of the structure in bytes */
  876. + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  877. + OMX_U32 nPortIndex; /**< port that this structure applies to */
  878. + OMX_U32 nChannels; /**< Number of channels */
  879. + OMX_U32 nBitRate; /**< Bit rate of the input data. Use 0 for variable
  880. + rate or unknown bit rates */
  881. + OMX_U32 nSampleRate; /**< Sampling rate of the source data. Use 0 for
  882. + variable or unknown sampling rate. */
  883. + OMX_U32 nAudioBandWidth; /**< Audio band width (in Hz) to which an encoder should
  884. + limit the audio signal. Use 0 to let encoder decide */
  885. + OMX_AUDIO_CHANNELMODETYPE eChannelMode; /**< Channel mode enumeration */
  886. + OMX_AUDIO_MP3STREAMFORMATTYPE eFormat; /**< MP3 stream format */
  887. +} OMX_AUDIO_PARAM_MP3TYPE;
  888. +
  889. +
  890. +typedef enum OMX_AUDIO_AACSTREAMFORMATTYPE {
  891. + OMX_AUDIO_AACStreamFormatMP2ADTS = 0, /**< AAC Audio Data Transport Stream 2 format */
  892. + OMX_AUDIO_AACStreamFormatMP4ADTS, /**< AAC Audio Data Transport Stream 4 format */
  893. + OMX_AUDIO_AACStreamFormatMP4LOAS, /**< AAC Low Overhead Audio Stream format */
  894. + OMX_AUDIO_AACStreamFormatMP4LATM, /**< AAC Low overhead Audio Transport Multiplex */
  895. + OMX_AUDIO_AACStreamFormatADIF, /**< AAC Audio Data Interchange Format */
  896. + OMX_AUDIO_AACStreamFormatMP4FF, /**< AAC inside MPEG-4/ISO File Format */
  897. + OMX_AUDIO_AACStreamFormatRAW, /**< AAC Raw Format */
  898. + OMX_AUDIO_AACStreamFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  899. + OMX_AUDIO_AACStreamFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  900. + OMX_AUDIO_AACStreamFormatMax = 0x7FFFFFFF
  901. +} OMX_AUDIO_AACSTREAMFORMATTYPE;
  902. +
  903. +
  904. +/** AAC mode type. Note that the term profile is used with the MPEG-2
  905. + * standard and the term object type and profile is used with MPEG-4 */
  906. +typedef enum OMX_AUDIO_AACPROFILETYPE {
  907. + OMX_AUDIO_AACObjectNull = 0, /**< Null, not used */
  908. + OMX_AUDIO_AACObjectMain = 1, /**< AAC Main object */
  909. + OMX_AUDIO_AACObjectLC, /**< AAC Low Complexity object (AAC profile) */
  910. + OMX_AUDIO_AACObjectSSR, /**< AAC Scalable Sample Rate object */
  911. + OMX_AUDIO_AACObjectLTP, /**< AAC Long Term Prediction object */
  912. + OMX_AUDIO_AACObjectHE, /**< AAC High Efficiency (object type SBR, HE-AAC profile) */
  913. + OMX_AUDIO_AACObjectScalable, /**< AAC Scalable object */
  914. + OMX_AUDIO_AACObjectERLC = 17, /**< ER AAC Low Complexity object (Error Resilient AAC-LC) */
  915. + OMX_AUDIO_AACObjectLD = 23, /**< AAC Low Delay object (Error Resilient) */
  916. + OMX_AUDIO_AACObjectHE_PS = 29, /**< AAC High Efficiency with Parametric Stereo coding (HE-AAC v2, object type PS) */
  917. + OMX_AUDIO_AACObjectKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  918. + OMX_AUDIO_AACObjectVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  919. + OMX_AUDIO_AACObjectMax = 0x7FFFFFFF
  920. +} OMX_AUDIO_AACPROFILETYPE;
  921. +
  922. +
  923. +/** AAC tool usage (for nAACtools in OMX_AUDIO_PARAM_AACPROFILETYPE).
  924. + * Required for encoder configuration and optional as decoder info output.
  925. + * For MP3, OMX_AUDIO_CHANNELMODETYPE is sufficient. */
  926. +#define OMX_AUDIO_AACToolNone 0x00000000 /**< no AAC tools allowed (encoder config) or active (decoder info output) */
  927. +#define OMX_AUDIO_AACToolMS 0x00000001 /**< MS: Mid/side joint coding tool allowed or active */
  928. +#define OMX_AUDIO_AACToolIS 0x00000002 /**< IS: Intensity stereo tool allowed or active */
  929. +#define OMX_AUDIO_AACToolTNS 0x00000004 /**< TNS: Temporal Noise Shaping tool allowed or active */
  930. +#define OMX_AUDIO_AACToolPNS 0x00000008 /**< PNS: MPEG-4 Perceptual Noise substitution tool allowed or active */
  931. +#define OMX_AUDIO_AACToolLTP 0x00000010 /**< LTP: MPEG-4 Long Term Prediction tool allowed or active */
  932. +#define OMX_AUDIO_AACToolAll 0x7FFFFFFF /**< all AAC tools allowed or active (*/
  933. +
  934. +/** MPEG-4 AAC error resilience (ER) tool usage (for nAACERtools in OMX_AUDIO_PARAM_AACPROFILETYPE).
  935. + * Required for ER encoder configuration and optional as decoder info output */
  936. +#define OMX_AUDIO_AACERNone 0x00000000 /**< no AAC ER tools allowed/used */
  937. +#define OMX_AUDIO_AACERVCB11 0x00000001 /**< VCB11: Virtual Code Books for AAC section data */
  938. +#define OMX_AUDIO_AACERRVLC 0x00000002 /**< RVLC: Reversible Variable Length Coding */
  939. +#define OMX_AUDIO_AACERHCR 0x00000004 /**< HCR: Huffman Codeword Reordering */
  940. +#define OMX_AUDIO_AACERAll 0x7FFFFFFF /**< all AAC ER tools allowed/used */
  941. +
  942. +
  943. +/** AAC params */
  944. +typedef struct OMX_AUDIO_PARAM_AACPROFILETYPE {
  945. + OMX_U32 nSize; /**< Size of this structure, in Bytes */
  946. + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  947. + OMX_U32 nPortIndex; /**< Port that this structure applies to */
  948. + OMX_U32 nChannels; /**< Number of channels */
  949. + OMX_U32 nSampleRate; /**< Sampling rate of the source data. Use 0 for
  950. + variable or unknown sampling rate. */
  951. + OMX_U32 nBitRate; /**< Bit rate of the input data. Use 0 for variable
  952. + rate or unknown bit rates */
  953. + OMX_U32 nAudioBandWidth; /**< Audio band width (in Hz) to which an encoder should
  954. + limit the audio signal. Use 0 to let encoder decide */
  955. + OMX_U32 nFrameLength; /**< Frame length (in audio samples per channel) of the codec.
  956. + Can be 1024 or 960 (AAC-LC), 2048 (HE-AAC), 480 or 512 (AAC-LD).
  957. + Use 0 to let encoder decide */
  958. + OMX_U32 nAACtools; /**< AAC tool usage */
  959. + OMX_U32 nAACERtools; /**< MPEG-4 AAC error resilience tool usage */
  960. + OMX_AUDIO_AACPROFILETYPE eAACProfile; /**< AAC profile enumeration */
  961. + OMX_AUDIO_AACSTREAMFORMATTYPE eAACStreamFormat; /**< AAC stream format enumeration */
  962. + OMX_AUDIO_CHANNELMODETYPE eChannelMode; /**< Channel mode enumeration */
  963. +} OMX_AUDIO_PARAM_AACPROFILETYPE;
  964. +
  965. +
  966. +/** VORBIS params */
  967. +typedef struct OMX_AUDIO_PARAM_VORBISTYPE {
  968. + OMX_U32 nSize; /**< size of the structure in bytes */
  969. + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  970. + OMX_U32 nPortIndex; /**< port that this structure applies to */
  971. + OMX_U32 nChannels; /**< Number of channels */
  972. + OMX_U32 nBitRate; /**< Bit rate of the encoded data data. Use 0 for variable
  973. + rate or unknown bit rates. Encoding is set to the
  974. + bitrate closest to specified value (in bps) */
  975. + OMX_U32 nMinBitRate; /**< Sets minimum bitrate (in bps). */
  976. + OMX_U32 nMaxBitRate; /**< Sets maximum bitrate (in bps). */
  977. +
  978. + OMX_U32 nSampleRate; /**< Sampling rate of the source data. Use 0 for
  979. + variable or unknown sampling rate. */
  980. + OMX_U32 nAudioBandWidth; /**< Audio band width (in Hz) to which an encoder should
  981. + limit the audio signal. Use 0 to let encoder decide */
  982. + OMX_S32 nQuality; /**< Sets encoding quality to n, between -1 (low) and 10 (high).
  983. + In the default mode of operation, teh quality level is 3.
  984. + Normal quality range is 0 - 10. */
  985. + OMX_BOOL bManaged; /**< Set bitrate management mode. This turns off the
  986. + normal VBR encoding, but allows hard or soft bitrate
  987. + constraints to be enforced by the encoder. This mode can
  988. + be slower, and may also be lower quality. It is
  989. + primarily useful for streaming. */
  990. + OMX_BOOL bDownmix; /**< Downmix input from stereo to mono (has no effect on
  991. + non-stereo streams). Useful for lower-bitrate encoding. */
  992. +} OMX_AUDIO_PARAM_VORBISTYPE;
  993. +
  994. +
  995. +/** WMA Version */
  996. +typedef enum OMX_AUDIO_WMAFORMATTYPE {
  997. + OMX_AUDIO_WMAFormatUnused = 0, /**< format unused or unknown */
  998. + OMX_AUDIO_WMAFormat7, /**< Windows Media Audio format 7 */
  999. + OMX_AUDIO_WMAFormat8, /**< Windows Media Audio format 8 */
  1000. + OMX_AUDIO_WMAFormat9, /**< Windows Media Audio format 9 */
  1001. + OMX_AUDIO_WMAFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  1002. + OMX_AUDIO_WMAFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  1003. + OMX_AUDIO_WMAFormatMax = 0x7FFFFFFF
  1004. +} OMX_AUDIO_WMAFORMATTYPE;
  1005. +
  1006. +
  1007. +/** WMA Profile */
  1008. +typedef enum OMX_AUDIO_WMAPROFILETYPE {
  1009. + OMX_AUDIO_WMAProfileUnused = 0, /**< profile unused or unknown */
  1010. + OMX_AUDIO_WMAProfileL1, /**< Windows Media audio version 9 profile L1 */
  1011. + OMX_AUDIO_WMAProfileL2, /**< Windows Media audio version 9 profile L2 */
  1012. + OMX_AUDIO_WMAProfileL3, /**< Windows Media audio version 9 profile L3 */
  1013. + OMX_AUDIO_WMAProfileKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  1014. + OMX_AUDIO_WMAProfileVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  1015. + OMX_AUDIO_WMAProfileMax = 0x7FFFFFFF
  1016. +} OMX_AUDIO_WMAPROFILETYPE;
  1017. +
  1018. +
  1019. +/** WMA params */
  1020. +typedef struct OMX_AUDIO_PARAM_WMATYPE {
  1021. + OMX_U32 nSize; /**< size of the structure in bytes */
  1022. + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  1023. + OMX_U32 nPortIndex; /**< port that this structure applies to */
  1024. + OMX_U16 nChannels; /**< Number of channels */
  1025. + OMX_U32 nBitRate; /**< Bit rate of the input data. Use 0 for variable
  1026. + rate or unknown bit rates */
  1027. + OMX_AUDIO_WMAFORMATTYPE eFormat; /**< Version of WMA stream / data */
  1028. + OMX_AUDIO_WMAPROFILETYPE eProfile; /**< Profile of WMA stream / data */
  1029. + OMX_U32 nSamplingRate; /**< Sampling rate of the source data */
  1030. + OMX_U16 nBlockAlign; /**< is the block alignment, or block size, in bytes of the audio codec */
  1031. + OMX_U16 nEncodeOptions; /**< WMA Type-specific data */
  1032. + OMX_U32 nSuperBlockAlign; /**< WMA Type-specific data */
  1033. +} OMX_AUDIO_PARAM_WMATYPE;
  1034. +
  1035. +/**
  1036. + * RealAudio format
  1037. + */
  1038. +typedef enum OMX_AUDIO_RAFORMATTYPE {
  1039. + OMX_AUDIO_RAFormatUnused = 0, /**< Format unused or unknown */
  1040. + OMX_AUDIO_RA8, /**< RealAudio 8 codec */
  1041. + OMX_AUDIO_RA9, /**< RealAudio 9 codec */
  1042. + OMX_AUDIO_RA10_AAC, /**< MPEG-4 AAC codec for bitrates of more than 128kbps */
  1043. + OMX_AUDIO_RA10_CODEC, /**< RealAudio codec for bitrates less than 128 kbps */
  1044. + OMX_AUDIO_RA10_LOSSLESS, /**< RealAudio Lossless */
  1045. + OMX_AUDIO_RA10_MULTICHANNEL, /**< RealAudio Multichannel */
  1046. + OMX_AUDIO_RA10_VOICE, /**< RealAudio Voice for bitrates below 15 kbps */
  1047. + OMX_AUDIO_RAFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  1048. + OMX_AUDIO_RAFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  1049. + OMX_VIDEO_RAFormatMax = 0x7FFFFFFF
  1050. +} OMX_AUDIO_RAFORMATTYPE;
  1051. +
  1052. +/** RA (Real Audio) params */
  1053. +typedef struct OMX_AUDIO_PARAM_RATYPE {
  1054. + OMX_U32 nSize; /**< Size of this structure, in Bytes */
  1055. + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  1056. + OMX_U32 nPortIndex; /**< Port that this structure applies to */
  1057. + OMX_U32 nChannels; /**< Number of channels */
  1058. + OMX_U32 nSamplingRate; /**< is the sampling rate of the source data */
  1059. + OMX_U32 nBitsPerFrame; /**< is the value for bits per frame */
  1060. + OMX_U32 nSamplePerFrame; /**< is the value for samples per frame */
  1061. + OMX_U32 nCouplingQuantBits; /**< is the number of coupling quantization bits in the stream */
  1062. + OMX_U32 nCouplingStartRegion; /**< is the coupling start region in the stream */
  1063. + OMX_U32 nNumRegions; /**< is the number of regions value */
  1064. + OMX_AUDIO_RAFORMATTYPE eFormat; /**< is the RealAudio audio format */
  1065. +} OMX_AUDIO_PARAM_RATYPE;
  1066. +
  1067. +
  1068. +/** SBC Allocation Method Type */
  1069. +typedef enum OMX_AUDIO_SBCALLOCMETHODTYPE {
  1070. + OMX_AUDIO_SBCAllocMethodLoudness, /**< Loudness allocation method */
  1071. + OMX_AUDIO_SBCAllocMethodSNR, /**< SNR allocation method */
  1072. + OMX_AUDIO_SBCAllocMethodKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  1073. + OMX_AUDIO_SBCAllocMethodVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  1074. + OMX_AUDIO_SBCAllocMethodMax = 0x7FFFFFFF
  1075. +} OMX_AUDIO_SBCALLOCMETHODTYPE;
  1076. +
  1077. +
  1078. +/** SBC params */
  1079. +typedef struct OMX_AUDIO_PARAM_SBCTYPE {
  1080. + OMX_U32 nSize; /**< size of the structure in bytes */
  1081. + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  1082. + OMX_U32 nPortIndex; /**< port that this structure applies to */
  1083. + OMX_U32 nChannels; /**< Number of channels */
  1084. + OMX_U32 nBitRate; /**< Bit rate of the input data. Use 0 for variable
  1085. + rate or unknown bit rates */
  1086. + OMX_U32 nSampleRate; /**< Sampling rate of the source data. Use 0 for
  1087. + variable or unknown sampling rate. */
  1088. + OMX_U32 nBlocks; /**< Number of blocks */
  1089. + OMX_U32 nSubbands; /**< Number of subbands */
  1090. + OMX_U32 nBitPool; /**< Bitpool value */
  1091. + OMX_BOOL bEnableBitrate; /**< Use bitrate value instead of bitpool */
  1092. + OMX_AUDIO_CHANNELMODETYPE eChannelMode; /**< Channel mode enumeration */
  1093. + OMX_AUDIO_SBCALLOCMETHODTYPE eSBCAllocType; /**< SBC Allocation method type */
  1094. +} OMX_AUDIO_PARAM_SBCTYPE;
  1095. +
  1096. +
  1097. +/** ADPCM stream format parameters */
  1098. +typedef struct OMX_AUDIO_PARAM_ADPCMTYPE {
  1099. + OMX_U32 nSize; /**< size of the structure in bytes */
  1100. + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  1101. + OMX_U32 nPortIndex; /**< port that this structure applies to */
  1102. + OMX_U32 nChannels; /**< Number of channels in the data stream (not
  1103. + necessarily the same as the number of channels
  1104. + to be rendered. */
  1105. + OMX_U32 nBitsPerSample; /**< Number of bits in each sample */
  1106. + OMX_U32 nSampleRate; /**< Sampling rate of the source data. Use 0 for
  1107. + variable or unknown sampling rate. */
  1108. +} OMX_AUDIO_PARAM_ADPCMTYPE;
  1109. +
  1110. +
  1111. +/** G723 rate */
  1112. +typedef enum OMX_AUDIO_G723RATE {
  1113. + OMX_AUDIO_G723ModeUnused = 0, /**< AMRNB Mode unused / unknown */
  1114. + OMX_AUDIO_G723ModeLow, /**< 5300 bps */
  1115. + OMX_AUDIO_G723ModeHigh, /**< 6300 bps */
  1116. + OMX_AUDIO_G723ModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  1117. + OMX_AUDIO_G723ModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  1118. + OMX_AUDIO_G723ModeMax = 0x7FFFFFFF
  1119. +} OMX_AUDIO_G723RATE;
  1120. +
  1121. +
  1122. +/** G723 - Sample rate must be 8 KHz */
  1123. +typedef struct OMX_AUDIO_PARAM_G723TYPE {
  1124. + OMX_U32 nSize; /**< size of the structure in bytes */
  1125. + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  1126. + OMX_U32 nPortIndex; /**< port that this structure applies to */
  1127. + OMX_U32 nChannels; /**< Number of channels in the data stream (not
  1128. + necessarily the same as the number of channels
  1129. + to be rendered. */
  1130. + OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */
  1131. + OMX_AUDIO_G723RATE eBitRate; /**< todo: Should this be moved to a config? */
  1132. + OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */
  1133. + OMX_BOOL bPostFilter; /**< Enable Post Filter */
  1134. +} OMX_AUDIO_PARAM_G723TYPE;
  1135. +
  1136. +
  1137. +/** ITU G726 (ADPCM) rate */
  1138. +typedef enum OMX_AUDIO_G726MODE {
  1139. + OMX_AUDIO_G726ModeUnused = 0, /**< G726 Mode unused / unknown */
  1140. + OMX_AUDIO_G726Mode16, /**< 16 kbps */
  1141. + OMX_AUDIO_G726Mode24, /**< 24 kbps */
  1142. + OMX_AUDIO_G726Mode32, /**< 32 kbps, most common rate, also G721 */
  1143. + OMX_AUDIO_G726Mode40, /**< 40 kbps */
  1144. + OMX_AUDIO_G726ModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  1145. + OMX_AUDIO_G726ModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  1146. + OMX_AUDIO_G726ModeMax = 0x7FFFFFFF
  1147. +} OMX_AUDIO_G726MODE;
  1148. +
  1149. +
  1150. +/** G.726 stream format parameters - must be at 8KHz */
  1151. +typedef struct OMX_AUDIO_PARAM_G726TYPE {
  1152. + OMX_U32 nSize; /**< size of the structure in bytes */
  1153. + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  1154. + OMX_U32 nPortIndex; /**< port that this structure applies to */
  1155. + OMX_U32 nChannels; /**< Number of channels in the data stream (not
  1156. + necessarily the same as the number of channels
  1157. + to be rendered. */
  1158. + OMX_AUDIO_G726MODE eG726Mode;
  1159. +} OMX_AUDIO_PARAM_G726TYPE;
  1160. +
  1161. +
  1162. +/** G729 coder type */
  1163. +typedef enum OMX_AUDIO_G729TYPE {
  1164. + OMX_AUDIO_G729 = 0, /**< ITU G.729 encoded data */
  1165. + OMX_AUDIO_G729A, /**< ITU G.729 annex A encoded data */
  1166. + OMX_AUDIO_G729B, /**< ITU G.729 with annex B encoded data */
  1167. + OMX_AUDIO_G729AB, /**< ITU G.729 annexes A and B encoded data */
  1168. + OMX_AUDIO_G729KhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  1169. + OMX_AUDIO_G729VendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  1170. + OMX_AUDIO_G729Max = 0x7FFFFFFF
  1171. +} OMX_AUDIO_G729TYPE;
  1172. +
  1173. +
  1174. +/** G729 stream format parameters - fixed 6KHz sample rate */
  1175. +typedef struct OMX_AUDIO_PARAM_G729TYPE {
  1176. + OMX_U32 nSize; /**< size of the structure in bytes */
  1177. + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  1178. + OMX_U32 nPortIndex; /**< port that this structure applies to */
  1179. + OMX_U32 nChannels; /**< Number of channels in the data stream (not
  1180. + necessarily the same as the number of channels
  1181. + to be rendered. */
  1182. + OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */
  1183. + OMX_AUDIO_G729TYPE eBitType;
  1184. +} OMX_AUDIO_PARAM_G729TYPE;
  1185. +
  1186. +
  1187. +/** AMR Frame format */
  1188. +typedef enum OMX_AUDIO_AMRFRAMEFORMATTYPE {
  1189. + OMX_AUDIO_AMRFrameFormatConformance = 0, /**< Frame Format is AMR Conformance
  1190. + (Standard) Format */
  1191. + OMX_AUDIO_AMRFrameFormatIF1, /**< Frame Format is AMR Interface
  1192. + Format 1 */
  1193. + OMX_AUDIO_AMRFrameFormatIF2, /**< Frame Format is AMR Interface
  1194. + Format 2*/
  1195. + OMX_AUDIO_AMRFrameFormatFSF, /**< Frame Format is AMR File Storage
  1196. + Format */
  1197. + OMX_AUDIO_AMRFrameFormatRTPPayload, /**< Frame Format is AMR Real-Time
  1198. + Transport Protocol Payload Format */
  1199. + OMX_AUDIO_AMRFrameFormatITU, /**< Frame Format is ITU Format (added at Motorola request) */
  1200. + OMX_AUDIO_AMRFrameFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  1201. + OMX_AUDIO_AMRFrameFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  1202. + OMX_AUDIO_AMRFrameFormatMax = 0x7FFFFFFF
  1203. +} OMX_AUDIO_AMRFRAMEFORMATTYPE;
  1204. +
  1205. +
  1206. +/** AMR band mode */
  1207. +typedef enum OMX_AUDIO_AMRBANDMODETYPE {
  1208. + OMX_AUDIO_AMRBandModeUnused = 0, /**< AMRNB Mode unused / unknown */
  1209. + OMX_AUDIO_AMRBandModeNB0, /**< AMRNB Mode 0 = 4750 bps */
  1210. + OMX_AUDIO_AMRBandModeNB1, /**< AMRNB Mode 1 = 5150 bps */
  1211. + OMX_AUDIO_AMRBandModeNB2, /**< AMRNB Mode 2 = 5900 bps */
  1212. + OMX_AUDIO_AMRBandModeNB3, /**< AMRNB Mode 3 = 6700 bps */
  1213. + OMX_AUDIO_AMRBandModeNB4, /**< AMRNB Mode 4 = 7400 bps */
  1214. + OMX_AUDIO_AMRBandModeNB5, /**< AMRNB Mode 5 = 7950 bps */
  1215. + OMX_AUDIO_AMRBandModeNB6, /**< AMRNB Mode 6 = 10200 bps */
  1216. + OMX_AUDIO_AMRBandModeNB7, /**< AMRNB Mode 7 = 12200 bps */
  1217. + OMX_AUDIO_AMRBandModeWB0, /**< AMRWB Mode 0 = 6600 bps */
  1218. + OMX_AUDIO_AMRBandModeWB1, /**< AMRWB Mode 1 = 8850 bps */
  1219. + OMX_AUDIO_AMRBandModeWB2, /**< AMRWB Mode 2 = 12650 bps */
  1220. + OMX_AUDIO_AMRBandModeWB3, /**< AMRWB Mode 3 = 14250 bps */
  1221. + OMX_AUDIO_AMRBandModeWB4, /**< AMRWB Mode 4 = 15850 bps */
  1222. + OMX_AUDIO_AMRBandModeWB5, /**< AMRWB Mode 5 = 18250 bps */
  1223. + OMX_AUDIO_AMRBandModeWB6, /**< AMRWB Mode 6 = 19850 bps */
  1224. + OMX_AUDIO_AMRBandModeWB7, /**< AMRWB Mode 7 = 23050 bps */
  1225. + OMX_AUDIO_AMRBandModeWB8, /**< AMRWB Mode 8 = 23850 bps */
  1226. + OMX_AUDIO_AMRBandModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  1227. + OMX_AUDIO_AMRBandModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  1228. + OMX_AUDIO_AMRBandModeMax = 0x7FFFFFFF
  1229. +} OMX_AUDIO_AMRBANDMODETYPE;
  1230. +
  1231. +
  1232. +/** AMR Discontinuous Transmission mode */
  1233. +typedef enum OMX_AUDIO_AMRDTXMODETYPE {
  1234. + OMX_AUDIO_AMRDTXModeOff = 0, /**< AMR Discontinuous Transmission Mode is disabled */
  1235. + OMX_AUDIO_AMRDTXModeOnVAD1, /**< AMR Discontinuous Transmission Mode using
  1236. + Voice Activity Detector 1 (VAD1) is enabled */
  1237. + OMX_AUDIO_AMRDTXModeOnVAD2, /**< AMR Discontinuous Transmission Mode using
  1238. + Voice Activity Detector 2 (VAD2) is enabled */
  1239. + OMX_AUDIO_AMRDTXModeOnAuto, /**< The codec will automatically select between
  1240. + Off, VAD1 or VAD2 modes */
  1241. +
  1242. + OMX_AUDIO_AMRDTXasEFR, /**< DTX as EFR instead of AMR standard (3GPP 26.101, frame type =8,9,10) */
  1243. +
  1244. + OMX_AUDIO_AMRDTXModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  1245. + OMX_AUDIO_AMRDTXModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  1246. + OMX_AUDIO_AMRDTXModeMax = 0x7FFFFFFF
  1247. +} OMX_AUDIO_AMRDTXMODETYPE;
  1248. +
  1249. +
  1250. +/** AMR params */
  1251. +typedef struct OMX_AUDIO_PARAM_AMRTYPE {
  1252. + OMX_U32 nSize; /**< size of the structure in bytes */
  1253. + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  1254. + OMX_U32 nPortIndex; /**< port that this structure applies to */
  1255. + OMX_U32 nChannels; /**< Number of channels */
  1256. + OMX_U32 nBitRate; /**< Bit rate read only field */
  1257. + OMX_AUDIO_AMRBANDMODETYPE eAMRBandMode; /**< AMR Band Mode enumeration */
  1258. + OMX_AUDIO_AMRDTXMODETYPE eAMRDTXMode; /**< AMR DTX Mode enumeration */
  1259. + OMX_AUDIO_AMRFRAMEFORMATTYPE eAMRFrameFormat; /**< AMR frame format enumeration */
  1260. +} OMX_AUDIO_PARAM_AMRTYPE;
  1261. +
  1262. +
  1263. +/** GSM_FR (ETSI 06.10, 3GPP 46.010) stream format parameters */
  1264. +typedef struct OMX_AUDIO_PARAM_GSMFRTYPE {
  1265. + OMX_U32 nSize; /**< size of the structure in bytes */
  1266. + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  1267. + OMX_U32 nPortIndex; /**< port that this structure applies to */
  1268. + OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */
  1269. + OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */
  1270. +} OMX_AUDIO_PARAM_GSMFRTYPE;
  1271. +
  1272. +
  1273. +/** GSM-HR (ETSI 06.20, 3GPP 46.020) stream format parameters */
  1274. +typedef struct OMX_AUDIO_PARAM_GSMHRTYPE {
  1275. + OMX_U32 nSize; /**< size of the structure in bytes */
  1276. + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  1277. + OMX_U32 nPortIndex; /**< port that this structure applies to */
  1278. + OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */
  1279. + OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */
  1280. +} OMX_AUDIO_PARAM_GSMHRTYPE;
  1281. +
  1282. +
  1283. +/** GSM-EFR (ETSI 06.60, 3GPP 46.060) stream format parameters */
  1284. +typedef struct OMX_AUDIO_PARAM_GSMEFRTYPE {
  1285. + OMX_U32 nSize; /**< size of the structure in bytes */
  1286. + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  1287. + OMX_U32 nPortIndex; /**< port that this structure applies to */
  1288. + OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */
  1289. + OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */
  1290. +} OMX_AUDIO_PARAM_GSMEFRTYPE;
  1291. +
  1292. +
  1293. +/** TDMA FR (TIA/EIA-136-420, VSELP 7.95kbps coder) stream format parameters */
  1294. +typedef struct OMX_AUDIO_PARAM_TDMAFRTYPE {
  1295. + OMX_U32 nSize; /**< size of the structure in bytes */
  1296. + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  1297. + OMX_U32 nPortIndex; /**< port that this structure applies to */
  1298. + OMX_U32 nChannels; /**< Number of channels in the data stream (not
  1299. + necessarily the same as the number of channels
  1300. + to be rendered. */
  1301. + OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */
  1302. + OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */
  1303. +} OMX_AUDIO_PARAM_TDMAFRTYPE;
  1304. +
  1305. +
  1306. +/** TDMA EFR (TIA/EIA-136-410, ACELP 7.4kbps coder) stream format parameters */
  1307. +typedef struct OMX_AUDIO_PARAM_TDMAEFRTYPE {
  1308. + OMX_U32 nSize; /**< size of the structure in bytes */
  1309. + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  1310. + OMX_U32 nPortIndex; /**< port that this structure applies to */
  1311. + OMX_U32 nChannels; /**< Number of channels in the data stream (not
  1312. + necessarily the same as the number of channels
  1313. + to be rendered. */
  1314. + OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */
  1315. + OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */
  1316. +} OMX_AUDIO_PARAM_TDMAEFRTYPE;
  1317. +
  1318. +
  1319. +/** PDC FR ( RCR-27, VSELP 6.7kbps coder) stream format parameters */
  1320. +typedef struct OMX_AUDIO_PARAM_PDCFRTYPE {
  1321. + OMX_U32 nSize; /**< size of the structure in bytes */
  1322. + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  1323. + OMX_U32 nPortIndex; /**< port that this structure applies to */
  1324. + OMX_U32 nChannels; /**< Number of channels in the data stream (not
  1325. + necessarily the same as the number of channels
  1326. + to be rendered. */
  1327. + OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */
  1328. + OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */
  1329. +} OMX_AUDIO_PARAM_PDCFRTYPE;
  1330. +
  1331. +
  1332. +/** PDC EFR ( RCR-27, ACELP 6.7kbps coder) stream format parameters */
  1333. +typedef struct OMX_AUDIO_PARAM_PDCEFRTYPE {
  1334. + OMX_U32 nSize; /**< size of the structure in bytes */
  1335. + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  1336. + OMX_U32 nPortIndex; /**< port that this structure applies to */
  1337. + OMX_U32 nChannels; /**< Number of channels in the data stream (not
  1338. + necessarily the same as the number of channels
  1339. + to be rendered. */
  1340. + OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */
  1341. + OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */
  1342. +} OMX_AUDIO_PARAM_PDCEFRTYPE;
  1343. +
  1344. +/** PDC HR ( RCR-27, PSI-CELP 3.45kbps coder) stream format parameters */
  1345. +typedef struct OMX_AUDIO_PARAM_PDCHRTYPE {
  1346. + OMX_U32 nSize; /**< size of the structure in bytes */
  1347. + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  1348. + OMX_U32 nPortIndex; /**< port that this structure applies to */
  1349. + OMX_U32 nChannels; /**< Number of channels in the data stream (not
  1350. + necessarily the same as the number of channels
  1351. + to be rendered. */
  1352. + OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */
  1353. + OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */
  1354. +} OMX_AUDIO_PARAM_PDCHRTYPE;
  1355. +
  1356. +
  1357. +/** CDMA Rate types */
  1358. +typedef enum OMX_AUDIO_CDMARATETYPE {
  1359. + OMX_AUDIO_CDMARateBlank = 0, /**< CDMA encoded frame is blank */
  1360. + OMX_AUDIO_CDMARateFull, /**< CDMA encoded frame in full rate */
  1361. + OMX_AUDIO_CDMARateHalf, /**< CDMA encoded frame in half rate */
  1362. + OMX_AUDIO_CDMARateQuarter, /**< CDMA encoded frame in quarter rate */
  1363. + OMX_AUDIO_CDMARateEighth, /**< CDMA encoded frame in eighth rate (DTX)*/
  1364. + OMX_AUDIO_CDMARateErasure, /**< CDMA erasure frame */
  1365. + OMX_AUDIO_CDMARateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  1366. + OMX_AUDIO_CDMARateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  1367. + OMX_AUDIO_CDMARateMax = 0x7FFFFFFF
  1368. +} OMX_AUDIO_CDMARATETYPE;
  1369. +
  1370. +
  1371. +/** QCELP8 (TIA/EIA-96, up to 8kbps coder) stream format parameters */
  1372. +typedef struct OMX_AUDIO_PARAM_QCELP8TYPE {
  1373. + OMX_U32 nSize; /**< size of the structure in bytes */
  1374. + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  1375. + OMX_U32 nPortIndex; /**< port that this structure applies to */
  1376. + OMX_U32 nChannels; /**< Number of channels in the data stream (not
  1377. + necessarily the same as the number of channels
  1378. + to be rendered. */
  1379. + OMX_U32 nBitRate; /**< Bit rate of the input data. Use 0 for variable
  1380. + rate or unknown bit rates */
  1381. + OMX_AUDIO_CDMARATETYPE eCDMARate; /**< Frame rate */
  1382. + OMX_U32 nMinBitRate; /**< minmal rate for the encoder = 1,2,3,4, default = 1 */
  1383. + OMX_U32 nMaxBitRate; /**< maximal rate for the encoder = 1,2,3,4, default = 4 */
  1384. +} OMX_AUDIO_PARAM_QCELP8TYPE;
  1385. +
  1386. +
  1387. +/** QCELP13 ( CDMA, EIA/TIA-733, 13.3kbps coder) stream format parameters */
  1388. +typedef struct OMX_AUDIO_PARAM_QCELP13TYPE {
  1389. + OMX_U32 nSize; /**< size of the structure in bytes */
  1390. + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  1391. + OMX_U32 nPortIndex; /**< port that this structure applies to */
  1392. + OMX_U32 nChannels; /**< Number of channels in the data stream (not
  1393. + necessarily the same as the number of channels
  1394. + to be rendered. */
  1395. + OMX_AUDIO_CDMARATETYPE eCDMARate; /**< Frame rate */
  1396. + OMX_U32 nMinBitRate; /**< minmal rate for the encoder = 1,2,3,4, default = 1 */
  1397. + OMX_U32 nMaxBitRate; /**< maximal rate for the encoder = 1,2,3,4, default = 4 */
  1398. +} OMX_AUDIO_PARAM_QCELP13TYPE;
  1399. +
  1400. +
  1401. +/** EVRC ( CDMA, EIA/TIA-127, RCELP up to 8.55kbps coder) stream format parameters */
  1402. +typedef struct OMX_AUDIO_PARAM_EVRCTYPE {
  1403. + OMX_U32 nSize; /**< size of the structure in bytes */
  1404. + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  1405. + OMX_U32 nPortIndex; /**< port that this structure applies to */
  1406. + OMX_U32 nChannels; /**< Number of channels in the data stream (not
  1407. + necessarily the same as the number of channels
  1408. + to be rendered. */
  1409. + OMX_AUDIO_CDMARATETYPE eCDMARate; /**< actual Frame rate */
  1410. + OMX_BOOL bRATE_REDUCon; /**< RATE_REDUCtion is requested for this frame */
  1411. + OMX_U32 nMinBitRate; /**< minmal rate for the encoder = 1,2,3,4, default = 1 */
  1412. + OMX_U32 nMaxBitRate; /**< maximal rate for the encoder = 1,2,3,4, default = 4 */
  1413. + OMX_BOOL bHiPassFilter; /**< Enable encoder's High Pass Filter */
  1414. + OMX_BOOL bNoiseSuppressor; /**< Enable encoder's noise suppressor pre-processing */
  1415. + OMX_BOOL bPostFilter; /**< Enable decoder's post Filter */
  1416. +} OMX_AUDIO_PARAM_EVRCTYPE;
  1417. +
  1418. +
  1419. +/** SMV ( up to 8.55kbps coder) stream format parameters */
  1420. +typedef struct OMX_AUDIO_PARAM_SMVTYPE {
  1421. + OMX_U32 nSize; /**< size of the structure in bytes */
  1422. + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  1423. + OMX_U32 nPortIndex; /**< port that this structure applies to */
  1424. + OMX_U32 nChannels; /**< Number of channels in the data stream (not
  1425. + necessarily the same as the number of channels
  1426. + to be rendered. */
  1427. + OMX_AUDIO_CDMARATETYPE eCDMARate; /**< Frame rate */
  1428. + OMX_BOOL bRATE_REDUCon; /**< RATE_REDUCtion is requested for this frame */
  1429. + OMX_U32 nMinBitRate; /**< minmal rate for the encoder = 1,2,3,4, default = 1 ??*/
  1430. + OMX_U32 nMaxBitRate; /**< maximal rate for the encoder = 1,2,3,4, default = 4 ??*/
  1431. + OMX_BOOL bHiPassFilter; /**< Enable encoder's High Pass Filter ??*/
  1432. + OMX_BOOL bNoiseSuppressor; /**< Enable encoder's noise suppressor pre-processing */
  1433. + OMX_BOOL bPostFilter; /**< Enable decoder's post Filter ??*/
  1434. +} OMX_AUDIO_PARAM_SMVTYPE;
  1435. +
  1436. +
  1437. +/** MIDI Format
  1438. + * @ingroup midi
  1439. + */
  1440. +typedef enum OMX_AUDIO_MIDIFORMATTYPE {
  1441. + OMX_AUDIO_MIDIFormatUnknown = 0, /**< MIDI Format unknown or don't care */
  1442. + OMX_AUDIO_MIDIFormatSMF0, /**< Standard MIDI File Type 0 */
  1443. + OMX_AUDIO_MIDIFormatSMF1, /**< Standard MIDI File Type 1 */
  1444. + OMX_AUDIO_MIDIFormatSMF2, /**< Standard MIDI File Type 2 */
  1445. + OMX_AUDIO_MIDIFormatSPMIDI, /**< SP-MIDI */
  1446. + OMX_AUDIO_MIDIFormatXMF0, /**< eXtensible Music Format type 0 */
  1447. + OMX_AUDIO_MIDIFormatXMF1, /**< eXtensible Music Format type 1 */
  1448. + OMX_AUDIO_MIDIFormatMobileXMF, /**< Mobile XMF (eXtensible Music Format type 2) */
  1449. + OMX_AUDIO_MIDIFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  1450. + OMX_AUDIO_MIDIFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  1451. + OMX_AUDIO_MIDIFormatMax = 0x7FFFFFFF
  1452. +} OMX_AUDIO_MIDIFORMATTYPE;
  1453. +
  1454. +
  1455. +/** MIDI params
  1456. + * @ingroup midi
  1457. + */
  1458. +typedef struct OMX_AUDIO_PARAM_MIDITYPE {
  1459. + OMX_U32 nSize; /**< size of the structure in bytes */
  1460. + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  1461. + OMX_U32 nPortIndex; /**< port that this structure applies to */
  1462. + OMX_U32 nFileSize; /**< size of the MIDI file in bytes, where the entire
  1463. + MIDI file passed in, otherwise if 0x0, the MIDI data
  1464. + is merged and streamed (instead of passed as an
  1465. + entire MIDI file) */
  1466. + OMX_BU32 sMaxPolyphony; /**< Specifies the maximum simultaneous polyphonic
  1467. + voices. A value of zero indicates that the default
  1468. + polyphony of the device is used */
  1469. + OMX_BOOL bLoadDefaultSound; /**< Whether to load default sound
  1470. + bank at initialization */
  1471. + OMX_AUDIO_MIDIFORMATTYPE eMidiFormat; /**< Version of the MIDI file */
  1472. +} OMX_AUDIO_PARAM_MIDITYPE;
  1473. +
  1474. +
  1475. +/** Type of the MIDI sound bank
  1476. + * @ingroup midi
  1477. + */
  1478. +typedef enum OMX_AUDIO_MIDISOUNDBANKTYPE {
  1479. + OMX_AUDIO_MIDISoundBankUnused = 0, /**< unused/unknown soundbank type */
  1480. + OMX_AUDIO_MIDISoundBankDLS1, /**< DLS version 1 */
  1481. + OMX_AUDIO_MIDISoundBankDLS2, /**< DLS version 2 */
  1482. + OMX_AUDIO_MIDISoundBankMobileDLSBase, /**< Mobile DLS, using the base functionality */
  1483. + OMX_AUDIO_MIDISoundBankMobileDLSPlusOptions, /**< Mobile DLS, using the specification-defined optional feature set */
  1484. + OMX_AUDIO_MIDISoundBankKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  1485. + OMX_AUDIO_MIDISoundBankVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  1486. + OMX_AUDIO_MIDISoundBankMax = 0x7FFFFFFF
  1487. +} OMX_AUDIO_MIDISOUNDBANKTYPE;
  1488. +
  1489. +
  1490. +/** Bank Layout describes how bank MSB & LSB are used in the DLS instrument definitions sound bank
  1491. + * @ingroup midi
  1492. + */
  1493. +typedef enum OMX_AUDIO_MIDISOUNDBANKLAYOUTTYPE {
  1494. + OMX_AUDIO_MIDISoundBankLayoutUnused = 0, /**< unused/unknown soundbank type */
  1495. + OMX_AUDIO_MIDISoundBankLayoutGM, /**< GS layout (based on bank MSB 0x00) */
  1496. + OMX_AUDIO_MIDISoundBankLayoutGM2, /**< General MIDI 2 layout (using MSB 0x78/0x79, LSB 0x00) */
  1497. + OMX_AUDIO_MIDISoundBankLayoutUser, /**< Does not conform to any bank numbering standards */
  1498. + OMX_AUDIO_MIDISoundBankLayoutKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  1499. + OMX_AUDIO_MIDISoundBankLayoutVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  1500. + OMX_AUDIO_MIDISoundBankLayoutMax = 0x7FFFFFFF
  1501. +} OMX_AUDIO_MIDISOUNDBANKLAYOUTTYPE;
  1502. +
  1503. +
  1504. +/** MIDI params to load/unload user soundbank
  1505. + * @ingroup midi
  1506. + */
  1507. +typedef struct OMX_AUDIO_PARAM_MIDILOADUSERSOUNDTYPE {
  1508. + OMX_U32 nSize; /**< size of the structure in bytes */
  1509. + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  1510. + OMX_U32 nPortIndex; /**< port that this structure applies to */
  1511. + OMX_U32 nDLSIndex; /**< DLS file index to be loaded */
  1512. + OMX_U32 nDLSSize; /**< Size in bytes */
  1513. + OMX_PTR pDLSData; /**< Pointer to DLS file data */
  1514. + OMX_AUDIO_MIDISOUNDBANKTYPE eMidiSoundBank; /**< Midi sound bank type enumeration */
  1515. + OMX_AUDIO_MIDISOUNDBANKLAYOUTTYPE eMidiSoundBankLayout; /**< Midi sound bank layout enumeration */
  1516. +} OMX_AUDIO_PARAM_MIDILOADUSERSOUNDTYPE;
  1517. +
  1518. +
  1519. +/** Structure for Live MIDI events and MIP messages.
  1520. + * (MIP = Maximum Instantaneous Polyphony; part of the SP-MIDI standard.)
  1521. + * @ingroup midi
  1522. + */
  1523. +typedef struct OMX_AUDIO_CONFIG_MIDIIMMEDIATEEVENTTYPE {
  1524. + OMX_U32 nSize; /**< size of the structure in bytes */
  1525. + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  1526. + OMX_U32 nPortIndex; /**< Port that this structure applies to */
  1527. + OMX_U32 nMidiEventSize; /**< Size of immediate MIDI events or MIP message in bytes */
  1528. + OMX_U8 nMidiEvents[1]; /**< MIDI event array to be rendered immediately, or an
  1529. + array for the MIP message buffer, where the size is
  1530. + indicated by nMidiEventSize */
  1531. +} OMX_AUDIO_CONFIG_MIDIIMMEDIATEEVENTTYPE;
  1532. +
  1533. +
  1534. +/** MIDI sound bank/ program pair in a given channel
  1535. + * @ingroup midi
  1536. + */
  1537. +typedef struct OMX_AUDIO_CONFIG_MIDISOUNDBANKPROGRAMTYPE {
  1538. + OMX_U32 nSize; /**< size of the structure in bytes */
  1539. + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  1540. + OMX_U32 nPortIndex; /**< Port that this structure applies to */
  1541. + OMX_U32 nChannel; /**< Valid channel values range from 1 to 16 */
  1542. + OMX_U16 nIDProgram; /**< Valid program ID range is 1 to 128 */
  1543. + OMX_U16 nIDSoundBank; /**< Sound bank ID */
  1544. + OMX_U32 nUserSoundBankIndex;/**< User soundbank index, easier to access soundbanks
  1545. + by index if multiple banks are present */
  1546. +} OMX_AUDIO_CONFIG_MIDISOUNDBANKPROGRAMTYPE;
  1547. +
  1548. +
  1549. +/** MIDI control
  1550. + * @ingroup midi
  1551. + */
  1552. +typedef struct OMX_AUDIO_CONFIG_MIDICONTROLTYPE {
  1553. + OMX_U32 nSize; /**< size of the structure in bytes */
  1554. + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  1555. + OMX_U32 nPortIndex; /**< port that this structure applies to */
  1556. + OMX_BS32 sPitchTransposition; /**< Pitch transposition in semitones, stored as Q22.10
  1557. + format based on JAVA MMAPI (JSR-135) requirement */
  1558. + OMX_BU32 sPlayBackRate; /**< Relative playback rate, stored as Q14.17 fixed-point
  1559. + number based on JSR-135 requirement */
  1560. + OMX_BU32 sTempo ; /**< Tempo in beats per minute (BPM), stored as Q22.10
  1561. + fixed-point number based on JSR-135 requirement */
  1562. + OMX_U32 nMaxPolyphony; /**< Specifies the maximum simultaneous polyphonic
  1563. + voices. A value of zero indicates that the default
  1564. + polyphony of the device is used */
  1565. + OMX_U32 nNumRepeat; /**< Number of times to repeat playback */
  1566. + OMX_U32 nStopTime; /**< Time in milliseconds to indicate when playback
  1567. + will stop automatically. Set to zero if not used */
  1568. + OMX_U16 nChannelMuteMask; /**< 16 bit mask for channel mute status */
  1569. + OMX_U16 nChannelSoloMask; /**< 16 bit mask for channel solo status */
  1570. + OMX_U32 nTrack0031MuteMask; /**< 32 bit mask for track mute status. Note: This is for tracks 0-31 */
  1571. + OMX_U32 nTrack3263MuteMask; /**< 32 bit mask for track mute status. Note: This is for tracks 32-63 */
  1572. + OMX_U32 nTrack0031SoloMask; /**< 32 bit mask for track solo status. Note: This is for tracks 0-31 */
  1573. + OMX_U32 nTrack3263SoloMask; /**< 32 bit mask for track solo status. Note: This is for tracks 32-63 */
  1574. +
  1575. +} OMX_AUDIO_CONFIG_MIDICONTROLTYPE;
  1576. +
  1577. +
  1578. +/** MIDI Playback States
  1579. + * @ingroup midi
  1580. + */
  1581. +typedef enum OMX_AUDIO_MIDIPLAYBACKSTATETYPE {
  1582. + OMX_AUDIO_MIDIPlayBackStateUnknown = 0, /**< Unknown state or state does not map to
  1583. + other defined states */
  1584. + OMX_AUDIO_MIDIPlayBackStateClosedEngaged, /**< No MIDI resource is currently open.
  1585. + The MIDI engine is currently processing
  1586. + MIDI events. */
  1587. + OMX_AUDIO_MIDIPlayBackStateParsing, /**< A MIDI resource is open and is being
  1588. + primed. The MIDI engine is currently
  1589. + processing MIDI events. */
  1590. + OMX_AUDIO_MIDIPlayBackStateOpenEngaged, /**< A MIDI resource is open and primed but
  1591. + not playing. The MIDI engine is currently
  1592. + processing MIDI events. The transition to
  1593. + this state is only possible from the
  1594. + OMX_AUDIO_MIDIPlayBackStatePlaying state,
  1595. + when the 'playback head' reaches the end
  1596. + of media data or the playback stops due
  1597. + to stop time set.*/
  1598. + OMX_AUDIO_MIDIPlayBackStatePlaying, /**< A MIDI resource is open and currently
  1599. + playing. The MIDI engine is currently
  1600. + processing MIDI events.*/
  1601. + OMX_AUDIO_MIDIPlayBackStatePlayingPartially, /**< Best-effort playback due to SP-MIDI/DLS
  1602. + resource constraints */
  1603. + OMX_AUDIO_MIDIPlayBackStatePlayingSilently, /**< Due to system resource constraints and
  1604. + SP-MIDI content constraints, there is
  1605. + no audible MIDI content during playback
  1606. + currently. The situation may change if
  1607. + resources are freed later.*/
  1608. + OMX_AUDIO_MIDIPlayBackStateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  1609. + OMX_AUDIO_MIDIPlayBackStateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  1610. + OMX_AUDIO_MIDIPlayBackStateMax = 0x7FFFFFFF
  1611. +} OMX_AUDIO_MIDIPLAYBACKSTATETYPE;
  1612. +
  1613. +
  1614. +/** MIDI status
  1615. + * @ingroup midi
  1616. + */
  1617. +typedef struct OMX_AUDIO_CONFIG_MIDISTATUSTYPE {
  1618. + OMX_U32 nSize; /**< size of the structure in bytes */
  1619. + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  1620. + OMX_U32 nPortIndex; /**< port that this structure applies to */
  1621. + OMX_U16 nNumTracks; /**< Number of MIDI tracks in the file, read only field.
  1622. + NOTE: May not return a meaningful value until the entire
  1623. + file is parsed and buffered. */
  1624. + OMX_U32 nDuration; /**< The length of the currently open MIDI resource
  1625. + in milliseconds. NOTE: May not return a meaningful value
  1626. + until the entire file is parsed and buffered. */
  1627. + OMX_U32 nPosition; /**< Current Position of the MIDI resource being played
  1628. + in milliseconds */
  1629. + OMX_BOOL bVibra; /**< Does Vibra track exist? NOTE: May not return a meaningful
  1630. + value until the entire file is parsed and buffered. */
  1631. + OMX_U32 nNumMetaEvents; /**< Total number of MIDI Meta Events in the currently
  1632. + open MIDI resource. NOTE: May not return a meaningful value
  1633. + until the entire file is parsed and buffered. */
  1634. + OMX_U32 nNumActiveVoices; /**< Number of active voices in the currently playing
  1635. + MIDI resource. NOTE: May not return a meaningful value until
  1636. + the entire file is parsed and buffered. */
  1637. + OMX_AUDIO_MIDIPLAYBACKSTATETYPE eMIDIPlayBackState; /**< MIDI playback state enumeration, read only field */
  1638. +} OMX_AUDIO_CONFIG_MIDISTATUSTYPE;
  1639. +
  1640. +
  1641. +/** MIDI Meta Event structure one per Meta Event.
  1642. + * MIDI Meta Events are like audio metadata, except that they are interspersed
  1643. + * with the MIDI content throughout the file and are not localized in the header.
  1644. + * As such, it is necessary to retrieve information about these Meta Events from
  1645. + * the engine, as it encounters these Meta Events within the MIDI content.
  1646. + * For example, SMF files can have up to 14 types of MIDI Meta Events (copyright,
  1647. + * author, default tempo, etc.) scattered throughout the file.
  1648. + * @ingroup midi
  1649. + */
  1650. +typedef struct OMX_AUDIO_CONFIG_MIDIMETAEVENTTYPE {
  1651. + OMX_U32 nSize; /**< size of the structure in bytes */
  1652. + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  1653. + OMX_U32 nPortIndex; /**< port that this structure applies to */
  1654. + OMX_U32 nIndex; /**< Index of Meta Event */
  1655. + OMX_U8 nMetaEventType; /**< Meta Event Type, 7bits (i.e. 0 - 127) */
  1656. + OMX_U32 nMetaEventSize; /**< size of the Meta Event in bytes */
  1657. + OMX_U32 nTrack; /**< track number for the meta event */
  1658. + OMX_U32 nPosition; /**< Position of the meta-event in milliseconds */
  1659. +} OMX_AUDIO_CONFIG_MIDIMETAEVENTTYPE;
  1660. +
  1661. +
  1662. +/** MIDI Meta Event Data structure - one per Meta Event.
  1663. + * @ingroup midi
  1664. + */
  1665. +typedef struct OMX_AUDIO_CONFIG_MIDIMETAEVENTDATATYPE {
  1666. + OMX_U32 nSize; /**< size of the structure in bytes */
  1667. + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  1668. + OMX_U32 nPortIndex; /**< port that this structure applies to */
  1669. + OMX_U32 nIndex; /**< Index of Meta Event */
  1670. + OMX_U32 nMetaEventSize; /**< size of the Meta Event in bytes */
  1671. + OMX_U8 nData[1]; /**< array of one or more bytes of meta data
  1672. + as indicated by the nMetaEventSize field */
  1673. +} OMX_AUDIO_CONFIG__MIDIMETAEVENTDATATYPE;
  1674. +
  1675. +
  1676. +/** Audio Volume adjustment for a port */
  1677. +typedef struct OMX_AUDIO_CONFIG_VOLUMETYPE {
  1678. + OMX_U32 nSize; /**< size of the structure in bytes */
  1679. + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  1680. + OMX_U32 nPortIndex; /**< Port index indicating which port to
  1681. + set. Select the input port to set
  1682. + just that port's volume. Select the
  1683. + output port to adjust the master
  1684. + volume. */
  1685. + OMX_BOOL bLinear; /**< Is the volume to be set in linear (0.100)
  1686. + or logarithmic scale (mB) */
  1687. + OMX_BS32 sVolume; /**< Volume linear setting in the 0..100 range, OR
  1688. + Volume logarithmic setting for this port. The values
  1689. + for volume are in mB (millibels = 1/100 dB) relative
  1690. + to a gain of 1 (e.g. the output is the same as the
  1691. + input level). Values are in mB from nMax
  1692. + (maximum volume) to nMin mB (typically negative).
  1693. + Since the volume is "voltage"
  1694. + and not a "power", it takes a setting of
  1695. + -600 mB to decrease the volume by 1/2. If
  1696. + a component cannot accurately set the
  1697. + volume to the requested value, it must
  1698. + set the volume to the closest value BELOW
  1699. + the requested value. When getting the
  1700. + volume setting, the current actual volume
  1701. + must be returned. */
  1702. +} OMX_AUDIO_CONFIG_VOLUMETYPE;
  1703. +
  1704. +
  1705. +/** Audio Volume adjustment for a channel */
  1706. +typedef struct OMX_AUDIO_CONFIG_CHANNELVOLUMETYPE {
  1707. + OMX_U32 nSize; /**< size of the structure in bytes */
  1708. + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  1709. + OMX_U32 nPortIndex; /**< Port index indicating which port to
  1710. + set. Select the input port to set
  1711. + just that port's volume. Select the
  1712. + output port to adjust the master
  1713. + volume. */
  1714. + OMX_U32 nChannel; /**< channel to select from 0 to N-1,
  1715. + using OMX_ALL to apply volume settings
  1716. + to all channels */
  1717. + OMX_BOOL bLinear; /**< Is the volume to be set in linear (0.100) or
  1718. + logarithmic scale (mB) */
  1719. + OMX_BS32 sVolume; /**< Volume linear setting in the 0..100 range, OR
  1720. + Volume logarithmic setting for this port.
  1721. + The values for volume are in mB
  1722. + (millibels = 1/100 dB) relative to a gain
  1723. + of 1 (e.g. the output is the same as the
  1724. + input level). Values are in mB from nMax
  1725. + (maximum volume) to nMin mB (typically negative).
  1726. + Since the volume is "voltage"
  1727. + and not a "power", it takes a setting of
  1728. + -600 mB to decrease the volume by 1/2. If
  1729. + a component cannot accurately set the
  1730. + volume to the requested value, it must
  1731. + set the volume to the closest value BELOW
  1732. + the requested value. When getting the
  1733. + volume setting, the current actual volume
  1734. + must be returned. */
  1735. + OMX_BOOL bIsMIDI; /**< TRUE if nChannel refers to a MIDI channel,
  1736. + FALSE otherwise */
  1737. +} OMX_AUDIO_CONFIG_CHANNELVOLUMETYPE;
  1738. +
  1739. +
  1740. +/** Audio balance setting */
  1741. +typedef struct OMX_AUDIO_CONFIG_BALANCETYPE {
  1742. + OMX_U32 nSize; /**< size of the structure in bytes */
  1743. + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  1744. + OMX_U32 nPortIndex; /**< Port index indicating which port to
  1745. + set. Select the input port to set
  1746. + just that port's balance. Select the
  1747. + output port to adjust the master
  1748. + balance. */
  1749. + OMX_S32 nBalance; /**< balance setting for this port
  1750. + (-100 to 100, where -100 indicates
  1751. + all left, and no right */
  1752. +} OMX_AUDIO_CONFIG_BALANCETYPE;
  1753. +
  1754. +
  1755. +/** Audio Port mute */
  1756. +typedef struct OMX_AUDIO_CONFIG_MUTETYPE {
  1757. + OMX_U32 nSize; /**< size of the structure in bytes */
  1758. + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  1759. + OMX_U32 nPortIndex; /**< Port index indicating which port to
  1760. + set. Select the input port to set
  1761. + just that port's mute. Select the
  1762. + output port to adjust the master
  1763. + mute. */
  1764. + OMX_BOOL bMute; /**< Mute setting for this port */
  1765. +} OMX_AUDIO_CONFIG_MUTETYPE;
  1766. +
  1767. +
  1768. +/** Audio Channel mute */
  1769. +typedef struct OMX_AUDIO_CONFIG_CHANNELMUTETYPE {
  1770. + OMX_U32 nSize; /**< size of the structure in bytes */
  1771. + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  1772. + OMX_U32 nPortIndex; /**< port that this structure applies to */
  1773. + OMX_U32 nChannel; /**< channel to select from 0 to N-1,
  1774. + using OMX_ALL to apply mute settings
  1775. + to all channels */
  1776. + OMX_BOOL bMute; /**< Mute setting for this channel */
  1777. + OMX_BOOL bIsMIDI; /**< TRUE if nChannel refers to a MIDI channel,
  1778. + FALSE otherwise */
  1779. +} OMX_AUDIO_CONFIG_CHANNELMUTETYPE;
  1780. +
  1781. +
  1782. +
  1783. +/** Enable / Disable for loudness control, which boosts bass and to a
  1784. + * smaller extent high end frequencies to compensate for hearing
  1785. + * ability at the extreme ends of the audio spectrum
  1786. + */
  1787. +typedef struct OMX_AUDIO_CONFIG_LOUDNESSTYPE {
  1788. + OMX_U32 nSize; /**< size of the structure in bytes */
  1789. + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  1790. + OMX_U32 nPortIndex; /**< port that this structure applies to */
  1791. + OMX_BOOL bLoudness; /**< Enable/disable for loudness */
  1792. +} OMX_AUDIO_CONFIG_LOUDNESSTYPE;
  1793. +
  1794. +
  1795. +/** Enable / Disable for bass, which controls low frequencies
  1796. + */
  1797. +typedef struct OMX_AUDIO_CONFIG_BASSTYPE {
  1798. + OMX_U32 nSize; /**< size of the structure in bytes */
  1799. + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  1800. + OMX_U32 nPortIndex; /**< port that this structure applies to */
  1801. + OMX_BOOL bEnable; /**< Enable/disable for bass control */
  1802. + OMX_S32 nBass; /**< bass setting for the port, as a
  1803. + continuous value from -100 to 100
  1804. + (0 means no change in bass level)*/
  1805. +} OMX_AUDIO_CONFIG_BASSTYPE;
  1806. +
  1807. +
  1808. +/** Enable / Disable for treble, which controls high frequencies tones
  1809. + */
  1810. +typedef struct OMX_AUDIO_CONFIG_TREBLETYPE {
  1811. + OMX_U32 nSize; /**< size of the structure in bytes */
  1812. + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  1813. + OMX_U32 nPortIndex; /**< port that this structure applies to */
  1814. + OMX_BOOL bEnable; /**< Enable/disable for treble control */
  1815. + OMX_S32 nTreble; /**< treble setting for the port, as a
  1816. + continuous value from -100 to 100
  1817. + (0 means no change in treble level) */
  1818. +} OMX_AUDIO_CONFIG_TREBLETYPE;
  1819. +
  1820. +
  1821. +/** An equalizer is typically used for two reasons: to compensate for an
  1822. + * sub-optimal frequency response of a system to make it sound more natural
  1823. + * or to create intentionally some unnatural coloring to the sound to create
  1824. + * an effect.
  1825. + * @ingroup effects
  1826. + */
  1827. +typedef struct OMX_AUDIO_CONFIG_EQUALIZERTYPE {
  1828. + OMX_U32 nSize; /**< size of the structure in bytes */
  1829. + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  1830. + OMX_U32 nPortIndex; /**< port that this structure applies to */
  1831. + OMX_BOOL bEnable; /**< Enable/disable for equalizer */
  1832. + OMX_BU32 sBandIndex; /**< Band number to be set. Upper Limit is
  1833. + N-1, where N is the number of bands, lower limit is 0 */
  1834. + OMX_BU32 sCenterFreq; /**< Center frequecies in Hz. This is a
  1835. + read only element and is used to determine
  1836. + the lower, center and upper frequency of
  1837. + this band. */
  1838. + OMX_BS32 sBandLevel; /**< band level in millibels */
  1839. +} OMX_AUDIO_CONFIG_EQUALIZERTYPE;
  1840. +
  1841. +
  1842. +/** Stereo widening mode type
  1843. + * @ingroup effects
  1844. + */
  1845. +typedef enum OMX_AUDIO_STEREOWIDENINGTYPE {
  1846. + OMX_AUDIO_StereoWideningHeadphones, /**< Stereo widening for loudspeakers */
  1847. + OMX_AUDIO_StereoWideningLoudspeakers, /**< Stereo widening for closely spaced loudspeakers */
  1848. + OMX_AUDIO_StereoWideningKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  1849. + OMX_AUDIO_StereoWideningVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  1850. + OMX_AUDIO_StereoWideningMax = 0x7FFFFFFF
  1851. +} OMX_AUDIO_STEREOWIDENINGTYPE;
  1852. +
  1853. +
  1854. +/** Control for stereo widening, which is a special 2-channel
  1855. + * case of the audio virtualizer effect. For example, for 5.1-channel
  1856. + * output, it translates to virtual surround sound.
  1857. + * @ingroup effects
  1858. + */
  1859. +typedef struct OMX_AUDIO_CONFIG_STEREOWIDENINGTYPE {
  1860. + OMX_U32 nSize; /**< size of the structure in bytes */
  1861. + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  1862. + OMX_U32 nPortIndex; /**< port that this structure applies to */
  1863. + OMX_BOOL bEnable; /**< Enable/disable for stereo widening control */
  1864. + OMX_AUDIO_STEREOWIDENINGTYPE eWideningType; /**< Stereo widening algorithm type */
  1865. + OMX_U32 nStereoWidening; /**< stereo widening setting for the port,
  1866. + as a continuous value from 0 to 100 */
  1867. +} OMX_AUDIO_CONFIG_STEREOWIDENINGTYPE;
  1868. +
  1869. +
  1870. +/** The chorus effect (or ``choralizer'') is any signal processor which makes
  1871. + * one sound source (such as a voice) sound like many such sources singing
  1872. + * (or playing) in unison. Since performance in unison is never exact, chorus
  1873. + * effects simulate this by making independently modified copies of the input
  1874. + * signal. Modifications may include (1) delay, (2) frequency shift, and
  1875. + * (3) amplitude modulation.
  1876. + * @ingroup effects
  1877. + */
  1878. +typedef struct OMX_AUDIO_CONFIG_CHORUSTYPE {
  1879. + OMX_U32 nSize; /**< size of the structure in bytes */
  1880. + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  1881. + OMX_U32 nPortIndex; /**< port that this structure applies to */
  1882. + OMX_BOOL bEnable; /**< Enable/disable for chorus */
  1883. + OMX_BU32 sDelay; /**< average delay in milliseconds */
  1884. + OMX_BU32 sModulationRate; /**< rate of modulation in millihertz */
  1885. + OMX_U32 nModulationDepth; /**< depth of modulation as a percentage of
  1886. + delay (i.e. 0 to 100) */
  1887. + OMX_BU32 nFeedback; /**< Feedback from chorus output to input in percentage */
  1888. +} OMX_AUDIO_CONFIG_CHORUSTYPE;
  1889. +
  1890. +
  1891. +/** Reverberation is part of the reflected sound that follows the early
  1892. + * reflections. In a typical room, this consists of a dense succession of
  1893. + * echoes whose energy decays exponentially. The reverberation effect structure
  1894. + * as defined here includes both (early) reflections as well as (late) reverberations.
  1895. + * @ingroup effects
  1896. + */
  1897. +typedef struct OMX_AUDIO_CONFIG_REVERBERATIONTYPE {
  1898. + OMX_U32 nSize; /**< size of the structure in bytes */
  1899. + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  1900. + OMX_U32 nPortIndex; /**< port that this structure applies to */
  1901. + OMX_BOOL bEnable; /**< Enable/disable for reverberation control */
  1902. + OMX_BS32 sRoomLevel; /**< Intensity level for the whole room effect
  1903. + (i.e. both early reflections and late
  1904. + reverberation) in millibels */
  1905. + OMX_BS32 sRoomHighFreqLevel; /**< Attenuation at high frequencies
  1906. + relative to the intensity at low
  1907. + frequencies in millibels */
  1908. + OMX_BS32 sReflectionsLevel; /**< Intensity level of early reflections
  1909. + (relative to room value), in millibels */
  1910. + OMX_BU32 sReflectionsDelay; /**< Delay time of the first reflection relative
  1911. + to the direct path, in milliseconds */
  1912. + OMX_BS32 sReverbLevel; /**< Intensity level of late reverberation
  1913. + relative to room level, in millibels */
  1914. + OMX_BU32 sReverbDelay; /**< Time delay from the first early reflection
  1915. + to the beginning of the late reverberation
  1916. + section, in milliseconds */
  1917. + OMX_BU32 sDecayTime; /**< Late reverberation decay time at low
  1918. + frequencies, in milliseconds */
  1919. + OMX_BU32 nDecayHighFreqRatio; /**< Ratio of high frequency decay time relative
  1920. + to low frequency decay time in percent */
  1921. + OMX_U32 nDensity; /**< Modal density in the late reverberation decay,
  1922. + in percent (i.e. 0 - 100) */
  1923. + OMX_U32 nDiffusion; /**< Echo density in the late reverberation decay,
  1924. + in percent (i.e. 0 - 100) */
  1925. + OMX_BU32 sReferenceHighFreq; /**< Reference high frequency in Hertz. This is
  1926. + the frequency used as the reference for all
  1927. + the high-frequency settings above */
  1928. +
  1929. +} OMX_AUDIO_CONFIG_REVERBERATIONTYPE;
  1930. +
  1931. +
  1932. +/** Possible settings for the Echo Cancelation structure to use
  1933. + * @ingroup effects
  1934. + */
  1935. +typedef enum OMX_AUDIO_ECHOCANTYPE {
  1936. + OMX_AUDIO_EchoCanOff = 0, /**< Echo Cancellation is disabled */
  1937. + OMX_AUDIO_EchoCanNormal, /**< Echo Cancellation normal operation -
  1938. + echo from plastics and face */
  1939. + OMX_AUDIO_EchoCanHFree, /**< Echo Cancellation optimized for
  1940. + Hands Free operation */
  1941. + OMX_AUDIO_EchoCanCarKit, /**< Echo Cancellation optimized for
  1942. + Car Kit (longer echo) */
  1943. + OMX_AUDIO_EchoCanKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  1944. + OMX_AUDIO_EchoCanVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  1945. + OMX_AUDIO_EchoCanMax = 0x7FFFFFFF
  1946. +} OMX_AUDIO_ECHOCANTYPE;
  1947. +
  1948. +
  1949. +/** Enable / Disable for echo cancelation, which removes undesired echo's
  1950. + * from the audio
  1951. + * @ingroup effects
  1952. + */
  1953. +typedef struct OMX_AUDIO_CONFIG_ECHOCANCELATIONTYPE {
  1954. + OMX_U32 nSize; /**< size of the structure in bytes */
  1955. + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  1956. + OMX_U32 nPortIndex; /**< port that this structure applies to */
  1957. + OMX_AUDIO_ECHOCANTYPE eEchoCancelation; /**< Echo cancelation settings */
  1958. +} OMX_AUDIO_CONFIG_ECHOCANCELATIONTYPE;
  1959. +
  1960. +
  1961. +/** Enable / Disable for noise reduction, which undesired noise from
  1962. + * the audio
  1963. + * @ingroup effects
  1964. + */
  1965. +typedef struct OMX_AUDIO_CONFIG_NOISEREDUCTIONTYPE {
  1966. + OMX_U32 nSize; /**< size of the structure in bytes */
  1967. + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  1968. + OMX_U32 nPortIndex; /**< port that this structure applies to */
  1969. + OMX_BOOL bNoiseReduction; /**< Enable/disable for noise reduction */
  1970. +} OMX_AUDIO_CONFIG_NOISEREDUCTIONTYPE;
  1971. +
  1972. +/** @} */
  1973. +
  1974. +#ifdef __cplusplus
  1975. +}
  1976. +#endif /* __cplusplus */
  1977. +
  1978. +#endif
  1979. +/* File EOF */
  1980. +
  1981. diff --git a/encoder/include/khronos/OMX_Component.h b/encoder/include/khronos/OMX_Component.h
  1982. new file mode 100755
  1983. index 0000000..56fd37e
  1984. --- /dev/null
  1985. +++ b/encoder/include/khronos/OMX_Component.h
  1986. @@ -0,0 +1,569 @@
  1987. +/*
  1988. + * Copyright (c) 2008 The Khronos Group Inc.
  1989. + *
  1990. + * Permission is hereby granted, free of charge, to any person obtaining
  1991. + * a copy of this software and associated documentation files (the
  1992. + * "Software"), to deal in the Software without restriction, including
  1993. + * without limitation the rights to use, copy, modify, merge, publish,
  1994. + * distribute, sublicense, and/or sell copies of the Software, and to
  1995. + * permit persons to whom the Software is furnished to do so, subject
  1996. + * to the following conditions:
  1997. + * The above copyright notice and this permission notice shall be included
  1998. + * in all copies or substantial portions of the Software.
  1999. + *
  2000. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  2001. + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  2002. + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  2003. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
  2004. + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  2005. + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  2006. + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  2007. + *
  2008. + */
  2009. +
  2010. +/** OMX_Component.h - OpenMax IL version 1.1.2
  2011. + * The OMX_Component header file contains the definitions used to define
  2012. + * the public interface of a component. This header file is intended to
  2013. + * be used by both the application and the component.
  2014. + */
  2015. +
  2016. +#ifndef OMX_Component_h
  2017. +#define OMX_Component_h
  2018. +
  2019. +#ifdef __cplusplus
  2020. +extern "C" {
  2021. +#endif /* __cplusplus */
  2022. +
  2023. +
  2024. +
  2025. +/* Each OMX header must include all required header files to allow the
  2026. + * header to compile without errors. The includes below are required
  2027. + * for this header file to compile successfully
  2028. + */
  2029. +
  2030. +#include <OMX_Audio.h>
  2031. +#include <OMX_Video.h>
  2032. +#include <OMX_Image.h>
  2033. +#include <OMX_Other.h>
  2034. +
  2035. +/** @ingroup comp */
  2036. +typedef enum OMX_PORTDOMAINTYPE {
  2037. + OMX_PortDomainAudio,
  2038. + OMX_PortDomainVideo,
  2039. + OMX_PortDomainImage,
  2040. + OMX_PortDomainOther,
  2041. + OMX_PortDomainKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  2042. + OMX_PortDomainVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  2043. + OMX_PortDomainMax = 0x7ffffff
  2044. +} OMX_PORTDOMAINTYPE;
  2045. +
  2046. +/** @ingroup comp */
  2047. +typedef struct OMX_PARAM_PORTDEFINITIONTYPE {
  2048. + OMX_U32 nSize; /**< Size of the structure in bytes */
  2049. + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  2050. + OMX_U32 nPortIndex; /**< Port number the structure applies to */
  2051. + OMX_DIRTYPE eDir; /**< Direction (input or output) of this port */
  2052. + OMX_U32 nBufferCountActual; /**< The actual number of buffers allocated on this port */
  2053. + OMX_U32 nBufferCountMin; /**< The minimum number of buffers this port requires */
  2054. + OMX_U32 nBufferSize; /**< Size, in bytes, for buffers to be used for this channel */
  2055. + OMX_BOOL bEnabled; /**< Ports default to enabled and are enabled/disabled by
  2056. + OMX_CommandPortEnable/OMX_CommandPortDisable.
  2057. + When disabled a port is unpopulated. A disabled port
  2058. + is not populated with buffers on a transition to IDLE. */
  2059. + OMX_BOOL bPopulated; /**< Port is populated with all of its buffers as indicated by
  2060. + nBufferCountActual. A disabled port is always unpopulated.
  2061. + An enabled port is populated on a transition to OMX_StateIdle
  2062. + and unpopulated on a transition to loaded. */
  2063. + OMX_PORTDOMAINTYPE eDomain; /**< Domain of the port. Determines the contents of metadata below. */
  2064. + union {
  2065. + OMX_AUDIO_PORTDEFINITIONTYPE audio;
  2066. + OMX_VIDEO_PORTDEFINITIONTYPE video;
  2067. + OMX_IMAGE_PORTDEFINITIONTYPE image;
  2068. + OMX_OTHER_PORTDEFINITIONTYPE other;
  2069. + } format;
  2070. + OMX_BOOL bBuffersContiguous;
  2071. + OMX_U32 nBufferAlignment;
  2072. +} OMX_PARAM_PORTDEFINITIONTYPE;
  2073. +
  2074. +/** @ingroup comp */
  2075. +typedef struct OMX_PARAM_U32TYPE {
  2076. + OMX_U32 nSize; /**< Size of this structure, in Bytes */
  2077. + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  2078. + OMX_U32 nPortIndex; /**< port that this structure applies to */
  2079. + OMX_U32 nU32; /**< U32 value */
  2080. +} OMX_PARAM_U32TYPE;
  2081. +
  2082. +/** @ingroup rpm */
  2083. +typedef enum OMX_SUSPENSIONPOLICYTYPE {
  2084. + OMX_SuspensionDisabled, /**< No suspension; v1.0 behavior */
  2085. + OMX_SuspensionEnabled, /**< Suspension allowed */
  2086. + OMX_SuspensionPolicyKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  2087. + OMX_SuspensionPolicyStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  2088. + OMX_SuspensionPolicyMax = 0x7fffffff
  2089. +} OMX_SUSPENSIONPOLICYTYPE;
  2090. +
  2091. +/** @ingroup rpm */
  2092. +typedef struct OMX_PARAM_SUSPENSIONPOLICYTYPE {
  2093. + OMX_U32 nSize;
  2094. + OMX_VERSIONTYPE nVersion;
  2095. + OMX_SUSPENSIONPOLICYTYPE ePolicy;
  2096. +} OMX_PARAM_SUSPENSIONPOLICYTYPE;
  2097. +
  2098. +/** @ingroup rpm */
  2099. +typedef enum OMX_SUSPENSIONTYPE {
  2100. + OMX_NotSuspended, /**< component is not suspended */
  2101. + OMX_Suspended, /**< component is suspended */
  2102. + OMX_SuspensionKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  2103. + OMX_SuspensionVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  2104. + OMX_SuspendMax = 0x7FFFFFFF
  2105. +} OMX_SUSPENSIONTYPE;
  2106. +
  2107. +/** @ingroup rpm */
  2108. +typedef struct OMX_PARAM_SUSPENSIONTYPE {
  2109. + OMX_U32 nSize;
  2110. + OMX_VERSIONTYPE nVersion;
  2111. + OMX_SUSPENSIONTYPE eType;
  2112. +} OMX_PARAM_SUSPENSIONTYPE ;
  2113. +
  2114. +typedef struct OMX_CONFIG_BOOLEANTYPE {
  2115. + OMX_U32 nSize;
  2116. + OMX_VERSIONTYPE nVersion;
  2117. + OMX_BOOL bEnabled;
  2118. +} OMX_CONFIG_BOOLEANTYPE;
  2119. +
  2120. +/* Parameter specifying the content uri to use. */
  2121. +/** @ingroup cp */
  2122. +typedef struct OMX_PARAM_CONTENTURITYPE {
  2123. + OMX_U32 nSize; /**< size of the structure in bytes, including
  2124. + actual URI name */
  2125. + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  2126. + OMX_U8 contentURI[1]; /**< The URI name */
  2127. +} OMX_PARAM_CONTENTURITYPE;
  2128. +
  2129. +/* Parameter specifying the pipe to use. */
  2130. +/** @ingroup cp */
  2131. +typedef struct OMX_PARAM_CONTENTPIPETYPE {
  2132. + OMX_U32 nSize; /**< size of the structure in bytes */
  2133. + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  2134. + OMX_HANDLETYPE hPipe; /**< The pipe handle*/
  2135. +} OMX_PARAM_CONTENTPIPETYPE;
  2136. +
  2137. +/** @ingroup rpm */
  2138. +typedef struct OMX_RESOURCECONCEALMENTTYPE {
  2139. + OMX_U32 nSize; /**< size of the structure in bytes */
  2140. + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  2141. + OMX_BOOL bResourceConcealmentForbidden; /**< disallow the use of resource concealment
  2142. + methods (like degrading algorithm quality to
  2143. + lower resource consumption or functional bypass)
  2144. + on a component as a resolution to resource conflicts. */
  2145. +} OMX_RESOURCECONCEALMENTTYPE;
  2146. +
  2147. +
  2148. +/** @ingroup metadata */
  2149. +typedef enum OMX_METADATACHARSETTYPE {
  2150. + OMX_MetadataCharsetUnknown = 0,
  2151. + OMX_MetadataCharsetASCII,
  2152. + OMX_MetadataCharsetBinary,
  2153. + OMX_MetadataCharsetCodePage1252,
  2154. + OMX_MetadataCharsetUTF8,
  2155. + OMX_MetadataCharsetJavaConformantUTF8,
  2156. + OMX_MetadataCharsetUTF7,
  2157. + OMX_MetadataCharsetImapUTF7,
  2158. + OMX_MetadataCharsetUTF16LE,
  2159. + OMX_MetadataCharsetUTF16BE,
  2160. + OMX_MetadataCharsetGB12345,
  2161. + OMX_MetadataCharsetHZGB2312,
  2162. + OMX_MetadataCharsetGB2312,
  2163. + OMX_MetadataCharsetGB18030,
  2164. + OMX_MetadataCharsetGBK,
  2165. + OMX_MetadataCharsetBig5,
  2166. + OMX_MetadataCharsetISO88591,
  2167. + OMX_MetadataCharsetISO88592,
  2168. + OMX_MetadataCharsetISO88593,
  2169. + OMX_MetadataCharsetISO88594,
  2170. + OMX_MetadataCharsetISO88595,
  2171. + OMX_MetadataCharsetISO88596,
  2172. + OMX_MetadataCharsetISO88597,
  2173. + OMX_MetadataCharsetISO88598,
  2174. + OMX_MetadataCharsetISO88599,
  2175. + OMX_MetadataCharsetISO885910,
  2176. + OMX_MetadataCharsetISO885913,
  2177. + OMX_MetadataCharsetISO885914,
  2178. + OMX_MetadataCharsetISO885915,
  2179. + OMX_MetadataCharsetShiftJIS,
  2180. + OMX_MetadataCharsetISO2022JP,
  2181. + OMX_MetadataCharsetISO2022JP1,
  2182. + OMX_MetadataCharsetISOEUCJP,
  2183. + OMX_MetadataCharsetSMS7Bit,
  2184. + OMX_MetadataCharsetKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  2185. + OMX_MetadataCharsetVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  2186. + OMX_MetadataCharsetTypeMax = 0x7FFFFFFF
  2187. +} OMX_METADATACHARSETTYPE;
  2188. +
  2189. +/** @ingroup metadata */
  2190. +typedef enum OMX_METADATASCOPETYPE {
  2191. + OMX_MetadataScopeAllLevels,
  2192. + OMX_MetadataScopeTopLevel,
  2193. + OMX_MetadataScopePortLevel,
  2194. + OMX_MetadataScopeNodeLevel,
  2195. + OMX_MetadataScopeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  2196. + OMX_MetadataScopeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  2197. + OMX_MetadataScopeTypeMax = 0x7fffffff
  2198. +} OMX_METADATASCOPETYPE;
  2199. +
  2200. +/** @ingroup metadata */
  2201. +typedef enum OMX_METADATASEARCHMODETYPE {
  2202. + OMX_MetadataSearchValueSizeByIndex,
  2203. + OMX_MetadataSearchItemByIndex,
  2204. + OMX_MetadataSearchNextItemByKey,
  2205. + OMX_MetadataSearchKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  2206. + OMX_MetadataSearchVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  2207. + OMX_MetadataSearchTypeMax = 0x7fffffff
  2208. +} OMX_METADATASEARCHMODETYPE;
  2209. +/** @ingroup metadata */
  2210. +typedef struct OMX_CONFIG_METADATAITEMCOUNTTYPE {
  2211. + OMX_U32 nSize;
  2212. + OMX_VERSIONTYPE nVersion;
  2213. + OMX_METADATASCOPETYPE eScopeMode;
  2214. + OMX_U32 nScopeSpecifier;
  2215. + OMX_U32 nMetadataItemCount;
  2216. +} OMX_CONFIG_METADATAITEMCOUNTTYPE;
  2217. +
  2218. +/** @ingroup metadata */
  2219. +typedef struct OMX_CONFIG_METADATAITEMTYPE {
  2220. + OMX_U32 nSize;
  2221. + OMX_VERSIONTYPE nVersion;
  2222. + OMX_METADATASCOPETYPE eScopeMode;
  2223. + OMX_U32 nScopeSpecifier;
  2224. + OMX_U32 nMetadataItemIndex;
  2225. + OMX_METADATASEARCHMODETYPE eSearchMode;
  2226. + OMX_METADATACHARSETTYPE eKeyCharset;
  2227. + OMX_U8 nKeySizeUsed;
  2228. + OMX_U8 nKey[128];
  2229. + OMX_METADATACHARSETTYPE eValueCharset;
  2230. + OMX_STRING sLanguageCountry;
  2231. + OMX_U32 nValueMaxSize;
  2232. + OMX_U32 nValueSizeUsed;
  2233. + OMX_U8 nValue[1];
  2234. +} OMX_CONFIG_METADATAITEMTYPE;
  2235. +
  2236. +/* @ingroup metadata */
  2237. +typedef struct OMX_CONFIG_CONTAINERNODECOUNTTYPE {
  2238. + OMX_U32 nSize;
  2239. + OMX_VERSIONTYPE nVersion;
  2240. + OMX_BOOL bAllKeys;
  2241. + OMX_U32 nParentNodeID;
  2242. + OMX_U32 nNumNodes;
  2243. +} OMX_CONFIG_CONTAINERNODECOUNTTYPE;
  2244. +
  2245. +/** @ingroup metadata */
  2246. +typedef struct OMX_CONFIG_CONTAINERNODEIDTYPE {
  2247. + OMX_U32 nSize;
  2248. + OMX_VERSIONTYPE nVersion;
  2249. + OMX_BOOL bAllKeys;
  2250. + OMX_U32 nParentNodeID;
  2251. + OMX_U32 nNodeIndex;
  2252. + OMX_U32 nNodeID;
  2253. + OMX_STRING cNodeName;
  2254. + OMX_BOOL bIsLeafType;
  2255. +} OMX_CONFIG_CONTAINERNODEIDTYPE;
  2256. +
  2257. +/** @ingroup metadata */
  2258. +typedef struct OMX_PARAM_METADATAFILTERTYPE {
  2259. + OMX_U32 nSize;
  2260. + OMX_VERSIONTYPE nVersion;
  2261. + OMX_BOOL bAllKeys; /* if true then this structure refers to all keys and
  2262. + * the three key fields below are ignored */
  2263. + OMX_METADATACHARSETTYPE eKeyCharset;
  2264. + OMX_U32 nKeySizeUsed;
  2265. + OMX_U8 nKey [128];
  2266. + OMX_U32 nLanguageCountrySizeUsed;
  2267. + OMX_U8 nLanguageCountry[128];
  2268. + OMX_BOOL bEnabled; /* if true then key is part of filter (e.g.
  2269. + * retained for query later). If false then
  2270. + * key is not part of filter */
  2271. +} OMX_PARAM_METADATAFILTERTYPE;
  2272. +
  2273. +/** The OMX_HANDLETYPE structure defines the component handle. The component
  2274. + * handle is used to access all of the component's public methods and also
  2275. + * contains pointers to the component's private data area. The component
  2276. + * handle is initialized by the OMX core (with help from the component)
  2277. + * during the process of loading the component. After the component is
  2278. + * successfully loaded, the application can safely access any of the
  2279. + * component's public functions (although some may return an error because
  2280. + * the state is inappropriate for the access).
  2281. + *
  2282. + * @ingroup comp
  2283. + */
  2284. +typedef struct OMX_COMPONENTTYPE {
  2285. + /** The size of this structure, in bytes. It is the responsibility
  2286. + of the allocator of this structure to fill in this value. Since
  2287. + this structure is allocated by the GetHandle function, this
  2288. + function will fill in this value. */
  2289. + OMX_U32 nSize;
  2290. +
  2291. + /** nVersion is the version of the OMX specification that the structure
  2292. + is built against. It is the responsibility of the creator of this
  2293. + structure to initialize this value and every user of this structure
  2294. + should verify that it knows how to use the exact version of
  2295. + this structure found herein. */
  2296. + OMX_VERSIONTYPE nVersion;
  2297. +
  2298. + /** pComponentPrivate is a pointer to the component private data area.
  2299. + This member is allocated and initialized by the component when the
  2300. + component is first loaded. The application should not access this
  2301. + data area. */
  2302. + OMX_PTR pComponentPrivate;
  2303. +
  2304. + /** pApplicationPrivate is a pointer that is a parameter to the
  2305. + OMX_GetHandle method, and contains an application private value
  2306. + provided by the IL client. This application private data is
  2307. + returned to the IL Client by OMX in all callbacks */
  2308. + OMX_PTR pApplicationPrivate;
  2309. +
  2310. + /** refer to OMX_GetComponentVersion in OMX_core.h or the OMX IL
  2311. + specification for details on the GetComponentVersion method.
  2312. + */
  2313. + OMX_ERRORTYPE (*GetComponentVersion)(
  2314. + OMX_IN OMX_HANDLETYPE hComponent,
  2315. + OMX_OUT OMX_STRING pComponentName,
  2316. + OMX_OUT OMX_VERSIONTYPE* pComponentVersion,
  2317. + OMX_OUT OMX_VERSIONTYPE* pSpecVersion,
  2318. + OMX_OUT OMX_UUIDTYPE* pComponentUUID);
  2319. +
  2320. + /** refer to OMX_SendCommand in OMX_core.h or the OMX IL
  2321. + specification for details on the SendCommand method.
  2322. + */
  2323. + OMX_ERRORTYPE (*SendCommand)(
  2324. + OMX_IN OMX_HANDLETYPE hComponent,
  2325. + OMX_IN OMX_COMMANDTYPE Cmd,
  2326. + OMX_IN OMX_U32 nParam1,
  2327. + OMX_IN OMX_PTR pCmdData);
  2328. +
  2329. + /** refer to OMX_GetParameter in OMX_core.h or the OMX IL
  2330. + specification for details on the GetParameter method.
  2331. + */
  2332. + OMX_ERRORTYPE (*GetParameter)(
  2333. + OMX_IN OMX_HANDLETYPE hComponent,
  2334. + OMX_IN OMX_INDEXTYPE nParamIndex,
  2335. + OMX_INOUT OMX_PTR pComponentParameterStructure);
  2336. +
  2337. +
  2338. + /** refer to OMX_SetParameter in OMX_core.h or the OMX IL
  2339. + specification for details on the SetParameter method.
  2340. + */
  2341. + OMX_ERRORTYPE (*SetParameter)(
  2342. + OMX_IN OMX_HANDLETYPE hComponent,
  2343. + OMX_IN OMX_INDEXTYPE nIndex,
  2344. + OMX_IN OMX_PTR pComponentParameterStructure);
  2345. +
  2346. +
  2347. + /** refer to OMX_GetConfig in OMX_core.h or the OMX IL
  2348. + specification for details on the GetConfig method.
  2349. + */
  2350. + OMX_ERRORTYPE (*GetConfig)(
  2351. + OMX_IN OMX_HANDLETYPE hComponent,
  2352. + OMX_IN OMX_INDEXTYPE nIndex,
  2353. + OMX_INOUT OMX_PTR pComponentConfigStructure);
  2354. +
  2355. +
  2356. + /** refer to OMX_SetConfig in OMX_core.h or the OMX IL
  2357. + specification for details on the SetConfig method.
  2358. + */
  2359. + OMX_ERRORTYPE (*SetConfig)(
  2360. + OMX_IN OMX_HANDLETYPE hComponent,
  2361. + OMX_IN OMX_INDEXTYPE nIndex,
  2362. + OMX_IN OMX_PTR pComponentConfigStructure);
  2363. +
  2364. +
  2365. + /** refer to OMX_GetExtensionIndex in OMX_core.h or the OMX IL
  2366. + specification for details on the GetExtensionIndex method.
  2367. + */
  2368. + OMX_ERRORTYPE (*GetExtensionIndex)(
  2369. + OMX_IN OMX_HANDLETYPE hComponent,
  2370. + OMX_IN OMX_STRING cParameterName,
  2371. + OMX_OUT OMX_INDEXTYPE* pIndexType);
  2372. +
  2373. +
  2374. + /** refer to OMX_GetState in OMX_core.h or the OMX IL
  2375. + specification for details on the GetState method.
  2376. + */
  2377. + OMX_ERRORTYPE (*GetState)(
  2378. + OMX_IN OMX_HANDLETYPE hComponent,
  2379. + OMX_OUT OMX_STATETYPE* pState);
  2380. +
  2381. +
  2382. + /** The ComponentTunnelRequest method will interact with another OMX
  2383. + component to determine if tunneling is possible and to setup the
  2384. + tunneling. The return codes for this method can be used to
  2385. + determine if tunneling is not possible, or if tunneling is not
  2386. + supported.
  2387. +
  2388. + Base profile components (i.e. non-interop) do not support this
  2389. + method and should return OMX_ErrorNotImplemented
  2390. +
  2391. + The interop profile component MUST support tunneling to another
  2392. + interop profile component with a compatible port parameters.
  2393. + A component may also support proprietary communication.
  2394. +
  2395. + If proprietary communication is supported the negotiation of
  2396. + proprietary communication is done outside of OMX in a vendor
  2397. + specific way. It is only required that the proper result be
  2398. + returned and the details of how the setup is done is left
  2399. + to the component implementation.
  2400. +
  2401. + When this method is invoked when nPort in an output port, the
  2402. + component will:
  2403. + 1. Populate the pTunnelSetup structure with the output port's
  2404. + requirements and constraints for the tunnel.
  2405. +
  2406. + When this method is invoked when nPort in an input port, the
  2407. + component will:
  2408. + 1. Query the necessary parameters from the output port to
  2409. + determine if the ports are compatible for tunneling
  2410. + 2. If the ports are compatible, the component should store
  2411. + the tunnel step provided by the output port
  2412. + 3. Determine which port (either input or output) is the buffer
  2413. + supplier, and call OMX_SetParameter on the output port to
  2414. + indicate this selection.
  2415. +
  2416. + The component will return from this call within 5 msec.
  2417. +
  2418. + @param [in] hComp
  2419. + Handle of the component to be accessed. This is the component
  2420. + handle returned by the call to the OMX_GetHandle method.
  2421. + @param [in] nPort
  2422. + nPort is used to select the port on the component to be used
  2423. + for tunneling.
  2424. + @param [in] hTunneledComp
  2425. + Handle of the component to tunnel with. This is the component
  2426. + handle returned by the call to the OMX_GetHandle method. When
  2427. + this parameter is 0x0 the component should setup the port for
  2428. + communication with the application / IL Client.
  2429. + @param [in] nPortOutput
  2430. + nPortOutput is used indicate the port the component should
  2431. + tunnel with.
  2432. + @param [in] pTunnelSetup
  2433. + Pointer to the tunnel setup structure. When nPort is an output port
  2434. + the component should populate the fields of this structure. When
  2435. + When nPort is an input port the component should review the setup
  2436. + provided by the component with the output port.
  2437. + @return OMX_ERRORTYPE
  2438. + If the command successfully executes, the return code will be
  2439. + OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
  2440. + @ingroup tun
  2441. + */
  2442. +
  2443. + OMX_ERRORTYPE (*ComponentTunnelRequest)(
  2444. + OMX_IN OMX_HANDLETYPE hComp,
  2445. + OMX_IN OMX_U32 nPort,
  2446. + OMX_IN OMX_HANDLETYPE hTunneledComp,
  2447. + OMX_IN OMX_U32 nTunneledPort,
  2448. + OMX_INOUT OMX_TUNNELSETUPTYPE* pTunnelSetup);
  2449. +
  2450. + /** refer to OMX_UseBuffer in OMX_core.h or the OMX IL
  2451. + specification for details on the UseBuffer method.
  2452. + @ingroup buf
  2453. + */
  2454. + OMX_ERRORTYPE (*UseBuffer)(
  2455. + OMX_IN OMX_HANDLETYPE hComponent,
  2456. + OMX_INOUT OMX_BUFFERHEADERTYPE** ppBufferHdr,
  2457. + OMX_IN OMX_U32 nPortIndex,
  2458. + OMX_IN OMX_PTR pAppPrivate,
  2459. + OMX_IN OMX_U32 nSizeBytes,
  2460. + OMX_IN OMX_U8* pBuffer);
  2461. +
  2462. + /** refer to OMX_AllocateBuffer in OMX_core.h or the OMX IL
  2463. + specification for details on the AllocateBuffer method.
  2464. + @ingroup buf
  2465. + */
  2466. + OMX_ERRORTYPE (*AllocateBuffer)(
  2467. + OMX_IN OMX_HANDLETYPE hComponent,
  2468. + OMX_INOUT OMX_BUFFERHEADERTYPE** ppBuffer,
  2469. + OMX_IN OMX_U32 nPortIndex,
  2470. + OMX_IN OMX_PTR pAppPrivate,
  2471. + OMX_IN OMX_U32 nSizeBytes);
  2472. +
  2473. + /** refer to OMX_FreeBuffer in OMX_core.h or the OMX IL
  2474. + specification for details on the FreeBuffer method.
  2475. + @ingroup buf
  2476. + */
  2477. + OMX_ERRORTYPE (*FreeBuffer)(
  2478. + OMX_IN OMX_HANDLETYPE hComponent,
  2479. + OMX_IN OMX_U32 nPortIndex,
  2480. + OMX_IN OMX_BUFFERHEADERTYPE* pBuffer);
  2481. +
  2482. + /** refer to OMX_EmptyThisBuffer in OMX_core.h or the OMX IL
  2483. + specification for details on the EmptyThisBuffer method.
  2484. + @ingroup buf
  2485. + */
  2486. + OMX_ERRORTYPE (*EmptyThisBuffer)(
  2487. + OMX_IN OMX_HANDLETYPE hComponent,
  2488. + OMX_IN OMX_BUFFERHEADERTYPE* pBuffer);
  2489. +
  2490. + /** refer to OMX_FillThisBuffer in OMX_core.h or the OMX IL
  2491. + specification for details on the FillThisBuffer method.
  2492. + @ingroup buf
  2493. + */
  2494. + OMX_ERRORTYPE (*FillThisBuffer)(
  2495. + OMX_IN OMX_HANDLETYPE hComponent,
  2496. + OMX_IN OMX_BUFFERHEADERTYPE* pBuffer);
  2497. +
  2498. + /** The SetCallbacks method is used by the core to specify the callback
  2499. + structure from the application to the component. This is a blocking
  2500. + call. The component will return from this call within 5 msec.
  2501. + @param [in] hComponent
  2502. + Handle of the component to be accessed. This is the component
  2503. + handle returned by the call to the GetHandle function.
  2504. + @param [in] pCallbacks
  2505. + pointer to an OMX_CALLBACKTYPE structure used to provide the
  2506. + callback information to the component
  2507. + @param [in] pAppData
  2508. + pointer to an application defined value. It is anticipated that
  2509. + the application will pass a pointer to a data structure or a "this
  2510. + pointer" in this area to allow the callback (in the application)
  2511. + to determine the context of the call
  2512. + @return OMX_ERRORTYPE
  2513. + If the command successfully executes, the return code will be
  2514. + OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
  2515. + */
  2516. + OMX_ERRORTYPE (*SetCallbacks)(
  2517. + OMX_IN OMX_HANDLETYPE hComponent,
  2518. + OMX_IN OMX_CALLBACKTYPE* pCallbacks,
  2519. + OMX_IN OMX_PTR pAppData);
  2520. +
  2521. + /** ComponentDeInit method is used to deinitialize the component
  2522. + providing a means to free any resources allocated at component
  2523. + initialization. NOTE: After this call the component handle is
  2524. + not valid for further use.
  2525. + @param [in] hComponent
  2526. + Handle of the component to be accessed. This is the component
  2527. + handle returned by the call to the GetHandle function.
  2528. + @return OMX_ERRORTYPE
  2529. + If the command successfully executes, the return code will be
  2530. + OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
  2531. + */
  2532. + OMX_ERRORTYPE (*ComponentDeInit)(
  2533. + OMX_IN OMX_HANDLETYPE hComponent);
  2534. +
  2535. + /** @ingroup buf */
  2536. + OMX_ERRORTYPE (*UseEGLImage)(
  2537. + OMX_IN OMX_HANDLETYPE hComponent,
  2538. + OMX_INOUT OMX_BUFFERHEADERTYPE** ppBufferHdr,
  2539. + OMX_IN OMX_U32 nPortIndex,
  2540. + OMX_IN OMX_PTR pAppPrivate,
  2541. + OMX_IN void* eglImage);
  2542. +
  2543. + OMX_ERRORTYPE (*ComponentRoleEnum)(
  2544. + OMX_IN OMX_HANDLETYPE hComponent,
  2545. + OMX_OUT OMX_U8 *cRole,
  2546. + OMX_IN OMX_U32 nIndex);
  2547. +
  2548. +} OMX_COMPONENTTYPE;
  2549. +
  2550. +#ifdef __cplusplus
  2551. +}
  2552. +#endif /* __cplusplus */
  2553. +
  2554. +#endif
  2555. +/* File EOF */
  2556. diff --git a/encoder/include/khronos/OMX_ComponentExt.h b/encoder/include/khronos/OMX_ComponentExt.h
  2557. new file mode 100755
  2558. index 0000000..24ec20c
  2559. --- /dev/null
  2560. +++ b/encoder/include/khronos/OMX_ComponentExt.h
  2561. @@ -0,0 +1,61 @@
  2562. +/*
  2563. + * Copyright (c) 2016 The Khronos Group Inc.
  2564. + *
  2565. + * Permission is hereby granted, free of charge, to any person obtaining
  2566. + * a copy of this software and associated documentation files (the
  2567. + * "Software"), to deal in the Software without restriction, including
  2568. + * without limitation the rights to use, copy, modify, merge, publish,
  2569. + * distribute, sublicense, and/or sell copies of the Software, and to
  2570. + * permit persons to whom the Software is furnished to do so, subject
  2571. + * to the following conditions:
  2572. + * The above copyright notice and this permission notice shall be included
  2573. + * in all copies or substantial portions of the Software.
  2574. + *
  2575. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  2576. + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  2577. + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  2578. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
  2579. + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  2580. + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  2581. + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  2582. + *
  2583. + */
  2584. +
  2585. +/** OMX_ComponentExt.h - OpenMax IL version 1.1.2
  2586. + * The OMX_ComponentExt header file contains extensions to the definitions used
  2587. + * by both the application and the component to access common items.
  2588. + */
  2589. +
  2590. +#ifndef OMX_ComponentExt_h
  2591. +#define OMX_ComponentExt_h
  2592. +
  2593. +#ifdef __cplusplus
  2594. +extern "C" {
  2595. +#endif /* __cplusplus */
  2596. +
  2597. +/* Each OMX header must include all required header files to allow the
  2598. + * header to compile without errors. The includes below are required
  2599. + * for this header file to compile successfully
  2600. + */
  2601. +#include <OMX_Types.h>
  2602. +
  2603. +
  2604. +/** Set/query the commit mode */
  2605. +typedef struct OMX_CONFIG_COMMITMODETYPE {
  2606. + OMX_U32 nSize;
  2607. + OMX_VERSIONTYPE nVersion;
  2608. + OMX_BOOL bDeferred;
  2609. +} OMX_CONFIG_COMMITMODETYPE;
  2610. +
  2611. +/** Explicit commit */
  2612. +typedef struct OMX_CONFIG_COMMITTYPE {
  2613. + OMX_U32 nSize;
  2614. + OMX_VERSIONTYPE nVersion;
  2615. +} OMX_CONFIG_COMMITTYPE;
  2616. +
  2617. +
  2618. +#ifdef __cplusplus
  2619. +}
  2620. +#endif /* __cplusplus */
  2621. +
  2622. +#endif /* OMX_ComponentExt_h */
  2623. diff --git a/encoder/include/khronos/OMX_ContentPipe.h b/encoder/include/khronos/OMX_ContentPipe.h
  2624. new file mode 100755
  2625. index 0000000..843cb7a
  2626. --- /dev/null
  2627. +++ b/encoder/include/khronos/OMX_ContentPipe.h
  2628. @@ -0,0 +1,193 @@
  2629. +/*
  2630. + * Copyright (c) 2008 The Khronos Group Inc.
  2631. + *
  2632. + * Permission is hereby granted, free of charge, to any person obtaining
  2633. + * a copy of this software and associated documentation files (the
  2634. + * "Software"), to deal in the Software without restriction, including
  2635. + * without limitation the rights to use, copy, modify, merge, publish,
  2636. + * distribute, sublicense, and/or sell copies of the Software, and to
  2637. + * permit persons to whom the Software is furnished to do so, subject
  2638. + * to the following conditions:
  2639. + * The above copyright notice and this permission notice shall be included
  2640. + * in all copies or substantial portions of the Software.
  2641. + *
  2642. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  2643. + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  2644. + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  2645. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
  2646. + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  2647. + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  2648. + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  2649. + *
  2650. + */
  2651. +
  2652. +/** OMX_ContentPipe.h - OpenMax IL version 1.1.2
  2653. + * The OMX_ContentPipe header file contains the definitions used to define
  2654. + * the public interface for content piples. This header file is intended to
  2655. + * be used by the component.
  2656. + */
  2657. +
  2658. +#ifndef OMX_CONTENTPIPE_H
  2659. +#define OMX_CONTENTPIPE_H
  2660. +
  2661. +#ifndef KD_EACCES
  2662. +/* OpenKODE error codes. CPResult values may be zero (indicating success
  2663. + or one of the following values) */
  2664. +#define KD_EACCES (1)
  2665. +#define KD_EADDRINUSE (2)
  2666. +#define KD_EAGAIN (5)
  2667. +#define KD_EBADF (7)
  2668. +#define KD_EBUSY (8)
  2669. +#define KD_ECONNREFUSED (9)
  2670. +#define KD_ECONNRESET (10)
  2671. +#define KD_EDEADLK (11)
  2672. +#define KD_EDESTADDRREQ (12)
  2673. +#define KD_ERANGE (35)
  2674. +#define KD_EEXIST (13)
  2675. +#define KD_EFBIG (14)
  2676. +#define KD_EHOSTUNREACH (15)
  2677. +#define KD_EINVAL (17)
  2678. +#define KD_EIO (18)
  2679. +#define KD_EISCONN (20)
  2680. +#define KD_EISDIR (21)
  2681. +#define KD_EMFILE (22)
  2682. +#define KD_ENAMETOOLONG (23)
  2683. +#define KD_ENOENT (24)
  2684. +#define KD_ENOMEM (25)
  2685. +#define KD_ENOSPC (26)
  2686. +#define KD_ENOSYS (27)
  2687. +#define KD_ENOTCONN (28)
  2688. +#define KD_EPERM (33)
  2689. +#define KD_ETIMEDOUT (36)
  2690. +#define KD_EILSEQ (19)
  2691. +#endif
  2692. +
  2693. +/** Map types from OMX standard types only here so interface is as generic as possible. */
  2694. +typedef OMX_U32 CPresult;
  2695. +typedef char * CPstring;
  2696. +typedef void * CPhandle;
  2697. +typedef OMX_U32 CPuint;
  2698. +typedef OMX_S32 CPint;
  2699. +typedef char CPbyte;
  2700. +typedef OMX_BOOL CPbool;
  2701. +
  2702. +/** enumeration of origin types used in the CP_PIPETYPE's Seek function
  2703. + * @ingroup cp
  2704. + */
  2705. +typedef enum CP_ORIGINTYPE {
  2706. + CP_OriginBegin,
  2707. + CP_OriginCur,
  2708. + CP_OriginEnd,
  2709. + CP_OriginKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  2710. + CP_OriginVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  2711. + CP_OriginMax = 0X7FFFFFFF
  2712. +} CP_ORIGINTYPE;
  2713. +
  2714. +/** enumeration of contact access types used in the CP_PIPETYPE's Open function
  2715. + * @ingroup cp
  2716. + */
  2717. +typedef enum CP_ACCESSTYPE {
  2718. + CP_AccessRead,
  2719. + CP_AccessWrite,
  2720. + CP_AccessReadWrite ,
  2721. + CP_AccessKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  2722. + CP_AccessVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  2723. + CP_AccessMax = 0X7FFFFFFF
  2724. +} CP_ACCESSTYPE;
  2725. +
  2726. +/** enumeration of results returned by the CP_PIPETYPE's CheckAvailableBytes function
  2727. + * @ingroup cp
  2728. + */
  2729. +typedef enum CP_CHECKBYTESRESULTTYPE {
  2730. + CP_CheckBytesOk, /**< There are at least the request number
  2731. + of bytes available */
  2732. + CP_CheckBytesNotReady, /**< The pipe is still retrieving bytes
  2733. + and presently lacks sufficient bytes.
  2734. + Client will be called when they are
  2735. + sufficient bytes are available. */
  2736. + CP_CheckBytesInsufficientBytes , /**< The pipe has retrieved all bytes
  2737. + but those available are less than those
  2738. + requested */
  2739. + CP_CheckBytesAtEndOfStream, /**< The pipe has reached the end of stream
  2740. + and no more bytes are available. */
  2741. + CP_CheckBytesOutOfBuffers, /**< All read/write buffers are currently in use. */
  2742. + CP_CheckBytesKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  2743. + CP_CheckBytesVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  2744. + CP_CheckBytesMax = 0X7FFFFFFF
  2745. +} CP_CHECKBYTESRESULTTYPE;
  2746. +
  2747. +/** enumeration of content pipe events sent to the client callback.
  2748. + * @ingroup cp
  2749. + */
  2750. +typedef enum CP_EVENTTYPE {
  2751. + CP_BytesAvailable, /** bytes requested in a CheckAvailableBytes call are now available*/
  2752. + CP_Overflow, /** enumeration of content pipe events sent to the client callback*/
  2753. + CP_PipeDisconnected , /** enumeration of content pipe events sent to the client callback*/
  2754. + CP_EventKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  2755. + CP_EventVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  2756. + CP_EventMax = 0X7FFFFFFF
  2757. +} CP_EVENTTYPE;
  2758. +
  2759. +/** content pipe definition
  2760. + * @ingroup cp
  2761. + */
  2762. +typedef struct CP_PIPETYPE {
  2763. + /** Open a content stream for reading or writing. */
  2764. + CPresult (*Open)( CPhandle* hContent, CPstring szURI, CP_ACCESSTYPE eAccess );
  2765. +
  2766. + /** Close a content stream. */
  2767. + CPresult (*Close)( CPhandle hContent );
  2768. +
  2769. + /** Create a content source and open it for writing. */
  2770. + CPresult (*Create)( CPhandle *hContent, CPstring szURI );
  2771. +
  2772. + /** Check the that specified number of bytes are available for reading or writing (depending on access type).*/
  2773. + CPresult (*CheckAvailableBytes)( CPhandle hContent, CPuint nBytesRequested, CP_CHECKBYTESRESULTTYPE *eResult );
  2774. +
  2775. + /** Seek to certain position in the content relative to the specified origin. */
  2776. + CPresult (*SetPosition)( CPhandle hContent, CPint nOffset, CP_ORIGINTYPE eOrigin);
  2777. +
  2778. + /** Retrieve the current position relative to the start of the content. */
  2779. + CPresult (*GetPosition)( CPhandle hContent, CPuint *pPosition);
  2780. +
  2781. + /** Retrieve data of the specified size from the content stream (advance content pointer by size of data).
  2782. + Note: pipe client provides pointer. This function is appropriate for small high frequency reads. */
  2783. + CPresult (*Read)( CPhandle hContent, CPbyte *pData, CPuint nSize);
  2784. +
  2785. + /** Retrieve a buffer allocated by the pipe that contains the requested number of bytes.
  2786. + Buffer contains the next block of bytes, as specified by nSize, of the content. nSize also
  2787. + returns the size of the block actually read. Content pointer advances the by the returned size.
  2788. + Note: pipe provides pointer. This function is appropriate for large reads. The client must call
  2789. + ReleaseReadBuffer when done with buffer.
  2790. +
  2791. + In some cases the requested block may not reside in contiguous memory within the
  2792. + pipe implementation. For instance if the pipe leverages a circular buffer then the requested
  2793. + block may straddle the boundary of the circular buffer. By default a pipe implementation
  2794. + performs a copy in this case to provide the block to the pipe client in one contiguous buffer.
  2795. + If, however, the client sets bForbidCopy, then the pipe returns only those bytes preceding the memory
  2796. + boundary. Here the client may retrieve the data in segments over successive calls. */
  2797. + CPresult (*ReadBuffer)( CPhandle hContent, CPbyte **ppBuffer, CPuint *nSize, CPbool bForbidCopy);
  2798. +
  2799. + /** Release a buffer obtained by ReadBuffer back to the pipe. */
  2800. + CPresult (*ReleaseReadBuffer)(CPhandle hContent, CPbyte *pBuffer);
  2801. +
  2802. + /** Write data of the specified size to the content (advance content pointer by size of data).
  2803. + Note: pipe client provides pointer. This function is appropriate for small high frequency writes. */
  2804. + CPresult (*Write)( CPhandle hContent, CPbyte *data, CPuint nSize);
  2805. +
  2806. + /** Retrieve a buffer allocated by the pipe used to write data to the content.
  2807. + Client will fill buffer with output data. Note: pipe provides pointer. This function is appropriate
  2808. + for large writes. The client must call WriteBuffer when done it has filled the buffer with data.*/
  2809. + CPresult (*GetWriteBuffer)( CPhandle hContent, CPbyte **ppBuffer, CPuint nSize);
  2810. +
  2811. + /** Deliver a buffer obtained via GetWriteBuffer to the pipe. Pipe will write the
  2812. + the contents of the buffer to content and advance content pointer by the size of the buffer */
  2813. + CPresult (*WriteBuffer)( CPhandle hContent, CPbyte *pBuffer, CPuint nFilledSize);
  2814. +
  2815. + /** Register a per-handle client callback with the content pipe. */
  2816. + CPresult (*RegisterCallback)( CPhandle hContent, CPresult (*ClientCallback)(CP_EVENTTYPE eEvent, CPuint iParam));
  2817. +
  2818. +} CP_PIPETYPE;
  2819. +
  2820. +#endif
  2821. +
  2822. diff --git a/encoder/include/khronos/OMX_Core.h b/encoder/include/khronos/OMX_Core.h
  2823. new file mode 100755
  2824. index 0000000..c8f3c4b
  2825. --- /dev/null
  2826. +++ b/encoder/include/khronos/OMX_Core.h
  2827. @@ -0,0 +1,1422 @@
  2828. +/*
  2829. + * Copyright (c) 2008 The Khronos Group Inc.
  2830. + *
  2831. + * Permission is hereby granted, free of charge, to any person obtaining
  2832. + * a copy of this software and associated documentation files (the
  2833. + * "Software"), to deal in the Software without restriction, including
  2834. + * without limitation the rights to use, copy, modify, merge, publish,
  2835. + * distribute, sublicense, and/or sell copies of the Software, and to
  2836. + * permit persons to whom the Software is furnished to do so, subject
  2837. + * to the following conditions:
  2838. + * The above copyright notice and this permission notice shall be included
  2839. + * in all copies or substantial portions of the Software.
  2840. + *
  2841. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  2842. + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  2843. + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  2844. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
  2845. + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  2846. + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  2847. + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  2848. + *
  2849. + */
  2850. +
  2851. +/** OMX_Core.h - OpenMax IL version 1.1.2
  2852. + * The OMX_Core header file contains the definitions used by both the
  2853. + * application and the component to access common items.
  2854. + */
  2855. +
  2856. +#ifndef OMX_Core_h
  2857. +#define OMX_Core_h
  2858. +
  2859. +#ifdef __cplusplus
  2860. +extern "C" {
  2861. +#endif /* __cplusplus */
  2862. +
  2863. +
  2864. +/* Each OMX header shall include all required header files to allow the
  2865. + * header to compile without errors. The includes below are required
  2866. + * for this header file to compile successfully
  2867. + */
  2868. +
  2869. +#include <OMX_Index.h>
  2870. +
  2871. +
  2872. +/** The OMX_COMMANDTYPE enumeration is used to specify the action in the
  2873. + * OMX_SendCommand macro.
  2874. + * @ingroup core
  2875. + */
  2876. +typedef enum OMX_COMMANDTYPE
  2877. +{
  2878. + OMX_CommandStateSet, /**< Change the component state */
  2879. + OMX_CommandFlush, /**< Flush the data queue(s) of a component */
  2880. + OMX_CommandPortDisable, /**< Disable a port on a component. */
  2881. + OMX_CommandPortEnable, /**< Enable a port on a component. */
  2882. + OMX_CommandMarkBuffer, /**< Mark a component/buffer for observation */
  2883. + OMX_CommandKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  2884. + OMX_CommandVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  2885. + OMX_CommandMax = 0X7FFFFFFF
  2886. +} OMX_COMMANDTYPE;
  2887. +
  2888. +
  2889. +
  2890. +/** The OMX_STATETYPE enumeration is used to indicate or change the component
  2891. + * state. This enumeration reflects the current state of the component when
  2892. + * used with the OMX_GetState macro or becomes the parameter in a state change
  2893. + * command when used with the OMX_SendCommand macro.
  2894. + *
  2895. + * The component will be in the Loaded state after the component is initially
  2896. + * loaded into memory. In the Loaded state, the component is not allowed to
  2897. + * allocate or hold resources other than to build it's internal parameter
  2898. + * and configuration tables. The application will send one or more
  2899. + * SetParameters/GetParameters and SetConfig/GetConfig commands to the
  2900. + * component and the component will record each of these parameter and
  2901. + * configuration changes for use later. When the application sends the
  2902. + * Idle command, the component will acquire the resources needed for the
  2903. + * specified configuration and will transition to the idle state if the
  2904. + * allocation is successful. If the component cannot successfully
  2905. + * transition to the idle state for any reason, the state of the component
  2906. + * shall be fully rolled back to the Loaded state (e.g. all allocated
  2907. + * resources shall be released). When the component receives the command
  2908. + * to go to the Executing state, it shall begin processing buffers by
  2909. + * sending all input buffers it holds to the application. While
  2910. + * the component is in the Idle state, the application may also send the
  2911. + * Pause command. If the component receives the pause command while in the
  2912. + * Idle state, the component shall send all input buffers it holds to the
  2913. + * application, but shall not begin processing buffers. This will allow the
  2914. + * application to prefill buffers.
  2915. + *
  2916. + * @ingroup comp
  2917. + */
  2918. +
  2919. +typedef enum OMX_STATETYPE {
  2920. + OMX_StateInvalid, /**< component has detected that it's internal data
  2921. + structures are corrupted to the point that
  2922. + it cannot determine it's state properly */
  2923. + OMX_StateLoaded, /**< component has been loaded but has not completed
  2924. + initialization. The OMX_SetParameter macro
  2925. + and the OMX_GetParameter macro are the only
  2926. + valid macros allowed to be sent to the
  2927. + component in this state. */
  2928. + OMX_StateIdle, /**< component initialization has been completed
  2929. + successfully and the component is ready to
  2930. + to start. */
  2931. + OMX_StateExecuting, /**< component has accepted the start command and
  2932. + is processing data (if data is available) */
  2933. + OMX_StatePause, /**< component has received pause command */
  2934. + OMX_StateWaitForResources, /**< component is waiting for resources, either after
  2935. + preemption or before it gets the resources requested.
  2936. + See specification for complete details. */
  2937. + OMX_StateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  2938. + OMX_StateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  2939. + OMX_StateMax = 0X7FFFFFFF
  2940. +} OMX_STATETYPE;
  2941. +
  2942. +/** The OMX_ERRORTYPE enumeration defines the standard OMX Errors. These
  2943. + * errors should cover most of the common failure cases. However,
  2944. + * vendors are free to add additional error messages of their own as
  2945. + * long as they follow these rules:
  2946. + * 1. Vendor error messages shall be in the range of 0x90000000 to
  2947. + * 0x9000FFFF.
  2948. + * 2. Vendor error messages shall be defined in a header file provided
  2949. + * with the component. No error messages are allowed that are
  2950. + * not defined.
  2951. + */
  2952. +typedef enum OMX_ERRORTYPE {
  2953. + OMX_ErrorNone = 0,
  2954. +
  2955. + /** There were insufficient resources to perform the requested operation */
  2956. + OMX_ErrorInsufficientResources = (OMX_S32) 0x80001000,
  2957. +
  2958. + /** There was an error, but the cause of the error could not be determined */
  2959. + OMX_ErrorUndefined = (OMX_S32) 0x80001001,
  2960. +
  2961. + /** The component name string was not valid */
  2962. + OMX_ErrorInvalidComponentName = (OMX_S32) 0x80001002,
  2963. +
  2964. + /** No component with the specified name string was found */
  2965. + OMX_ErrorComponentNotFound = (OMX_S32) 0x80001003,
  2966. +
  2967. + /** The component specified did not have a "OMX_ComponentInit" or
  2968. + "OMX_ComponentDeInit entry point */
  2969. + OMX_ErrorInvalidComponent = (OMX_S32) 0x80001004,
  2970. +
  2971. + /** One or more parameters were not valid */
  2972. + OMX_ErrorBadParameter = (OMX_S32) 0x80001005,
  2973. +
  2974. + /** The requested function is not implemented */
  2975. + OMX_ErrorNotImplemented = (OMX_S32) 0x80001006,
  2976. +
  2977. + /** The buffer was emptied before the next buffer was ready */
  2978. + OMX_ErrorUnderflow = (OMX_S32) 0x80001007,
  2979. +
  2980. + /** The buffer was not available when it was needed */
  2981. + OMX_ErrorOverflow = (OMX_S32) 0x80001008,
  2982. +
  2983. + /** The hardware failed to respond as expected */
  2984. + OMX_ErrorHardware = (OMX_S32) 0x80001009,
  2985. +
  2986. + /** The component is in the state OMX_StateInvalid */
  2987. + OMX_ErrorInvalidState = (OMX_S32) 0x8000100A,
  2988. +
  2989. + /** Stream is found to be corrupt */
  2990. + OMX_ErrorStreamCorrupt = (OMX_S32) 0x8000100B,
  2991. +
  2992. + /** Ports being connected are not compatible */
  2993. + OMX_ErrorPortsNotCompatible = (OMX_S32) 0x8000100C,
  2994. +
  2995. + /** Resources allocated to an idle component have been
  2996. + lost resulting in the component returning to the loaded state */
  2997. + OMX_ErrorResourcesLost = (OMX_S32) 0x8000100D,
  2998. +
  2999. + /** No more indicies can be enumerated */
  3000. + OMX_ErrorNoMore = (OMX_S32) 0x8000100E,
  3001. +
  3002. + /** The component detected a version mismatch */
  3003. + OMX_ErrorVersionMismatch = (OMX_S32) 0x8000100F,
  3004. +
  3005. + /** The component is not ready to return data at this time */
  3006. + OMX_ErrorNotReady = (OMX_S32) 0x80001010,
  3007. +
  3008. + /** There was a timeout that occurred */
  3009. + OMX_ErrorTimeout = (OMX_S32) 0x80001011,
  3010. +
  3011. + /** This error occurs when trying to transition into the state you are already in */
  3012. + OMX_ErrorSameState = (OMX_S32) 0x80001012,
  3013. +
  3014. + /** Resources allocated to an executing or paused component have been
  3015. + preempted, causing the component to return to the idle state */
  3016. + OMX_ErrorResourcesPreempted = (OMX_S32) 0x80001013,
  3017. +
  3018. + /** A non-supplier port sends this error to the IL client (via the EventHandler callback)
  3019. + during the allocation of buffers (on a transition from the LOADED to the IDLE state or
  3020. + on a port restart) when it deems that it has waited an unusually long time for the supplier
  3021. + to send it an allocated buffer via a UseBuffer call. */
  3022. + OMX_ErrorPortUnresponsiveDuringAllocation = (OMX_S32) 0x80001014,
  3023. +
  3024. + /** A non-supplier port sends this error to the IL client (via the EventHandler callback)
  3025. + during the deallocation of buffers (on a transition from the IDLE to LOADED state or
  3026. + on a port stop) when it deems that it has waited an unusually long time for the supplier
  3027. + to request the deallocation of a buffer header via a FreeBuffer call. */
  3028. + OMX_ErrorPortUnresponsiveDuringDeallocation = (OMX_S32) 0x80001015,
  3029. +
  3030. + /** A supplier port sends this error to the IL client (via the EventHandler callback)
  3031. + during the stopping of a port (either on a transition from the IDLE to LOADED
  3032. + state or a port stop) when it deems that it has waited an unusually long time for
  3033. + the non-supplier to return a buffer via an EmptyThisBuffer or FillThisBuffer call. */
  3034. + OMX_ErrorPortUnresponsiveDuringStop = (OMX_S32) 0x80001016,
  3035. +
  3036. + /** Attempting a state transtion that is not allowed */
  3037. + OMX_ErrorIncorrectStateTransition = (OMX_S32) 0x80001017,
  3038. +
  3039. + /* Attempting a command that is not allowed during the present state. */
  3040. + OMX_ErrorIncorrectStateOperation = (OMX_S32) 0x80001018,
  3041. +
  3042. + /** The values encapsulated in the parameter or config structure are not supported. */
  3043. + OMX_ErrorUnsupportedSetting = (OMX_S32) 0x80001019,
  3044. +
  3045. + /** The parameter or config indicated by the given index is not supported. */
  3046. + OMX_ErrorUnsupportedIndex = (OMX_S32) 0x8000101A,
  3047. +
  3048. + /** The port index supplied is incorrect. */
  3049. + OMX_ErrorBadPortIndex = (OMX_S32) 0x8000101B,
  3050. +
  3051. + /** The port has lost one or more of its buffers and it thus unpopulated. */
  3052. + OMX_ErrorPortUnpopulated = (OMX_S32) 0x8000101C,
  3053. +
  3054. + /** Component suspended due to temporary loss of resources */
  3055. + OMX_ErrorComponentSuspended = (OMX_S32) 0x8000101D,
  3056. +
  3057. + /** Component suspended due to an inability to acquire dynamic resources */
  3058. + OMX_ErrorDynamicResourcesUnavailable = (OMX_S32) 0x8000101E,
  3059. +
  3060. + /** When the macroblock error reporting is enabled the component returns new error
  3061. + for every frame that has errors */
  3062. + OMX_ErrorMbErrorsInFrame = (OMX_S32) 0x8000101F,
  3063. +
  3064. + /** A component reports this error when it cannot parse or determine the format of an input stream. */
  3065. + OMX_ErrorFormatNotDetected = (OMX_S32) 0x80001020,
  3066. +
  3067. + /** The content open operation failed. */
  3068. + OMX_ErrorContentPipeOpenFailed = (OMX_S32) 0x80001021,
  3069. +
  3070. + /** The content creation operation failed. */
  3071. + OMX_ErrorContentPipeCreationFailed = (OMX_S32) 0x80001022,
  3072. +
  3073. + /** Separate table information is being used */
  3074. + OMX_ErrorSeperateTablesUsed = (OMX_S32) 0x80001023,
  3075. +
  3076. + /** Tunneling is unsupported by the component*/
  3077. + OMX_ErrorTunnelingUnsupported = (OMX_S32) 0x80001024,
  3078. +
  3079. + OMX_ErrorKhronosExtensions = (OMX_S32)0x8F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  3080. + OMX_ErrorVendorStartUnused = (OMX_S32)0x90000000, /**< Reserved region for introducing Vendor Extensions */
  3081. + OMX_ErrorMax = 0x7FFFFFFF
  3082. +} OMX_ERRORTYPE;
  3083. +
  3084. +/** @ingroup core */
  3085. +typedef OMX_ERRORTYPE (* OMX_COMPONENTINITTYPE)(OMX_IN OMX_HANDLETYPE hComponent);
  3086. +
  3087. +/** @ingroup core */
  3088. +typedef struct OMX_COMPONENTREGISTERTYPE {
  3089. + const char * pName; /* Component name, 128 byte limit (including '\0') applies */
  3090. + OMX_COMPONENTINITTYPE pInitialize; /* Component instance initialization function */
  3091. +} OMX_COMPONENTREGISTERTYPE;
  3092. +
  3093. +/** @ingroup core */
  3094. +extern OMX_COMPONENTREGISTERTYPE OMX_ComponentRegistered[];
  3095. +
  3096. +/** @ingroup rpm */
  3097. +typedef struct OMX_PRIORITYMGMTTYPE {
  3098. + OMX_U32 nSize; /**< size of the structure in bytes */
  3099. + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  3100. + OMX_U32 nGroupPriority; /**< Priority of the component group */
  3101. + OMX_U32 nGroupID; /**< ID of the component group */
  3102. +} OMX_PRIORITYMGMTTYPE;
  3103. +
  3104. +/* Component name and Role names are limited to 128 characters including the terminating '\0'. */
  3105. +#define OMX_MAX_STRINGNAME_SIZE 128
  3106. +
  3107. +/** @ingroup comp */
  3108. +typedef struct OMX_PARAM_COMPONENTROLETYPE {
  3109. + OMX_U32 nSize; /**< size of the structure in bytes */
  3110. + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  3111. + OMX_U8 cRole[OMX_MAX_STRINGNAME_SIZE]; /**< name of standard component which defines component role */
  3112. +} OMX_PARAM_COMPONENTROLETYPE;
  3113. +
  3114. +/** End of Stream Buffer Flag:
  3115. + *
  3116. + * A component sets EOS when it has no more data to emit on a particular
  3117. + * output port. Thus an output port shall set EOS on the last buffer it
  3118. + * emits. A component's determination of when an output port should
  3119. + * cease sending data is implemenation specific.
  3120. + * @ingroup buf
  3121. + */
  3122. +
  3123. +#define OMX_BUFFERFLAG_EOS 0x00000001
  3124. +
  3125. +/** Start Time Buffer Flag:
  3126. + *
  3127. + * The source of a stream (e.g. a demux component) sets the STARTTIME
  3128. + * flag on the buffer that contains the starting timestamp for the
  3129. + * stream. The starting timestamp corresponds to the first data that
  3130. + * should be displayed at startup or after a seek.
  3131. + * The first timestamp of the stream is not necessarily the start time.
  3132. + * For instance, in the case of a seek to a particular video frame,
  3133. + * the target frame may be an interframe. Thus the first buffer of
  3134. + * the stream will be the intra-frame preceding the target frame and
  3135. + * the starttime will occur with the target frame (with any other
  3136. + * required frames required to reconstruct the target intervening).
  3137. + *
  3138. + * The STARTTIME flag is directly associated with the buffer's
  3139. + * timestamp ' thus its association to buffer data and its
  3140. + * propagation is identical to the timestamp's.
  3141. + *
  3142. + * When a Sync Component client receives a buffer with the
  3143. + * STARTTIME flag it shall perform a SetConfig on its sync port
  3144. + * using OMX_ConfigTimeClientStartTime and passing the buffer's
  3145. + * timestamp.
  3146. + *
  3147. + * @ingroup buf
  3148. + */
  3149. +
  3150. +#define OMX_BUFFERFLAG_STARTTIME 0x00000002
  3151. +
  3152. +
  3153. +
  3154. +/** Decode Only Buffer Flag:
  3155. + *
  3156. + * The source of a stream (e.g. a demux component) sets the DECODEONLY
  3157. + * flag on any buffer that should shall be decoded but should not be
  3158. + * displayed. This flag is used, for instance, when a source seeks to
  3159. + * a target interframe that requires the decode of frames preceding the
  3160. + * target to facilitate the target's reconstruction. In this case the
  3161. + * source would emit the frames preceding the target downstream
  3162. + * but mark them as decode only.
  3163. + *
  3164. + * The DECODEONLY is associated with buffer data and propagated in a
  3165. + * manner identical to the buffer timestamp.
  3166. + *
  3167. + * A component that renders data should ignore all buffers with
  3168. + * the DECODEONLY flag set.
  3169. + *
  3170. + * @ingroup buf
  3171. + */
  3172. +
  3173. +#define OMX_BUFFERFLAG_DECODEONLY 0x00000004
  3174. +
  3175. +
  3176. +/* Data Corrupt Flag: This flag is set when the IL client believes the data in the associated buffer is corrupt
  3177. + * @ingroup buf
  3178. + */
  3179. +
  3180. +#define OMX_BUFFERFLAG_DATACORRUPT 0x00000008
  3181. +
  3182. +/* End of Frame: The buffer contains exactly one end of frame and no data
  3183. + * occurs after the end of frame. This flag is an optional hint. The absence
  3184. + * of this flag does not imply the absence of an end of frame within the buffer.
  3185. + * @ingroup buf
  3186. +*/
  3187. +#define OMX_BUFFERFLAG_ENDOFFRAME 0x00000010
  3188. +
  3189. +/* Sync Frame Flag: This flag is set when the buffer content contains a coded sync frame '
  3190. + * a frame that has no dependency on any other frame information
  3191. + * @ingroup buf
  3192. + */
  3193. +#define OMX_BUFFERFLAG_SYNCFRAME 0x00000020
  3194. +
  3195. +/* Extra data present flag: there is extra data appended to the data stream
  3196. + * residing in the buffer
  3197. + * @ingroup buf
  3198. + */
  3199. +#define OMX_BUFFERFLAG_EXTRADATA 0x00000040
  3200. +
  3201. +/** Codec Config Buffer Flag:
  3202. +* OMX_BUFFERFLAG_CODECCONFIG is an optional flag that is set by an
  3203. +* output port when all bytes in the buffer form part or all of a set of
  3204. +* codec specific configuration data. Examples include SPS/PPS nal units
  3205. +* for OMX_VIDEO_CodingAVC or AudioSpecificConfig data for
  3206. +* OMX_AUDIO_CodingAAC. Any component that for a given stream sets
  3207. +* OMX_BUFFERFLAG_CODECCONFIG shall not mix codec configuration bytes
  3208. +* with frame data in the same buffer, and shall send all buffers
  3209. +* containing codec configuration bytes before any buffers containing
  3210. +* frame data that those configurations bytes describe.
  3211. +* If the stream format for a particular codec has a frame specific
  3212. +* header at the start of each frame, for example OMX_AUDIO_CodingMP3 or
  3213. +* OMX_AUDIO_CodingAAC in ADTS mode, then these shall be presented as
  3214. +* normal without setting OMX_BUFFERFLAG_CODECCONFIG.
  3215. + * @ingroup buf
  3216. + */
  3217. +#define OMX_BUFFERFLAG_CODECCONFIG 0x00000080
  3218. +
  3219. +
  3220. +
  3221. +/** @ingroup buf */
  3222. +typedef struct OMX_BUFFERHEADERTYPE {
  3223. + OMX_U32 nSize; /**< size of the structure in bytes */
  3224. + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  3225. + OMX_U8* pBuffer; /**< Pointer to actual block of memory
  3226. + that is acting as the buffer */
  3227. + OMX_U32 nAllocLen; /**< size of the buffer allocated, in bytes */
  3228. + OMX_U32 nFilledLen; /**< number of bytes currently in the
  3229. + buffer */
  3230. + OMX_U32 nOffset; /**< start offset of valid data in bytes from
  3231. + the start of the buffer */
  3232. + OMX_PTR pAppPrivate; /**< pointer to any data the application
  3233. + wants to associate with this buffer */
  3234. + OMX_PTR pPlatformPrivate; /**< pointer to any data the platform
  3235. + wants to associate with this buffer */
  3236. + OMX_PTR pInputPortPrivate; /**< pointer to any data the input port
  3237. + wants to associate with this buffer */
  3238. + OMX_PTR pOutputPortPrivate; /**< pointer to any data the output port
  3239. + wants to associate with this buffer */
  3240. + OMX_HANDLETYPE hMarkTargetComponent; /**< The component that will generate a
  3241. + mark event upon processing this buffer. */
  3242. + OMX_PTR pMarkData; /**< Application specific data associated with
  3243. + the mark sent on a mark event to disambiguate
  3244. + this mark from others. */
  3245. + OMX_U32 nTickCount; /**< Optional entry that the component and
  3246. + application can update with a tick count
  3247. + when they access the component. This
  3248. + value should be in microseconds. Since
  3249. + this is a value relative to an arbitrary
  3250. + starting point, this value cannot be used
  3251. + to determine absolute time. This is an
  3252. + optional entry and not all components
  3253. + will update it.*/
  3254. + OMX_TICKS nTimeStamp; /**< Timestamp corresponding to the sample
  3255. + starting at the first logical sample
  3256. + boundary in the buffer. Timestamps of
  3257. + successive samples within the buffer may
  3258. + be inferred by adding the duration of the
  3259. + of the preceding buffer to the timestamp
  3260. + of the preceding buffer.*/
  3261. + OMX_U32 nFlags; /**< buffer specific flags */
  3262. + OMX_U32 nOutputPortIndex; /**< The index of the output port (if any) using
  3263. + this buffer */
  3264. + OMX_U32 nInputPortIndex; /**< The index of the input port (if any) using
  3265. + this buffer */
  3266. +} OMX_BUFFERHEADERTYPE;
  3267. +
  3268. +/** The OMX_EXTRADATATYPE enumeration is used to define the
  3269. + * possible extra data payload types.
  3270. + * NB: this enum is binary backwards compatible with the previous
  3271. + * OMX_EXTRADATA_QUANT define. This should be replaced with
  3272. + * OMX_ExtraDataQuantization.
  3273. + */
  3274. +typedef enum OMX_EXTRADATATYPE {
  3275. + OMX_ExtraDataNone = 0, /**< Indicates that no more extra data sections follow */
  3276. + OMX_ExtraDataQuantization, /**< The data payload contains quantization data */
  3277. + OMX_ExtraDataKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  3278. + OMX_ExtraDataVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  3279. + OMX_ExtraDataMax = 0x7FFFFFFF
  3280. +} OMX_EXTRADATATYPE;
  3281. +
  3282. +
  3283. +typedef struct OMX_OTHER_EXTRADATATYPE {
  3284. + OMX_U32 nSize;
  3285. + OMX_VERSIONTYPE nVersion;
  3286. + OMX_U32 nPortIndex;
  3287. + OMX_EXTRADATATYPE eType; /* Extra Data type */
  3288. + OMX_U32 nDataSize; /* Size of the supporting data to follow */
  3289. + OMX_U8 data[1]; /* Supporting data hint */
  3290. +} OMX_OTHER_EXTRADATATYPE;
  3291. +
  3292. +/** @ingroup comp */
  3293. +typedef struct OMX_PORT_PARAM_TYPE {
  3294. + OMX_U32 nSize; /**< size of the structure in bytes */
  3295. + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  3296. + OMX_U32 nPorts; /**< The number of ports for this component */
  3297. + OMX_U32 nStartPortNumber; /** first port number for this type of port */
  3298. +} OMX_PORT_PARAM_TYPE;
  3299. +
  3300. +/** @ingroup comp */
  3301. +typedef enum OMX_EVENTTYPE {
  3302. + OMX_EventCmdComplete, /**< component has sucessfully completed a command */
  3303. + OMX_EventError, /**< component has detected an error condition */
  3304. + OMX_EventMark, /**< component has detected a buffer mark */
  3305. + OMX_EventPortSettingsChanged, /**< component is reported a port settings change */
  3306. + OMX_EventBufferFlag, /**< component has detected an EOS */
  3307. + OMX_EventResourcesAcquired, /**< component has been granted resources and is
  3308. + automatically starting the state change from
  3309. + OMX_StateWaitForResources to OMX_StateIdle. */
  3310. + OMX_EventComponentResumed, /**< Component resumed due to reacquisition of resources */
  3311. + OMX_EventDynamicResourcesAvailable, /**< Component has acquired previously unavailable dynamic resources */
  3312. + OMX_EventPortFormatDetected, /**< Component has detected a supported format. */
  3313. + OMX_EventKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  3314. + OMX_EventVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  3315. + OMX_EventMax = 0x7FFFFFFF
  3316. +} OMX_EVENTTYPE;
  3317. +
  3318. +typedef struct OMX_CALLBACKTYPE {
  3319. + /** The EventHandler method is used to notify the application when an
  3320. + event of interest occurs. Events are defined in the OMX_EVENTTYPE
  3321. + enumeration. Please see that enumeration for details of what will
  3322. + be returned for each type of event. Callbacks should not return
  3323. + an error to the component, so if an error occurs, the application
  3324. + shall handle it internally. This is a blocking call.
  3325. +
  3326. + The application should return from this call within 5 msec to avoid
  3327. + blocking the component for an excessively long period of time.
  3328. +
  3329. + @param hComponent
  3330. + handle of the component to access. This is the component
  3331. + handle returned by the call to the GetHandle function.
  3332. + @param pAppData
  3333. + pointer to an application defined value that was provided in the
  3334. + pAppData parameter to the OMX_GetHandle method for the component.
  3335. + This application defined value is provided so that the application
  3336. + can have a component specific context when receiving the callback.
  3337. + @param eEvent
  3338. + Event that the component wants to notify the application about.
  3339. + @param nData1
  3340. + nData will be the OMX_ERRORTYPE for an error event and will be
  3341. + an OMX_COMMANDTYPE for a command complete event and OMX_INDEXTYPE for a OMX_PortSettingsChanged event.
  3342. + @param nData2
  3343. + nData2 will hold further information related to the event. Can be OMX_STATETYPE for
  3344. + a OMX_CommandStateSet command or port index for a OMX_PortSettingsChanged event.
  3345. + Default value is 0 if not used. )
  3346. + @param pEventData
  3347. + Pointer to additional event-specific data (see spec for meaning).
  3348. + */
  3349. +
  3350. + OMX_ERRORTYPE (*EventHandler)(
  3351. + OMX_IN OMX_HANDLETYPE hComponent,
  3352. + OMX_IN OMX_PTR pAppData,
  3353. + OMX_IN OMX_EVENTTYPE eEvent,
  3354. + OMX_IN OMX_U32 nData1,
  3355. + OMX_IN OMX_U32 nData2,
  3356. + OMX_IN OMX_PTR pEventData);
  3357. +
  3358. + /** The EmptyBufferDone method is used to return emptied buffers from an
  3359. + input port back to the application for reuse. This is a blocking call
  3360. + so the application should not attempt to refill the buffers during this
  3361. + call, but should queue them and refill them in another thread. There
  3362. + is no error return, so the application shall handle any errors generated
  3363. + internally.
  3364. +
  3365. + The application should return from this call within 5 msec.
  3366. +
  3367. + @param hComponent
  3368. + handle of the component to access. This is the component
  3369. + handle returned by the call to the GetHandle function.
  3370. + @param pAppData
  3371. + pointer to an application defined value that was provided in the
  3372. + pAppData parameter to the OMX_GetHandle method for the component.
  3373. + This application defined value is provided so that the application
  3374. + can have a component specific context when receiving the callback.
  3375. + @param pBuffer
  3376. + pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer
  3377. + or AllocateBuffer indicating the buffer that was emptied.
  3378. + @ingroup buf
  3379. + */
  3380. + OMX_ERRORTYPE (*EmptyBufferDone)(
  3381. + OMX_IN OMX_HANDLETYPE hComponent,
  3382. + OMX_IN OMX_PTR pAppData,
  3383. + OMX_IN OMX_BUFFERHEADERTYPE* pBuffer);
  3384. +
  3385. + /** The FillBufferDone method is used to return filled buffers from an
  3386. + output port back to the application for emptying and then reuse.
  3387. + This is a blocking call so the application should not attempt to
  3388. + empty the buffers during this call, but should queue the buffers
  3389. + and empty them in another thread. There is no error return, so
  3390. + the application shall handle any errors generated internally. The
  3391. + application shall also update the buffer header to indicate the
  3392. + number of bytes placed into the buffer.
  3393. +
  3394. + The application should return from this call within 5 msec.
  3395. +
  3396. + @param hComponent
  3397. + handle of the component to access. This is the component
  3398. + handle returned by the call to the GetHandle function.
  3399. + @param pAppData
  3400. + pointer to an application defined value that was provided in the
  3401. + pAppData parameter to the OMX_GetHandle method for the component.
  3402. + This application defined value is provided so that the application
  3403. + can have a component specific context when receiving the callback.
  3404. + @param pBuffer
  3405. + pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer
  3406. + or AllocateBuffer indicating the buffer that was filled.
  3407. + @ingroup buf
  3408. + */
  3409. + OMX_ERRORTYPE (*FillBufferDone)(
  3410. + OMX_OUT OMX_HANDLETYPE hComponent,
  3411. + OMX_OUT OMX_PTR pAppData,
  3412. + OMX_OUT OMX_BUFFERHEADERTYPE* pBuffer);
  3413. +
  3414. +} OMX_CALLBACKTYPE;
  3415. +
  3416. +/** The OMX_BUFFERSUPPLIERTYPE enumeration is used to dictate port supplier
  3417. + preference when tunneling between two ports.
  3418. + @ingroup tun buf
  3419. +*/
  3420. +typedef enum OMX_BUFFERSUPPLIERTYPE {
  3421. + OMX_BufferSupplyUnspecified = 0x0, /**< port supplying the buffers is unspecified,
  3422. + or don't care */
  3423. + OMX_BufferSupplyInput, /**< input port supplies the buffers */
  3424. + OMX_BufferSupplyOutput, /**< output port supplies the buffers */
  3425. + OMX_BufferSupplyKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  3426. + OMX_BufferSupplyVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  3427. + OMX_BufferSupplyMax = 0x7FFFFFFF
  3428. +} OMX_BUFFERSUPPLIERTYPE;
  3429. +
  3430. +
  3431. +/** buffer supplier parameter
  3432. + * @ingroup tun
  3433. + */
  3434. +typedef struct OMX_PARAM_BUFFERSUPPLIERTYPE {
  3435. + OMX_U32 nSize; /**< size of the structure in bytes */
  3436. + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  3437. + OMX_U32 nPortIndex; /**< port that this structure applies to */
  3438. + OMX_BUFFERSUPPLIERTYPE eBufferSupplier; /**< buffer supplier */
  3439. +} OMX_PARAM_BUFFERSUPPLIERTYPE;
  3440. +
  3441. +
  3442. +/**< indicates that buffers received by an input port of a tunnel
  3443. + may not modify the data in the buffers
  3444. + @ingroup tun
  3445. + */
  3446. +#define OMX_PORTTUNNELFLAG_READONLY 0x00000001
  3447. +
  3448. +
  3449. +/** The OMX_TUNNELSETUPTYPE structure is used to pass data from an output
  3450. + port to an input port as part the two ComponentTunnelRequest calls
  3451. + resulting from a OMX_SetupTunnel call from the IL Client.
  3452. + @ingroup tun
  3453. + */
  3454. +typedef struct OMX_TUNNELSETUPTYPE {
  3455. + OMX_U32 nTunnelFlags; /**< bit flags for tunneling */
  3456. + OMX_BUFFERSUPPLIERTYPE eSupplier; /**< supplier preference */
  3457. +} OMX_TUNNELSETUPTYPE;
  3458. +
  3459. +/* OMX Component headers is included to enable the core to use
  3460. + macros for functions into the component for OMX release 1.0.
  3461. + Developers should not access any structures or data from within
  3462. + the component header directly */
  3463. +/* TO BE REMOVED - #include <OMX_Component.h> */
  3464. +
  3465. +/** GetComponentVersion will return information about the component.
  3466. + This is a blocking call. This macro will go directly from the
  3467. + application to the component (via a core macro). The
  3468. + component will return from this call within 5 msec.
  3469. + @param [in] hComponent
  3470. + handle of component to execute the command
  3471. + @param [out] pComponentName
  3472. + pointer to an empty string of length 128 bytes. The component
  3473. + will write its name into this string. The name will be
  3474. + terminated by a single zero byte. The name of a component will
  3475. + be 127 bytes or less to leave room for the trailing zero byte.
  3476. + An example of a valid component name is "OMX.ABC.ChannelMixer\0".
  3477. + @param [out] pComponentVersion
  3478. + pointer to an OMX Version structure that the component will fill
  3479. + in. The component will fill in a value that indicates the
  3480. + component version. NOTE: the component version is NOT the same
  3481. + as the OMX Specification version (found in all structures). The
  3482. + component version is defined by the vendor of the component and
  3483. + its value is entirely up to the component vendor.
  3484. + @param [out] pSpecVersion
  3485. + pointer to an OMX Version structure that the component will fill
  3486. + in. The SpecVersion is the version of the specification that the
  3487. + component was built against. Please note that this value may or
  3488. + may not match the structure's version. For example, if the
  3489. + component was built against the 2.0 specification, but the
  3490. + application (which creates the structure is built against the
  3491. + 1.0 specification the versions would be different.
  3492. + @param [out] pComponentUUID
  3493. + pointer to the UUID of the component which will be filled in by
  3494. + the component. The UUID is a unique identifier that is set at
  3495. + RUN time for the component and is unique to each instantion of
  3496. + the component.
  3497. + @return OMX_ERRORTYPE
  3498. + If the command successfully executes, the return code will be
  3499. + OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
  3500. + @ingroup comp
  3501. + */
  3502. +#define OMX_GetComponentVersion( \
  3503. + hComponent, \
  3504. + pComponentName, \
  3505. + pComponentVersion, \
  3506. + pSpecVersion, \
  3507. + pComponentUUID) \
  3508. + ((OMX_COMPONENTTYPE*)hComponent)->GetComponentVersion( \
  3509. + hComponent, \
  3510. + pComponentName, \
  3511. + pComponentVersion, \
  3512. + pSpecVersion, \
  3513. + pComponentUUID) /* Macro End */
  3514. +
  3515. +
  3516. +/** Send a command to the component. This call is a non-blocking call.
  3517. + The component should check the parameters and then queue the command
  3518. + to the component thread to be executed. The component thread shall
  3519. + send the EventHandler() callback at the conclusion of the command.
  3520. + This macro will go directly from the application to the component (via
  3521. + a core macro). The component will return from this call within 5 msec.
  3522. +
  3523. + When the command is "OMX_CommandStateSet" the component will queue a
  3524. + state transition to the new state idenfied in nParam.
  3525. +
  3526. + When the command is "OMX_CommandFlush", to flush a port's buffer queues,
  3527. + the command will force the component to return all buffers NOT CURRENTLY
  3528. + BEING PROCESSED to the application, in the order in which the buffers
  3529. + were received.
  3530. +
  3531. + When the command is "OMX_CommandPortDisable" or
  3532. + "OMX_CommandPortEnable", the component's port (given by the value of
  3533. + nParam) will be stopped or restarted.
  3534. +
  3535. + When the command "OMX_CommandMarkBuffer" is used to mark a buffer, the
  3536. + pCmdData will point to a OMX_MARKTYPE structure containing the component
  3537. + handle of the component to examine the buffer chain for the mark. nParam1
  3538. + contains the index of the port on which the buffer mark is applied.
  3539. +
  3540. + Specification text for more details.
  3541. +
  3542. + @param [in] hComponent
  3543. + handle of component to execute the command
  3544. + @param [in] Cmd
  3545. + Command for the component to execute
  3546. + @param [in] nParam
  3547. + Parameter for the command to be executed. When Cmd has the value
  3548. + OMX_CommandStateSet, value is a member of OMX_STATETYPE. When Cmd has
  3549. + the value OMX_CommandFlush, value of nParam indicates which port(s)
  3550. + to flush. -1 is used to flush all ports a single port index will
  3551. + only flush that port. When Cmd has the value "OMX_CommandPortDisable"
  3552. + or "OMX_CommandPortEnable", the component's port is given by
  3553. + the value of nParam. When Cmd has the value "OMX_CommandMarkBuffer"
  3554. + the components pot is given by the value of nParam.
  3555. + @param [in] pCmdData
  3556. + Parameter pointing to the OMX_MARKTYPE structure when Cmd has the value
  3557. + "OMX_CommandMarkBuffer".
  3558. + @return OMX_ERRORTYPE
  3559. + If the command successfully executes, the return code will be
  3560. + OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
  3561. + @ingroup comp
  3562. + */
  3563. +#define OMX_SendCommand( \
  3564. + hComponent, \
  3565. + Cmd, \
  3566. + nParam, \
  3567. + pCmdData) \
  3568. + ((OMX_COMPONENTTYPE*)hComponent)->SendCommand( \
  3569. + hComponent, \
  3570. + Cmd, \
  3571. + nParam, \
  3572. + pCmdData) /* Macro End */
  3573. +
  3574. +
  3575. +/** The OMX_GetParameter macro will get one of the current parameter
  3576. + settings from the component. This macro cannot only be invoked when
  3577. + the component is in the OMX_StateInvalid state. The nParamIndex
  3578. + parameter is used to indicate which structure is being requested from
  3579. + the component. The application shall allocate the correct structure
  3580. + and shall fill in the structure size and version information before
  3581. + invoking this macro. When the parameter applies to a port, the
  3582. + caller shall fill in the appropriate nPortIndex value indicating the
  3583. + port on which the parameter applies. If the component has not had
  3584. + any settings changed, then the component should return a set of
  3585. + valid DEFAULT parameters for the component. This is a blocking
  3586. + call.
  3587. +
  3588. + The component should return from this call within 20 msec.
  3589. +
  3590. + @param [in] hComponent
  3591. + Handle of the component to be accessed. This is the component
  3592. + handle returned by the call to the OMX_GetHandle function.
  3593. + @param [in] nParamIndex
  3594. + Index of the structure to be filled. This value is from the
  3595. + OMX_INDEXTYPE enumeration.
  3596. + @param [in,out] pComponentParameterStructure
  3597. + Pointer to application allocated structure to be filled by the
  3598. + component.
  3599. + @return OMX_ERRORTYPE
  3600. + If the command successfully executes, the return code will be
  3601. + OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
  3602. + @ingroup comp
  3603. + */
  3604. +#define OMX_GetParameter( \
  3605. + hComponent, \
  3606. + nParamIndex, \
  3607. + pComponentParameterStructure) \
  3608. + ((OMX_COMPONENTTYPE*)hComponent)->GetParameter( \
  3609. + hComponent, \
  3610. + nParamIndex, \
  3611. + pComponentParameterStructure) /* Macro End */
  3612. +
  3613. +
  3614. +/** The OMX_SetParameter macro will send an initialization parameter
  3615. + structure to a component. Each structure shall be sent one at a time,
  3616. + in a separate invocation of the macro. This macro can only be
  3617. + invoked when the component is in the OMX_StateLoaded state, or the
  3618. + port is disabled (when the parameter applies to a port). The
  3619. + nParamIndex parameter is used to indicate which structure is being
  3620. + passed to the component. The application shall allocate the
  3621. + correct structure and shall fill in the structure size and version
  3622. + information (as well as the actual data) before invoking this macro.
  3623. + The application is free to dispose of this structure after the call
  3624. + as the component is required to copy any data it shall retain. This
  3625. + is a blocking call.
  3626. +
  3627. + The component should return from this call within 20 msec.
  3628. +
  3629. + @param [in] hComponent
  3630. + Handle of the component to be accessed. This is the component
  3631. + handle returned by the call to the OMX_GetHandle function.
  3632. + @param [in] nIndex
  3633. + Index of the structure to be sent. This value is from the
  3634. + OMX_INDEXTYPE enumeration.
  3635. + @param [in] pComponentParameterStructure
  3636. + pointer to application allocated structure to be used for
  3637. + initialization by the component.
  3638. + @return OMX_ERRORTYPE
  3639. + If the command successfully executes, the return code will be
  3640. + OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
  3641. + @ingroup comp
  3642. + */
  3643. +#define OMX_SetParameter( \
  3644. + hComponent, \
  3645. + nParamIndex, \
  3646. + pComponentParameterStructure) \
  3647. + ((OMX_COMPONENTTYPE*)hComponent)->SetParameter( \
  3648. + hComponent, \
  3649. + nParamIndex, \
  3650. + pComponentParameterStructure) /* Macro End */
  3651. +
  3652. +
  3653. +/** The OMX_GetConfig macro will get one of the configuration structures
  3654. + from a component. This macro can be invoked anytime after the
  3655. + component has been loaded. The nParamIndex call parameter is used to
  3656. + indicate which structure is being requested from the component. The
  3657. + application shall allocate the correct structure and shall fill in the
  3658. + structure size and version information before invoking this macro.
  3659. + If the component has not had this configuration parameter sent before,
  3660. + then the component should return a set of valid DEFAULT values for the
  3661. + component. This is a blocking call.
  3662. +
  3663. + The component should return from this call within 5 msec.
  3664. +
  3665. + @param [in] hComponent
  3666. + Handle of the component to be accessed. This is the component
  3667. + handle returned by the call to the OMX_GetHandle function.
  3668. + @param [in] nIndex
  3669. + Index of the structure to be filled. This value is from the
  3670. + OMX_INDEXTYPE enumeration.
  3671. + @param [in,out] pComponentConfigStructure
  3672. + pointer to application allocated structure to be filled by the
  3673. + component.
  3674. + @return OMX_ERRORTYPE
  3675. + If the command successfully executes, the return code will be
  3676. + OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
  3677. + @ingroup comp
  3678. +*/
  3679. +#define OMX_GetConfig( \
  3680. + hComponent, \
  3681. + nConfigIndex, \
  3682. + pComponentConfigStructure) \
  3683. + ((OMX_COMPONENTTYPE*)hComponent)->GetConfig( \
  3684. + hComponent, \
  3685. + nConfigIndex, \
  3686. + pComponentConfigStructure) /* Macro End */
  3687. +
  3688. +
  3689. +/** The OMX_SetConfig macro will send one of the configuration
  3690. + structures to a component. Each structure shall be sent one at a time,
  3691. + each in a separate invocation of the macro. This macro can be invoked
  3692. + anytime after the component has been loaded. The application shall
  3693. + allocate the correct structure and shall fill in the structure size
  3694. + and version information (as well as the actual data) before invoking
  3695. + this macro. The application is free to dispose of this structure after
  3696. + the call as the component is required to copy any data it shall retain.
  3697. + This is a blocking call.
  3698. +
  3699. + The component should return from this call within 5 msec.
  3700. +
  3701. + @param [in] hComponent
  3702. + Handle of the component to be accessed. This is the component
  3703. + handle returned by the call to the OMX_GetHandle function.
  3704. + @param [in] nConfigIndex
  3705. + Index of the structure to be sent. This value is from the
  3706. + OMX_INDEXTYPE enumeration above.
  3707. + @param [in] pComponentConfigStructure
  3708. + pointer to application allocated structure to be used for
  3709. + initialization by the component.
  3710. + @return OMX_ERRORTYPE
  3711. + If the command successfully executes, the return code will be
  3712. + OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
  3713. + @ingroup comp
  3714. + */
  3715. +#define OMX_SetConfig( \
  3716. + hComponent, \
  3717. + nConfigIndex, \
  3718. + pComponentConfigStructure) \
  3719. + ((OMX_COMPONENTTYPE*)hComponent)->SetConfig( \
  3720. + hComponent, \
  3721. + nConfigIndex, \
  3722. + pComponentConfigStructure) /* Macro End */
  3723. +
  3724. +
  3725. +/** The OMX_GetExtensionIndex macro will invoke a component to translate
  3726. + a vendor specific configuration or parameter string into an OMX
  3727. + structure index. There is no requirement for the vendor to support
  3728. + this command for the indexes already found in the OMX_INDEXTYPE
  3729. + enumeration (this is done to save space in small components). The
  3730. + component shall support all vendor supplied extension indexes not found
  3731. + in the master OMX_INDEXTYPE enumeration. This is a blocking call.
  3732. +
  3733. + The component should return from this call within 5 msec.
  3734. +
  3735. + @param [in] hComponent
  3736. + Handle of the component to be accessed. This is the component
  3737. + handle returned by the call to the GetHandle function.
  3738. + @param [in] cParameterName
  3739. + OMX_STRING that shall be less than 128 characters long including
  3740. + the trailing null byte. This is the string that will get
  3741. + translated by the component into a configuration index.
  3742. + @param [out] pIndexType
  3743. + a pointer to a OMX_INDEXTYPE to receive the index value.
  3744. + @return OMX_ERRORTYPE
  3745. + If the command successfully executes, the return code will be
  3746. + OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
  3747. + @ingroup comp
  3748. + */
  3749. +#define OMX_GetExtensionIndex( \
  3750. + hComponent, \
  3751. + cParameterName, \
  3752. + pIndexType) \
  3753. + ((OMX_COMPONENTTYPE*)hComponent)->GetExtensionIndex( \
  3754. + hComponent, \
  3755. + cParameterName, \
  3756. + pIndexType) /* Macro End */
  3757. +
  3758. +
  3759. +/** The OMX_GetState macro will invoke the component to get the current
  3760. + state of the component and place the state value into the location
  3761. + pointed to by pState.
  3762. +
  3763. + The component should return from this call within 5 msec.
  3764. +
  3765. + @param [in] hComponent
  3766. + Handle of the component to be accessed. This is the component
  3767. + handle returned by the call to the OMX_GetHandle function.
  3768. + @param [out] pState
  3769. + pointer to the location to receive the state. The value returned
  3770. + is one of the OMX_STATETYPE members
  3771. + @return OMX_ERRORTYPE
  3772. + If the command successfully executes, the return code will be
  3773. + OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
  3774. + @ingroup comp
  3775. + */
  3776. +#define OMX_GetState( \
  3777. + hComponent, \
  3778. + pState) \
  3779. + ((OMX_COMPONENTTYPE*)hComponent)->GetState( \
  3780. + hComponent, \
  3781. + pState) /* Macro End */
  3782. +
  3783. +
  3784. +/** The OMX_UseBuffer macro will request that the component use
  3785. + a buffer (and allocate its own buffer header) already allocated
  3786. + by another component, or by the IL Client. This is a blocking
  3787. + call.
  3788. +
  3789. + The component should return from this call within 20 msec.
  3790. +
  3791. + @param [in] hComponent
  3792. + Handle of the component to be accessed. This is the component
  3793. + handle returned by the call to the OMX_GetHandle function.
  3794. + @param [out] ppBuffer
  3795. + pointer to an OMX_BUFFERHEADERTYPE structure used to receive the
  3796. + pointer to the buffer header
  3797. + @return OMX_ERRORTYPE
  3798. + If the command successfully executes, the return code will be
  3799. + OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
  3800. + @ingroup comp buf
  3801. + */
  3802. +
  3803. +#define OMX_UseBuffer( \
  3804. + hComponent, \
  3805. + ppBufferHdr, \
  3806. + nPortIndex, \
  3807. + pAppPrivate, \
  3808. + nSizeBytes, \
  3809. + pBuffer) \
  3810. + ((OMX_COMPONENTTYPE*)hComponent)->UseBuffer( \
  3811. + hComponent, \
  3812. + ppBufferHdr, \
  3813. + nPortIndex, \
  3814. + pAppPrivate, \
  3815. + nSizeBytes, \
  3816. + pBuffer)
  3817. +
  3818. +
  3819. +/** The OMX_AllocateBuffer macro will request that the component allocate
  3820. + a new buffer and buffer header. The component will allocate the
  3821. + buffer and the buffer header and return a pointer to the buffer
  3822. + header. This is a blocking call.
  3823. +
  3824. + The component should return from this call within 5 msec.
  3825. +
  3826. + @param [in] hComponent
  3827. + Handle of the component to be accessed. This is the component
  3828. + handle returned by the call to the OMX_GetHandle function.
  3829. + @param [out] ppBuffer
  3830. + pointer to an OMX_BUFFERHEADERTYPE structure used to receive
  3831. + the pointer to the buffer header
  3832. + @param [in] nPortIndex
  3833. + nPortIndex is used to select the port on the component the buffer will
  3834. + be used with. The port can be found by using the nPortIndex
  3835. + value as an index into the Port Definition array of the component.
  3836. + @param [in] pAppPrivate
  3837. + pAppPrivate is used to initialize the pAppPrivate member of the
  3838. + buffer header structure.
  3839. + @param [in] nSizeBytes
  3840. + size of the buffer to allocate. Used when bAllocateNew is true.
  3841. + @return OMX_ERRORTYPE
  3842. + If the command successfully executes, the return code will be
  3843. + OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
  3844. + @ingroup comp buf
  3845. + */
  3846. +#define OMX_AllocateBuffer( \
  3847. + hComponent, \
  3848. + ppBuffer, \
  3849. + nPortIndex, \
  3850. + pAppPrivate, \
  3851. + nSizeBytes) \
  3852. + ((OMX_COMPONENTTYPE*)hComponent)->AllocateBuffer( \
  3853. + hComponent, \
  3854. + ppBuffer, \
  3855. + nPortIndex, \
  3856. + pAppPrivate, \
  3857. + nSizeBytes) /* Macro End */
  3858. +
  3859. +
  3860. +/** The OMX_FreeBuffer macro will release a buffer header from the component
  3861. + which was allocated using either OMX_AllocateBuffer or OMX_UseBuffer. If
  3862. + the component allocated the buffer (see the OMX_UseBuffer macro) then
  3863. + the component shall free the buffer and buffer header. This is a
  3864. + blocking call.
  3865. +
  3866. + The component should return from this call within 20 msec.
  3867. +
  3868. + @param [in] hComponent
  3869. + Handle of the component to be accessed. This is the component
  3870. + handle returned by the call to the OMX_GetHandle function.
  3871. + @param [in] nPortIndex
  3872. + nPortIndex is used to select the port on the component the buffer will
  3873. + be used with.
  3874. + @param [in] pBuffer
  3875. + pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer
  3876. + or AllocateBuffer.
  3877. + @return OMX_ERRORTYPE
  3878. + If the command successfully executes, the return code will be
  3879. + OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
  3880. + @ingroup comp buf
  3881. + */
  3882. +#define OMX_FreeBuffer( \
  3883. + hComponent, \
  3884. + nPortIndex, \
  3885. + pBuffer) \
  3886. + ((OMX_COMPONENTTYPE*)hComponent)->FreeBuffer( \
  3887. + hComponent, \
  3888. + nPortIndex, \
  3889. + pBuffer) /* Macro End */
  3890. +
  3891. +
  3892. +/** The OMX_EmptyThisBuffer macro will send a buffer full of data to an
  3893. + input port of a component. The buffer will be emptied by the component
  3894. + and returned to the application via the EmptyBufferDone call back.
  3895. + This is a non-blocking call in that the component will record the buffer
  3896. + and return immediately and then empty the buffer, later, at the proper
  3897. + time. As expected, this macro may be invoked only while the component
  3898. + is in the OMX_StateExecuting. If nPortIndex does not specify an input
  3899. + port, the component shall return an error.
  3900. +
  3901. + The component should return from this call within 5 msec.
  3902. +
  3903. + @param [in] hComponent
  3904. + Handle of the component to be accessed. This is the component
  3905. + handle returned by the call to the OMX_GetHandle function.
  3906. + @param [in] pBuffer
  3907. + pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer
  3908. + or AllocateBuffer.
  3909. + @return OMX_ERRORTYPE
  3910. + If the command successfully executes, the return code will be
  3911. + OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
  3912. + @ingroup comp buf
  3913. + */
  3914. +#define OMX_EmptyThisBuffer( \
  3915. + hComponent, \
  3916. + pBuffer) \
  3917. + ((OMX_COMPONENTTYPE*)hComponent)->EmptyThisBuffer( \
  3918. + hComponent, \
  3919. + pBuffer) /* Macro End */
  3920. +
  3921. +
  3922. +/** The OMX_FillThisBuffer macro will send an empty buffer to an
  3923. + output port of a component. The buffer will be filled by the component
  3924. + and returned to the application via the FillBufferDone call back.
  3925. + This is a non-blocking call in that the component will record the buffer
  3926. + and return immediately and then fill the buffer, later, at the proper
  3927. + time. As expected, this macro may be invoked only while the component
  3928. + is in the OMX_ExecutingState. If nPortIndex does not specify an output
  3929. + port, the component shall return an error.
  3930. +
  3931. + The component should return from this call within 5 msec.
  3932. +
  3933. + @param [in] hComponent
  3934. + Handle of the component to be accessed. This is the component
  3935. + handle returned by the call to the OMX_GetHandle function.
  3936. + @param [in] pBuffer
  3937. + pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer
  3938. + or AllocateBuffer.
  3939. + @return OMX_ERRORTYPE
  3940. + If the command successfully executes, the return code will be
  3941. + OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
  3942. + @ingroup comp buf
  3943. + */
  3944. +#define OMX_FillThisBuffer( \
  3945. + hComponent, \
  3946. + pBuffer) \
  3947. + ((OMX_COMPONENTTYPE*)hComponent)->FillThisBuffer( \
  3948. + hComponent, \
  3949. + pBuffer) /* Macro End */
  3950. +
  3951. +
  3952. +
  3953. +/** The OMX_UseEGLImage macro will request that the component use
  3954. + a EGLImage provided by EGL (and allocate its own buffer header)
  3955. + This is a blocking call.
  3956. +
  3957. + The component should return from this call within 20 msec.
  3958. +
  3959. + @param [in] hComponent
  3960. + Handle of the component to be accessed. This is the component
  3961. + handle returned by the call to the OMX_GetHandle function.
  3962. + @param [out] ppBuffer
  3963. + pointer to an OMX_BUFFERHEADERTYPE structure used to receive the
  3964. + pointer to the buffer header. Note that the memory location used
  3965. + for this buffer is NOT visible to the IL Client.
  3966. + @param [in] nPortIndex
  3967. + nPortIndex is used to select the port on the component the buffer will
  3968. + be used with. The port can be found by using the nPortIndex
  3969. + value as an index into the Port Definition array of the component.
  3970. + @param [in] pAppPrivate
  3971. + pAppPrivate is used to initialize the pAppPrivate member of the
  3972. + buffer header structure.
  3973. + @param [in] eglImage
  3974. + eglImage contains the handle of the EGLImage to use as a buffer on the
  3975. + specified port. The component is expected to validate properties of
  3976. + the EGLImage against the configuration of the port to ensure the component
  3977. + can use the EGLImage as a buffer.
  3978. + @return OMX_ERRORTYPE
  3979. + If the command successfully executes, the return code will be
  3980. + OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
  3981. + @ingroup comp buf
  3982. + */
  3983. +#define OMX_UseEGLImage( \
  3984. + hComponent, \
  3985. + ppBufferHdr, \
  3986. + nPortIndex, \
  3987. + pAppPrivate, \
  3988. + eglImage) \
  3989. + ((OMX_COMPONENTTYPE*)hComponent)->UseEGLImage( \
  3990. + hComponent, \
  3991. + ppBufferHdr, \
  3992. + nPortIndex, \
  3993. + pAppPrivate, \
  3994. + eglImage)
  3995. +
  3996. +/** The OMX_Init method is used to initialize the OMX core. It shall be the
  3997. + first call made into OMX and it should only be executed one time without
  3998. + an interviening OMX_Deinit call.
  3999. +
  4000. + The core should return from this call within 20 msec.
  4001. +
  4002. + @return OMX_ERRORTYPE
  4003. + If the command successfully executes, the return code will be
  4004. + OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
  4005. + @ingroup core
  4006. + */
  4007. +OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_Init(void);
  4008. +
  4009. +
  4010. +/** The OMX_Deinit method is used to deinitialize the OMX core. It shall be
  4011. + the last call made into OMX. In the event that the core determines that
  4012. + thare are components loaded when this call is made, the core may return
  4013. + with an error rather than try to unload the components.
  4014. +
  4015. + The core should return from this call within 20 msec.
  4016. +
  4017. + @return OMX_ERRORTYPE
  4018. + If the command successfully executes, the return code will be
  4019. + OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
  4020. + @ingroup core
  4021. + */
  4022. +OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_Deinit(void);
  4023. +
  4024. +
  4025. +/** The OMX_ComponentNameEnum method will enumerate through all the names of
  4026. + recognised valid components in the system. This function is provided
  4027. + as a means to detect all the components in the system run-time. There is
  4028. + no strict ordering to the enumeration order of component names, although
  4029. + each name will only be enumerated once. If the OMX core supports run-time
  4030. + installation of new components, it is only requried to detect newly
  4031. + installed components when the first call to enumerate component names
  4032. + is made (i.e. when nIndex is 0x0).
  4033. +
  4034. + The core should return from this call in 20 msec.
  4035. +
  4036. + @param [out] cComponentName
  4037. + pointer to a null terminated string with the component name. The
  4038. + names of the components are strings less than 127 bytes in length
  4039. + plus the trailing null for a maximum size of 128 bytes. An example
  4040. + of a valid component name is "OMX.TI.AUDIO.DSP.MIXER\0". Names are
  4041. + assigned by the vendor, but shall start with "OMX." and then have
  4042. + the Vendor designation next.
  4043. + @param [in] nNameLength
  4044. + number of characters in the cComponentName string. With all
  4045. + component name strings restricted to less than 128 characters
  4046. + (including the trailing null) it is recomended that the caller
  4047. + provide a input string for the cComponentName of 128 characters.
  4048. + @param [in] nIndex
  4049. + number containing the enumeration index for the component.
  4050. + Multiple calls to OMX_ComponentNameEnum with increasing values
  4051. + of nIndex will enumerate through the component names in the
  4052. + system until OMX_ErrorNoMore is returned. The value of nIndex
  4053. + is 0 to (N-1), where N is the number of valid installed components
  4054. + in the system.
  4055. + @return OMX_ERRORTYPE
  4056. + If the command successfully executes, the return code will be
  4057. + OMX_ErrorNone. When the value of nIndex exceeds the number of
  4058. + components in the system minus 1, OMX_ErrorNoMore will be
  4059. + returned. Otherwise the appropriate OMX error will be returned.
  4060. + @ingroup core
  4061. + */
  4062. +OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_ComponentNameEnum(
  4063. + OMX_OUT OMX_STRING cComponentName,
  4064. + OMX_IN OMX_U32 nNameLength,
  4065. + OMX_IN OMX_U32 nIndex);
  4066. +
  4067. +
  4068. +/** The OMX_GetHandle method will locate the component specified by the
  4069. + component name given, load that component into memory and then invoke
  4070. + the component's methods to create an instance of the component.
  4071. +
  4072. + The core should return from this call within 20 msec.
  4073. +
  4074. + @param [out] pHandle
  4075. + pointer to an OMX_HANDLETYPE pointer to be filled in by this method.
  4076. + @param [in] cComponentName
  4077. + pointer to a null terminated string with the component name. The
  4078. + names of the components are strings less than 127 bytes in length
  4079. + plus the trailing null for a maximum size of 128 bytes. An example
  4080. + of a valid component name is "OMX.TI.AUDIO.DSP.MIXER\0". Names are
  4081. + assigned by the vendor, but shall start with "OMX." and then have
  4082. + the Vendor designation next.
  4083. + @param [in] pAppData
  4084. + pointer to an application defined value that will be returned
  4085. + during callbacks so that the application can identify the source
  4086. + of the callback.
  4087. + @param [in] pCallBacks
  4088. + pointer to a OMX_CALLBACKTYPE structure that will be passed to the
  4089. + component to initialize it with.
  4090. + @return OMX_ERRORTYPE
  4091. + If the command successfully executes, the return code will be
  4092. + OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
  4093. + @ingroup core
  4094. + */
  4095. +OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_GetHandle(
  4096. + OMX_OUT OMX_HANDLETYPE* pHandle,
  4097. + OMX_IN OMX_STRING cComponentName,
  4098. + OMX_IN OMX_PTR pAppData,
  4099. + OMX_IN OMX_CALLBACKTYPE* pCallBacks);
  4100. +
  4101. +
  4102. +/** The OMX_FreeHandle method will free a handle allocated by the OMX_GetHandle
  4103. + method. If the component reference count goes to zero, the component will
  4104. + be unloaded from memory.
  4105. +
  4106. + The core should return from this call within 20 msec when the component is
  4107. + in the OMX_StateLoaded state.
  4108. +
  4109. + @param [in] hComponent
  4110. + Handle of the component to be accessed. This is the component
  4111. + handle returned by the call to the GetHandle function.
  4112. + @return OMX_ERRORTYPE
  4113. + If the command successfully executes, the return code will be
  4114. + OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
  4115. + @ingroup core
  4116. + */
  4117. +OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_FreeHandle(
  4118. + OMX_IN OMX_HANDLETYPE hComponent);
  4119. +
  4120. +
  4121. +
  4122. +/** The OMX_SetupTunnel method will handle the necessary calls to the components
  4123. + to setup the specified tunnel the two components. NOTE: This is
  4124. + an actual method (not a #define macro). This method will make calls into
  4125. + the component ComponentTunnelRequest method to do the actual tunnel
  4126. + connection.
  4127. +
  4128. + The ComponentTunnelRequest method on both components will be called.
  4129. + This method shall not be called unless the component is in the
  4130. + OMX_StateLoaded state except when the ports used for the tunnel are
  4131. + disabled. In this case, the component may be in the OMX_StateExecuting,
  4132. + OMX_StatePause, or OMX_StateIdle states.
  4133. +
  4134. + The core should return from this call within 20 msec.
  4135. +
  4136. + @param [in] hOutput
  4137. + Handle of the component to be accessed. Also this is the handle
  4138. + of the component whose port, specified in the nPortOutput parameter
  4139. + will be used the source for the tunnel. This is the component handle
  4140. + returned by the call to the OMX_GetHandle function. There is a
  4141. + requirement that hOutput be the source for the data when
  4142. + tunelling (i.e. nPortOutput is an output port). If 0x0, the component
  4143. + specified in hInput will have it's port specified in nPortInput
  4144. + setup for communication with the application / IL client.
  4145. + @param [in] nPortOutput
  4146. + nPortOutput is used to select the source port on component to be
  4147. + used in the tunnel.
  4148. + @param [in] hInput
  4149. + This is the component to setup the tunnel with. This is the handle
  4150. + of the component whose port, specified in the nPortInput parameter
  4151. + will be used the destination for the tunnel. This is the component handle
  4152. + returned by the call to the OMX_GetHandle function. There is a
  4153. + requirement that hInput be the destination for the data when
  4154. + tunelling (i.e. nPortInut is an input port). If 0x0, the component
  4155. + specified in hOutput will have it's port specified in nPortPOutput
  4156. + setup for communication with the application / IL client.
  4157. + @param [in] nPortInput
  4158. + nPortInput is used to select the destination port on component to be
  4159. + used in the tunnel.
  4160. + @return OMX_ERRORTYPE
  4161. + If the command successfully executes, the return code will be
  4162. + OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
  4163. + When OMX_ErrorNotImplemented is returned, one or both components is
  4164. + a non-interop component and does not support tunneling.
  4165. +
  4166. + On failure, the ports of both components are setup for communication
  4167. + with the application / IL Client.
  4168. + @ingroup core tun
  4169. + */
  4170. +OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_SetupTunnel(
  4171. + OMX_IN OMX_HANDLETYPE hOutput,
  4172. + OMX_IN OMX_U32 nPortOutput,
  4173. + OMX_IN OMX_HANDLETYPE hInput,
  4174. + OMX_IN OMX_U32 nPortInput);
  4175. +
  4176. +/** @ingroup cp */
  4177. +OMX_API OMX_ERRORTYPE OMX_GetContentPipe(
  4178. + OMX_OUT OMX_HANDLETYPE *hPipe,
  4179. + OMX_IN OMX_STRING szURI);
  4180. +
  4181. +/** The OMX_GetComponentsOfRole method will return the number of components that support the given
  4182. + role and (if the compNames field is non-NULL) the names of those components. The call will fail if
  4183. + an insufficiently sized array of names is supplied. To ensure the array is sufficiently sized the
  4184. + client should:
  4185. + * first call this function with the compNames field NULL to determine the number of component names
  4186. + * second call this function with the compNames field pointing to an array of names allocated
  4187. + according to the number returned by the first call.
  4188. +
  4189. + The core should return from this call within 5 msec.
  4190. +
  4191. + @param [in] role
  4192. + This is generic standard component name consisting only of component class
  4193. + name and the type within that class (e.g. 'audio_decoder.aac').
  4194. + @param [inout] pNumComps
  4195. + This is used both as input and output.
  4196. +
  4197. + If compNames is NULL, the input is ignored and the output specifies how many components support
  4198. + the given role.
  4199. +
  4200. + If compNames is not NULL, on input it bounds the size of the input structure and
  4201. + on output, it specifies the number of components string names listed within the compNames parameter.
  4202. + @param [inout] compNames
  4203. + If NULL this field is ignored. If non-NULL this points to an array of 128-byte strings which accepts
  4204. + a list of the names of all physical components that implement the specified standard component name.
  4205. + Each name is NULL terminated. numComps indicates the number of names.
  4206. + @ingroup core
  4207. + */
  4208. +OMX_API OMX_ERRORTYPE OMX_GetComponentsOfRole (
  4209. + OMX_IN OMX_STRING role,
  4210. + OMX_INOUT OMX_U32 *pNumComps,
  4211. + OMX_INOUT OMX_U8 **compNames);
  4212. +
  4213. +/** The OMX_GetRolesOfComponent method will return the number of roles supported by the given
  4214. + component and (if the roles field is non-NULL) the names of those roles. The call will fail if
  4215. + an insufficiently sized array of names is supplied. To ensure the array is sufficiently sized the
  4216. + client should:
  4217. + * first call this function with the roles field NULL to determine the number of role names
  4218. + * second call this function with the roles field pointing to an array of names allocated
  4219. + according to the number returned by the first call.
  4220. +
  4221. + The core should return from this call within 5 msec.
  4222. +
  4223. + @param [in] compName
  4224. + This is the name of the component being queried about.
  4225. + @param [inout] pNumRoles
  4226. + This is used both as input and output.
  4227. +
  4228. + If roles is NULL, the input is ignored and the output specifies how many roles the component supports.
  4229. +
  4230. + If compNames is not NULL, on input it bounds the size of the input structure and
  4231. + on output, it specifies the number of roles string names listed within the roles parameter.
  4232. + @param [out] roles
  4233. + If NULL this field is ignored. If non-NULL this points to an array of 128-byte strings
  4234. + which accepts a list of the names of all standard components roles implemented on the
  4235. + specified component name. numComps indicates the number of names.
  4236. + @ingroup core
  4237. + */
  4238. +OMX_API OMX_ERRORTYPE OMX_GetRolesOfComponent (
  4239. + OMX_IN OMX_STRING compName,
  4240. + OMX_INOUT OMX_U32 *pNumRoles,
  4241. + OMX_OUT OMX_U8 **roles);
  4242. +
  4243. +#ifdef __cplusplus
  4244. +}
  4245. +#endif /* __cplusplus */
  4246. +
  4247. +#endif
  4248. +/* File EOF */
  4249. +
  4250. diff --git a/encoder/include/khronos/OMX_CoreExt.h b/encoder/include/khronos/OMX_CoreExt.h
  4251. new file mode 100755
  4252. index 0000000..e2e21cc
  4253. --- /dev/null
  4254. +++ b/encoder/include/khronos/OMX_CoreExt.h
  4255. @@ -0,0 +1,73 @@
  4256. +/*
  4257. + * Copyright (c) 2016 The Khronos Group Inc.
  4258. + *
  4259. + * Permission is hereby granted, free of charge, to any person obtaining
  4260. + * a copy of this software and associated documentation files (the
  4261. + * "Software"), to deal in the Software without restriction, including
  4262. + * without limitation the rights to use, copy, modify, merge, publish,
  4263. + * distribute, sublicense, and/or sell copies of the Software, and to
  4264. + * permit persons to whom the Software is furnished to do so, subject
  4265. + * to the following conditions:
  4266. + * The above copyright notice and this permission notice shall be included
  4267. + * in all copies or substantial portions of the Software.
  4268. + *
  4269. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  4270. + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  4271. + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  4272. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
  4273. + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  4274. + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  4275. + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  4276. + *
  4277. + */
  4278. +
  4279. +/** OMX_CoreExt.h - OpenMax IL version 1.1.2
  4280. + * The OMX_CoreExt header file contains extensions to the definitions used
  4281. + * by both the application and the component to access common items.
  4282. + */
  4283. +
  4284. +#ifndef OMX_CoreExt_h
  4285. +#define OMX_CoreExt_h
  4286. +
  4287. +#ifdef __cplusplus
  4288. +extern "C" {
  4289. +#endif /* __cplusplus */
  4290. +
  4291. +/* Each OMX header shall include all required header files to allow the
  4292. + * header to compile without errors. The includes below are required
  4293. + * for this header file to compile successfully
  4294. + */
  4295. +#include <OMX_Core.h>
  4296. +
  4297. +/** Extensions to the standard IL errors. */
  4298. +typedef enum OMX_ERROREXTTYPE
  4299. +{
  4300. + OMX_ErrorInvalidMode = (OMX_S32) (OMX_ErrorKhronosExtensions + 0x00000001),
  4301. + OMX_ErrorExtMax = 0x7FFFFFFF
  4302. +} OMX_ERROREXTTYPE;
  4303. +
  4304. +
  4305. +/** Event type extensions. */
  4306. +typedef enum OMX_EVENTEXTTYPE
  4307. +{
  4308. + OMX_EventIndexSettingChanged = OMX_EventKhronosExtensions, /**< component signals the IL client of a change
  4309. + in a param, config, or extension */
  4310. + OMX_EventExtMax = 0x7FFFFFFF
  4311. +} OMX_EVENTEXTTYPE;
  4312. +
  4313. +
  4314. +/** Enable or disable a callback event. */
  4315. +typedef struct OMX_CONFIG_CALLBACKREQUESTTYPE {
  4316. + OMX_U32 nSize; /**< size of the structure in bytes */
  4317. + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  4318. + OMX_U32 nPortIndex; /**< port that this structure applies to */
  4319. + OMX_INDEXTYPE nIndex; /**< the index the callback is requested for */
  4320. + OMX_BOOL bEnable; /**< enable (OMX_TRUE) or disable (OMX_FALSE) the callback */
  4321. +} OMX_CONFIG_CALLBACKREQUESTTYPE;
  4322. +
  4323. +#ifdef __cplusplus
  4324. +}
  4325. +#endif /* __cplusplus */
  4326. +
  4327. +#endif /* OMX_CoreExt_h */
  4328. +/* File EOF */
  4329. diff --git a/encoder/include/khronos/OMX_IVCommon.h b/encoder/include/khronos/OMX_IVCommon.h
  4330. new file mode 100755
  4331. index 0000000..9aad7e9
  4332. --- /dev/null
  4333. +++ b/encoder/include/khronos/OMX_IVCommon.h
  4334. @@ -0,0 +1,993 @@
  4335. +/**
  4336. + * Copyright (c) 2008 The Khronos Group Inc.
  4337. + *
  4338. + * Permission is hereby granted, free of charge, to any person obtaining
  4339. + * a copy of this software and associated documentation files (the
  4340. + * "Software"), to deal in the Software without restriction, including
  4341. + * without limitation the rights to use, copy, modify, merge, publish,
  4342. + * distribute, sublicense, and/or sell copies of the Software, and to
  4343. + * permit persons to whom the Software is furnished to do so, subject
  4344. + * to the following conditions:
  4345. + * The above copyright notice and this permission notice shall be included
  4346. + * in all copies or substantial portions of the Software.
  4347. + *
  4348. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  4349. + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  4350. + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  4351. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
  4352. + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  4353. + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  4354. + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  4355. + *
  4356. + */
  4357. +
  4358. +/**
  4359. + * @file OMX_IVCommon.h - OpenMax IL version 1.1.2
  4360. + * The structures needed by Video and Image components to exchange
  4361. + * parameters and configuration data with the components.
  4362. + */
  4363. +#ifndef OMX_IVCommon_h
  4364. +#define OMX_IVCommon_h
  4365. +
  4366. +#ifdef __cplusplus
  4367. +extern "C" {
  4368. +#endif /* __cplusplus */
  4369. +
  4370. +/**
  4371. + * Each OMX header must include all required header files to allow the header
  4372. + * to compile without errors. The includes below are required for this header
  4373. + * file to compile successfully
  4374. + */
  4375. +
  4376. +#include <OMX_Core.h>
  4377. +
  4378. +/** @defgroup iv OpenMAX IL Imaging and Video Domain
  4379. + * Common structures for OpenMAX IL Imaging and Video domains
  4380. + * @{
  4381. + */
  4382. +
  4383. +
  4384. +/**
  4385. + * Enumeration defining possible uncompressed image/video formats.
  4386. + *
  4387. + * ENUMS:
  4388. + * Unused : Placeholder value when format is N/A
  4389. + * Monochrome : black and white
  4390. + * 8bitRGB332 : Red 7:5, Green 4:2, Blue 1:0
  4391. + * 12bitRGB444 : Red 11:8, Green 7:4, Blue 3:0
  4392. + * 16bitARGB4444 : Alpha 15:12, Red 11:8, Green 7:4, Blue 3:0
  4393. + * 16bitARGB1555 : Alpha 15, Red 14:10, Green 9:5, Blue 4:0
  4394. + * 16bitRGB565 : Red 15:11, Green 10:5, Blue 4:0
  4395. + * 16bitBGR565 : Blue 15:11, Green 10:5, Red 4:0
  4396. + * 18bitRGB666 : Red 17:12, Green 11:6, Blue 5:0
  4397. + * 18bitARGB1665 : Alpha 17, Red 16:11, Green 10:5, Blue 4:0
  4398. + * 19bitARGB1666 : Alpha 18, Red 17:12, Green 11:6, Blue 5:0
  4399. + * 24bitRGB888 : Red 24:16, Green 15:8, Blue 7:0
  4400. + * 24bitBGR888 : Blue 24:16, Green 15:8, Red 7:0
  4401. + * 24bitARGB1887 : Alpha 23, Red 22:15, Green 14:7, Blue 6:0
  4402. + * 25bitARGB1888 : Alpha 24, Red 23:16, Green 15:8, Blue 7:0
  4403. + * 32bitBGRA8888 : Blue 31:24, Green 23:16, Red 15:8, Alpha 7:0
  4404. + * 32bitARGB8888 : Alpha 31:24, Red 23:16, Green 15:8, Blue 7:0
  4405. + * YUV411Planar : U,Y are subsampled by a factor of 4 horizontally
  4406. + * YUV411PackedPlanar : packed per payload in planar slices
  4407. + * YUV420Planar : Three arrays Y,U,V.
  4408. + * YUV420PackedPlanar : packed per payload in planar slices
  4409. + * YUV420SemiPlanar : Two arrays, one is all Y, the other is U and V
  4410. + * YUV422Planar : Three arrays Y,U,V.
  4411. + * YUV422PackedPlanar : packed per payload in planar slices
  4412. + * YUV422SemiPlanar : Two arrays, one is all Y, the other is U and V
  4413. + * YCbYCr : Organized as 16bit YUYV (i.e. YCbYCr)
  4414. + * YCrYCb : Organized as 16bit YVYU (i.e. YCrYCb)
  4415. + * CbYCrY : Organized as 16bit UYVY (i.e. CbYCrY)
  4416. + * CrYCbY : Organized as 16bit VYUY (i.e. CrYCbY)
  4417. + * YUV444Interleaved : Each pixel contains equal parts YUV
  4418. + * RawBayer8bit : SMIA camera output format
  4419. + * RawBayer10bit : SMIA camera output format
  4420. + * RawBayer8bitcompressed : SMIA camera output format
  4421. + */
  4422. +typedef enum OMX_COLOR_FORMATTYPE {
  4423. + OMX_COLOR_FormatUnused,
  4424. + OMX_COLOR_FormatMonochrome,
  4425. + OMX_COLOR_Format8bitRGB332,
  4426. + OMX_COLOR_Format12bitRGB444,
  4427. + OMX_COLOR_Format16bitARGB4444,
  4428. + OMX_COLOR_Format16bitARGB1555,
  4429. + OMX_COLOR_Format16bitRGB565,
  4430. + OMX_COLOR_Format16bitBGR565,
  4431. + OMX_COLOR_Format18bitRGB666,
  4432. + OMX_COLOR_Format18bitARGB1665,
  4433. + OMX_COLOR_Format19bitARGB1666,
  4434. + OMX_COLOR_Format24bitRGB888,
  4435. + OMX_COLOR_Format24bitBGR888,
  4436. + OMX_COLOR_Format24bitARGB1887,
  4437. + OMX_COLOR_Format25bitARGB1888,
  4438. + OMX_COLOR_Format32bitBGRA8888,
  4439. + OMX_COLOR_Format32bitARGB8888,
  4440. + OMX_COLOR_FormatYUV411Planar,
  4441. + OMX_COLOR_FormatYUV411PackedPlanar,
  4442. + OMX_COLOR_FormatYUV420Planar,
  4443. + OMX_COLOR_FormatYUV420PackedPlanar,
  4444. + OMX_COLOR_FormatYUV420SemiPlanar,
  4445. + OMX_COLOR_FormatYUV422Planar,
  4446. + OMX_COLOR_FormatYUV422PackedPlanar,
  4447. + OMX_COLOR_FormatYUV422SemiPlanar,
  4448. + OMX_COLOR_FormatYCbYCr,
  4449. + OMX_COLOR_FormatYCrYCb,
  4450. + OMX_COLOR_FormatCbYCrY,
  4451. + OMX_COLOR_FormatCrYCbY,
  4452. + OMX_COLOR_FormatYUV444Interleaved,
  4453. + OMX_COLOR_FormatRawBayer8bit,
  4454. + OMX_COLOR_FormatRawBayer10bit,
  4455. + OMX_COLOR_FormatRawBayer8bitcompressed,
  4456. + OMX_COLOR_FormatL2,
  4457. + OMX_COLOR_FormatL4,
  4458. + OMX_COLOR_FormatL8,
  4459. + OMX_COLOR_FormatL16,
  4460. + OMX_COLOR_FormatL24,
  4461. + OMX_COLOR_FormatL32,
  4462. + OMX_COLOR_FormatYUV420PackedSemiPlanar,
  4463. + OMX_COLOR_FormatYUV422PackedSemiPlanar,
  4464. + OMX_COLOR_Format18BitBGR666,
  4465. + OMX_COLOR_Format24BitARGB6666,
  4466. + OMX_COLOR_Format24BitABGR6666,
  4467. + OMX_COLOR_FormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  4468. + OMX_COLOR_FormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  4469. +
  4470. + /* Starfive extensions */
  4471. + /* I420 */
  4472. + OMX_COLOR_FormatYUV420Planar_P10_16BIT_MSB,
  4473. + OMX_COLOR_FormatYUV420Planar_P10_16BIT_LSB,
  4474. + OMX_COLOR_FormatYUV420Planar_P12_16BIT_MSB,
  4475. + OMX_COLOR_FormatYUV420Planar_P12_16BIT_LSB,
  4476. + /* NV12 */
  4477. + OMX_COLOR_FormatYUV420SemiPlanar_P10_16BIT_MSB,
  4478. + OMX_COLOR_FormatYUV420SemiPlanar_P10_16BIT_LSB,
  4479. + OMX_COLOR_FormatYUV420SemiPlanar_P12_16BIT_MSB,
  4480. + OMX_COLOR_FormatYUV420SemiPlanar_P12_16BIT_LSB,
  4481. + /* NV21 */
  4482. + OMX_COLOR_FormatYVU420SemiPlanar,
  4483. + OMX_COLOR_FormatYVU420SemiPlanar_P10_16BIT_MSB,
  4484. + OMX_COLOR_FormatYVU420SemiPlanar_P10_16BIT_LSB,
  4485. + OMX_COLOR_FormatYVU420SemiPlanar_P12_16BIT_MSB,
  4486. + OMX_COLOR_FormatYVU420SemiPlanar_P12_16BIT_LSB,
  4487. + /* I422 */
  4488. + OMX_COLOR_FormatYUV422Planar_P10_16BIT_MSB,
  4489. + OMX_COLOR_FormatYUV422Planar_P10_16BIT_LSB,
  4490. + OMX_COLOR_FormatYUV422Planar_P12_16BIT_MSB,
  4491. + OMX_COLOR_FormatYUV422Planar_P12_16BIT_LSB,
  4492. + /* NV16 */
  4493. + OMX_COLOR_FormatYUV422SemiPlanar_P10_16BIT_MSB,
  4494. + OMX_COLOR_FormatYUV422SemiPlanar_P10_16BIT_LSB,
  4495. + OMX_COLOR_FormatYUV422SemiPlanar_P12_16BIT_MSB,
  4496. + OMX_COLOR_FormatYUV422SemiPlanar_P12_16BIT_LSB,
  4497. + /* NV61 */
  4498. + OMX_COLOR_FormatYVU422SemiPlanar,
  4499. + OMX_COLOR_FormatYVU422SemiPlanar_P10_16BIT_MSB,
  4500. + OMX_COLOR_FormatYVU422SemiPlanar_P10_16BIT_LSB,
  4501. + OMX_COLOR_FormatYVU422SemiPlanar_P12_16BIT_MSB,
  4502. + OMX_COLOR_FormatYVU422SemiPlanar_P12_16BIT_LSB,
  4503. + /* YUYV */
  4504. + OMX_COLOR_FormatYCbYCr_P10_16BIT_MSB,
  4505. + OMX_COLOR_FormatYCbYCr_P10_16BIT_LSB,
  4506. + OMX_COLOR_FormatYCbYCr_P12_16BIT_MSB,
  4507. + OMX_COLOR_FormatYCbYCr_P12_16BIT_LSB,
  4508. + /* YVYU */
  4509. + OMX_COLOR_FormatYCrYCb_P10_16BIT_MSB,
  4510. + OMX_COLOR_FormatYCrYCb_P10_16BIT_LSB,
  4511. + OMX_COLOR_FormatYCrYCb_P12_16BIT_MSB,
  4512. + OMX_COLOR_FormatYCrYCb_P12_16BIT_LSB,
  4513. + /* UYVY */
  4514. + OMX_COLOR_FormatCbYCrY_P10_16BIT_MSB,
  4515. + OMX_COLOR_FormatCbYCrY_P10_16BIT_LSB,
  4516. + OMX_COLOR_FormatCbYCrY_P12_16BIT_MSB,
  4517. + OMX_COLOR_FormatCbYCrY_P12_16BIT_LSB,
  4518. + /* VYUY */
  4519. + OMX_COLOR_FormatCrYCbY_P10_16BIT_MSB,
  4520. + OMX_COLOR_FormatCrYCbY_P10_16BIT_LSB,
  4521. + OMX_COLOR_FormatCrYCbY_P12_16BIT_MSB,
  4522. + OMX_COLOR_FormatCrYCbY_P12_16BIT_LSB,
  4523. + /* I444 */
  4524. + OMX_COLOR_FormatYUV444Planar,
  4525. + OMX_COLOR_FormatYUV444Planar_P10_16BIT_MSB,
  4526. + OMX_COLOR_FormatYUV444Planar_P10_16BIT_LSB,
  4527. + OMX_COLOR_FormatYUV444Planar_P12_16BIT_MSB,
  4528. + OMX_COLOR_FormatYUV444Planar_P12_16BIT_LSB,
  4529. + /* YUV444PACKED */
  4530. + OMX_COLOR_FormatYUV444Interleaved_P10_16BIT_MSB,
  4531. + OMX_COLOR_FormatYUV444Interleaved_P10_16BIT_LSB,
  4532. + OMX_COLOR_FormatYUV444Interleaved_P12_16BIT_MSB,
  4533. + OMX_COLOR_FormatYUV444Interleaved_P12_16BIT_LSB,
  4534. + /* YUV400 */
  4535. + OMX_COLOR_FormatYUV400,
  4536. + OMX_COLOR_FormatYUV400_P10_16BIT_MSB,
  4537. + OMX_COLOR_FormatYUV400_P10_16BIT_LSB,
  4538. + OMX_COLOR_FormatYUV400_P12_16BIT_MSB,
  4539. + OMX_COLOR_FormatYUV400_P12_16BIT_LSB,
  4540. + /* Starfive extensions end */
  4541. +
  4542. + OMX_COLOR_FormatMax = 0x7FFFFFFF
  4543. +} OMX_COLOR_FORMATTYPE;
  4544. +
  4545. +
  4546. +/**
  4547. + * Defines the matrix for conversion from RGB to YUV or vice versa.
  4548. + * iColorMatrix should be initialized with the fixed point values
  4549. + * used in converting between formats.
  4550. + */
  4551. +typedef struct OMX_CONFIG_COLORCONVERSIONTYPE {
  4552. + OMX_U32 nSize; /**< Size of the structure in bytes */
  4553. + OMX_VERSIONTYPE nVersion; /**< OMX specification version info */
  4554. + OMX_U32 nPortIndex; /**< Port that this struct applies to */
  4555. + OMX_S32 xColorMatrix[3][3]; /**< Stored in signed Q16 format */
  4556. + OMX_S32 xColorOffset[4]; /**< Stored in signed Q16 format */
  4557. +} OMX_CONFIG_COLORCONVERSIONTYPE;
  4558. +
  4559. +
  4560. +/**
  4561. + * Structure defining percent to scale each frame dimension. For example:
  4562. + * To make the width 50% larger, use fWidth = 1.5 and to make the width
  4563. + * 1/2 the original size, use fWidth = 0.5
  4564. + */
  4565. +typedef struct OMX_CONFIG_SCALEFACTORTYPE {
  4566. + OMX_U32 nSize; /**< Size of the structure in bytes */
  4567. + OMX_VERSIONTYPE nVersion; /**< OMX specification version info */
  4568. + OMX_U32 nPortIndex; /**< Port that this struct applies to */
  4569. + OMX_S32 xWidth; /**< Fixed point value stored as Q16 */
  4570. + OMX_S32 xHeight; /**< Fixed point value stored as Q16 */
  4571. +} OMX_CONFIG_SCALEFACTORTYPE;
  4572. +
  4573. +
  4574. +/**
  4575. + * Enumeration of possible image filter types
  4576. + */
  4577. +typedef enum OMX_IMAGEFILTERTYPE {
  4578. + OMX_ImageFilterNone,
  4579. + OMX_ImageFilterNoise,
  4580. + OMX_ImageFilterEmboss,
  4581. + OMX_ImageFilterNegative,
  4582. + OMX_ImageFilterSketch,
  4583. + OMX_ImageFilterOilPaint,
  4584. + OMX_ImageFilterHatch,
  4585. + OMX_ImageFilterGpen,
  4586. + OMX_ImageFilterAntialias,
  4587. + OMX_ImageFilterDeRing,
  4588. + OMX_ImageFilterSolarize,
  4589. + OMX_ImageFilterKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  4590. + OMX_ImageFilterVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  4591. + OMX_ImageFilterMax = 0x7FFFFFFF
  4592. +} OMX_IMAGEFILTERTYPE;
  4593. +
  4594. +
  4595. +/**
  4596. + * Image filter configuration
  4597. + *
  4598. + * STRUCT MEMBERS:
  4599. + * nSize : Size of the structure in bytes
  4600. + * nVersion : OMX specification version information
  4601. + * nPortIndex : Port that this structure applies to
  4602. + * eImageFilter : Image filter type enumeration
  4603. + */
  4604. +typedef struct OMX_CONFIG_IMAGEFILTERTYPE {
  4605. + OMX_U32 nSize;
  4606. + OMX_VERSIONTYPE nVersion;
  4607. + OMX_U32 nPortIndex;
  4608. + OMX_IMAGEFILTERTYPE eImageFilter;
  4609. +} OMX_CONFIG_IMAGEFILTERTYPE;
  4610. +
  4611. +
  4612. +/**
  4613. + * Customized U and V for color enhancement
  4614. + *
  4615. + * STRUCT MEMBERS:
  4616. + * nSize : Size of the structure in bytes
  4617. + * nVersion : OMX specification version information
  4618. + * nPortIndex : Port that this structure applies to
  4619. + * bColorEnhancement : Enable/disable color enhancement
  4620. + * nCustomizedU : Practical values: 16-240, range: 0-255, value set for
  4621. + * U component
  4622. + * nCustomizedV : Practical values: 16-240, range: 0-255, value set for
  4623. + * V component
  4624. + */
  4625. +typedef struct OMX_CONFIG_COLORENHANCEMENTTYPE {
  4626. + OMX_U32 nSize;
  4627. + OMX_VERSIONTYPE nVersion;
  4628. + OMX_U32 nPortIndex;
  4629. + OMX_BOOL bColorEnhancement;
  4630. + OMX_U8 nCustomizedU;
  4631. + OMX_U8 nCustomizedV;
  4632. +} OMX_CONFIG_COLORENHANCEMENTTYPE;
  4633. +
  4634. +
  4635. +/**
  4636. + * Define color key and color key mask
  4637. + *
  4638. + * STRUCT MEMBERS:
  4639. + * nSize : Size of the structure in bytes
  4640. + * nVersion : OMX specification version information
  4641. + * nPortIndex : Port that this structure applies to
  4642. + * nARGBColor : 32bit Alpha, Red, Green, Blue Color
  4643. + * nARGBMask : 32bit Mask for Alpha, Red, Green, Blue channels
  4644. + */
  4645. +typedef struct OMX_CONFIG_COLORKEYTYPE {
  4646. + OMX_U32 nSize;
  4647. + OMX_VERSIONTYPE nVersion;
  4648. + OMX_U32 nPortIndex;
  4649. + OMX_U32 nARGBColor;
  4650. + OMX_U32 nARGBMask;
  4651. +} OMX_CONFIG_COLORKEYTYPE;
  4652. +
  4653. +
  4654. +/**
  4655. + * List of color blend types for pre/post processing
  4656. + *
  4657. + * ENUMS:
  4658. + * None : No color blending present
  4659. + * AlphaConstant : Function is (alpha_constant * src) +
  4660. + * (1 - alpha_constant) * dst)
  4661. + * AlphaPerPixel : Function is (alpha * src) + (1 - alpha) * dst)
  4662. + * Alternate : Function is alternating pixels from src and dst
  4663. + * And : Function is (src & dst)
  4664. + * Or : Function is (src | dst)
  4665. + * Invert : Function is ~src
  4666. + */
  4667. +typedef enum OMX_COLORBLENDTYPE {
  4668. + OMX_ColorBlendNone,
  4669. + OMX_ColorBlendAlphaConstant,
  4670. + OMX_ColorBlendAlphaPerPixel,
  4671. + OMX_ColorBlendAlternate,
  4672. + OMX_ColorBlendAnd,
  4673. + OMX_ColorBlendOr,
  4674. + OMX_ColorBlendInvert,
  4675. + OMX_ColorBlendKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  4676. + OMX_ColorBlendVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  4677. + OMX_ColorBlendMax = 0x7FFFFFFF
  4678. +} OMX_COLORBLENDTYPE;
  4679. +
  4680. +
  4681. +/**
  4682. + * Color blend configuration
  4683. + *
  4684. + * STRUCT MEMBERS:
  4685. + * nSize : Size of the structure in bytes
  4686. + * nVersion : OMX specification version information
  4687. + * nPortIndex : Port that this structure applies to
  4688. + * nRGBAlphaConstant : Constant global alpha values when global alpha is used
  4689. + * eColorBlend : Color blend type enumeration
  4690. + */
  4691. +typedef struct OMX_CONFIG_COLORBLENDTYPE {
  4692. + OMX_U32 nSize;
  4693. + OMX_VERSIONTYPE nVersion;
  4694. + OMX_U32 nPortIndex;
  4695. + OMX_U32 nRGBAlphaConstant;
  4696. + OMX_COLORBLENDTYPE eColorBlend;
  4697. +} OMX_CONFIG_COLORBLENDTYPE;
  4698. +
  4699. +
  4700. +/**
  4701. + * Hold frame dimension
  4702. + *
  4703. + * STRUCT MEMBERS:
  4704. + * nSize : Size of the structure in bytes
  4705. + * nVersion : OMX specification version information
  4706. + * nPortIndex : Port that this structure applies to
  4707. + * nWidth : Frame width in pixels
  4708. + * nHeight : Frame height in pixels
  4709. + */
  4710. +typedef struct OMX_FRAMESIZETYPE {
  4711. + OMX_U32 nSize;
  4712. + OMX_VERSIONTYPE nVersion;
  4713. + OMX_U32 nPortIndex;
  4714. + OMX_U32 nWidth;
  4715. + OMX_U32 nHeight;
  4716. +} OMX_FRAMESIZETYPE;
  4717. +
  4718. +
  4719. +/**
  4720. + * Rotation configuration
  4721. + *
  4722. + * STRUCT MEMBERS:
  4723. + * nSize : Size of the structure in bytes
  4724. + * nVersion : OMX specification version information
  4725. + * nPortIndex : Port that this structure applies to
  4726. + * nRotation : +/- integer rotation value
  4727. + */
  4728. +typedef struct OMX_CONFIG_ROTATIONTYPE {
  4729. + OMX_U32 nSize;
  4730. + OMX_VERSIONTYPE nVersion;
  4731. + OMX_U32 nPortIndex;
  4732. + OMX_S32 nRotation;
  4733. +} OMX_CONFIG_ROTATIONTYPE;
  4734. +
  4735. +
  4736. +/**
  4737. + * Possible mirroring directions for pre/post processing
  4738. + *
  4739. + * ENUMS:
  4740. + * None : No mirroring
  4741. + * Vertical : Vertical mirroring, flip on X axis
  4742. + * Horizontal : Horizontal mirroring, flip on Y axis
  4743. + * Both : Both vertical and horizontal mirroring
  4744. + */
  4745. +typedef enum OMX_MIRRORTYPE {
  4746. + OMX_MirrorNone = 0,
  4747. + OMX_MirrorVertical,
  4748. + OMX_MirrorHorizontal,
  4749. + OMX_MirrorBoth,
  4750. + OMX_MirrorKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  4751. + OMX_MirrorVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  4752. + OMX_MirrorMax = 0x7FFFFFFF
  4753. +} OMX_MIRRORTYPE;
  4754. +
  4755. +
  4756. +/**
  4757. + * Mirroring configuration
  4758. + *
  4759. + * STRUCT MEMBERS:
  4760. + * nSize : Size of the structure in bytes
  4761. + * nVersion : OMX specification version information
  4762. + * nPortIndex : Port that this structure applies to
  4763. + * eMirror : Mirror type enumeration
  4764. + */
  4765. +typedef struct OMX_CONFIG_MIRRORTYPE {
  4766. + OMX_U32 nSize;
  4767. + OMX_VERSIONTYPE nVersion;
  4768. + OMX_U32 nPortIndex;
  4769. + OMX_MIRRORTYPE eMirror;
  4770. +} OMX_CONFIG_MIRRORTYPE;
  4771. +
  4772. +
  4773. +/**
  4774. + * Position information only
  4775. + *
  4776. + * STRUCT MEMBERS:
  4777. + * nSize : Size of the structure in bytes
  4778. + * nVersion : OMX specification version information
  4779. + * nPortIndex : Port that this structure applies to
  4780. + * nX : X coordinate for the point
  4781. + * nY : Y coordinate for the point
  4782. + */
  4783. +typedef struct OMX_CONFIG_POINTTYPE {
  4784. + OMX_U32 nSize;
  4785. + OMX_VERSIONTYPE nVersion;
  4786. + OMX_U32 nPortIndex;
  4787. + OMX_S32 nX;
  4788. + OMX_S32 nY;
  4789. +} OMX_CONFIG_POINTTYPE;
  4790. +
  4791. +
  4792. +/**
  4793. + * Frame size plus position
  4794. + *
  4795. + * STRUCT MEMBERS:
  4796. + * nSize : Size of the structure in bytes
  4797. + * nVersion : OMX specification version information
  4798. + * nPortIndex : Port that this structure applies to
  4799. + * nLeft : X Coordinate of the top left corner of the rectangle
  4800. + * nTop : Y Coordinate of the top left corner of the rectangle
  4801. + * nWidth : Width of the rectangle
  4802. + * nHeight : Height of the rectangle
  4803. + */
  4804. +typedef struct OMX_CONFIG_RECTTYPE {
  4805. + OMX_U32 nSize;
  4806. + OMX_VERSIONTYPE nVersion;
  4807. + OMX_U32 nPortIndex;
  4808. + OMX_S32 nLeft;
  4809. + OMX_S32 nTop;
  4810. + OMX_U32 nWidth;
  4811. + OMX_U32 nHeight;
  4812. +} OMX_CONFIG_RECTTYPE;
  4813. +
  4814. +
  4815. +/**
  4816. + * Deblocking state; it is required to be set up before starting the codec
  4817. + *
  4818. + * STRUCT MEMBERS:
  4819. + * nSize : Size of the structure in bytes
  4820. + * nVersion : OMX specification version information
  4821. + * nPortIndex : Port that this structure applies to
  4822. + * bDeblocking : Enable/disable deblocking mode
  4823. + */
  4824. +typedef struct OMX_PARAM_DEBLOCKINGTYPE {
  4825. + OMX_U32 nSize;
  4826. + OMX_VERSIONTYPE nVersion;
  4827. + OMX_U32 nPortIndex;
  4828. + OMX_BOOL bDeblocking;
  4829. +} OMX_PARAM_DEBLOCKINGTYPE;
  4830. +
  4831. +
  4832. +/**
  4833. + * Stabilization state
  4834. + *
  4835. + * STRUCT MEMBERS:
  4836. + * nSize : Size of the structure in bytes
  4837. + * nVersion : OMX specification version information
  4838. + * nPortIndex : Port that this structure applies to
  4839. + * bStab : Enable/disable frame stabilization state
  4840. + */
  4841. +typedef struct OMX_CONFIG_FRAMESTABTYPE {
  4842. + OMX_U32 nSize;
  4843. + OMX_VERSIONTYPE nVersion;
  4844. + OMX_U32 nPortIndex;
  4845. + OMX_BOOL bStab;
  4846. +} OMX_CONFIG_FRAMESTABTYPE;
  4847. +
  4848. +
  4849. +/**
  4850. + * White Balance control type
  4851. + *
  4852. + * STRUCT MEMBERS:
  4853. + * SunLight : Referenced in JSR-234
  4854. + * Flash : Optimal for device's integrated flash
  4855. + */
  4856. +typedef enum OMX_WHITEBALCONTROLTYPE {
  4857. + OMX_WhiteBalControlOff = 0,
  4858. + OMX_WhiteBalControlAuto,
  4859. + OMX_WhiteBalControlSunLight,
  4860. + OMX_WhiteBalControlCloudy,
  4861. + OMX_WhiteBalControlShade,
  4862. + OMX_WhiteBalControlTungsten,
  4863. + OMX_WhiteBalControlFluorescent,
  4864. + OMX_WhiteBalControlIncandescent,
  4865. + OMX_WhiteBalControlFlash,
  4866. + OMX_WhiteBalControlHorizon,
  4867. + OMX_WhiteBalControlKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  4868. + OMX_WhiteBalControlVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  4869. + OMX_WhiteBalControlMax = 0x7FFFFFFF
  4870. +} OMX_WHITEBALCONTROLTYPE;
  4871. +
  4872. +
  4873. +/**
  4874. + * White Balance control configuration
  4875. + *
  4876. + * STRUCT MEMBERS:
  4877. + * nSize : Size of the structure in bytes
  4878. + * nVersion : OMX specification version information
  4879. + * nPortIndex : Port that this structure applies to
  4880. + * eWhiteBalControl : White balance enumeration
  4881. + */
  4882. +typedef struct OMX_CONFIG_WHITEBALCONTROLTYPE {
  4883. + OMX_U32 nSize;
  4884. + OMX_VERSIONTYPE nVersion;
  4885. + OMX_U32 nPortIndex;
  4886. + OMX_WHITEBALCONTROLTYPE eWhiteBalControl;
  4887. +} OMX_CONFIG_WHITEBALCONTROLTYPE;
  4888. +
  4889. +
  4890. +/**
  4891. + * Exposure control type
  4892. + */
  4893. +typedef enum OMX_EXPOSURECONTROLTYPE {
  4894. + OMX_ExposureControlOff = 0,
  4895. + OMX_ExposureControlAuto,
  4896. + OMX_ExposureControlNight,
  4897. + OMX_ExposureControlBackLight,
  4898. + OMX_ExposureControlSpotLight,
  4899. + OMX_ExposureControlSports,
  4900. + OMX_ExposureControlSnow,
  4901. + OMX_ExposureControlBeach,
  4902. + OMX_ExposureControlLargeAperture,
  4903. + OMX_ExposureControlSmallApperture,
  4904. + OMX_ExposureControlKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  4905. + OMX_ExposureControlVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  4906. + OMX_ExposureControlMax = 0x7FFFFFFF
  4907. +} OMX_EXPOSURECONTROLTYPE;
  4908. +
  4909. +
  4910. +/**
  4911. + * White Balance control configuration
  4912. + *
  4913. + * STRUCT MEMBERS:
  4914. + * nSize : Size of the structure in bytes
  4915. + * nVersion : OMX specification version information
  4916. + * nPortIndex : Port that this structure applies to
  4917. + * eExposureControl : Exposure control enumeration
  4918. + */
  4919. +typedef struct OMX_CONFIG_EXPOSURECONTROLTYPE {
  4920. + OMX_U32 nSize;
  4921. + OMX_VERSIONTYPE nVersion;
  4922. + OMX_U32 nPortIndex;
  4923. + OMX_EXPOSURECONTROLTYPE eExposureControl;
  4924. +} OMX_CONFIG_EXPOSURECONTROLTYPE;
  4925. +
  4926. +
  4927. +/**
  4928. + * Defines sensor supported mode.
  4929. + *
  4930. + * STRUCT MEMBERS:
  4931. + * nSize : Size of the structure in bytes
  4932. + * nVersion : OMX specification version information
  4933. + * nPortIndex : Port that this structure applies to
  4934. + * nFrameRate : Single shot mode is indicated by a 0
  4935. + * bOneShot : Enable for single shot, disable for streaming
  4936. + * sFrameSize : Framesize
  4937. + */
  4938. +typedef struct OMX_PARAM_SENSORMODETYPE {
  4939. + OMX_U32 nSize;
  4940. + OMX_VERSIONTYPE nVersion;
  4941. + OMX_U32 nPortIndex;
  4942. + OMX_U32 nFrameRate;
  4943. + OMX_BOOL bOneShot;
  4944. + OMX_FRAMESIZETYPE sFrameSize;
  4945. +} OMX_PARAM_SENSORMODETYPE;
  4946. +
  4947. +
  4948. +/**
  4949. + * Defines contrast level
  4950. + *
  4951. + * STRUCT MEMBERS:
  4952. + * nSize : Size of the structure in bytes
  4953. + * nVersion : OMX specification version information
  4954. + * nPortIndex : Port that this structure applies to
  4955. + * nContrast : Values allowed for contrast -100 to 100, zero means no change
  4956. + */
  4957. +typedef struct OMX_CONFIG_CONTRASTTYPE {
  4958. + OMX_U32 nSize;
  4959. + OMX_VERSIONTYPE nVersion;
  4960. + OMX_U32 nPortIndex;
  4961. + OMX_S32 nContrast;
  4962. +} OMX_CONFIG_CONTRASTTYPE;
  4963. +
  4964. +
  4965. +/**
  4966. + * Defines brightness level
  4967. + *
  4968. + * STRUCT MEMBERS:
  4969. + * nSize : Size of the structure in bytes
  4970. + * nVersion : OMX specification version information
  4971. + * nPortIndex : Port that this structure applies to
  4972. + * nBrightness : 0-100%
  4973. + */
  4974. +typedef struct OMX_CONFIG_BRIGHTNESSTYPE {
  4975. + OMX_U32 nSize;
  4976. + OMX_VERSIONTYPE nVersion;
  4977. + OMX_U32 nPortIndex;
  4978. + OMX_U32 nBrightness;
  4979. +} OMX_CONFIG_BRIGHTNESSTYPE;
  4980. +
  4981. +
  4982. +/**
  4983. + * Defines backlight level configuration for a video sink, e.g. LCD panel
  4984. + *
  4985. + * STRUCT MEMBERS:
  4986. + * nSize : Size of the structure in bytes
  4987. + * nVersion : OMX specification version information
  4988. + * nPortIndex : Port that this structure applies to
  4989. + * nBacklight : Values allowed for backlight 0-100%
  4990. + * nTimeout : Number of milliseconds before backlight automatically turns
  4991. + * off. A value of 0x0 disables backight timeout
  4992. + */
  4993. +typedef struct OMX_CONFIG_BACKLIGHTTYPE {
  4994. + OMX_U32 nSize;
  4995. + OMX_VERSIONTYPE nVersion;
  4996. + OMX_U32 nPortIndex;
  4997. + OMX_U32 nBacklight;
  4998. + OMX_U32 nTimeout;
  4999. +} OMX_CONFIG_BACKLIGHTTYPE;
  5000. +
  5001. +
  5002. +/**
  5003. + * Defines setting for Gamma
  5004. + *
  5005. + * STRUCT MEMBERS:
  5006. + * nSize : Size of the structure in bytes
  5007. + * nVersion : OMX specification version information
  5008. + * nPortIndex : Port that this structure applies to
  5009. + * nGamma : Values allowed for gamma -100 to 100, zero means no change
  5010. + */
  5011. +typedef struct OMX_CONFIG_GAMMATYPE {
  5012. + OMX_U32 nSize;
  5013. + OMX_VERSIONTYPE nVersion;
  5014. + OMX_U32 nPortIndex;
  5015. + OMX_S32 nGamma;
  5016. +} OMX_CONFIG_GAMMATYPE;
  5017. +
  5018. +
  5019. +/**
  5020. + * Define for setting saturation
  5021. + *
  5022. + * STRUCT MEMBERS:
  5023. + * nSize : Size of the structure in bytes
  5024. + * nVersion : OMX specification version information
  5025. + * nPortIndex : Port that this structure applies to
  5026. + * nSaturation : Values allowed for saturation -100 to 100, zero means
  5027. + * no change
  5028. + */
  5029. +typedef struct OMX_CONFIG_SATURATIONTYPE {
  5030. + OMX_U32 nSize;
  5031. + OMX_VERSIONTYPE nVersion;
  5032. + OMX_U32 nPortIndex;
  5033. + OMX_S32 nSaturation;
  5034. +} OMX_CONFIG_SATURATIONTYPE;
  5035. +
  5036. +
  5037. +/**
  5038. + * Define for setting Lightness
  5039. + *
  5040. + * STRUCT MEMBERS:
  5041. + * nSize : Size of the structure in bytes
  5042. + * nVersion : OMX specification version information
  5043. + * nPortIndex : Port that this structure applies to
  5044. + * nLightness : Values allowed for lightness -100 to 100, zero means no
  5045. + * change
  5046. + */
  5047. +typedef struct OMX_CONFIG_LIGHTNESSTYPE {
  5048. + OMX_U32 nSize;
  5049. + OMX_VERSIONTYPE nVersion;
  5050. + OMX_U32 nPortIndex;
  5051. + OMX_S32 nLightness;
  5052. +} OMX_CONFIG_LIGHTNESSTYPE;
  5053. +
  5054. +
  5055. +/**
  5056. + * Plane blend configuration
  5057. + *
  5058. + * STRUCT MEMBERS:
  5059. + * nSize : Size of the structure in bytes
  5060. + * nVersion : OMX specification version information
  5061. + * nPortIndex : Index of input port associated with the plane.
  5062. + * nDepth : Depth of the plane in relation to the screen. Higher
  5063. + * numbered depths are "behind" lower number depths.
  5064. + * This number defaults to the Port Index number.
  5065. + * nAlpha : Transparency blending component for the entire plane.
  5066. + * See blending modes for more detail.
  5067. + */
  5068. +typedef struct OMX_CONFIG_PLANEBLENDTYPE {
  5069. + OMX_U32 nSize;
  5070. + OMX_VERSIONTYPE nVersion;
  5071. + OMX_U32 nPortIndex;
  5072. + OMX_U32 nDepth;
  5073. + OMX_U32 nAlpha;
  5074. +} OMX_CONFIG_PLANEBLENDTYPE;
  5075. +
  5076. +
  5077. +/**
  5078. + * Define interlace type
  5079. + *
  5080. + * STRUCT MEMBERS:
  5081. + * nSize : Size of the structure in bytes
  5082. + * nVersion : OMX specification version information
  5083. + * nPortIndex : Port that this structure applies to
  5084. + * bEnable : Enable control variable for this functionality
  5085. + * (see below)
  5086. + * nInterleavePortIndex : Index of input or output port associated with
  5087. + * the interleaved plane.
  5088. + * pPlanarPortIndexes[4] : Index of input or output planar ports.
  5089. + */
  5090. +typedef struct OMX_PARAM_INTERLEAVETYPE {
  5091. + OMX_U32 nSize;
  5092. + OMX_VERSIONTYPE nVersion;
  5093. + OMX_U32 nPortIndex;
  5094. + OMX_BOOL bEnable;
  5095. + OMX_U32 nInterleavePortIndex;
  5096. +} OMX_PARAM_INTERLEAVETYPE;
  5097. +
  5098. +
  5099. +/**
  5100. + * Defines the picture effect used for an input picture
  5101. + */
  5102. +typedef enum OMX_TRANSITIONEFFECTTYPE {
  5103. + OMX_EffectNone,
  5104. + OMX_EffectFadeFromBlack,
  5105. + OMX_EffectFadeToBlack,
  5106. + OMX_EffectUnspecifiedThroughConstantColor,
  5107. + OMX_EffectDissolve,
  5108. + OMX_EffectWipe,
  5109. + OMX_EffectUnspecifiedMixOfTwoScenes,
  5110. + OMX_EffectKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  5111. + OMX_EffectVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  5112. + OMX_EffectMax = 0x7FFFFFFF
  5113. +} OMX_TRANSITIONEFFECTTYPE;
  5114. +
  5115. +
  5116. +/**
  5117. + * Structure used to configure current transition effect
  5118. + *
  5119. + * STRUCT MEMBERS:
  5120. + * nSize : Size of the structure in bytes
  5121. + * nVersion : OMX specification version information
  5122. + * nPortIndex : Port that this structure applies to
  5123. + * eEffect : Effect to enable
  5124. + */
  5125. +typedef struct OMX_CONFIG_TRANSITIONEFFECTTYPE {
  5126. + OMX_U32 nSize;
  5127. + OMX_VERSIONTYPE nVersion;
  5128. + OMX_U32 nPortIndex;
  5129. + OMX_TRANSITIONEFFECTTYPE eEffect;
  5130. +} OMX_CONFIG_TRANSITIONEFFECTTYPE;
  5131. +
  5132. +
  5133. +/**
  5134. + * Defines possible data unit types for encoded video data. The data unit
  5135. + * types are used both for encoded video input for playback as well as
  5136. + * encoded video output from recording.
  5137. + */
  5138. +typedef enum OMX_DATAUNITTYPE {
  5139. + OMX_DataUnitCodedPicture,
  5140. + OMX_DataUnitVideoSegment,
  5141. + OMX_DataUnitSeveralSegments,
  5142. + OMX_DataUnitArbitraryStreamSection,
  5143. + OMX_DataUnitKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  5144. + OMX_DataUnitVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  5145. + OMX_DataUnitMax = 0x7FFFFFFF
  5146. +} OMX_DATAUNITTYPE;
  5147. +
  5148. +
  5149. +/**
  5150. + * Defines possible encapsulation types for coded video data unit. The
  5151. + * encapsulation information is used both for encoded video input for
  5152. + * playback as well as encoded video output from recording.
  5153. + */
  5154. +typedef enum OMX_DATAUNITENCAPSULATIONTYPE {
  5155. + OMX_DataEncapsulationElementaryStream,
  5156. + OMX_DataEncapsulationGenericPayload,
  5157. + OMX_DataEncapsulationRtpPayload,
  5158. + OMX_DataEncapsulationKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  5159. + OMX_DataEncapsulationVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  5160. + OMX_DataEncapsulationMax = 0x7FFFFFFF
  5161. +} OMX_DATAUNITENCAPSULATIONTYPE;
  5162. +
  5163. +
  5164. +/**
  5165. + * Structure used to configure the type of being decoded/encoded
  5166. + */
  5167. +typedef struct OMX_PARAM_DATAUNITTYPE {
  5168. + OMX_U32 nSize; /**< Size of the structure in bytes */
  5169. + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  5170. + OMX_U32 nPortIndex; /**< Port that this structure applies to */
  5171. + OMX_DATAUNITTYPE eUnitType;
  5172. + OMX_DATAUNITENCAPSULATIONTYPE eEncapsulationType;
  5173. +} OMX_PARAM_DATAUNITTYPE;
  5174. +
  5175. +
  5176. +/**
  5177. + * Defines dither types
  5178. + */
  5179. +typedef enum OMX_DITHERTYPE {
  5180. + OMX_DitherNone,
  5181. + OMX_DitherOrdered,
  5182. + OMX_DitherErrorDiffusion,
  5183. + OMX_DitherOther,
  5184. + OMX_DitherKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  5185. + OMX_DitherVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  5186. + OMX_DitherMax = 0x7FFFFFFF
  5187. +} OMX_DITHERTYPE;
  5188. +
  5189. +
  5190. +/**
  5191. + * Structure used to configure current type of dithering
  5192. + */
  5193. +typedef struct OMX_CONFIG_DITHERTYPE {
  5194. + OMX_U32 nSize; /**< Size of the structure in bytes */
  5195. + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  5196. + OMX_U32 nPortIndex; /**< Port that this structure applies to */
  5197. + OMX_DITHERTYPE eDither; /**< Type of dithering to use */
  5198. +} OMX_CONFIG_DITHERTYPE;
  5199. +
  5200. +typedef struct OMX_CONFIG_CAPTUREMODETYPE {
  5201. + OMX_U32 nSize;
  5202. + OMX_VERSIONTYPE nVersion;
  5203. + OMX_U32 nPortIndex; /**< Port that this structure applies to */
  5204. + OMX_BOOL bContinuous; /**< If true then ignore frame rate and emit capture
  5205. + * data as fast as possible (otherwise obey port's frame rate). */
  5206. + OMX_BOOL bFrameLimited; /**< If true then terminate capture after the port emits the
  5207. + * specified number of frames (otherwise the port does not
  5208. + * terminate the capture until instructed to do so by the client).
  5209. + * Even if set, the client may manually terminate the capture prior
  5210. + * to reaching the limit. */
  5211. + OMX_U32 nFrameLimit; /**< Limit on number of frames emitted during a capture (only
  5212. + * valid if bFrameLimited is set). */
  5213. +} OMX_CONFIG_CAPTUREMODETYPE;
  5214. +
  5215. +typedef enum OMX_METERINGTYPE {
  5216. +
  5217. + OMX_MeteringModeAverage, /**< Center-weighted average metering. */
  5218. + OMX_MeteringModeSpot, /**< Spot (partial) metering. */
  5219. + OMX_MeteringModeMatrix, /**< Matrix or evaluative metering. */
  5220. +
  5221. + OMX_MeteringKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  5222. + OMX_MeteringVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  5223. + OMX_EVModeMax = 0x7fffffff
  5224. +} OMX_METERINGTYPE;
  5225. +
  5226. +typedef struct OMX_CONFIG_EXPOSUREVALUETYPE {
  5227. + OMX_U32 nSize;
  5228. + OMX_VERSIONTYPE nVersion;
  5229. + OMX_U32 nPortIndex;
  5230. + OMX_METERINGTYPE eMetering;
  5231. + OMX_S32 xEVCompensation; /**< Fixed point value stored as Q16 */
  5232. + OMX_U32 nApertureFNumber; /**< e.g. nApertureFNumber = 2 implies "f/2" - Q16 format */
  5233. + OMX_BOOL bAutoAperture; /**< Whether aperture number is defined automatically */
  5234. + OMX_U32 nShutterSpeedMsec; /**< Shutterspeed in milliseconds */
  5235. + OMX_BOOL bAutoShutterSpeed; /**< Whether shutter speed is defined automatically */
  5236. + OMX_U32 nSensitivity; /**< e.g. nSensitivity = 100 implies "ISO 100" */
  5237. + OMX_BOOL bAutoSensitivity; /**< Whether sensitivity is defined automatically */
  5238. +} OMX_CONFIG_EXPOSUREVALUETYPE;
  5239. +
  5240. +/**
  5241. + * Focus region configuration
  5242. + *
  5243. + * STRUCT MEMBERS:
  5244. + * nSize : Size of the structure in bytes
  5245. + * nVersion : OMX specification version information
  5246. + * nPortIndex : Port that this structure applies to
  5247. + * bCenter : Use center region as focus region of interest
  5248. + * bLeft : Use left region as focus region of interest
  5249. + * bRight : Use right region as focus region of interest
  5250. + * bTop : Use top region as focus region of interest
  5251. + * bBottom : Use bottom region as focus region of interest
  5252. + * bTopLeft : Use top left region as focus region of interest
  5253. + * bTopRight : Use top right region as focus region of interest
  5254. + * bBottomLeft : Use bottom left region as focus region of interest
  5255. + * bBottomRight : Use bottom right region as focus region of interest
  5256. + */
  5257. +typedef struct OMX_CONFIG_FOCUSREGIONTYPE {
  5258. + OMX_U32 nSize;
  5259. + OMX_VERSIONTYPE nVersion;
  5260. + OMX_U32 nPortIndex;
  5261. + OMX_BOOL bCenter;
  5262. + OMX_BOOL bLeft;
  5263. + OMX_BOOL bRight;
  5264. + OMX_BOOL bTop;
  5265. + OMX_BOOL bBottom;
  5266. + OMX_BOOL bTopLeft;
  5267. + OMX_BOOL bTopRight;
  5268. + OMX_BOOL bBottomLeft;
  5269. + OMX_BOOL bBottomRight;
  5270. +} OMX_CONFIG_FOCUSREGIONTYPE;
  5271. +
  5272. +/**
  5273. + * Focus Status type
  5274. + */
  5275. +typedef enum OMX_FOCUSSTATUSTYPE {
  5276. + OMX_FocusStatusOff = 0,
  5277. + OMX_FocusStatusRequest,
  5278. + OMX_FocusStatusReached,
  5279. + OMX_FocusStatusUnableToReach,
  5280. + OMX_FocusStatusLost,
  5281. + OMX_FocusStatusKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  5282. + OMX_FocusStatusVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  5283. + OMX_FocusStatusMax = 0x7FFFFFFF
  5284. +} OMX_FOCUSSTATUSTYPE;
  5285. +
  5286. +/**
  5287. + * Focus status configuration
  5288. + *
  5289. + * STRUCT MEMBERS:
  5290. + * nSize : Size of the structure in bytes
  5291. + * nVersion : OMX specification version information
  5292. + * nPortIndex : Port that this structure applies to
  5293. + * eFocusStatus : Specifies the focus status
  5294. + * bCenterStatus : Use center region as focus region of interest
  5295. + * bLeftStatus : Use left region as focus region of interest
  5296. + * bRightStatus : Use right region as focus region of interest
  5297. + * bTopStatus : Use top region as focus region of interest
  5298. + * bBottomStatus : Use bottom region as focus region of interest
  5299. + * bTopLeftStatus : Use top left region as focus region of interest
  5300. + * bTopRightStatus : Use top right region as focus region of interest
  5301. + * bBottomLeftStatus : Use bottom left region as focus region of interest
  5302. + * bBottomRightStatus : Use bottom right region as focus region of interest
  5303. + */
  5304. +typedef struct OMX_PARAM_FOCUSSTATUSTYPE {
  5305. + OMX_U32 nSize;
  5306. + OMX_VERSIONTYPE nVersion;
  5307. + OMX_U32 nPortIndex;
  5308. + OMX_FOCUSSTATUSTYPE eFocusStatus;
  5309. + OMX_BOOL bCenterStatus;
  5310. + OMX_BOOL bLeftStatus;
  5311. + OMX_BOOL bRightStatus;
  5312. + OMX_BOOL bTopStatus;
  5313. + OMX_BOOL bBottomStatus;
  5314. + OMX_BOOL bTopLeftStatus;
  5315. + OMX_BOOL bTopRightStatus;
  5316. + OMX_BOOL bBottomLeftStatus;
  5317. + OMX_BOOL bBottomRightStatus;
  5318. +} OMX_PARAM_FOCUSSTATUSTYPE;
  5319. +
  5320. +/** @} */
  5321. +
  5322. +#ifdef __cplusplus
  5323. +}
  5324. +#endif /* __cplusplus */
  5325. +
  5326. +#endif
  5327. +/* File EOF */
  5328. diff --git a/encoder/include/khronos/OMX_Image.h b/encoder/include/khronos/OMX_Image.h
  5329. new file mode 100755
  5330. index 0000000..ca64882
  5331. --- /dev/null
  5332. +++ b/encoder/include/khronos/OMX_Image.h
  5333. @@ -0,0 +1,328 @@
  5334. +/**
  5335. + * Copyright (c) 2008 The Khronos Group Inc.
  5336. + *
  5337. + * Permission is hereby granted, free of charge, to any person obtaining
  5338. + * a copy of this software and associated documentation files (the
  5339. + * "Software"), to deal in the Software without restriction, including
  5340. + * without limitation the rights to use, copy, modify, merge, publish,
  5341. + * distribute, sublicense, and/or sell copies of the Software, and to
  5342. + * permit persons to whom the Software is furnished to do so, subject
  5343. + * to the following conditions:
  5344. + * The above copyright notice and this permission notice shall be included
  5345. + * in all copies or substantial portions of the Software.
  5346. + *
  5347. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  5348. + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  5349. + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  5350. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
  5351. + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  5352. + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  5353. + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  5354. + */
  5355. +
  5356. +/**
  5357. + * @file OMX_Image.h - OpenMax IL version 1.1.2
  5358. + * The structures needed by Image components to exchange parameters and
  5359. + * configuration data with the components.
  5360. + */
  5361. +#ifndef OMX_Image_h
  5362. +#define OMX_Image_h
  5363. +
  5364. +#ifdef __cplusplus
  5365. +extern "C" {
  5366. +#endif /* __cplusplus */
  5367. +
  5368. +
  5369. +/**
  5370. + * Each OMX header must include all required header files to allow the
  5371. + * header to compile without errors. The includes below are required
  5372. + * for this header file to compile successfully
  5373. + */
  5374. +
  5375. +#include <OMX_IVCommon.h>
  5376. +
  5377. +/** @defgroup imaging OpenMAX IL Imaging Domain
  5378. + * @ingroup iv
  5379. + * Structures for OpenMAX IL Imaging domain
  5380. + * @{
  5381. + */
  5382. +
  5383. +/**
  5384. + * Enumeration used to define the possible image compression coding.
  5385. + */
  5386. +typedef enum OMX_IMAGE_CODINGTYPE {
  5387. + OMX_IMAGE_CodingUnused, /**< Value when format is N/A */
  5388. + OMX_IMAGE_CodingAutoDetect, /**< Auto detection of image format */
  5389. + OMX_IMAGE_CodingJPEG, /**< JPEG/JFIF image format */
  5390. + OMX_IMAGE_CodingJPEG2K, /**< JPEG 2000 image format */
  5391. + OMX_IMAGE_CodingEXIF, /**< EXIF image format */
  5392. + OMX_IMAGE_CodingTIFF, /**< TIFF image format */
  5393. + OMX_IMAGE_CodingGIF, /**< Graphics image format */
  5394. + OMX_IMAGE_CodingPNG, /**< PNG image format */
  5395. + OMX_IMAGE_CodingLZW, /**< LZW image format */
  5396. + OMX_IMAGE_CodingBMP, /**< Windows Bitmap format */
  5397. + OMX_IMAGE_CodingKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  5398. + OMX_IMAGE_CodingVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  5399. + OMX_IMAGE_CodingMax = 0x7FFFFFFF
  5400. +} OMX_IMAGE_CODINGTYPE;
  5401. +
  5402. +
  5403. +/**
  5404. + * Data structure used to define an image path. The number of image paths
  5405. + * for input and output will vary by type of the image component.
  5406. + *
  5407. + * Input (aka Source) : Zero Inputs, one Output,
  5408. + * Splitter : One Input, 2 or more Outputs,
  5409. + * Processing Element : One Input, one output,
  5410. + * Mixer : 2 or more inputs, one output,
  5411. + * Output (aka Sink) : One Input, zero outputs.
  5412. + *
  5413. + * The PortDefinition structure is used to define all of the parameters
  5414. + * necessary for the compliant component to setup an input or an output
  5415. + * image path. If additional vendor specific data is required, it should
  5416. + * be transmitted to the component using the CustomCommand function.
  5417. + * Compliant components will prepopulate this structure with optimal
  5418. + * values during the OMX_GetParameter() command.
  5419. + *
  5420. + * STRUCT MEMBERS:
  5421. + * cMIMEType : MIME type of data for the port
  5422. + * pNativeRender : Platform specific reference for a display if a
  5423. + * sync, otherwise this field is 0
  5424. + * nFrameWidth : Width of frame to be used on port if
  5425. + * uncompressed format is used. Use 0 for
  5426. + * unknown, don't care or variable
  5427. + * nFrameHeight : Height of frame to be used on port if
  5428. + * uncompressed format is used. Use 0 for
  5429. + * unknown, don't care or variable
  5430. + * nStride : Number of bytes per span of an image (i.e.
  5431. + * indicates the number of bytes to get from
  5432. + * span N to span N+1, where negative stride
  5433. + * indicates the image is bottom up
  5434. + * nSliceHeight : Height used when encoding in slices
  5435. + * bFlagErrorConcealment : Turns on error concealment if it is supported by
  5436. + * the OMX component
  5437. + * eCompressionFormat : Compression format used in this instance of
  5438. + * the component. When OMX_IMAGE_CodingUnused is
  5439. + * specified, eColorFormat is valid
  5440. + * eColorFormat : Decompressed format used by this component
  5441. + * pNativeWindow : Platform specific reference for a window object if a
  5442. + * display sink , otherwise this field is 0x0.
  5443. + */
  5444. +typedef struct OMX_IMAGE_PORTDEFINITIONTYPE {
  5445. + OMX_STRING cMIMEType;
  5446. + OMX_NATIVE_DEVICETYPE pNativeRender;
  5447. + OMX_U32 nFrameWidth;
  5448. + OMX_U32 nFrameHeight;
  5449. + OMX_S32 nStride;
  5450. + OMX_U32 nSliceHeight;
  5451. + OMX_BOOL bFlagErrorConcealment;
  5452. + OMX_IMAGE_CODINGTYPE eCompressionFormat;
  5453. + OMX_COLOR_FORMATTYPE eColorFormat;
  5454. + OMX_NATIVE_WINDOWTYPE pNativeWindow;
  5455. +} OMX_IMAGE_PORTDEFINITIONTYPE;
  5456. +
  5457. +
  5458. +/**
  5459. + * Port format parameter. This structure is used to enumerate the various
  5460. + * data input/output format supported by the port.
  5461. + *
  5462. + * STRUCT MEMBERS:
  5463. + * nSize : Size of the structure in bytes
  5464. + * nVersion : OMX specification version information
  5465. + * nPortIndex : Indicates which port to set
  5466. + * nIndex : Indicates the enumeration index for the format from
  5467. + * 0x0 to N-1
  5468. + * eCompressionFormat : Compression format used in this instance of the
  5469. + * component. When OMX_IMAGE_CodingUnused is specified,
  5470. + * eColorFormat is valid
  5471. + * eColorFormat : Decompressed format used by this component
  5472. + */
  5473. +typedef struct OMX_IMAGE_PARAM_PORTFORMATTYPE {
  5474. + OMX_U32 nSize;
  5475. + OMX_VERSIONTYPE nVersion;
  5476. + OMX_U32 nPortIndex;
  5477. + OMX_U32 nIndex;
  5478. + OMX_IMAGE_CODINGTYPE eCompressionFormat;
  5479. + OMX_COLOR_FORMATTYPE eColorFormat;
  5480. +} OMX_IMAGE_PARAM_PORTFORMATTYPE;
  5481. +
  5482. +
  5483. +/**
  5484. + * Flash control type
  5485. + *
  5486. + * ENUMS
  5487. + * Torch : Flash forced constantly on
  5488. + */
  5489. +typedef enum OMX_IMAGE_FLASHCONTROLTYPE {
  5490. + OMX_IMAGE_FlashControlOn = 0,
  5491. + OMX_IMAGE_FlashControlOff,
  5492. + OMX_IMAGE_FlashControlAuto,
  5493. + OMX_IMAGE_FlashControlRedEyeReduction,
  5494. + OMX_IMAGE_FlashControlFillin,
  5495. + OMX_IMAGE_FlashControlTorch,
  5496. + OMX_IMAGE_FlashControlKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  5497. + OMX_IMAGE_FlashControlVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  5498. + OMX_IMAGE_FlashControlMax = 0x7FFFFFFF
  5499. +} OMX_IMAGE_FLASHCONTROLTYPE;
  5500. +
  5501. +
  5502. +/**
  5503. + * Flash control configuration
  5504. + *
  5505. + * STRUCT MEMBERS:
  5506. + * nSize : Size of the structure in bytes
  5507. + * nVersion : OMX specification version information
  5508. + * nPortIndex : Port that this structure applies to
  5509. + * eFlashControl : Flash control type
  5510. + */
  5511. +typedef struct OMX_IMAGE_PARAM_FLASHCONTROLTYPE {
  5512. + OMX_U32 nSize;
  5513. + OMX_VERSIONTYPE nVersion;
  5514. + OMX_U32 nPortIndex;
  5515. + OMX_IMAGE_FLASHCONTROLTYPE eFlashControl;
  5516. +} OMX_IMAGE_PARAM_FLASHCONTROLTYPE;
  5517. +
  5518. +
  5519. +/**
  5520. + * Focus control type
  5521. + */
  5522. +typedef enum OMX_IMAGE_FOCUSCONTROLTYPE {
  5523. + OMX_IMAGE_FocusControlOn = 0,
  5524. + OMX_IMAGE_FocusControlOff,
  5525. + OMX_IMAGE_FocusControlAuto,
  5526. + OMX_IMAGE_FocusControlAutoLock,
  5527. + OMX_IMAGE_FocusControlKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  5528. + OMX_IMAGE_FocusControlVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  5529. + OMX_IMAGE_FocusControlMax = 0x7FFFFFFF
  5530. +} OMX_IMAGE_FOCUSCONTROLTYPE;
  5531. +
  5532. +
  5533. +/**
  5534. + * Focus control configuration
  5535. + *
  5536. + * STRUCT MEMBERS:
  5537. + * nSize : Size of the structure in bytes
  5538. + * nVersion : OMX specification version information
  5539. + * nPortIndex : Port that this structure applies to
  5540. + * eFocusControl : Focus control
  5541. + * nFocusSteps : Focus can take on values from 0 mm to infinity.
  5542. + * Interest is only in number of steps over this range.
  5543. + * nFocusStepIndex : Current focus step index
  5544. + */
  5545. +typedef struct OMX_IMAGE_CONFIG_FOCUSCONTROLTYPE {
  5546. + OMX_U32 nSize;
  5547. + OMX_VERSIONTYPE nVersion;
  5548. + OMX_U32 nPortIndex;
  5549. + OMX_IMAGE_FOCUSCONTROLTYPE eFocusControl;
  5550. + OMX_U32 nFocusSteps;
  5551. + OMX_U32 nFocusStepIndex;
  5552. +} OMX_IMAGE_CONFIG_FOCUSCONTROLTYPE;
  5553. +
  5554. +
  5555. +/**
  5556. + * Q Factor for JPEG compression, which controls the tradeoff between image
  5557. + * quality and size. Q Factor provides a more simple means of controlling
  5558. + * JPEG compression quality, without directly programming Quantization
  5559. + * tables for chroma and luma
  5560. + *
  5561. + * STRUCT MEMBERS:
  5562. + * nSize : Size of the structure in bytes
  5563. + * nVersion : OMX specification version information
  5564. + * nPortIndex : Port that this structure applies to
  5565. + * nQFactor : JPEG Q factor value in the range of 1-100. A factor of 1
  5566. + * produces the smallest, worst quality images, and a factor
  5567. + * of 100 produces the largest, best quality images. A
  5568. + * typical default is 75 for small good quality images
  5569. + */
  5570. +typedef struct OMX_IMAGE_PARAM_QFACTORTYPE {
  5571. + OMX_U32 nSize;
  5572. + OMX_VERSIONTYPE nVersion;
  5573. + OMX_U32 nPortIndex;
  5574. + OMX_U32 nQFactor;
  5575. +} OMX_IMAGE_PARAM_QFACTORTYPE;
  5576. +
  5577. +/**
  5578. + * Quantization table type
  5579. + */
  5580. +
  5581. +typedef enum OMX_IMAGE_QUANTIZATIONTABLETYPE {
  5582. + OMX_IMAGE_QuantizationTableLuma = 0,
  5583. + OMX_IMAGE_QuantizationTableChroma,
  5584. + OMX_IMAGE_QuantizationTableChromaCb,
  5585. + OMX_IMAGE_QuantizationTableChromaCr,
  5586. + OMX_IMAGE_QuantizationTableKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  5587. + OMX_IMAGE_QuantizationTableVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  5588. + OMX_IMAGE_QuantizationTableMax = 0x7FFFFFFF
  5589. +} OMX_IMAGE_QUANTIZATIONTABLETYPE;
  5590. +
  5591. +/**
  5592. + * JPEG quantization tables are used to determine DCT compression for
  5593. + * YUV data, as an alternative to specifying Q factor, providing exact
  5594. + * control of compression
  5595. + *
  5596. + * STRUCT MEMBERS:
  5597. + * nSize : Size of the structure in bytes
  5598. + * nVersion : OMX specification version information
  5599. + * nPortIndex : Port that this structure applies to
  5600. + * eQuantizationTable : Quantization table type
  5601. + * nQuantizationMatrix[64] : JPEG quantization table of coefficients stored
  5602. + * in increasing columns then by rows of data (i.e.
  5603. + * row 1, ... row 8). Quantization values are in
  5604. + * the range 0-255 and stored in linear order
  5605. + * (i.e. the component will zig-zag the
  5606. + * quantization table data if required internally)
  5607. + */
  5608. +typedef struct OMX_IMAGE_PARAM_QUANTIZATIONTABLETYPE {
  5609. + OMX_U32 nSize;
  5610. + OMX_VERSIONTYPE nVersion;
  5611. + OMX_U32 nPortIndex;
  5612. + OMX_IMAGE_QUANTIZATIONTABLETYPE eQuantizationTable;
  5613. + OMX_U8 nQuantizationMatrix[64];
  5614. +} OMX_IMAGE_PARAM_QUANTIZATIONTABLETYPE;
  5615. +
  5616. +
  5617. +/**
  5618. + * Huffman table type, the same Huffman table is applied for chroma and
  5619. + * luma component
  5620. + */
  5621. +typedef enum OMX_IMAGE_HUFFMANTABLETYPE {
  5622. + OMX_IMAGE_HuffmanTableAC = 0,
  5623. + OMX_IMAGE_HuffmanTableDC,
  5624. + OMX_IMAGE_HuffmanTableACLuma,
  5625. + OMX_IMAGE_HuffmanTableACChroma,
  5626. + OMX_IMAGE_HuffmanTableDCLuma,
  5627. + OMX_IMAGE_HuffmanTableDCChroma,
  5628. + OMX_IMAGE_HuffmanTableKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  5629. + OMX_IMAGE_HuffmanTableVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  5630. + OMX_IMAGE_HuffmanTableMax = 0x7FFFFFFF
  5631. +} OMX_IMAGE_HUFFMANTABLETYPE;
  5632. +
  5633. +/**
  5634. + * JPEG Huffman table
  5635. + *
  5636. + * STRUCT MEMBERS:
  5637. + * nSize : Size of the structure in bytes
  5638. + * nVersion : OMX specification version information
  5639. + * nPortIndex : Port that this structure applies to
  5640. + * eHuffmanTable : Huffman table type
  5641. + * nNumberOfHuffmanCodeOfLength[16] : 0-16, number of Huffman codes of each
  5642. + * possible length
  5643. + * nHuffmanTable[256] : 0-255, the size used for AC and DC
  5644. + * HuffmanTable are 16 and 162
  5645. + */
  5646. +typedef struct OMX_IMAGE_PARAM_HUFFMANTTABLETYPE {
  5647. + OMX_U32 nSize;
  5648. + OMX_VERSIONTYPE nVersion;
  5649. + OMX_U32 nPortIndex;
  5650. + OMX_IMAGE_HUFFMANTABLETYPE eHuffmanTable;
  5651. + OMX_U8 nNumberOfHuffmanCodeOfLength[16];
  5652. + OMX_U8 nHuffmanTable[256];
  5653. +} OMX_IMAGE_PARAM_HUFFMANTTABLETYPE;
  5654. +
  5655. +/** @} */
  5656. +#ifdef __cplusplus
  5657. +}
  5658. +#endif /* __cplusplus */
  5659. +
  5660. +#endif
  5661. +/* File EOF */
  5662. diff --git a/encoder/include/khronos/OMX_ImageExt.h b/encoder/include/khronos/OMX_ImageExt.h
  5663. new file mode 100755
  5664. index 0000000..e7cae02
  5665. --- /dev/null
  5666. +++ b/encoder/include/khronos/OMX_ImageExt.h
  5667. @@ -0,0 +1,55 @@
  5668. +/*
  5669. + * Copyright (c) 2016 The Khronos Group Inc.
  5670. + *
  5671. + * Permission is hereby granted, free of charge, to any person obtaining
  5672. + * a copy of this software and associated documentation files (the
  5673. + * "Software"), to deal in the Software without restriction, including
  5674. + * without limitation the rights to use, copy, modify, merge, publish,
  5675. + * distribute, sublicense, and/or sell copies of the Software, and to
  5676. + * permit persons to whom the Software is furnished to do so, subject
  5677. + * to the following conditions:
  5678. + * The above copyright notice and this permission notice shall be included
  5679. + * in all copies or substantial portions of the Software.
  5680. + *
  5681. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  5682. + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  5683. + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  5684. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
  5685. + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  5686. + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  5687. + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  5688. + *
  5689. + */
  5690. +
  5691. +/** OMX_ImageExt.h - OpenMax IL version 1.1.2
  5692. + * The OMX_ImageExt header file contains extensions to the
  5693. + * definitions used by both the application and the component to
  5694. + * access image items.
  5695. + */
  5696. +
  5697. +#ifndef OMX_ImageExt_h
  5698. +#define OMX_ImageExt_h
  5699. +
  5700. +#ifdef __cplusplus
  5701. +extern "C" {
  5702. +#endif /* __cplusplus */
  5703. +
  5704. +/* Each OMX header shall include all required header files to allow the
  5705. + * header to compile without errors. The includes below are required
  5706. + * for this header file to compile successfully
  5707. + */
  5708. +#include <OMX_Core.h>
  5709. +
  5710. +/** Enum for standard image codingtype extensions */
  5711. +typedef enum OMX_IMAGE_CODINGEXTTYPE {
  5712. + OMX_IMAGE_CodingExtUnused = OMX_IMAGE_CodingKhronosExtensions,
  5713. + OMX_IMAGE_CodingWEBP, /**< WebP image format */
  5714. +} OMX_IMAGE_CODINGEXTTYPE;
  5715. +
  5716. +
  5717. +#ifdef __cplusplus
  5718. +}
  5719. +#endif /* __cplusplus */
  5720. +
  5721. +#endif /* OMX_ImageExt_h */
  5722. +/* File EOF */
  5723. diff --git a/encoder/include/khronos/OMX_Index.h b/encoder/include/khronos/OMX_Index.h
  5724. new file mode 100755
  5725. index 0000000..20a109c
  5726. --- /dev/null
  5727. +++ b/encoder/include/khronos/OMX_Index.h
  5728. @@ -0,0 +1,260 @@
  5729. +/*
  5730. + * Copyright (c) 2008 The Khronos Group Inc.
  5731. + *
  5732. + * Permission is hereby granted, free of charge, to any person obtaining
  5733. + * a copy of this software and associated documentation files (the
  5734. + * "Software"), to deal in the Software without restriction, including
  5735. + * without limitation the rights to use, copy, modify, merge, publish,
  5736. + * distribute, sublicense, and/or sell copies of the Software, and to
  5737. + * permit persons to whom the Software is furnished to do so, subject
  5738. + * to the following conditions:
  5739. + * The above copyright notice and this permission notice shall be included
  5740. + * in all copies or substantial portions of the Software.
  5741. + *
  5742. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  5743. + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  5744. + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  5745. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
  5746. + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  5747. + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  5748. + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  5749. + *
  5750. + */
  5751. +
  5752. +/** @file OMX_Index.h - OpenMax IL version 1.1.2
  5753. + * The OMX_Index header file contains the definitions for both applications
  5754. + * and components .
  5755. + */
  5756. +
  5757. +
  5758. +#ifndef OMX_Index_h
  5759. +#define OMX_Index_h
  5760. +
  5761. +#ifdef __cplusplus
  5762. +extern "C" {
  5763. +#endif /* __cplusplus */
  5764. +
  5765. +
  5766. +/* Each OMX header must include all required header files to allow the
  5767. + * header to compile without errors. The includes below are required
  5768. + * for this header file to compile successfully
  5769. + */
  5770. +#include <OMX_Types.h>
  5771. +
  5772. +
  5773. +/** The OMX_INDEXTYPE enumeration is used to select a structure when either
  5774. + * getting or setting parameters and/or configuration data. Each entry in
  5775. + * this enumeration maps to an OMX specified structure. When the
  5776. + * OMX_GetParameter, OMX_SetParameter, OMX_GetConfig or OMX_SetConfig methods
  5777. + * are used, the second parameter will always be an entry from this enumeration
  5778. + * and the third entry will be the structure shown in the comments for the entry.
  5779. + * For example, if the application is initializing a cropping function, the
  5780. + * OMX_SetConfig command would have OMX_IndexConfigCommonInputCrop as the second parameter
  5781. + * and would send a pointer to an initialized OMX_RECTTYPE structure as the
  5782. + * third parameter.
  5783. + *
  5784. + * The enumeration entries named with the OMX_Config prefix are sent using
  5785. + * the OMX_SetConfig command and the enumeration entries named with the
  5786. + * OMX_PARAM_ prefix are sent using the OMX_SetParameter command.
  5787. + */
  5788. +typedef enum OMX_INDEXTYPE {
  5789. +
  5790. + OMX_IndexComponentStartUnused = 0x01000000,
  5791. + OMX_IndexParamPriorityMgmt, /**< reference: OMX_PRIORITYMGMTTYPE */
  5792. + OMX_IndexParamAudioInit, /**< reference: OMX_PORT_PARAM_TYPE */
  5793. + OMX_IndexParamImageInit, /**< reference: OMX_PORT_PARAM_TYPE */
  5794. + OMX_IndexParamVideoInit, /**< reference: OMX_PORT_PARAM_TYPE */
  5795. + OMX_IndexParamOtherInit, /**< reference: OMX_PORT_PARAM_TYPE */
  5796. + OMX_IndexParamNumAvailableStreams, /**< reference: OMX_PARAM_U32TYPE */
  5797. + OMX_IndexParamActiveStream, /**< reference: OMX_PARAM_U32TYPE */
  5798. + OMX_IndexParamSuspensionPolicy, /**< reference: OMX_PARAM_SUSPENSIONPOLICYTYPE */
  5799. + OMX_IndexParamComponentSuspended, /**< reference: OMX_PARAM_SUSPENSIONTYPE */
  5800. + OMX_IndexConfigCapturing, /**< reference: OMX_CONFIG_BOOLEANTYPE */
  5801. + OMX_IndexConfigCaptureMode, /**< reference: OMX_CONFIG_CAPTUREMODETYPE */
  5802. + OMX_IndexAutoPauseAfterCapture, /**< reference: OMX_CONFIG_BOOLEANTYPE */
  5803. + OMX_IndexParamContentURI, /**< reference: OMX_PARAM_CONTENTURITYPE */
  5804. + OMX_IndexParamCustomContentPipe, /**< reference: OMX_PARAM_CONTENTPIPETYPE */
  5805. + OMX_IndexParamDisableResourceConcealment, /**< reference: OMX_RESOURCECONCEALMENTTYPE */
  5806. + OMX_IndexConfigMetadataItemCount, /**< reference: OMX_CONFIG_METADATAITEMCOUNTTYPE */
  5807. + OMX_IndexConfigContainerNodeCount, /**< reference: OMX_CONFIG_CONTAINERNODECOUNTTYPE */
  5808. + OMX_IndexConfigMetadataItem, /**< reference: OMX_CONFIG_METADATAITEMTYPE */
  5809. + OMX_IndexConfigCounterNodeID, /**< reference: OMX_CONFIG_CONTAINERNODEIDTYPE */
  5810. + OMX_IndexParamMetadataFilterType, /**< reference: OMX_PARAM_METADATAFILTERTYPE */
  5811. + OMX_IndexParamMetadataKeyFilter, /**< reference: OMX_PARAM_METADATAFILTERTYPE */
  5812. + OMX_IndexConfigPriorityMgmt, /**< reference: OMX_PRIORITYMGMTTYPE */
  5813. + OMX_IndexParamStandardComponentRole, /**< reference: OMX_PARAM_COMPONENTROLETYPE */
  5814. +
  5815. + OMX_IndexPortStartUnused = 0x02000000,
  5816. + OMX_IndexParamPortDefinition, /**< reference: OMX_PARAM_PORTDEFINITIONTYPE */
  5817. + OMX_IndexParamCompBufferSupplier, /**< reference: OMX_PARAM_BUFFERSUPPLIERTYPE */
  5818. + OMX_IndexReservedStartUnused = 0x03000000,
  5819. +
  5820. + /* Audio parameters and configurations */
  5821. + OMX_IndexAudioStartUnused = 0x04000000,
  5822. + OMX_IndexParamAudioPortFormat, /**< reference: OMX_AUDIO_PARAM_PORTFORMATTYPE */
  5823. + OMX_IndexParamAudioPcm, /**< reference: OMX_AUDIO_PARAM_PCMMODETYPE */
  5824. + OMX_IndexParamAudioAac, /**< reference: OMX_AUDIO_PARAM_AACPROFILETYPE */
  5825. + OMX_IndexParamAudioRa, /**< reference: OMX_AUDIO_PARAM_RATYPE */
  5826. + OMX_IndexParamAudioMp3, /**< reference: OMX_AUDIO_PARAM_MP3TYPE */
  5827. + OMX_IndexParamAudioAdpcm, /**< reference: OMX_AUDIO_PARAM_ADPCMTYPE */
  5828. + OMX_IndexParamAudioG723, /**< reference: OMX_AUDIO_PARAM_G723TYPE */
  5829. + OMX_IndexParamAudioG729, /**< reference: OMX_AUDIO_PARAM_G729TYPE */
  5830. + OMX_IndexParamAudioAmr, /**< reference: OMX_AUDIO_PARAM_AMRTYPE */
  5831. + OMX_IndexParamAudioWma, /**< reference: OMX_AUDIO_PARAM_WMATYPE */
  5832. + OMX_IndexParamAudioSbc, /**< reference: OMX_AUDIO_PARAM_SBCTYPE */
  5833. + OMX_IndexParamAudioMidi, /**< reference: OMX_AUDIO_PARAM_MIDITYPE */
  5834. + OMX_IndexParamAudioGsm_FR, /**< reference: OMX_AUDIO_PARAM_GSMFRTYPE */
  5835. + OMX_IndexParamAudioMidiLoadUserSound, /**< reference: OMX_AUDIO_PARAM_MIDILOADUSERSOUNDTYPE */
  5836. + OMX_IndexParamAudioG726, /**< reference: OMX_AUDIO_PARAM_G726TYPE */
  5837. + OMX_IndexParamAudioGsm_EFR, /**< reference: OMX_AUDIO_PARAM_GSMEFRTYPE */
  5838. + OMX_IndexParamAudioGsm_HR, /**< reference: OMX_AUDIO_PARAM_GSMHRTYPE */
  5839. + OMX_IndexParamAudioPdc_FR, /**< reference: OMX_AUDIO_PARAM_PDCFRTYPE */
  5840. + OMX_IndexParamAudioPdc_EFR, /**< reference: OMX_AUDIO_PARAM_PDCEFRTYPE */
  5841. + OMX_IndexParamAudioPdc_HR, /**< reference: OMX_AUDIO_PARAM_PDCHRTYPE */
  5842. + OMX_IndexParamAudioTdma_FR, /**< reference: OMX_AUDIO_PARAM_TDMAFRTYPE */
  5843. + OMX_IndexParamAudioTdma_EFR, /**< reference: OMX_AUDIO_PARAM_TDMAEFRTYPE */
  5844. + OMX_IndexParamAudioQcelp8, /**< reference: OMX_AUDIO_PARAM_QCELP8TYPE */
  5845. + OMX_IndexParamAudioQcelp13, /**< reference: OMX_AUDIO_PARAM_QCELP13TYPE */
  5846. + OMX_IndexParamAudioEvrc, /**< reference: OMX_AUDIO_PARAM_EVRCTYPE */
  5847. + OMX_IndexParamAudioSmv, /**< reference: OMX_AUDIO_PARAM_SMVTYPE */
  5848. + OMX_IndexParamAudioVorbis, /**< reference: OMX_AUDIO_PARAM_VORBISTYPE */
  5849. +
  5850. + OMX_IndexConfigAudioMidiImmediateEvent, /**< reference: OMX_AUDIO_CONFIG_MIDIIMMEDIATEEVENTTYPE */
  5851. + OMX_IndexConfigAudioMidiControl, /**< reference: OMX_AUDIO_CONFIG_MIDICONTROLTYPE */
  5852. + OMX_IndexConfigAudioMidiSoundBankProgram, /**< reference: OMX_AUDIO_CONFIG_MIDISOUNDBANKPROGRAMTYPE */
  5853. + OMX_IndexConfigAudioMidiStatus, /**< reference: OMX_AUDIO_CONFIG_MIDISTATUSTYPE */
  5854. + OMX_IndexConfigAudioMidiMetaEvent, /**< reference: OMX_AUDIO_CONFIG_MIDIMETAEVENTTYPE */
  5855. + OMX_IndexConfigAudioMidiMetaEventData, /**< reference: OMX_AUDIO_CONFIG_MIDIMETAEVENTDATATYPE */
  5856. + OMX_IndexConfigAudioVolume, /**< reference: OMX_AUDIO_CONFIG_VOLUMETYPE */
  5857. + OMX_IndexConfigAudioBalance, /**< reference: OMX_AUDIO_CONFIG_BALANCETYPE */
  5858. + OMX_IndexConfigAudioChannelMute, /**< reference: OMX_AUDIO_CONFIG_CHANNELMUTETYPE */
  5859. + OMX_IndexConfigAudioMute, /**< reference: OMX_AUDIO_CONFIG_MUTETYPE */
  5860. + OMX_IndexConfigAudioLoudness, /**< reference: OMX_AUDIO_CONFIG_LOUDNESSTYPE */
  5861. + OMX_IndexConfigAudioEchoCancelation, /**< reference: OMX_AUDIO_CONFIG_ECHOCANCELATIONTYPE */
  5862. + OMX_IndexConfigAudioNoiseReduction, /**< reference: OMX_AUDIO_CONFIG_NOISEREDUCTIONTYPE */
  5863. + OMX_IndexConfigAudioBass, /**< reference: OMX_AUDIO_CONFIG_BASSTYPE */
  5864. + OMX_IndexConfigAudioTreble, /**< reference: OMX_AUDIO_CONFIG_TREBLETYPE */
  5865. + OMX_IndexConfigAudioStereoWidening, /**< reference: OMX_AUDIO_CONFIG_STEREOWIDENINGTYPE */
  5866. + OMX_IndexConfigAudioChorus, /**< reference: OMX_AUDIO_CONFIG_CHORUSTYPE */
  5867. + OMX_IndexConfigAudioEqualizer, /**< reference: OMX_AUDIO_CONFIG_EQUALIZERTYPE */
  5868. + OMX_IndexConfigAudioReverberation, /**< reference: OMX_AUDIO_CONFIG_REVERBERATIONTYPE */
  5869. + OMX_IndexConfigAudioChannelVolume, /**< reference: OMX_AUDIO_CONFIG_CHANNELVOLUMETYPE */
  5870. +
  5871. + /* Image specific parameters and configurations */
  5872. + OMX_IndexImageStartUnused = 0x05000000,
  5873. + OMX_IndexParamImagePortFormat, /**< reference: OMX_IMAGE_PARAM_PORTFORMATTYPE */
  5874. + OMX_IndexParamFlashControl, /**< reference: OMX_IMAGE_PARAM_FLASHCONTROLTYPE */
  5875. + OMX_IndexConfigFocusControl, /**< reference: OMX_IMAGE_CONFIG_FOCUSCONTROLTYPE */
  5876. + OMX_IndexParamQFactor, /**< reference: OMX_IMAGE_PARAM_QFACTORTYPE */
  5877. + OMX_IndexParamQuantizationTable, /**< reference: OMX_IMAGE_PARAM_QUANTIZATIONTABLETYPE */
  5878. + OMX_IndexParamHuffmanTable, /**< reference: OMX_IMAGE_PARAM_HUFFMANTTABLETYPE */
  5879. + OMX_IndexConfigFlashControl, /**< reference: OMX_IMAGE_PARAM_FLASHCONTROLTYPE */
  5880. +
  5881. + /* Video specific parameters and configurations */
  5882. + OMX_IndexVideoStartUnused = 0x06000000,
  5883. + OMX_IndexParamVideoPortFormat, /**< reference: OMX_VIDEO_PARAM_PORTFORMATTYPE */
  5884. + OMX_IndexParamVideoQuantization, /**< reference: OMX_VIDEO_PARAM_QUANTIZATIONTYPE */
  5885. + OMX_IndexParamVideoFastUpdate, /**< reference: OMX_VIDEO_PARAM_VIDEOFASTUPDATETYPE */
  5886. + OMX_IndexParamVideoBitrate, /**< reference: OMX_VIDEO_PARAM_BITRATETYPE */
  5887. + OMX_IndexParamVideoMotionVector, /**< reference: OMX_VIDEO_PARAM_MOTIONVECTORTYPE */
  5888. + OMX_IndexParamVideoIntraRefresh, /**< reference: OMX_VIDEO_PARAM_INTRAREFRESHTYPE */
  5889. + OMX_IndexParamVideoErrorCorrection, /**< reference: OMX_VIDEO_PARAM_ERRORCORRECTIONTYPE */
  5890. + OMX_IndexParamVideoVBSMC, /**< reference: OMX_VIDEO_PARAM_VBSMCTYPE */
  5891. + OMX_IndexParamVideoMpeg2, /**< reference: OMX_VIDEO_PARAM_MPEG2TYPE */
  5892. + OMX_IndexParamVideoMpeg4, /**< reference: OMX_VIDEO_PARAM_MPEG4TYPE */
  5893. + OMX_IndexParamVideoWmv, /**< reference: OMX_VIDEO_PARAM_WMVTYPE */
  5894. + OMX_IndexParamVideoRv, /**< reference: OMX_VIDEO_PARAM_RVTYPE */
  5895. + OMX_IndexParamVideoAvc, /**< reference: OMX_VIDEO_PARAM_AVCTYPE */
  5896. + OMX_IndexParamVideoH263, /**< reference: OMX_VIDEO_PARAM_H263TYPE */
  5897. + OMX_IndexParamVideoProfileLevelQuerySupported, /**< reference: OMX_VIDEO_PARAM_PROFILELEVELTYPE */
  5898. + OMX_IndexParamVideoProfileLevelCurrent, /**< reference: OMX_VIDEO_PARAM_PROFILELEVELTYPE */
  5899. + OMX_IndexConfigVideoBitrate, /**< reference: OMX_VIDEO_CONFIG_BITRATETYPE */
  5900. + OMX_IndexConfigVideoFramerate, /**< reference: OMX_CONFIG_FRAMERATETYPE */
  5901. + OMX_IndexConfigVideoIntraVOPRefresh, /**< reference: OMX_CONFIG_INTRAREFRESHVOPTYPE */
  5902. + OMX_IndexConfigVideoIntraMBRefresh, /**< reference: OMX_CONFIG_MACROBLOCKERRORMAPTYPE */
  5903. + OMX_IndexConfigVideoMBErrorReporting, /**< reference: OMX_CONFIG_MBERRORREPORTINGTYPE */
  5904. + OMX_IndexParamVideoMacroblocksPerFrame, /**< reference: OMX_PARAM_MACROBLOCKSTYPE */
  5905. + OMX_IndexConfigVideoMacroBlockErrorMap, /**< reference: OMX_CONFIG_MACROBLOCKERRORMAPTYPE */
  5906. + OMX_IndexParamVideoSliceFMO, /**< reference: OMX_VIDEO_PARAM_AVCSLICEFMO */
  5907. + OMX_IndexConfigVideoAVCIntraPeriod, /**< reference: OMX_VIDEO_CONFIG_AVCINTRAPERIOD */
  5908. + OMX_IndexConfigVideoNalSize, /**< reference: OMX_VIDEO_CONFIG_NALSIZE */
  5909. +
  5910. + /* Image & Video common Configurations */
  5911. + OMX_IndexCommonStartUnused = 0x07000000,
  5912. + OMX_IndexParamCommonDeblocking, /**< reference: OMX_PARAM_DEBLOCKINGTYPE */
  5913. + OMX_IndexParamCommonSensorMode, /**< reference: OMX_PARAM_SENSORMODETYPE */
  5914. + OMX_IndexParamCommonInterleave, /**< reference: OMX_PARAM_INTERLEAVETYPE */
  5915. + OMX_IndexConfigCommonColorFormatConversion, /**< reference: OMX_CONFIG_COLORCONVERSIONTYPE */
  5916. + OMX_IndexConfigCommonScale, /**< reference: OMX_CONFIG_SCALEFACTORTYPE */
  5917. + OMX_IndexConfigCommonImageFilter, /**< reference: OMX_CONFIG_IMAGEFILTERTYPE */
  5918. + OMX_IndexConfigCommonColorEnhancement, /**< reference: OMX_CONFIG_COLORENHANCEMENTTYPE */
  5919. + OMX_IndexConfigCommonColorKey, /**< reference: OMX_CONFIG_COLORKEYTYPE */
  5920. + OMX_IndexConfigCommonColorBlend, /**< reference: OMX_CONFIG_COLORBLENDTYPE */
  5921. + OMX_IndexConfigCommonFrameStabilisation,/**< reference: OMX_CONFIG_FRAMESTABTYPE */
  5922. + OMX_IndexConfigCommonRotate, /**< reference: OMX_CONFIG_ROTATIONTYPE */
  5923. + OMX_IndexConfigCommonMirror, /**< reference: OMX_CONFIG_MIRRORTYPE */
  5924. + OMX_IndexConfigCommonOutputPosition, /**< reference: OMX_CONFIG_POINTTYPE */
  5925. + OMX_IndexConfigCommonInputCrop, /**< reference: OMX_CONFIG_RECTTYPE */
  5926. + OMX_IndexConfigCommonOutputCrop, /**< reference: OMX_CONFIG_RECTTYPE */
  5927. + OMX_IndexConfigCommonDigitalZoom, /**< reference: OMX_CONFIG_SCALEFACTORTYPE */
  5928. + OMX_IndexConfigCommonOpticalZoom, /**< reference: OMX_CONFIG_SCALEFACTORTYPE*/
  5929. + OMX_IndexConfigCommonWhiteBalance, /**< reference: OMX_CONFIG_WHITEBALCONTROLTYPE */
  5930. + OMX_IndexConfigCommonExposure, /**< reference: OMX_CONFIG_EXPOSURECONTROLTYPE */
  5931. + OMX_IndexConfigCommonContrast, /**< reference: OMX_CONFIG_CONTRASTTYPE */
  5932. + OMX_IndexConfigCommonBrightness, /**< reference: OMX_CONFIG_BRIGHTNESSTYPE */
  5933. + OMX_IndexConfigCommonBacklight, /**< reference: OMX_CONFIG_BACKLIGHTTYPE */
  5934. + OMX_IndexConfigCommonGamma, /**< reference: OMX_CONFIG_GAMMATYPE */
  5935. + OMX_IndexConfigCommonSaturation, /**< reference: OMX_CONFIG_SATURATIONTYPE */
  5936. + OMX_IndexConfigCommonLightness, /**< reference: OMX_CONFIG_LIGHTNESSTYPE */
  5937. + OMX_IndexConfigCommonExclusionRect, /**< reference: OMX_CONFIG_RECTTYPE */
  5938. + OMX_IndexConfigCommonDithering, /**< reference: OMX_CONFIG_DITHERTYPE */
  5939. + OMX_IndexConfigCommonPlaneBlend, /**< reference: OMX_CONFIG_PLANEBLENDTYPE */
  5940. + OMX_IndexConfigCommonExposureValue, /**< reference: OMX_CONFIG_EXPOSUREVALUETYPE */
  5941. + OMX_IndexConfigCommonOutputSize, /**< reference: OMX_FRAMESIZETYPE */
  5942. + OMX_IndexParamCommonExtraQuantData, /**< reference: OMX_OTHER_EXTRADATATYPE */
  5943. + OMX_IndexConfigCommonFocusRegion, /**< reference: OMX_CONFIG_FOCUSREGIONTYPE */
  5944. + OMX_IndexConfigCommonFocusStatus, /**< reference: OMX_PARAM_FOCUSSTATUSTYPE */
  5945. + OMX_IndexConfigCommonTransitionEffect, /**< reference: OMX_CONFIG_TRANSITIONEFFECTTYPE */
  5946. +
  5947. + /* Reserved Configuration range */
  5948. + OMX_IndexOtherStartUnused = 0x08000000,
  5949. + OMX_IndexParamOtherPortFormat, /**< reference: OMX_OTHER_PARAM_PORTFORMATTYPE */
  5950. + OMX_IndexConfigOtherPower, /**< reference: OMX_OTHER_CONFIG_POWERTYPE */
  5951. + OMX_IndexConfigOtherStats, /**< reference: OMX_OTHER_CONFIG_STATSTYPE */
  5952. +
  5953. +
  5954. + /* Reserved Time range */
  5955. + OMX_IndexTimeStartUnused = 0x09000000,
  5956. + OMX_IndexConfigTimeScale, /**< reference: OMX_TIME_CONFIG_SCALETYPE */
  5957. + OMX_IndexConfigTimeClockState, /**< reference: OMX_TIME_CONFIG_CLOCKSTATETYPE */
  5958. + OMX_IndexConfigTimeActiveRefClock, /**< reference: OMX_TIME_CONFIG_ACTIVEREFCLOCKTYPE */
  5959. + OMX_IndexConfigTimeCurrentMediaTime, /**< reference: OMX_TIME_CONFIG_TIMESTAMPTYPE (read only) */
  5960. + OMX_IndexConfigTimeCurrentWallTime, /**< reference: OMX_TIME_CONFIG_TIMESTAMPTYPE (read only) */
  5961. + OMX_IndexConfigTimeCurrentAudioReference, /**< reference: OMX_TIME_CONFIG_TIMESTAMPTYPE (write only) */
  5962. + OMX_IndexConfigTimeCurrentVideoReference, /**< reference: OMX_TIME_CONFIG_TIMESTAMPTYPE (write only) */
  5963. + OMX_IndexConfigTimeMediaTimeRequest, /**< reference: OMX_TIME_CONFIG_MEDIATIMEREQUESTTYPE (write only) */
  5964. + OMX_IndexConfigTimeClientStartTime, /**<reference: OMX_TIME_CONFIG_TIMESTAMPTYPE (write only) */
  5965. + OMX_IndexConfigTimePosition, /**< reference: OMX_TIME_CONFIG_TIMESTAMPTYPE */
  5966. + OMX_IndexConfigTimeSeekMode, /**< reference: OMX_TIME_CONFIG_SEEKMODETYPE */
  5967. +
  5968. +
  5969. + OMX_IndexKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  5970. + /* Vendor specific area */
  5971. + OMX_IndexRockchipExtensions = 0x70000000, /**< Reserved region for introducing Rockchip Standard Extensions */
  5972. + OMX_IndexParamVideoHDRRockchipExtensions, /**< reference: OMX_EXTENSION_VIDEO_PARAM_HDR */
  5973. + OMX_IndexVendorStartUnused = 0x7F000000,
  5974. + /* Vendor specific structures should be in the range of 0x7F000000
  5975. + to 0x7FFFFFFE. This range is not broken out by vendor, so
  5976. + private indexes are not guaranteed unique and therefore should
  5977. + only be sent to the appropriate component. */
  5978. +
  5979. + OMX_IndexMax = 0x7FFFFFFF
  5980. +
  5981. +} OMX_INDEXTYPE;
  5982. +
  5983. +#ifdef __cplusplus
  5984. +}
  5985. +#endif /* __cplusplus */
  5986. +
  5987. +#endif
  5988. +/* File EOF */
  5989. diff --git a/encoder/include/khronos/OMX_IndexExt.h b/encoder/include/khronos/OMX_IndexExt.h
  5990. new file mode 100755
  5991. index 0000000..b688d1d
  5992. --- /dev/null
  5993. +++ b/encoder/include/khronos/OMX_IndexExt.h
  5994. @@ -0,0 +1,105 @@
  5995. +/*
  5996. + * Copyright (c) 2010 The Khronos Group Inc.
  5997. + *
  5998. + * Permission is hereby granted, free of charge, to any person obtaining
  5999. + * a copy of this software and associated documentation files (the
  6000. + * "Software"), to deal in the Software without restriction, including
  6001. + * without limitation the rights to use, copy, modify, merge, publish,
  6002. + * distribute, sublicense, and/or sell copies of the Software, and to
  6003. + * permit persons to whom the Software is furnished to do so, subject
  6004. + * to the following conditions:
  6005. + * The above copyright notice and this permission notice shall be included
  6006. + * in all copies or substantial portions of the Software.
  6007. + *
  6008. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  6009. + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  6010. + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  6011. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
  6012. + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  6013. + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  6014. + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  6015. + *
  6016. + */
  6017. +
  6018. +/** @file OMX_IndexExt.h - OpenMax IL version 1.1.2
  6019. + * The OMX_IndexExt header file contains extensions to the definitions
  6020. + * for both applications and components .
  6021. + */
  6022. +
  6023. +#ifndef OMX_IndexExt_h
  6024. +#define OMX_IndexExt_h
  6025. +
  6026. +#ifdef __cplusplus
  6027. +extern "C" {
  6028. +#endif /* __cplusplus */
  6029. +
  6030. +/* Each OMX header shall include all required header files to allow the
  6031. + * header to compile without errors. The includes below are required
  6032. + * for this header file to compile successfully
  6033. + */
  6034. +#include <OMX_Index.h>
  6035. +
  6036. +
  6037. +/** Khronos standard extension indices.
  6038. +
  6039. +This enum lists the current Khronos extension indices to OpenMAX IL.
  6040. +*/
  6041. +typedef enum OMX_INDEXEXTTYPE {
  6042. +
  6043. + /* Component parameters and configurations */
  6044. + OMX_IndexExtComponentStartUnused = OMX_IndexKhronosExtensions + 0x00100000,
  6045. + OMX_IndexConfigCallbackRequest, /**< reference: OMX_CONFIG_CALLBACKREQUESTTYPE */
  6046. + OMX_IndexConfigCommitMode, /**< reference: OMX_CONFIG_COMMITMODETYPE */
  6047. + OMX_IndexConfigCommit, /**< reference: OMX_CONFIG_COMMITTYPE */
  6048. +
  6049. + /* Port parameters and configurations */
  6050. + OMX_IndexExtPortStartUnused = OMX_IndexKhronosExtensions + 0x00200000,
  6051. +
  6052. + /* Audio parameters and configurations */
  6053. + OMX_IndexExtAudioStartUnused = OMX_IndexKhronosExtensions + 0x00400000,
  6054. + OMX_IndexParamAudioAndroidAc3, /**< reference: OMX_AUDIO_PARAM_ANDROID_AC3TYPE */
  6055. + OMX_IndexParamAudioAndroidOpus, /**< reference: OMX_AUDIO_PARAM_ANDROID_OPUSTYPE */
  6056. + OMX_IndexParamAudioAndroidAacPresentation, /**< reference: OMX_AUDIO_PARAM_ANDROID_AACPRESENTATIONTYPE */
  6057. + OMX_IndexParamAudioAndroidEac3, /**< reference: OMX_AUDIO_PARAM_ANDROID_EAC3TYPE */
  6058. + OMX_IndexParamAudioProfileQuerySupported, /**< reference: OMX_AUDIO_PARAM_ANDROID_PROFILETYPE */
  6059. +
  6060. + /* Image parameters and configurations */
  6061. + OMX_IndexExtImageStartUnused = OMX_IndexKhronosExtensions + 0x00500000,
  6062. +
  6063. + /* Video parameters and configurations */
  6064. + OMX_IndexExtVideoStartUnused = OMX_IndexKhronosExtensions + 0x00600000,
  6065. + OMX_IndexParamNalStreamFormatSupported, /**< reference: OMX_NALSTREAMFORMATTYPE */
  6066. + OMX_IndexParamNalStreamFormat, /**< reference: OMX_NALSTREAMFORMATTYPE */
  6067. + OMX_IndexParamNalStreamFormatSelect, /**< reference: OMX_NALSTREAMFORMATTYPE */
  6068. + OMX_IndexParamVideoVp8, /**< reference: OMX_VIDEO_PARAM_VP8TYPE */
  6069. + OMX_IndexConfigVideoVp8ReferenceFrame, /**< reference: OMX_VIDEO_VP8REFERENCEFRAMETYPE */
  6070. + OMX_IndexConfigVideoVp8ReferenceFrameType, /**< reference: OMX_VIDEO_VP8REFERENCEFRAMEINFOTYPE */
  6071. + OMX_IndexParamVideoAndroidVp8Encoder, /**< reference: OMX_VIDEO_PARAM_ANDROID_VP8ENCODERTYPE */
  6072. + OMX_IndexParamVideoHevc, /**< reference: OMX_VIDEO_PARAM_HEVCTYPE */
  6073. + OMX_IndexParamSliceSegments, /**< reference: OMX_VIDEO_SLICESEGMENTSTYPE */
  6074. + OMX_IndexConfigAndroidIntraRefresh, /**< reference: OMX_VIDEO_CONFIG_ANDROID_INTRAREFRESHTYPE */
  6075. + OMX_IndexParamAndroidVideoTemporalLayering, /**< reference: OMX_VIDEO_PARAM_ANDROID_TEMPORALLAYERINGTYPE */
  6076. + OMX_IndexConfigAndroidVideoTemporalLayering, /**< reference: OMX_VIDEO_CONFIG_ANDROID_TEMPORALLAYERINGTYPE */
  6077. +
  6078. + /* Image & Video common configurations */
  6079. + OMX_IndexExtCommonStartUnused = OMX_IndexKhronosExtensions + 0x00700000,
  6080. +
  6081. + /* Other configurations */
  6082. + OMX_IndexExtOtherStartUnused = OMX_IndexKhronosExtensions + 0x00800000,
  6083. + OMX_IndexConfigAutoFramerateConversion, /**< reference: OMX_CONFIG_BOOLEANTYPE */
  6084. + OMX_IndexConfigPriority, /**< reference: OMX_PARAM_U32TYPE */
  6085. + OMX_IndexConfigOperatingRate, /**< reference: OMX_PARAM_U32TYPE in Q16 format for video and in Hz for audio */
  6086. + OMX_IndexParamConsumerUsageBits, /**< reference: OMX_PARAM_U32TYPE */
  6087. +
  6088. + /* Time configurations */
  6089. + OMX_IndexExtTimeStartUnused = OMX_IndexKhronosExtensions + 0x00900000,
  6090. +
  6091. + OMX_IndexExtMax = 0x7FFFFFFF
  6092. +} OMX_INDEXEXTTYPE;
  6093. +
  6094. +#ifdef __cplusplus
  6095. +}
  6096. +#endif /* __cplusplus */
  6097. +
  6098. +#endif /* OMX_IndexExt_h */
  6099. +/* File EOF */
  6100. diff --git a/encoder/include/khronos/OMX_Other.h b/encoder/include/khronos/OMX_Other.h
  6101. new file mode 100755
  6102. index 0000000..8aa67b7
  6103. --- /dev/null
  6104. +++ b/encoder/include/khronos/OMX_Other.h
  6105. @@ -0,0 +1,366 @@
  6106. +/*
  6107. + * Copyright (c) 2008 The Khronos Group Inc.
  6108. + *
  6109. + * Permission is hereby granted, free of charge, to any person obtaining
  6110. + * a copy of this software and associated documentation files (the
  6111. + * "Software"), to deal in the Software without restriction, including
  6112. + * without limitation the rights to use, copy, modify, merge, publish,
  6113. + * distribute, sublicense, and/or sell copies of the Software, and to
  6114. + * permit persons to whom the Software is furnished to do so, subject
  6115. + * to the following conditions:
  6116. + * The above copyright notice and this permission notice shall be included
  6117. + * in all copies or substantial portions of the Software.
  6118. + *
  6119. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  6120. + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  6121. + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  6122. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
  6123. + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  6124. + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  6125. + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  6126. + *
  6127. + */
  6128. +
  6129. +/** @file OMX_Other.h - OpenMax IL version 1.1.2
  6130. + * The structures needed by Other components to exchange
  6131. + * parameters and configuration data with the components.
  6132. + */
  6133. +
  6134. +#ifndef OMX_Other_h
  6135. +#define OMX_Other_h
  6136. +
  6137. +#ifdef __cplusplus
  6138. +extern "C" {
  6139. +#endif /* __cplusplus */
  6140. +
  6141. +
  6142. +/* Each OMX header must include all required header files to allow the
  6143. + * header to compile without errors. The includes below are required
  6144. + * for this header file to compile successfully
  6145. + */
  6146. +
  6147. +#include <OMX_Core.h>
  6148. +
  6149. +
  6150. +/**
  6151. + * Enumeration of possible data types which match to multiple domains or no
  6152. + * domain at all. For types which are vendor specific, a value above
  6153. + * OMX_OTHER_VENDORTSTART should be used.
  6154. + */
  6155. +typedef enum OMX_OTHER_FORMATTYPE {
  6156. + OMX_OTHER_FormatTime = 0, /**< Transmission of various timestamps, elapsed time,
  6157. + time deltas, etc */
  6158. + OMX_OTHER_FormatPower, /**< Perhaps used for enabling/disabling power
  6159. + management, setting clocks? */
  6160. + OMX_OTHER_FormatStats, /**< Could be things such as frame rate, frames
  6161. + dropped, etc */
  6162. + OMX_OTHER_FormatBinary, /**< Arbitrary binary data */
  6163. + OMX_OTHER_FormatVendorReserved = 1000, /**< Starting value for vendor specific
  6164. + formats */
  6165. +
  6166. + OMX_OTHER_FormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  6167. + OMX_OTHER_FormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  6168. + OMX_OTHER_FormatMax = 0x7FFFFFFF
  6169. +} OMX_OTHER_FORMATTYPE;
  6170. +
  6171. +/**
  6172. + * Enumeration of seek modes.
  6173. + */
  6174. +typedef enum OMX_TIME_SEEKMODETYPE {
  6175. + OMX_TIME_SeekModeFast = 0, /**< Prefer seeking to an approximation
  6176. + * of the requested seek position over
  6177. + * the actual seek position if it
  6178. + * results in a faster seek. */
  6179. + OMX_TIME_SeekModeAccurate, /**< Prefer seeking to the actual seek
  6180. + * position over an approximation
  6181. + * of the requested seek position even
  6182. + * if it results in a slower seek. */
  6183. + OMX_TIME_SeekModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  6184. + OMX_TIME_SeekModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  6185. + OMX_TIME_SeekModeMax = 0x7FFFFFFF
  6186. +} OMX_TIME_SEEKMODETYPE;
  6187. +
  6188. +/* Structure representing the seekmode of the component */
  6189. +typedef struct OMX_TIME_CONFIG_SEEKMODETYPE {
  6190. + OMX_U32 nSize; /**< size of the structure in bytes */
  6191. + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  6192. + OMX_TIME_SEEKMODETYPE eType; /**< The seek mode */
  6193. +} OMX_TIME_CONFIG_SEEKMODETYPE;
  6194. +
  6195. +/**
  6196. + * colorspace
  6197. + */
  6198. +typedef enum OMX_ROCKCHIP_EXT_COLORSPACE {
  6199. + OMX_RK_EXT_ColorspaceBT709 = 1,
  6200. + OMX_RK_EXT_ColorspaceBT2020,
  6201. + OMX_RK_EXT_ColorspaceMax = 0x7FFFFFFF
  6202. +} OMX_RK_EXT_COLORSPACE;
  6203. +
  6204. +/**
  6205. + * dynamic range
  6206. + */
  6207. +typedef enum OMX_ROCKCHIP_EXT_DYNCRANGE {
  6208. + OMX_RK_EXT_DyncrangeSDR = 0,
  6209. + OMX_RK_EXT_DyncrangeHDR10,
  6210. + OMX_RK_EXT_DyncrangeHDRHLG,
  6211. + OMX_RK_EXT_DyncrangeHDRDOLBY,
  6212. + OMX_RK_EXT_DyncrangeMax = 0x7FFFFFFF
  6213. +} OMX_RK_EXT_DYNCRANGE;
  6214. +
  6215. +
  6216. +/* Structure Rockchip extension HDR param of the component */
  6217. + typedef struct OMX_EXTENSION_VIDEO_PARAM_HDR {
  6218. + OMX_U32 nSize; /**< size of the structure in bytes */
  6219. + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  6220. + OMX_RK_EXT_COLORSPACE eColorSpace; /**< Color space */
  6221. + OMX_RK_EXT_DYNCRANGE eDyncRange; /**< dynamic range */
  6222. +} OMX_EXTENSION_VIDEO_PARAM_HDR;
  6223. +
  6224. +/** Structure representing a time stamp used with the following configs
  6225. + * on the Clock Component (CC):
  6226. + *
  6227. + * OMX_IndexConfigTimeCurrentWallTime: query of the CC’s current wall
  6228. + * time
  6229. + * OMX_IndexConfigTimeCurrentMediaTime: query of the CC’s current media
  6230. + * time
  6231. + * OMX_IndexConfigTimeCurrentAudioReference and
  6232. + * OMX_IndexConfigTimeCurrentVideoReference: audio/video reference
  6233. + * clock sending SC its reference time
  6234. + * OMX_IndexConfigTimeClientStartTime: a Clock Component client sends
  6235. + * this structure to the Clock Component via a SetConfig on its
  6236. + * client port when it receives a buffer with
  6237. + * OMX_BUFFERFLAG_STARTTIME set. It must use the timestamp
  6238. + * specified by that buffer for nStartTimestamp.
  6239. + *
  6240. + * It’s also used with the following config on components in general:
  6241. + *
  6242. + * OMX_IndexConfigTimePosition: IL client querying component position
  6243. + * (GetConfig) or commanding a component to seek to the given location
  6244. + * (SetConfig)
  6245. + */
  6246. +typedef struct OMX_TIME_CONFIG_TIMESTAMPTYPE {
  6247. + OMX_U32 nSize; /**< size of the structure in bytes */
  6248. + OMX_VERSIONTYPE nVersion; /**< OMX specification version
  6249. + * information */
  6250. + OMX_U32 nPortIndex; /**< port that this structure applies to */
  6251. + OMX_TICKS nTimestamp; /**< timestamp .*/
  6252. +} OMX_TIME_CONFIG_TIMESTAMPTYPE;
  6253. +
  6254. +/** Enumeration of possible reference clocks to the media time. */
  6255. +typedef enum OMX_TIME_UPDATETYPE {
  6256. + OMX_TIME_UpdateRequestFulfillment, /**< Update is the fulfillment of a media time request. */
  6257. + OMX_TIME_UpdateScaleChanged, /**< Update was generated because the scale chagned. */
  6258. + OMX_TIME_UpdateClockStateChanged, /**< Update was generated because the clock state changed. */
  6259. + OMX_TIME_UpdateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  6260. + OMX_TIME_UpdateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  6261. + OMX_TIME_UpdateMax = 0x7FFFFFFF
  6262. +} OMX_TIME_UPDATETYPE;
  6263. +
  6264. +/** Enumeration of possible reference clocks to the media time. */
  6265. +typedef enum OMX_TIME_REFCLOCKTYPE {
  6266. + OMX_TIME_RefClockNone, /**< Use no references. */
  6267. + OMX_TIME_RefClockAudio, /**< Use references sent through OMX_IndexConfigTimeCurrentAudioReference */
  6268. + OMX_TIME_RefClockVideo, /**< Use references sent through OMX_IndexConfigTimeCurrentVideoReference */
  6269. + OMX_TIME_RefClockKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  6270. + OMX_TIME_RefClockVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  6271. + OMX_TIME_RefClockMax = 0x7FFFFFFF
  6272. +} OMX_TIME_REFCLOCKTYPE;
  6273. +
  6274. +/** Enumeration of clock states. */
  6275. +typedef enum OMX_TIME_CLOCKSTATE {
  6276. + OMX_TIME_ClockStateRunning, /**< Clock running. */
  6277. + OMX_TIME_ClockStateWaitingForStartTime, /**< Clock waiting until the
  6278. + * prescribed clients emit their
  6279. + * start time. */
  6280. + OMX_TIME_ClockStateStopped, /**< Clock stopped. */
  6281. + OMX_TIME_ClockStateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  6282. + OMX_TIME_ClockStateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  6283. + OMX_TIME_ClockStateMax = 0x7FFFFFFF
  6284. +} OMX_TIME_CLOCKSTATE;
  6285. +
  6286. +/** Structure representing a media time request to the clock component.
  6287. + *
  6288. + * A client component sends this structure to the Clock Component via a SetConfig
  6289. + * on its client port to specify a media timestamp the Clock Component
  6290. + * should emit. The Clock Component should fulfill the request by sending a
  6291. + * OMX_TIME_MEDIATIMETYPE when its media clock matches the requested
  6292. + * timestamp.
  6293. + *
  6294. + * The client may require a media time request be fulfilled slightly
  6295. + * earlier than the media time specified. In this case the client specifies
  6296. + * an offset which is equal to the difference between wall time corresponding
  6297. + * to the requested media time and the wall time when it will be
  6298. + * fulfilled.
  6299. + *
  6300. + * A client component may uses these requests and the OMX_TIME_MEDIATIMETYPE to
  6301. + * time events according to timestamps. If a client must perform an operation O at
  6302. + * a time T (e.g. deliver a video frame at its corresponding timestamp), it makes a
  6303. + * media time request at T (perhaps specifying an offset to ensure the request fulfillment
  6304. + * is a little early). When the clock component passes the resulting OMX_TIME_MEDIATIMETYPE
  6305. + * structure back to the client component, the client may perform operation O (perhaps having
  6306. + * to wait a slight amount more time itself as specified by the return values).
  6307. + */
  6308. +
  6309. +typedef struct OMX_TIME_CONFIG_MEDIATIMEREQUESTTYPE {
  6310. + OMX_U32 nSize; /**< size of the structure in bytes */
  6311. + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  6312. + OMX_U32 nPortIndex; /**< port that this structure applies to */
  6313. + OMX_PTR pClientPrivate; /**< Client private data to disabiguate this media time
  6314. + * from others (e.g. the number of the frame to deliver).
  6315. + * Duplicated in the media time structure that fulfills
  6316. + * this request. A value of zero is reserved for time scale
  6317. + * updates. */
  6318. + OMX_TICKS nMediaTimestamp; /**< Media timestamp requested.*/
  6319. + OMX_TICKS nOffset; /**< Amount of wall clock time by which this
  6320. + * request should be fulfilled early */
  6321. +} OMX_TIME_CONFIG_MEDIATIMEREQUESTTYPE;
  6322. +
  6323. +/**< Structure sent from the clock component client either when fulfilling
  6324. + * a media time request or when the time scale has changed.
  6325. + *
  6326. + * In the former case the Clock Component fills this structure and times its emission
  6327. + * to a client component (via the client port) according to the corresponding media
  6328. + * time request sent by the client. The Clock Component should time the emission to occur
  6329. + * when the requested timestamp matches the Clock Component's media time but also the
  6330. + * prescribed offset early.
  6331. + *
  6332. + * Upon scale changes the clock component clears the nClientPrivate data, sends the current
  6333. + * media time and sets the nScale to the new scale via the client port. It emits a
  6334. + * OMX_TIME_MEDIATIMETYPE to all clients independent of any requests. This allows clients to
  6335. + * alter processing to accomodate scaling. For instance a video component might skip inter-frames
  6336. + * in the case of extreme fastforward. Likewise an audio component might add or remove samples
  6337. + * from an audio frame to scale audio data.
  6338. + *
  6339. + * It is expected that some clock components may not be able to fulfill requests
  6340. + * at exactly the prescribed time. This is acceptable so long as the request is
  6341. + * fulfilled at least as early as described and not later. This structure provides
  6342. + * fields the client may use to wait for the remaining time.
  6343. + *
  6344. + * The client may use either the nOffset or nWallTimeAtMedia fields to determine the
  6345. + * wall time until the nMediaTimestamp actually occurs. In the latter case the
  6346. + * client can get a more accurate value for offset by getting the current wall
  6347. + * from the cloc component and subtracting it from nWallTimeAtMedia.
  6348. + */
  6349. +
  6350. +typedef struct OMX_TIME_MEDIATIMETYPE {
  6351. + OMX_U32 nSize; /**< size of the structure in bytes */
  6352. + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  6353. + OMX_U32 nClientPrivate; /**< Client private data to disabiguate this media time
  6354. + * from others. Copied from the media time request.
  6355. + * A value of zero is reserved for time scale updates. */
  6356. + OMX_TIME_UPDATETYPE eUpdateType; /**< Reason for the update */
  6357. + OMX_TICKS nMediaTimestamp; /**< Media time requested. If no media time was
  6358. + * requested then this is the current media time. */
  6359. + OMX_TICKS nOffset; /**< Amount of wall clock time by which this
  6360. + * request was actually fulfilled early */
  6361. +
  6362. + OMX_TICKS nWallTimeAtMediaTime; /**< Wall time corresponding to nMediaTimeStamp.
  6363. + * A client may compare this value to current
  6364. + * media time obtained from the Clock Component to determine
  6365. + * the wall time until the media timestamp is really
  6366. + * current. */
  6367. + OMX_S32 xScale; /**< Current media time scale in Q16 format. */
  6368. + OMX_TIME_CLOCKSTATE eState; /* Seeking Change. Added 7/12.*/
  6369. + /**< State of the media time. */
  6370. +} OMX_TIME_MEDIATIMETYPE;
  6371. +
  6372. +/** Structure representing the current media time scale factor. Applicable only to clock
  6373. + * component, other components see scale changes via OMX_TIME_MEDIATIMETYPE buffers sent via
  6374. + * the clock component client ports. Upon recieving this config the clock component changes
  6375. + * the rate by which the media time increases or decreases effectively implementing trick modes.
  6376. + */
  6377. +typedef struct OMX_TIME_CONFIG_SCALETYPE {
  6378. + OMX_U32 nSize; /**< size of the structure in bytes */
  6379. + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  6380. + OMX_S32 xScale; /**< This is a value in Q16 format which is used for
  6381. + * scaling the media time */
  6382. +} OMX_TIME_CONFIG_SCALETYPE;
  6383. +
  6384. +/** Bits used to identify a clock port. Used in OMX_TIME_CONFIG_CLOCKSTATETYPE’s nWaitMask field */
  6385. +#define OMX_CLOCKPORT0 0x00000001
  6386. +#define OMX_CLOCKPORT1 0x00000002
  6387. +#define OMX_CLOCKPORT2 0x00000004
  6388. +#define OMX_CLOCKPORT3 0x00000008
  6389. +#define OMX_CLOCKPORT4 0x00000010
  6390. +#define OMX_CLOCKPORT5 0x00000020
  6391. +#define OMX_CLOCKPORT6 0x00000040
  6392. +#define OMX_CLOCKPORT7 0x00000080
  6393. +
  6394. +/** Structure representing the current mode of the media clock.
  6395. + * IL Client uses this config to change or query the mode of the
  6396. + * media clock of the clock component. Applicable only to clock
  6397. + * component.
  6398. + *
  6399. + * On a SetConfig if eState is OMX_TIME_ClockStateRunning media time
  6400. + * starts immediately at the prescribed start time. If
  6401. + * OMX_TIME_ClockStateWaitingForStartTime the Clock Component ignores
  6402. + * the given nStartTime and waits for all clients specified in the
  6403. + * nWaitMask to send starttimes (via
  6404. + * OMX_IndexConfigTimeClientStartTime). The Clock Component then starts
  6405. + * the media clock using the earliest start time supplied. */
  6406. +typedef struct OMX_TIME_CONFIG_CLOCKSTATETYPE {
  6407. + OMX_U32 nSize; /**< size of the structure in bytes */
  6408. + OMX_VERSIONTYPE nVersion; /**< OMX specification version
  6409. + * information */
  6410. + OMX_TIME_CLOCKSTATE eState; /**< State of the media time. */
  6411. + OMX_TICKS nStartTime; /**< Start time of the media time. */
  6412. + OMX_TICKS nOffset; /**< Time to offset the media time by
  6413. + * (e.g. preroll). Media time will be
  6414. + * reported to be nOffset ticks earlier.
  6415. + */
  6416. + OMX_U32 nWaitMask; /**< Mask of OMX_CLOCKPORT values. */
  6417. +} OMX_TIME_CONFIG_CLOCKSTATETYPE;
  6418. +
  6419. +/** Structure representing the reference clock currently being used to
  6420. + * compute media time. IL client uses this config to change or query the
  6421. + * clock component's active reference clock */
  6422. +typedef struct OMX_TIME_CONFIG_ACTIVEREFCLOCKTYPE {
  6423. + OMX_U32 nSize; /**< size of the structure in bytes */
  6424. + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  6425. + OMX_TIME_REFCLOCKTYPE eClock; /**< Reference clock used to compute media time */
  6426. +} OMX_TIME_CONFIG_ACTIVEREFCLOCKTYPE;
  6427. +
  6428. +/** Descriptor for setting specifics of power type.
  6429. + * Note: this structure is listed for backwards compatibility. */
  6430. +typedef struct OMX_OTHER_CONFIG_POWERTYPE {
  6431. + OMX_U32 nSize; /**< size of the structure in bytes */
  6432. + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  6433. + OMX_BOOL bEnablePM; /**< Flag to enable Power Management */
  6434. +} OMX_OTHER_CONFIG_POWERTYPE;
  6435. +
  6436. +
  6437. +/** Descriptor for setting specifics of stats type.
  6438. + * Note: this structure is listed for backwards compatibility. */
  6439. +typedef struct OMX_OTHER_CONFIG_STATSTYPE {
  6440. + OMX_U32 nSize; /**< size of the structure in bytes */
  6441. + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  6442. + /* what goes here */
  6443. +} OMX_OTHER_CONFIG_STATSTYPE;
  6444. +
  6445. +
  6446. +/**
  6447. + * The PortDefinition structure is used to define all of the parameters
  6448. + * necessary for the compliant component to setup an input or an output other
  6449. + * path.
  6450. + */
  6451. +typedef struct OMX_OTHER_PORTDEFINITIONTYPE {
  6452. + OMX_OTHER_FORMATTYPE eFormat; /**< Type of data expected for this channel */
  6453. +} OMX_OTHER_PORTDEFINITIONTYPE;
  6454. +
  6455. +/** Port format parameter. This structure is used to enumerate
  6456. + * the various data input/output format supported by the port.
  6457. + */
  6458. +typedef struct OMX_OTHER_PARAM_PORTFORMATTYPE {
  6459. + OMX_U32 nSize; /**< size of the structure in bytes */
  6460. + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  6461. + OMX_U32 nPortIndex; /**< Indicates which port to set */
  6462. + OMX_U32 nIndex; /**< Indicates the enumeration index for the format from 0x0 to N-1 */
  6463. + OMX_OTHER_FORMATTYPE eFormat; /**< Type of data expected for this channel */
  6464. +} OMX_OTHER_PARAM_PORTFORMATTYPE;
  6465. +
  6466. +#ifdef __cplusplus
  6467. +}
  6468. +#endif /* __cplusplus */
  6469. +
  6470. +#endif
  6471. +/* File EOF */
  6472. diff --git a/encoder/include/khronos/OMX_Types.h b/encoder/include/khronos/OMX_Types.h
  6473. new file mode 100755
  6474. index 0000000..527ba23
  6475. --- /dev/null
  6476. +++ b/encoder/include/khronos/OMX_Types.h
  6477. @@ -0,0 +1,361 @@
  6478. +/*
  6479. + * Copyright (c) 2016 The Khronos Group Inc.
  6480. + *
  6481. + * Permission is hereby granted, free of charge, to any person obtaining
  6482. + * a copy of this software and associated documentation files (the
  6483. + * "Software"), to deal in the Software without restriction, including
  6484. + * without limitation the rights to use, copy, modify, merge, publish,
  6485. + * distribute, sublicense, and/or sell copies of the Software, and to
  6486. + * permit persons to whom the Software is furnished to do so, subject
  6487. + * to the following conditions:
  6488. + * The above copyright notice and this permission notice shall be included
  6489. + * in all copies or substantial portions of the Software.
  6490. + *
  6491. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  6492. + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  6493. + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  6494. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
  6495. + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  6496. + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  6497. + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  6498. + *
  6499. + */
  6500. +
  6501. +/** OMX_Types.h - OpenMax IL version 1.1.2
  6502. + * The OMX_Types header file contains the primitive type definitions used by
  6503. + * the core, the application and the component. This file may need to be
  6504. + * modified to be used on systems that do not have "char" set to 8 bits,
  6505. + * "short" set to 16 bits and "long" set to 32 bits.
  6506. + */
  6507. +
  6508. +#ifndef OMX_Types_h
  6509. +#define OMX_Types_h
  6510. +
  6511. +#include <stdint.h>
  6512. +
  6513. +#ifdef __cplusplus
  6514. +extern "C" {
  6515. +#endif /* __cplusplus */
  6516. +
  6517. +/** The OMX_API and OMX_APIENTRY are platform specific definitions used
  6518. + * to declare OMX function prototypes. They are modified to meet the
  6519. + * requirements for a particular platform */
  6520. +#ifdef __SYMBIAN32__
  6521. +# ifdef __OMX_EXPORTS
  6522. +# define OMX_API __declspec(dllexport)
  6523. +# else
  6524. +# ifdef _WIN32
  6525. +# define OMX_API __declspec(dllexport)
  6526. +# else
  6527. +# define OMX_API __declspec(dllimport)
  6528. +# endif
  6529. +# endif
  6530. +#else
  6531. +# ifdef _WIN32
  6532. +# ifdef __OMX_EXPORTS
  6533. +# define OMX_API __declspec(dllexport)
  6534. +# else
  6535. +# define OMX_API __declspec(dllimport)
  6536. +# endif
  6537. +# else
  6538. +# ifdef __OMX_EXPORTS
  6539. +# define OMX_API
  6540. +# else
  6541. +# define OMX_API extern
  6542. +# endif
  6543. +# endif
  6544. +#endif
  6545. +
  6546. +#ifndef OMX_APIENTRY
  6547. +#define OMX_APIENTRY
  6548. +#endif
  6549. +
  6550. +/** OMX_IN is used to identify inputs to an OMX function. This designation
  6551. + will also be used in the case of a pointer that points to a parameter
  6552. + that is used as an output. */
  6553. +#ifndef OMX_IN
  6554. +#define OMX_IN
  6555. +#endif
  6556. +
  6557. +/** OMX_OUT is used to identify outputs from an OMX function. This
  6558. + designation will also be used in the case of a pointer that points
  6559. + to a parameter that is used as an input. */
  6560. +#ifndef OMX_OUT
  6561. +#define OMX_OUT
  6562. +#endif
  6563. +
  6564. +
  6565. +/** OMX_INOUT is used to identify parameters that may be either inputs or
  6566. + outputs from an OMX function at the same time. This designation will
  6567. + also be used in the case of a pointer that points to a parameter that
  6568. + is used both as an input and an output. */
  6569. +#ifndef OMX_INOUT
  6570. +#define OMX_INOUT
  6571. +#endif
  6572. +
  6573. +/** OMX_ALL is used to as a wildcard to select all entities of the same type
  6574. + * when specifying the index, or referring to a object by an index. (i.e.
  6575. + * use OMX_ALL to indicate all N channels). When used as a port index
  6576. + * for a config or parameter this OMX_ALL denotes that the config or
  6577. + * parameter applies to the entire component not just one port. */
  6578. +#define OMX_ALL 0xFFFFFFFF
  6579. +
  6580. +/** In the following we define groups that help building doxygen documentation */
  6581. +
  6582. +/** @defgroup core OpenMAX IL core
  6583. + * Functions and structure related to the OMX IL core
  6584. + */
  6585. +
  6586. + /** @defgroup comp OpenMAX IL component
  6587. + * Functions and structure related to the OMX IL component
  6588. + */
  6589. +
  6590. +/** @defgroup rpm Resource and Policy Management
  6591. + * Structures for resource and policy management of components
  6592. + */
  6593. +
  6594. +/** @defgroup buf Buffer Management
  6595. + * Buffer handling functions and structures
  6596. + */
  6597. +
  6598. +/** @defgroup tun Tunneling
  6599. + * @ingroup core comp
  6600. + * Structures and functions to manage tunnels among component ports
  6601. + */
  6602. +
  6603. +/** @defgroup cp Content Pipes
  6604. + * @ingroup core
  6605. + */
  6606. +
  6607. + /** @defgroup metadata Metadata handling
  6608. + *
  6609. + */
  6610. +
  6611. +/** OMX_U8 is an 8 bit unsigned quantity that is byte aligned */
  6612. +typedef uint8_t OMX_U8;
  6613. +
  6614. +/** OMX_S8 is an 8 bit signed quantity that is byte aligned */
  6615. +typedef int8_t OMX_S8;
  6616. +
  6617. +/** OMX_U16 is a 16 bit unsigned quantity that is 16 bit word aligned */
  6618. +typedef uint16_t OMX_U16;
  6619. +
  6620. +/** OMX_S16 is a 16 bit signed quantity that is 16 bit word aligned */
  6621. +typedef int16_t OMX_S16;
  6622. +
  6623. +/** OMX_U32 is a 32 bit unsigned quantity that is 32 bit word aligned */
  6624. +typedef uint32_t OMX_U32;
  6625. +
  6626. +/** OMX_S32 is a 32 bit signed quantity that is 32 bit word aligned */
  6627. +typedef int32_t OMX_S32;
  6628. +
  6629. +
  6630. +/* Users with compilers that cannot accept the "long long" designation should
  6631. + define the OMX_SKIP64BIT macro. It should be noted that this may cause
  6632. + some components to fail to compile if the component was written to require
  6633. + 64 bit integral types. However, these components would NOT compile anyway
  6634. + since the compiler does not support the way the component was written.
  6635. +*/
  6636. +#ifndef OMX_SKIP64BIT
  6637. +#ifdef __SYMBIAN32__
  6638. +/** OMX_U64 is a 64 bit unsigned quantity that is 64 bit word aligned */
  6639. +typedef unsigned long long OMX_U64;
  6640. +
  6641. +/** OMX_S64 is a 64 bit signed quantity that is 64 bit word aligned */
  6642. +typedef signed long long OMX_S64;
  6643. +
  6644. +#elif defined(WIN32)
  6645. +
  6646. +/** OMX_U64 is a 64 bit unsigned quantity that is 64 bit word aligned */
  6647. +typedef unsigned __int64 OMX_U64;
  6648. +
  6649. +/** OMX_S64 is a 64 bit signed quantity that is 64 bit word aligned */
  6650. +typedef signed __int64 OMX_S64;
  6651. +
  6652. +#else /* WIN32 */
  6653. +
  6654. +/** OMX_U64 is a 64 bit unsigned quantity that is 64 bit word aligned */
  6655. +typedef uint64_t OMX_U64;
  6656. +
  6657. +/** OMX_S64 is a 64 bit signed quantity that is 64 bit word aligned */
  6658. +typedef int64_t OMX_S64;
  6659. +
  6660. +#endif /* WIN32 */
  6661. +#endif
  6662. +
  6663. +
  6664. +/** The OMX_BOOL type is intended to be used to represent a true or a false
  6665. + value when passing parameters to and from the OMX core and components. The
  6666. + OMX_BOOL is a 32 bit quantity and is aligned on a 32 bit word boundary.
  6667. + */
  6668. +typedef enum OMX_BOOL {
  6669. + OMX_FALSE = 0,
  6670. + OMX_TRUE = !OMX_FALSE,
  6671. + OMX_BOOL_MAX = 0x7FFFFFFF
  6672. +} OMX_BOOL;
  6673. +
  6674. +/** The OMX_PTR type is intended to be used to pass pointers between the OMX
  6675. + applications and the OMX Core and components. This is a 32 bit pointer and
  6676. + is aligned on a 32 bit boundary.
  6677. + */
  6678. +typedef void* OMX_PTR;
  6679. +
  6680. +/** The OMX_STRING type is intended to be used to pass "C" type strings between
  6681. + the application and the core and component. The OMX_STRING type is a 32
  6682. + bit pointer to a zero terminated string. The pointer is word aligned and
  6683. + the string is byte aligned.
  6684. + */
  6685. +typedef char* OMX_STRING;
  6686. +
  6687. +/** The OMX_BYTE type is intended to be used to pass arrays of bytes such as
  6688. + buffers between the application and the component and core. The OMX_BYTE
  6689. + type is a 32 bit pointer to a zero terminated string. The pointer is word
  6690. + aligned and the string is byte aligned.
  6691. + */
  6692. +typedef unsigned char* OMX_BYTE;
  6693. +
  6694. +/** OMX_UUIDTYPE is a very long unique identifier to uniquely identify
  6695. + at runtime. This identifier should be generated by a component in a way
  6696. + that guarantees that every instance of the identifier running on the system
  6697. + is unique. */
  6698. +typedef unsigned char OMX_UUIDTYPE[128];
  6699. +
  6700. +/** The OMX_DIRTYPE enumeration is used to indicate if a port is an input or
  6701. + an output port. This enumeration is common across all component types.
  6702. + */
  6703. +typedef enum OMX_DIRTYPE
  6704. +{
  6705. + OMX_DirInput, /**< Port is an input port */
  6706. + OMX_DirOutput, /**< Port is an output port */
  6707. + OMX_DirMax = 0x7FFFFFFF
  6708. +} OMX_DIRTYPE;
  6709. +
  6710. +/** The OMX_ENDIANTYPE enumeration is used to indicate the bit ordering
  6711. + for numerical data (i.e. big endian, or little endian).
  6712. + */
  6713. +typedef enum OMX_ENDIANTYPE
  6714. +{
  6715. + OMX_EndianBig, /**< big endian */
  6716. + OMX_EndianLittle, /**< little endian */
  6717. + OMX_EndianMax = 0x7FFFFFFF
  6718. +} OMX_ENDIANTYPE;
  6719. +
  6720. +
  6721. +/** The OMX_NUMERICALDATATYPE enumeration is used to indicate if data
  6722. + is signed or unsigned
  6723. + */
  6724. +typedef enum OMX_NUMERICALDATATYPE
  6725. +{
  6726. + OMX_NumericalDataSigned, /**< signed data */
  6727. + OMX_NumericalDataUnsigned, /**< unsigned data */
  6728. + OMX_NumercialDataMax = 0x7FFFFFFF
  6729. +} OMX_NUMERICALDATATYPE;
  6730. +
  6731. +
  6732. +/** Unsigned bounded value type */
  6733. +typedef struct OMX_BU32 {
  6734. + OMX_U32 nValue; /**< actual value */
  6735. + OMX_U32 nMin; /**< minimum for value (i.e. nValue >= nMin) */
  6736. + OMX_U32 nMax; /**< maximum for value (i.e. nValue <= nMax) */
  6737. +} OMX_BU32;
  6738. +
  6739. +
  6740. +/** Signed bounded value type */
  6741. +typedef struct OMX_BS32 {
  6742. + OMX_S32 nValue; /**< actual value */
  6743. + OMX_S32 nMin; /**< minimum for value (i.e. nValue >= nMin) */
  6744. + OMX_S32 nMax; /**< maximum for value (i.e. nValue <= nMax) */
  6745. +} OMX_BS32;
  6746. +
  6747. +
  6748. +/** Structure representing some time or duration in microseconds. This structure
  6749. + * must be interpreted as a signed 64 bit value. The quantity is signed to accommodate
  6750. + * negative deltas and preroll scenarios. The quantity is represented in microseconds
  6751. + * to accomodate high resolution timestamps (e.g. DVD presentation timestamps based
  6752. + * on a 90kHz clock) and to allow more accurate and synchronized delivery (e.g.
  6753. + * individual audio samples delivered at 192 kHz). The quantity is 64 bit to
  6754. + * accommodate a large dynamic range (signed 32 bit values would allow only for plus
  6755. + * or minus 35 minutes).
  6756. + *
  6757. + * Implementations with limited precision may convert the signed 64 bit value to
  6758. + * a signed 32 bit value internally but risk loss of precision.
  6759. + */
  6760. +#ifndef OMX_SKIP64BIT
  6761. +typedef OMX_S64 OMX_TICKS;
  6762. +#else
  6763. +typedef struct OMX_TICKS
  6764. +{
  6765. + OMX_U32 nLowPart; /** low bits of the signed 64 bit tick value */
  6766. + OMX_U32 nHighPart; /** high bits of the signed 64 bit tick value */
  6767. +} OMX_TICKS;
  6768. +#endif
  6769. +#define OMX_TICKS_PER_SECOND 1000000
  6770. +
  6771. +/** Define the public interface for the OMX Handle. The core will not use
  6772. + this value internally, but the application should only use this value.
  6773. + */
  6774. +typedef void* OMX_HANDLETYPE;
  6775. +
  6776. +typedef struct OMX_MARKTYPE
  6777. +{
  6778. + OMX_HANDLETYPE hMarkTargetComponent; /**< The component that will
  6779. + generate a mark event upon
  6780. + processing the mark. */
  6781. + OMX_PTR pMarkData; /**< Application specific data associated with
  6782. + the mark sent on a mark event to disambiguate
  6783. + this mark from others. */
  6784. +} OMX_MARKTYPE;
  6785. +
  6786. +
  6787. +/** OMX_NATIVE_DEVICETYPE is used to map a OMX video port to the
  6788. + * platform & operating specific object used to reference the display
  6789. + * or can be used by a audio port for native audio rendering */
  6790. +typedef void* OMX_NATIVE_DEVICETYPE;
  6791. +
  6792. +/** OMX_NATIVE_WINDOWTYPE is used to map a OMX video port to the
  6793. + * platform & operating specific object used to reference the window */
  6794. +typedef void* OMX_NATIVE_WINDOWTYPE;
  6795. +
  6796. +
  6797. +/** Define the OMX IL version that corresponds to this set of header files.
  6798. + * We also define a combined version that can be used to write or compare
  6799. + * values of the 32bit nVersion field, assuming a little endian architecture */
  6800. +#define OMX_VERSION_MAJOR 1
  6801. +#define OMX_VERSION_MINOR 1
  6802. +#define OMX_VERSION_REVISION 2
  6803. +#define OMX_VERSION_STEP 0
  6804. +
  6805. +#define OMX_VERSION ((OMX_VERSION_STEP<<24) | (OMX_VERSION_REVISION<<16) | (OMX_VERSION_MINOR<<8) | OMX_VERSION_MAJOR)
  6806. +
  6807. +
  6808. +/** The OMX_VERSIONTYPE union is used to specify the version for
  6809. + a structure or component. For a component, the version is entirely
  6810. + specified by the component vendor. Components doing the same function
  6811. + from different vendors may or may not have the same version. For
  6812. + structures, the version shall be set by the entity that allocates the
  6813. + structure. For structures specified in the OMX 1.1 specification, the
  6814. + value of the version shall be set to 1.1.0.0 in all cases. Access to the
  6815. + OMX_VERSIONTYPE can be by a single 32 bit access (e.g. by nVersion) or
  6816. + by accessing one of the structure elements to, for example, check only
  6817. + the Major revision.
  6818. + */
  6819. +typedef union OMX_VERSIONTYPE
  6820. +{
  6821. + struct
  6822. + {
  6823. + OMX_U8 nVersionMajor; /**< Major version accessor element */
  6824. + OMX_U8 nVersionMinor; /**< Minor version accessor element */
  6825. + OMX_U8 nRevision; /**< Revision version accessor element */
  6826. + OMX_U8 nStep; /**< Step version accessor element */
  6827. + } s;
  6828. + OMX_U32 nVersion; /**< 32 bit value to make accessing the
  6829. + version easily done in a single word
  6830. + size copy/compare operation */
  6831. +} OMX_VERSIONTYPE;
  6832. +
  6833. +#ifdef __cplusplus
  6834. +}
  6835. +#endif /* __cplusplus */
  6836. +
  6837. +#endif
  6838. +/* File EOF */
  6839. diff --git a/encoder/include/khronos/OMX_Video.h b/encoder/include/khronos/OMX_Video.h
  6840. new file mode 100755
  6841. index 0000000..6fa2626
  6842. --- /dev/null
  6843. +++ b/encoder/include/khronos/OMX_Video.h
  6844. @@ -0,0 +1,1141 @@
  6845. +/**
  6846. + * Copyright (c) 2008 The Khronos Group Inc.
  6847. + *
  6848. + * Permission is hereby granted, free of charge, to any person obtaining
  6849. + * a copy of this software and associated documentation files (the
  6850. + * "Software"), to deal in the Software without restriction, including
  6851. + * without limitation the rights to use, copy, modify, merge, publish,
  6852. + * distribute, sublicense, and/or sell copies of the Software, and to
  6853. + * permit persons to whom the Software is furnished to do so, subject
  6854. + * to the following conditions:
  6855. + * The above copyright notice and this permission notice shall be included
  6856. + * in all copies or substantial portions of the Software.
  6857. + *
  6858. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  6859. + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  6860. + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  6861. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
  6862. + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  6863. + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  6864. + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  6865. + *
  6866. + */
  6867. +
  6868. +/**
  6869. + * @file OMX_Video.h - OpenMax IL version 1.1.2
  6870. + * The structures is needed by Video components to exchange parameters
  6871. + * and configuration data with OMX components.
  6872. + */
  6873. +#ifndef OMX_Video_h
  6874. +#define OMX_Video_h
  6875. +
  6876. +/** @defgroup video OpenMAX IL Video Domain
  6877. + * @ingroup iv
  6878. + * Structures for OpenMAX IL Video domain
  6879. + * @{
  6880. + */
  6881. +
  6882. +#ifdef __cplusplus
  6883. +extern "C" {
  6884. +#endif /* __cplusplus */
  6885. +
  6886. +
  6887. +/**
  6888. + * Each OMX header must include all required header files to allow the
  6889. + * header to compile without errors. The includes below are required
  6890. + * for this header file to compile successfully
  6891. + */
  6892. +
  6893. +#include <OMX_IVCommon.h>
  6894. +
  6895. +
  6896. +/**
  6897. + * Enumeration used to define the possible video compression codings.
  6898. + * NOTE: This essentially refers to file extensions. If the coding is
  6899. + * being used to specify the ENCODE type, then additional work
  6900. + * must be done to configure the exact flavor of the compression
  6901. + * to be used. For decode cases where the user application can
  6902. + * not differentiate between MPEG-4 and H.264 bit streams, it is
  6903. + * up to the codec to handle this.
  6904. + */
  6905. +typedef enum OMX_VIDEO_CODINGTYPE {
  6906. + OMX_VIDEO_CodingUnused, /**< Value when coding is N/A */
  6907. + OMX_VIDEO_CodingAutoDetect, /**< Autodetection of coding type */
  6908. + OMX_VIDEO_CodingMPEG2, /**< AKA: H.262 */
  6909. + OMX_VIDEO_CodingH263, /**< H.263 */
  6910. + OMX_VIDEO_CodingMPEG4, /**< MPEG-4 */
  6911. + OMX_VIDEO_CodingWMV, /**< all versions of Windows Media Video */
  6912. + OMX_VIDEO_CodingRV, /**< all versions of Real Video */
  6913. + OMX_VIDEO_CodingAVC, /**< H.264/AVC */
  6914. + OMX_VIDEO_CodingMJPEG, /**< Motion JPEG */
  6915. + OMX_VIDEO_CodingVP8, /**< Google VP8, formerly known as On2 VP8 */
  6916. + OMX_VIDEO_CodingVP9, /**< Google VP9 */
  6917. + OMX_VIDEO_CodingHEVC, /**< ITU H.265/HEVC */
  6918. + OMX_VIDEO_CodingKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  6919. + OMX_VIDEO_CodingVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  6920. + OMX_VIDEO_CodingMax = 0x7FFFFFFF
  6921. +} OMX_VIDEO_CODINGTYPE;
  6922. +
  6923. +
  6924. +/**
  6925. + * Data structure used to define a video path. The number of Video paths for
  6926. + * input and output will vary by type of the Video component.
  6927. + *
  6928. + * Input (aka Source) : zero Inputs, one Output,
  6929. + * Splitter : one Input, 2 or more Outputs,
  6930. + * Processing Element : one Input, one output,
  6931. + * Mixer : 2 or more inputs, one output,
  6932. + * Output (aka Sink) : one Input, zero outputs.
  6933. + *
  6934. + * The PortDefinition structure is used to define all of the parameters
  6935. + * necessary for the compliant component to setup an input or an output video
  6936. + * path. If additional vendor specific data is required, it should be
  6937. + * transmitted to the component using the CustomCommand function. Compliant
  6938. + * components will prepopulate this structure with optimal values during the
  6939. + * GetDefaultInitParams command.
  6940. + *
  6941. + * STRUCT MEMBERS:
  6942. + * cMIMEType : MIME type of data for the port
  6943. + * pNativeRender : Platform specific reference for a display if a
  6944. + * sync, otherwise this field is 0
  6945. + * nFrameWidth : Width of frame to be used on channel if
  6946. + * uncompressed format is used. Use 0 for unknown,
  6947. + * don't care or variable
  6948. + * nFrameHeight : Height of frame to be used on channel if
  6949. + * uncompressed format is used. Use 0 for unknown,
  6950. + * don't care or variable
  6951. + * nStride : Number of bytes per span of an image
  6952. + * (i.e. indicates the number of bytes to get
  6953. + * from span N to span N+1, where negative stride
  6954. + * indicates the image is bottom up
  6955. + * nSliceHeight : Height used when encoding in slices
  6956. + * nBitrate : Bit rate of frame to be used on channel if
  6957. + * compressed format is used. Use 0 for unknown,
  6958. + * don't care or variable
  6959. + * xFramerate : Frame rate to be used on channel if uncompressed
  6960. + * format is used. Use 0 for unknown, don't care or
  6961. + * variable. Units are Q16 frames per second.
  6962. + * bFlagErrorConcealment : Turns on error concealment if it is supported by
  6963. + * the OMX component
  6964. + * eCompressionFormat : Compression format used in this instance of the
  6965. + * component. When OMX_VIDEO_CodingUnused is
  6966. + * specified, eColorFormat is used
  6967. + * eColorFormat : Decompressed format used by this component
  6968. + * pNativeWindow : Platform specific reference for a window object if a
  6969. + * display sink , otherwise this field is 0x0.
  6970. + */
  6971. +typedef struct OMX_VIDEO_PORTDEFINITIONTYPE {
  6972. + OMX_STRING cMIMEType;
  6973. + OMX_NATIVE_DEVICETYPE pNativeRender;
  6974. + OMX_U32 nFrameWidth;
  6975. + OMX_U32 nFrameHeight;
  6976. + OMX_S32 nStride;
  6977. + OMX_U32 nSliceHeight;
  6978. + OMX_U32 nBitrate;
  6979. + OMX_U32 xFramerate;
  6980. + OMX_BOOL bFlagErrorConcealment;
  6981. + OMX_VIDEO_CODINGTYPE eCompressionFormat;
  6982. + OMX_COLOR_FORMATTYPE eColorFormat;
  6983. + OMX_NATIVE_WINDOWTYPE pNativeWindow;
  6984. +} OMX_VIDEO_PORTDEFINITIONTYPE;
  6985. +
  6986. +/**
  6987. + * Port format parameter. This structure is used to enumerate the various
  6988. + * data input/output format supported by the port.
  6989. + *
  6990. + * STRUCT MEMBERS:
  6991. + * nSize : Size of the structure in bytes
  6992. + * nVersion : OMX specification version information
  6993. + * nPortIndex : Indicates which port to set
  6994. + * nIndex : Indicates the enumeration index for the format from
  6995. + * 0x0 to N-1
  6996. + * eCompressionFormat : Compression format used in this instance of the
  6997. + * component. When OMX_VIDEO_CodingUnused is specified,
  6998. + * eColorFormat is used
  6999. + * eColorFormat : Decompressed format used by this component
  7000. + * xFrameRate : Indicates the video frame rate in Q16 format
  7001. + */
  7002. +typedef struct OMX_VIDEO_PARAM_PORTFORMATTYPE {
  7003. + OMX_U32 nSize;
  7004. + OMX_VERSIONTYPE nVersion;
  7005. + OMX_U32 nPortIndex;
  7006. + OMX_U32 nIndex;
  7007. + OMX_VIDEO_CODINGTYPE eCompressionFormat;
  7008. + OMX_COLOR_FORMATTYPE eColorFormat;
  7009. + OMX_U32 xFramerate;
  7010. +} OMX_VIDEO_PARAM_PORTFORMATTYPE;
  7011. +
  7012. +
  7013. +/**
  7014. + * This is a structure for configuring video compression quantization
  7015. + * parameter values. Codecs may support different QP values for different
  7016. + * frame types.
  7017. + *
  7018. + * STRUCT MEMBERS:
  7019. + * nSize : Size of the structure in bytes
  7020. + * nVersion : OMX specification version info
  7021. + * nPortIndex : Port that this structure applies to
  7022. + * nQpI : QP value to use for index frames
  7023. + * nQpP : QP value to use for P frames
  7024. + * nQpB : QP values to use for bidirectional frames
  7025. + */
  7026. +typedef struct OMX_VIDEO_PARAM_QUANTIZATIONTYPE {
  7027. + OMX_U32 nSize;
  7028. + OMX_VERSIONTYPE nVersion;
  7029. + OMX_U32 nPortIndex;
  7030. + OMX_U32 nQpI;
  7031. + OMX_U32 nQpP;
  7032. + OMX_U32 nQpB;
  7033. +} OMX_VIDEO_PARAM_QUANTIZATIONTYPE;
  7034. +
  7035. +
  7036. +/**
  7037. + * Structure for configuration of video fast update parameters.
  7038. + *
  7039. + * STRUCT MEMBERS:
  7040. + * nSize : Size of the structure in bytes
  7041. + * nVersion : OMX specification version info
  7042. + * nPortIndex : Port that this structure applies to
  7043. + * bEnableVFU : Enable/Disable video fast update
  7044. + * nFirstGOB : Specifies the number of the first macroblock row
  7045. + * nFirstMB : specifies the first MB relative to the specified first GOB
  7046. + * nNumMBs : Specifies the number of MBs to be refreshed from nFirstGOB
  7047. + * and nFirstMB
  7048. + */
  7049. +typedef struct OMX_VIDEO_PARAM_VIDEOFASTUPDATETYPE {
  7050. + OMX_U32 nSize;
  7051. + OMX_VERSIONTYPE nVersion;
  7052. + OMX_U32 nPortIndex;
  7053. + OMX_BOOL bEnableVFU;
  7054. + OMX_U32 nFirstGOB;
  7055. + OMX_U32 nFirstMB;
  7056. + OMX_U32 nNumMBs;
  7057. +} OMX_VIDEO_PARAM_VIDEOFASTUPDATETYPE;
  7058. +
  7059. +
  7060. +/**
  7061. + * Enumeration of possible bitrate control types
  7062. + */
  7063. +typedef enum OMX_VIDEO_CONTROLRATETYPE {
  7064. + OMX_Video_ControlRateDisable,
  7065. + OMX_Video_ControlRateVariable,
  7066. + OMX_Video_ControlRateConstant,
  7067. + OMX_Video_ControlRateVariableSkipFrames,
  7068. + OMX_Video_ControlRateConstantSkipFrames,
  7069. + OMX_Video_ControlRateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  7070. + OMX_Video_ControlRateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  7071. + OMX_Video_ControlRateMax = 0x7FFFFFFF
  7072. +} OMX_VIDEO_CONTROLRATETYPE;
  7073. +
  7074. +
  7075. +/**
  7076. + * Structure for configuring bitrate mode of a codec.
  7077. + *
  7078. + * STRUCT MEMBERS:
  7079. + * nSize : Size of the struct in bytes
  7080. + * nVersion : OMX spec version info
  7081. + * nPortIndex : Port that this struct applies to
  7082. + * eControlRate : Control rate type enum
  7083. + * nTargetBitrate : Target bitrate to encode with
  7084. + */
  7085. +typedef struct OMX_VIDEO_PARAM_BITRATETYPE {
  7086. + OMX_U32 nSize;
  7087. + OMX_VERSIONTYPE nVersion;
  7088. + OMX_U32 nPortIndex;
  7089. + OMX_VIDEO_CONTROLRATETYPE eControlRate;
  7090. + OMX_U32 nTargetBitrate;
  7091. +} OMX_VIDEO_PARAM_BITRATETYPE;
  7092. +
  7093. +
  7094. +/**
  7095. + * Enumeration of possible motion vector (MV) types
  7096. + */
  7097. +typedef enum OMX_VIDEO_MOTIONVECTORTYPE {
  7098. + OMX_Video_MotionVectorPixel,
  7099. + OMX_Video_MotionVectorHalfPel,
  7100. + OMX_Video_MotionVectorQuarterPel,
  7101. + OMX_Video_MotionVectorEighthPel,
  7102. + OMX_Video_MotionVectorKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  7103. + OMX_Video_MotionVectorVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  7104. + OMX_Video_MotionVectorMax = 0x7FFFFFFF
  7105. +} OMX_VIDEO_MOTIONVECTORTYPE;
  7106. +
  7107. +
  7108. +/**
  7109. + * Structure for configuring the number of motion vectors used as well
  7110. + * as their accuracy.
  7111. + *
  7112. + * STRUCT MEMBERS:
  7113. + * nSize : Size of the struct in bytes
  7114. + * nVersion : OMX spec version info
  7115. + * nPortIndex : port that this structure applies to
  7116. + * eAccuracy : Enumerated MV accuracy
  7117. + * bUnrestrictedMVs : Allow unrestricted MVs
  7118. + * bFourMV : Allow use of 4 MVs
  7119. + * sXSearchRange : Search range in horizontal direction for MVs
  7120. + * sYSearchRange : Search range in vertical direction for MVs
  7121. + */
  7122. +typedef struct OMX_VIDEO_PARAM_MOTIONVECTORTYPE {
  7123. + OMX_U32 nSize;
  7124. + OMX_VERSIONTYPE nVersion;
  7125. + OMX_U32 nPortIndex;
  7126. + OMX_VIDEO_MOTIONVECTORTYPE eAccuracy;
  7127. + OMX_BOOL bUnrestrictedMVs;
  7128. + OMX_BOOL bFourMV;
  7129. + OMX_S32 sXSearchRange;
  7130. + OMX_S32 sYSearchRange;
  7131. +} OMX_VIDEO_PARAM_MOTIONVECTORTYPE;
  7132. +
  7133. +
  7134. +/**
  7135. + * Enumeration of possible methods to use for Intra Refresh
  7136. + */
  7137. +typedef enum OMX_VIDEO_INTRAREFRESHTYPE {
  7138. + OMX_VIDEO_IntraRefreshCyclic,
  7139. + OMX_VIDEO_IntraRefreshAdaptive,
  7140. + OMX_VIDEO_IntraRefreshBoth,
  7141. + OMX_VIDEO_IntraRefreshKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  7142. + OMX_VIDEO_IntraRefreshVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  7143. + OMX_VIDEO_IntraRefreshMax = 0x7FFFFFFF
  7144. +} OMX_VIDEO_INTRAREFRESHTYPE;
  7145. +
  7146. +
  7147. +/**
  7148. + * Structure for configuring intra refresh mode
  7149. + *
  7150. + * STRUCT MEMBERS:
  7151. + * nSize : Size of the structure in bytes
  7152. + * nVersion : OMX specification version information
  7153. + * nPortIndex : Port that this structure applies to
  7154. + * eRefreshMode : Cyclic, Adaptive, or Both
  7155. + * nAirMBs : Number of intra macroblocks to refresh in a frame when
  7156. + * AIR is enabled
  7157. + * nAirRef : Number of times a motion marked macroblock has to be
  7158. + * intra coded
  7159. + * nCirMBs : Number of consecutive macroblocks to be coded as "intra"
  7160. + * when CIR is enabled
  7161. + */
  7162. +typedef struct OMX_VIDEO_PARAM_INTRAREFRESHTYPE {
  7163. + OMX_U32 nSize;
  7164. + OMX_VERSIONTYPE nVersion;
  7165. + OMX_U32 nPortIndex;
  7166. + OMX_VIDEO_INTRAREFRESHTYPE eRefreshMode;
  7167. + OMX_U32 nAirMBs;
  7168. + OMX_U32 nAirRef;
  7169. + OMX_U32 nCirMBs;
  7170. +} OMX_VIDEO_PARAM_INTRAREFRESHTYPE;
  7171. +
  7172. +
  7173. +/**
  7174. + * Structure for enabling various error correction methods for video
  7175. + * compression.
  7176. + *
  7177. + * STRUCT MEMBERS:
  7178. + * nSize : Size of the structure in bytes
  7179. + * nVersion : OMX specification version information
  7180. + * nPortIndex : Port that this structure applies to
  7181. + * bEnableHEC : Enable/disable header extension codes (HEC)
  7182. + * bEnableResync : Enable/disable resynchronization markers
  7183. + * nResynchMarkerSpacing : Resynch markers interval (in bits) to be
  7184. + * applied in the stream
  7185. + * bEnableDataPartitioning : Enable/disable data partitioning
  7186. + * bEnableRVLC : Enable/disable reversible variable length
  7187. + * coding
  7188. + */
  7189. +typedef struct OMX_VIDEO_PARAM_ERRORCORRECTIONTYPE {
  7190. + OMX_U32 nSize;
  7191. + OMX_VERSIONTYPE nVersion;
  7192. + OMX_U32 nPortIndex;
  7193. + OMX_BOOL bEnableHEC;
  7194. + OMX_BOOL bEnableResync;
  7195. + OMX_U32 nResynchMarkerSpacing;
  7196. + OMX_BOOL bEnableDataPartitioning;
  7197. + OMX_BOOL bEnableRVLC;
  7198. +} OMX_VIDEO_PARAM_ERRORCORRECTIONTYPE;
  7199. +
  7200. +
  7201. +/**
  7202. + * Configuration of variable block-size motion compensation (VBSMC)
  7203. + *
  7204. + * STRUCT MEMBERS:
  7205. + * nSize : Size of the structure in bytes
  7206. + * nVersion : OMX specification version information
  7207. + * nPortIndex : Port that this structure applies to
  7208. + * b16x16 : Enable inter block search 16x16
  7209. + * b16x8 : Enable inter block search 16x8
  7210. + * b8x16 : Enable inter block search 8x16
  7211. + * b8x8 : Enable inter block search 8x8
  7212. + * b8x4 : Enable inter block search 8x4
  7213. + * b4x8 : Enable inter block search 4x8
  7214. + * b4x4 : Enable inter block search 4x4
  7215. + */
  7216. +typedef struct OMX_VIDEO_PARAM_VBSMCTYPE {
  7217. + OMX_U32 nSize;
  7218. + OMX_VERSIONTYPE nVersion;
  7219. + OMX_U32 nPortIndex;
  7220. + OMX_BOOL b16x16;
  7221. + OMX_BOOL b16x8;
  7222. + OMX_BOOL b8x16;
  7223. + OMX_BOOL b8x8;
  7224. + OMX_BOOL b8x4;
  7225. + OMX_BOOL b4x8;
  7226. + OMX_BOOL b4x4;
  7227. +} OMX_VIDEO_PARAM_VBSMCTYPE;
  7228. +
  7229. +
  7230. +/**
  7231. + * H.263 profile types, each profile indicates support for various
  7232. + * performance bounds and different annexes.
  7233. + *
  7234. + * ENUMS:
  7235. + * Baseline : Baseline Profile: H.263 (V1), no optional modes
  7236. + * H320 Coding : H.320 Coding Efficiency Backward Compatibility
  7237. + * Profile: H.263+ (V2), includes annexes I, J, L.4
  7238. + * and T
  7239. + * BackwardCompatible : Backward Compatibility Profile: H.263 (V1),
  7240. + * includes annex F
  7241. + * ISWV2 : Interactive Streaming Wireless Profile: H.263+
  7242. + * (V2), includes annexes I, J, K and T
  7243. + * ISWV3 : Interactive Streaming Wireless Profile: H.263++
  7244. + * (V3), includes profile 3 and annexes V and W.6.3.8
  7245. + * HighCompression : Conversational High Compression Profile: H.263++
  7246. + * (V3), includes profiles 1 & 2 and annexes D and U
  7247. + * Internet : Conversational Internet Profile: H.263++ (V3),
  7248. + * includes profile 5 and annex K
  7249. + * Interlace : Conversational Interlace Profile: H.263++ (V3),
  7250. + * includes profile 5 and annex W.6.3.11
  7251. + * HighLatency : High Latency Profile: H.263++ (V3), includes
  7252. + * profile 6 and annexes O.1 and P.5
  7253. + */
  7254. +typedef enum OMX_VIDEO_H263PROFILETYPE {
  7255. + OMX_VIDEO_H263ProfileBaseline = 0x01,
  7256. + OMX_VIDEO_H263ProfileH320Coding = 0x02,
  7257. + OMX_VIDEO_H263ProfileBackwardCompatible = 0x04,
  7258. + OMX_VIDEO_H263ProfileISWV2 = 0x08,
  7259. + OMX_VIDEO_H263ProfileISWV3 = 0x10,
  7260. + OMX_VIDEO_H263ProfileHighCompression = 0x20,
  7261. + OMX_VIDEO_H263ProfileInternet = 0x40,
  7262. + OMX_VIDEO_H263ProfileInterlace = 0x80,
  7263. + OMX_VIDEO_H263ProfileHighLatency = 0x100,
  7264. + OMX_VIDEO_H263ProfileKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  7265. + OMX_VIDEO_H263ProfileVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  7266. + OMX_VIDEO_H263ProfileMax = 0x7FFFFFFF
  7267. +} OMX_VIDEO_H263PROFILETYPE;
  7268. +
  7269. +
  7270. +/**
  7271. + * H.263 level types, each level indicates support for various frame sizes,
  7272. + * bit rates, decoder frame rates.
  7273. + */
  7274. +typedef enum OMX_VIDEO_H263LEVELTYPE {
  7275. + OMX_VIDEO_H263Level10 = 0x01,
  7276. + OMX_VIDEO_H263Level20 = 0x02,
  7277. + OMX_VIDEO_H263Level30 = 0x04,
  7278. + OMX_VIDEO_H263Level40 = 0x08,
  7279. + OMX_VIDEO_H263Level45 = 0x10,
  7280. + OMX_VIDEO_H263Level50 = 0x20,
  7281. + OMX_VIDEO_H263Level60 = 0x40,
  7282. + OMX_VIDEO_H263Level70 = 0x80,
  7283. + OMX_VIDEO_H263LevelKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  7284. + OMX_VIDEO_H263LevelVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  7285. + OMX_VIDEO_H263LevelMax = 0x7FFFFFFF
  7286. +} OMX_VIDEO_H263LEVELTYPE;
  7287. +
  7288. +
  7289. +/**
  7290. + * Specifies the picture type. These values should be OR'd to signal all
  7291. + * pictures types which are allowed.
  7292. + *
  7293. + * ENUMS:
  7294. + * Generic Picture Types: I, P and B
  7295. + * H.263 Specific Picture Types: SI and SP
  7296. + * H.264 Specific Picture Types: EI and EP
  7297. + * MPEG-4 Specific Picture Types: S
  7298. + */
  7299. +typedef enum OMX_VIDEO_PICTURETYPE {
  7300. + OMX_VIDEO_PictureTypeI = 0x01,
  7301. + OMX_VIDEO_PictureTypeP = 0x02,
  7302. + OMX_VIDEO_PictureTypeB = 0x04,
  7303. + OMX_VIDEO_PictureTypeSI = 0x08,
  7304. + OMX_VIDEO_PictureTypeSP = 0x10,
  7305. + OMX_VIDEO_PictureTypeEI = 0x11,
  7306. + OMX_VIDEO_PictureTypeEP = 0x12,
  7307. + OMX_VIDEO_PictureTypeS = 0x14,
  7308. + OMX_VIDEO_PictureTypeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  7309. + OMX_VIDEO_PictureTypeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  7310. + OMX_VIDEO_PictureTypeMax = 0x7FFFFFFF
  7311. +} OMX_VIDEO_PICTURETYPE;
  7312. +
  7313. +
  7314. +/**
  7315. + * H.263 Params
  7316. + *
  7317. + * STRUCT MEMBERS:
  7318. + * nSize : Size of the structure in bytes
  7319. + * nVersion : OMX specification version information
  7320. + * nPortIndex : Port that this structure applies to
  7321. + * nPFrames : Number of P frames between each I frame
  7322. + * nBFrames : Number of B frames between each I frame
  7323. + * eProfile : H.263 profile(s) to use
  7324. + * eLevel : H.263 level(s) to use
  7325. + * bPLUSPTYPEAllowed : Indicating that it is allowed to use PLUSPTYPE
  7326. + * (specified in the 1998 version of H.263) to
  7327. + * indicate custom picture sizes or clock
  7328. + * frequencies
  7329. + * nAllowedPictureTypes : Specifies the picture types allowed in the
  7330. + * bitstream
  7331. + * bForceRoundingTypeToZero : value of the RTYPE bit (bit 6 of MPPTYPE) is
  7332. + * not constrained. It is recommended to change
  7333. + * the value of the RTYPE bit for each reference
  7334. + * picture in error-free communication
  7335. + * nPictureHeaderRepetition : Specifies the frequency of picture header
  7336. + * repetition
  7337. + * nGOBHeaderInterval : Specifies the interval of non-empty GOB
  7338. + * headers in units of GOBs
  7339. + */
  7340. +typedef struct OMX_VIDEO_PARAM_H263TYPE {
  7341. + OMX_U32 nSize;
  7342. + OMX_VERSIONTYPE nVersion;
  7343. + OMX_U32 nPortIndex;
  7344. + OMX_U32 nPFrames;
  7345. + OMX_U32 nBFrames;
  7346. + OMX_VIDEO_H263PROFILETYPE eProfile;
  7347. + OMX_VIDEO_H263LEVELTYPE eLevel;
  7348. + OMX_BOOL bPLUSPTYPEAllowed;
  7349. + OMX_U32 nAllowedPictureTypes;
  7350. + OMX_BOOL bForceRoundingTypeToZero;
  7351. + OMX_U32 nPictureHeaderRepetition;
  7352. + OMX_U32 nGOBHeaderInterval;
  7353. +} OMX_VIDEO_PARAM_H263TYPE;
  7354. +
  7355. +
  7356. +/**
  7357. + * MPEG-2 profile types, each profile indicates support for various
  7358. + * performance bounds and different annexes.
  7359. + */
  7360. +typedef enum OMX_VIDEO_MPEG2PROFILETYPE {
  7361. + OMX_VIDEO_MPEG2ProfileSimple = 0, /**< Simple Profile */
  7362. + OMX_VIDEO_MPEG2ProfileMain, /**< Main Profile */
  7363. + OMX_VIDEO_MPEG2Profile422, /**< 4:2:2 Profile */
  7364. + OMX_VIDEO_MPEG2ProfileSNR, /**< SNR Profile */
  7365. + OMX_VIDEO_MPEG2ProfileSpatial, /**< Spatial Profile */
  7366. + OMX_VIDEO_MPEG2ProfileHigh, /**< High Profile */
  7367. + OMX_VIDEO_MPEG2ProfileKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  7368. + OMX_VIDEO_MPEG2ProfileVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  7369. + OMX_VIDEO_MPEG2ProfileMax = 0x7FFFFFFF
  7370. +} OMX_VIDEO_MPEG2PROFILETYPE;
  7371. +
  7372. +
  7373. +/**
  7374. + * MPEG-2 level types, each level indicates support for various frame
  7375. + * sizes, bit rates, decoder frame rates. No need
  7376. + */
  7377. +typedef enum OMX_VIDEO_MPEG2LEVELTYPE {
  7378. + OMX_VIDEO_MPEG2LevelLL = 0, /**< Low Level */
  7379. + OMX_VIDEO_MPEG2LevelML, /**< Main Level */
  7380. + OMX_VIDEO_MPEG2LevelH14, /**< High 1440 */
  7381. + OMX_VIDEO_MPEG2LevelHL, /**< High Level */
  7382. + OMX_VIDEO_MPEG2LevelKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  7383. + OMX_VIDEO_MPEG2LevelVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  7384. + OMX_VIDEO_MPEG2LevelMax = 0x7FFFFFFF
  7385. +} OMX_VIDEO_MPEG2LEVELTYPE;
  7386. +
  7387. +
  7388. +/**
  7389. + * MPEG-2 params
  7390. + *
  7391. + * STRUCT MEMBERS:
  7392. + * nSize : Size of the structure in bytes
  7393. + * nVersion : OMX specification version information
  7394. + * nPortIndex : Port that this structure applies to
  7395. + * nPFrames : Number of P frames between each I frame
  7396. + * nBFrames : Number of B frames between each I frame
  7397. + * eProfile : MPEG-2 profile(s) to use
  7398. + * eLevel : MPEG-2 levels(s) to use
  7399. + */
  7400. +typedef struct OMX_VIDEO_PARAM_MPEG2TYPE {
  7401. + OMX_U32 nSize;
  7402. + OMX_VERSIONTYPE nVersion;
  7403. + OMX_U32 nPortIndex;
  7404. + OMX_U32 nPFrames;
  7405. + OMX_U32 nBFrames;
  7406. + OMX_VIDEO_MPEG2PROFILETYPE eProfile;
  7407. + OMX_VIDEO_MPEG2LEVELTYPE eLevel;
  7408. +} OMX_VIDEO_PARAM_MPEG2TYPE;
  7409. +
  7410. +
  7411. +/**
  7412. + * MPEG-4 profile types, each profile indicates support for various
  7413. + * performance bounds and different annexes.
  7414. + *
  7415. + * ENUMS:
  7416. + * - Simple Profile, Levels 1-3
  7417. + * - Simple Scalable Profile, Levels 1-2
  7418. + * - Core Profile, Levels 1-2
  7419. + * - Main Profile, Levels 2-4
  7420. + * - N-bit Profile, Level 2
  7421. + * - Scalable Texture Profile, Level 1
  7422. + * - Simple Face Animation Profile, Levels 1-2
  7423. + * - Simple Face and Body Animation (FBA) Profile, Levels 1-2
  7424. + * - Basic Animated Texture Profile, Levels 1-2
  7425. + * - Hybrid Profile, Levels 1-2
  7426. + * - Advanced Real Time Simple Profiles, Levels 1-4
  7427. + * - Core Scalable Profile, Levels 1-3
  7428. + * - Advanced Coding Efficiency Profile, Levels 1-4
  7429. + * - Advanced Core Profile, Levels 1-2
  7430. + * - Advanced Scalable Texture, Levels 2-3
  7431. + */
  7432. +typedef enum OMX_VIDEO_MPEG4PROFILETYPE {
  7433. + OMX_VIDEO_MPEG4ProfileSimple = 0x01,
  7434. + OMX_VIDEO_MPEG4ProfileSimpleScalable = 0x02,
  7435. + OMX_VIDEO_MPEG4ProfileCore = 0x04,
  7436. + OMX_VIDEO_MPEG4ProfileMain = 0x08,
  7437. + OMX_VIDEO_MPEG4ProfileNbit = 0x10,
  7438. + OMX_VIDEO_MPEG4ProfileScalableTexture = 0x20,
  7439. + OMX_VIDEO_MPEG4ProfileSimpleFace = 0x40,
  7440. + OMX_VIDEO_MPEG4ProfileSimpleFBA = 0x80,
  7441. + OMX_VIDEO_MPEG4ProfileBasicAnimated = 0x100,
  7442. + OMX_VIDEO_MPEG4ProfileHybrid = 0x200,
  7443. + OMX_VIDEO_MPEG4ProfileAdvancedRealTime = 0x400,
  7444. + OMX_VIDEO_MPEG4ProfileCoreScalable = 0x800,
  7445. + OMX_VIDEO_MPEG4ProfileAdvancedCoding = 0x1000,
  7446. + OMX_VIDEO_MPEG4ProfileAdvancedCore = 0x2000,
  7447. + OMX_VIDEO_MPEG4ProfileAdvancedScalable = 0x4000,
  7448. + OMX_VIDEO_MPEG4ProfileAdvancedSimple = 0x8000,
  7449. + OMX_VIDEO_MPEG4ProfileKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  7450. + OMX_VIDEO_MPEG4ProfileVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  7451. + OMX_VIDEO_MPEG4ProfileMax = 0x7FFFFFFF
  7452. +} OMX_VIDEO_MPEG4PROFILETYPE;
  7453. +
  7454. +
  7455. +/**
  7456. + * MPEG-4 level types, each level indicates support for various frame
  7457. + * sizes, bit rates, decoder frame rates. No need
  7458. + */
  7459. +typedef enum OMX_VIDEO_MPEG4LEVELTYPE {
  7460. + OMX_VIDEO_MPEG4Level0 = 0x01, /**< Level 0 */
  7461. + OMX_VIDEO_MPEG4Level0b = 0x02, /**< Level 0b */
  7462. + OMX_VIDEO_MPEG4Level1 = 0x04, /**< Level 1 */
  7463. + OMX_VIDEO_MPEG4Level2 = 0x08, /**< Level 2 */
  7464. + OMX_VIDEO_MPEG4Level3 = 0x10, /**< Level 3 */
  7465. + OMX_VIDEO_MPEG4Level4 = 0x20, /**< Level 4 */
  7466. + OMX_VIDEO_MPEG4Level4a = 0x40, /**< Level 4a */
  7467. + OMX_VIDEO_MPEG4Level5 = 0x80, /**< Level 5 */
  7468. + OMX_VIDEO_MPEG4LevelKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  7469. + OMX_VIDEO_MPEG4LevelVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  7470. + OMX_VIDEO_MPEG4LevelMax = 0x7FFFFFFF
  7471. +} OMX_VIDEO_MPEG4LEVELTYPE;
  7472. +
  7473. +
  7474. +/**
  7475. + * MPEG-4 configuration. This structure handles configuration options
  7476. + * which are specific to MPEG4 algorithms
  7477. + *
  7478. + * STRUCT MEMBERS:
  7479. + * nSize : Size of the structure in bytes
  7480. + * nVersion : OMX specification version information
  7481. + * nPortIndex : Port that this structure applies to
  7482. + * nSliceHeaderSpacing : Number of macroblocks between slice header (H263+
  7483. + * Annex K). Put zero if not used
  7484. + * bSVH : Enable Short Video Header mode
  7485. + * bGov : Flag to enable GOV
  7486. + * nPFrames : Number of P frames between each I frame (also called
  7487. + * GOV period)
  7488. + * nBFrames : Number of B frames between each I frame
  7489. + * nIDCVLCThreshold : Value of intra DC VLC threshold
  7490. + * bACPred : Flag to use ac prediction
  7491. + * nMaxPacketSize : Maximum size of packet in bytes.
  7492. + * nTimeIncRes : Used to pass VOP time increment resolution for MPEG4.
  7493. + * Interpreted as described in MPEG4 standard.
  7494. + * eProfile : MPEG-4 profile(s) to use.
  7495. + * eLevel : MPEG-4 level(s) to use.
  7496. + * nAllowedPictureTypes : Specifies the picture types allowed in the bitstream
  7497. + * nHeaderExtension : Specifies the number of consecutive video packet
  7498. + * headers within a VOP
  7499. + * bReversibleVLC : Specifies whether reversible variable length coding
  7500. + * is in use
  7501. + */
  7502. +typedef struct OMX_VIDEO_PARAM_MPEG4TYPE {
  7503. + OMX_U32 nSize;
  7504. + OMX_VERSIONTYPE nVersion;
  7505. + OMX_U32 nPortIndex;
  7506. + OMX_U32 nSliceHeaderSpacing;
  7507. + OMX_BOOL bSVH;
  7508. + OMX_BOOL bGov;
  7509. + OMX_U32 nPFrames;
  7510. + OMX_U32 nBFrames;
  7511. + OMX_U32 nIDCVLCThreshold;
  7512. + OMX_BOOL bACPred;
  7513. + OMX_U32 nMaxPacketSize;
  7514. + OMX_U32 nTimeIncRes;
  7515. + OMX_VIDEO_MPEG4PROFILETYPE eProfile;
  7516. + OMX_VIDEO_MPEG4LEVELTYPE eLevel;
  7517. + OMX_U32 nAllowedPictureTypes;
  7518. + OMX_U32 nHeaderExtension;
  7519. + OMX_BOOL bReversibleVLC;
  7520. +} OMX_VIDEO_PARAM_MPEG4TYPE;
  7521. +
  7522. +
  7523. +/**
  7524. + * WMV Versions
  7525. + */
  7526. +typedef enum OMX_VIDEO_WMVFORMATTYPE {
  7527. + OMX_VIDEO_WMVFormatUnused = 0x01, /**< Format unused or unknown */
  7528. + OMX_VIDEO_WMVFormat7 = 0x02, /**< Windows Media Video format 7 */
  7529. + OMX_VIDEO_WMVFormat8 = 0x04, /**< Windows Media Video format 8 */
  7530. + OMX_VIDEO_WMVFormat9 = 0x08, /**< Windows Media Video format 9 */
  7531. + OMX_VIDEO_WMFFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  7532. + OMX_VIDEO_WMFFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  7533. + OMX_VIDEO_WMVFormatMax = 0x7FFFFFFF
  7534. +} OMX_VIDEO_WMVFORMATTYPE;
  7535. +
  7536. +
  7537. +/**
  7538. + * WMV Params
  7539. + *
  7540. + * STRUCT MEMBERS:
  7541. + * nSize : Size of the structure in bytes
  7542. + * nVersion : OMX specification version information
  7543. + * nPortIndex : Port that this structure applies to
  7544. + * eFormat : Version of WMV stream / data
  7545. + */
  7546. +typedef struct OMX_VIDEO_PARAM_WMVTYPE {
  7547. + OMX_U32 nSize;
  7548. + OMX_VERSIONTYPE nVersion;
  7549. + OMX_U32 nPortIndex;
  7550. + OMX_VIDEO_WMVFORMATTYPE eFormat;
  7551. +} OMX_VIDEO_PARAM_WMVTYPE;
  7552. +
  7553. +
  7554. +/**
  7555. + * Real Video Version
  7556. + */
  7557. +typedef enum OMX_VIDEO_RVFORMATTYPE {
  7558. + OMX_VIDEO_RVFormatUnused = 0, /**< Format unused or unknown */
  7559. + OMX_VIDEO_RVFormat8, /**< Real Video format 8 */
  7560. + OMX_VIDEO_RVFormat9, /**< Real Video format 9 */
  7561. + OMX_VIDEO_RVFormatG2, /**< Real Video Format G2 */
  7562. + OMX_VIDEO_RVFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  7563. + OMX_VIDEO_RVFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  7564. + OMX_VIDEO_RVFormatMax = 0x7FFFFFFF
  7565. +} OMX_VIDEO_RVFORMATTYPE;
  7566. +
  7567. +
  7568. +/**
  7569. + * Real Video Params
  7570. + *
  7571. + * STUCT MEMBERS:
  7572. + * nSize : Size of the structure in bytes
  7573. + * nVersion : OMX specification version information
  7574. + * nPortIndex : Port that this structure applies to
  7575. + * eFormat : Version of RV stream / data
  7576. + * nBitsPerPixel : Bits per pixel coded in the frame
  7577. + * nPaddedWidth : Padded width in pixel of a video frame
  7578. + * nPaddedHeight : Padded Height in pixels of a video frame
  7579. + * nFrameRate : Rate of video in frames per second
  7580. + * nBitstreamFlags : Flags which internal information about the bitstream
  7581. + * nBitstreamVersion : Bitstream version
  7582. + * nMaxEncodeFrameSize: Max encoded frame size
  7583. + * bEnablePostFilter : Turn on/off post filter
  7584. + * bEnableTemporalInterpolation : Turn on/off temporal interpolation
  7585. + * bEnableLatencyMode : When enabled, the decoder does not display a decoded
  7586. + * frame until it has detected that no enhancement layer
  7587. + * frames or dependent B frames will be coming. This
  7588. + * detection usually occurs when a subsequent non-B
  7589. + * frame is encountered
  7590. + */
  7591. +typedef struct OMX_VIDEO_PARAM_RVTYPE {
  7592. + OMX_U32 nSize;
  7593. + OMX_VERSIONTYPE nVersion;
  7594. + OMX_U32 nPortIndex;
  7595. + OMX_VIDEO_RVFORMATTYPE eFormat;
  7596. + OMX_U16 nBitsPerPixel;
  7597. + OMX_U16 nPaddedWidth;
  7598. + OMX_U16 nPaddedHeight;
  7599. + OMX_U32 nFrameRate;
  7600. + OMX_U32 nBitstreamFlags;
  7601. + OMX_U32 nBitstreamVersion;
  7602. + OMX_U32 nMaxEncodeFrameSize;
  7603. + OMX_BOOL bEnablePostFilter;
  7604. + OMX_BOOL bEnableTemporalInterpolation;
  7605. + OMX_BOOL bEnableLatencyMode;
  7606. +} OMX_VIDEO_PARAM_RVTYPE;
  7607. +
  7608. +
  7609. +/**
  7610. + * AVC profile types, each profile indicates support for various
  7611. + * performance bounds and different annexes.
  7612. + */
  7613. +typedef enum OMX_VIDEO_AVCPROFILETYPE {
  7614. + OMX_VIDEO_AVCProfileBaseline = 0x01, /**< Baseline profile */
  7615. + OMX_VIDEO_AVCProfileMain = 0x02, /**< Main profile */
  7616. + OMX_VIDEO_AVCProfileExtended = 0x04, /**< Extended profile */
  7617. + OMX_VIDEO_AVCProfileHigh = 0x08, /**< High profile */
  7618. + OMX_VIDEO_AVCProfileHigh10 = 0x10, /**< High 10 profile */
  7619. + OMX_VIDEO_AVCProfileHigh422 = 0x20, /**< High 4:2:2 profile */
  7620. + OMX_VIDEO_AVCProfileHigh444 = 0x40, /**< High 4:4:4 profile */
  7621. + OMX_VIDEO_AVCProfileKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  7622. + OMX_VIDEO_AVCProfileVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  7623. + OMX_VIDEO_AVCProfileMax = 0x7FFFFFFF
  7624. +} OMX_VIDEO_AVCPROFILETYPE;
  7625. +
  7626. +
  7627. +/**
  7628. + * AVC level types, each level indicates support for various frame sizes,
  7629. + * bit rates, decoder frame rates. No need
  7630. + */
  7631. +typedef enum OMX_VIDEO_AVCLEVELTYPE {
  7632. + OMX_VIDEO_AVCLevel1 = 0x01, /**< Level 1 */
  7633. + OMX_VIDEO_AVCLevel1b = 0x02, /**< Level 1b */
  7634. + OMX_VIDEO_AVCLevel11 = 0x04, /**< Level 1.1 */
  7635. + OMX_VIDEO_AVCLevel12 = 0x08, /**< Level 1.2 */
  7636. + OMX_VIDEO_AVCLevel13 = 0x10, /**< Level 1.3 */
  7637. + OMX_VIDEO_AVCLevel2 = 0x20, /**< Level 2 */
  7638. + OMX_VIDEO_AVCLevel21 = 0x40, /**< Level 2.1 */
  7639. + OMX_VIDEO_AVCLevel22 = 0x80, /**< Level 2.2 */
  7640. + OMX_VIDEO_AVCLevel3 = 0x100, /**< Level 3 */
  7641. + OMX_VIDEO_AVCLevel31 = 0x200, /**< Level 3.1 */
  7642. + OMX_VIDEO_AVCLevel32 = 0x400, /**< Level 3.2 */
  7643. + OMX_VIDEO_AVCLevel4 = 0x800, /**< Level 4 */
  7644. + OMX_VIDEO_AVCLevel41 = 0x1000, /**< Level 4.1 */
  7645. + OMX_VIDEO_AVCLevel42 = 0x2000, /**< Level 4.2 */
  7646. + OMX_VIDEO_AVCLevel5 = 0x4000, /**< Level 5 */
  7647. + OMX_VIDEO_AVCLevel51 = 0x8000, /**< Level 5.1 */
  7648. + OMX_VIDEO_AVCLevel52 = 0x10000, /**< Level 5.2 */
  7649. + OMX_VIDEO_AVCLevelKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  7650. + OMX_VIDEO_AVCLevelVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  7651. + OMX_VIDEO_AVCLevelMax = 0x7FFFFFFF
  7652. +} OMX_VIDEO_AVCLEVELTYPE;
  7653. +
  7654. +
  7655. +/**
  7656. + * AVC loop filter modes
  7657. + *
  7658. + * OMX_VIDEO_AVCLoopFilterEnable : Enable
  7659. + * OMX_VIDEO_AVCLoopFilterDisable : Disable
  7660. + * OMX_VIDEO_AVCLoopFilterDisableSliceBoundary : Disabled on slice boundaries
  7661. + */
  7662. +typedef enum OMX_VIDEO_AVCLOOPFILTERTYPE {
  7663. + OMX_VIDEO_AVCLoopFilterEnable = 0,
  7664. + OMX_VIDEO_AVCLoopFilterDisable,
  7665. + OMX_VIDEO_AVCLoopFilterDisableSliceBoundary,
  7666. + OMX_VIDEO_AVCLoopFilterKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  7667. + OMX_VIDEO_AVCLoopFilterVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  7668. + OMX_VIDEO_AVCLoopFilterMax = 0x7FFFFFFF
  7669. +} OMX_VIDEO_AVCLOOPFILTERTYPE;
  7670. +
  7671. +
  7672. +/**
  7673. + * AVC params
  7674. + *
  7675. + * STRUCT MEMBERS:
  7676. + * nSize : Size of the structure in bytes
  7677. + * nVersion : OMX specification version information
  7678. + * nPortIndex : Port that this structure applies to
  7679. + * nSliceHeaderSpacing : Number of macroblocks between slice header, put
  7680. + * zero if not used
  7681. + * nPFrames : Number of P frames between each I frame
  7682. + * nBFrames : Number of B frames between each I frame
  7683. + * bUseHadamard : Enable/disable Hadamard transform
  7684. + * nRefFrames : Max number of reference frames to use for inter
  7685. + * motion search (1-16)
  7686. + * nRefIdxTrailing : Pic param set ref frame index (index into ref
  7687. + * frame buffer of trailing frames list), B frame
  7688. + * support
  7689. + * nRefIdxForward : Pic param set ref frame index (index into ref
  7690. + * frame buffer of forward frames list), B frame
  7691. + * support
  7692. + * bEnableUEP : Enable/disable unequal error protection. This
  7693. + * is only valid of data partitioning is enabled.
  7694. + * bEnableFMO : Enable/disable flexible macroblock ordering
  7695. + * bEnableASO : Enable/disable arbitrary slice ordering
  7696. + * bEnableRS : Enable/disable sending of redundant slices
  7697. + * eProfile : AVC profile(s) to use
  7698. + * eLevel : AVC level(s) to use
  7699. + * nAllowedPictureTypes : Specifies the picture types allowed in the
  7700. + * bitstream
  7701. + * bFrameMBsOnly : specifies that every coded picture of the
  7702. + * coded video sequence is a coded frame
  7703. + * containing only frame macroblocks
  7704. + * bMBAFF : Enable/disable switching between frame and
  7705. + * field macroblocks within a picture
  7706. + * bEntropyCodingCABAC : Entropy decoding method to be applied for the
  7707. + * syntax elements for which two descriptors appear
  7708. + * in the syntax tables
  7709. + * bWeightedPPrediction : Enable/disable weighted prediction shall not
  7710. + * be applied to P and SP slices
  7711. + * nWeightedBipredicitonMode : Default weighted prediction is applied to B
  7712. + * slices
  7713. + * bconstIpred : Enable/disable intra prediction
  7714. + * bDirect8x8Inference : Specifies the method used in the derivation
  7715. + * process for luma motion vectors for B_Skip,
  7716. + * B_Direct_16x16 and B_Direct_8x8 as specified
  7717. + * in subclause 8.4.1.2 of the AVC spec
  7718. + * bDirectSpatialTemporal : Flag indicating spatial or temporal direct
  7719. + * mode used in B slice coding (related to
  7720. + * bDirect8x8Inference) . Spatial direct mode is
  7721. + * more common and should be the default.
  7722. + * nCabacInitIdx : Index used to init CABAC contexts
  7723. + * eLoopFilterMode : Enable/disable loop filter
  7724. + */
  7725. +typedef struct OMX_VIDEO_PARAM_AVCTYPE {
  7726. + OMX_U32 nSize;
  7727. + OMX_VERSIONTYPE nVersion;
  7728. + OMX_U32 nPortIndex;
  7729. + OMX_U32 nSliceHeaderSpacing;
  7730. + OMX_U32 nPFrames;
  7731. + OMX_U32 nBFrames;
  7732. + OMX_BOOL bUseHadamard;
  7733. + OMX_U32 nRefFrames;
  7734. + OMX_U32 nRefIdx10ActiveMinus1;
  7735. + OMX_U32 nRefIdx11ActiveMinus1;
  7736. + OMX_BOOL bEnableUEP;
  7737. + OMX_BOOL bEnableFMO;
  7738. + OMX_BOOL bEnableASO;
  7739. + OMX_BOOL bEnableRS;
  7740. + OMX_VIDEO_AVCPROFILETYPE eProfile;
  7741. + OMX_VIDEO_AVCLEVELTYPE eLevel;
  7742. + OMX_U32 nAllowedPictureTypes;
  7743. + OMX_BOOL bFrameMBsOnly;
  7744. + OMX_BOOL bMBAFF;
  7745. + OMX_BOOL bEntropyCodingCABAC;
  7746. + OMX_BOOL bWeightedPPrediction;
  7747. + OMX_U32 nWeightedBipredicitonMode;
  7748. + OMX_BOOL bconstIpred ;
  7749. + OMX_BOOL bDirect8x8Inference;
  7750. + OMX_BOOL bDirectSpatialTemporal;
  7751. + OMX_U32 nCabacInitIdc;
  7752. + OMX_VIDEO_AVCLOOPFILTERTYPE eLoopFilterMode;
  7753. +} OMX_VIDEO_PARAM_AVCTYPE;
  7754. +
  7755. +typedef struct OMX_VIDEO_PARAM_PROFILELEVELTYPE {
  7756. + OMX_U32 nSize;
  7757. + OMX_VERSIONTYPE nVersion;
  7758. + OMX_U32 nPortIndex;
  7759. + OMX_U32 eProfile; /**< type is OMX_VIDEO_AVCPROFILETYPE, OMX_VIDEO_H263PROFILETYPE,
  7760. + or OMX_VIDEO_MPEG4PROFILETYPE depending on context */
  7761. + OMX_U32 eLevel; /**< type is OMX_VIDEO_AVCLEVELTYPE, OMX_VIDEO_H263LEVELTYPE,
  7762. + or OMX_VIDEO_MPEG4PROFILETYPE depending on context */
  7763. + OMX_U32 nProfileIndex; /**< Used to query for individual profile support information,
  7764. + This parameter is valid only for
  7765. + OMX_IndexParamVideoProfileLevelQuerySupported index,
  7766. + For all other indices this parameter is to be ignored. */
  7767. +} OMX_VIDEO_PARAM_PROFILELEVELTYPE;
  7768. +
  7769. +/**
  7770. + * Structure for dynamically configuring bitrate mode of a codec.
  7771. + *
  7772. + * STRUCT MEMBERS:
  7773. + * nSize : Size of the struct in bytes
  7774. + * nVersion : OMX spec version info
  7775. + * nPortIndex : Port that this struct applies to
  7776. + * nEncodeBitrate : Target average bitrate to be generated in bps
  7777. + */
  7778. +typedef struct OMX_VIDEO_CONFIG_BITRATETYPE {
  7779. + OMX_U32 nSize;
  7780. + OMX_VERSIONTYPE nVersion;
  7781. + OMX_U32 nPortIndex;
  7782. + OMX_U32 nEncodeBitrate;
  7783. +} OMX_VIDEO_CONFIG_BITRATETYPE;
  7784. +
  7785. +/**
  7786. + * Defines Encoder Frame Rate setting
  7787. + *
  7788. + * STRUCT MEMBERS:
  7789. + * nSize : Size of the structure in bytes
  7790. + * nVersion : OMX specification version information
  7791. + * nPortIndex : Port that this structure applies to
  7792. + * xEncodeFramerate : Encoding framerate represented in Q16 format
  7793. + */
  7794. +typedef struct OMX_CONFIG_FRAMERATETYPE {
  7795. + OMX_U32 nSize;
  7796. + OMX_VERSIONTYPE nVersion;
  7797. + OMX_U32 nPortIndex;
  7798. + OMX_U32 xEncodeFramerate; /* Q16 format */
  7799. +} OMX_CONFIG_FRAMERATETYPE;
  7800. +
  7801. +typedef struct OMX_CONFIG_INTRAREFRESHVOPTYPE {
  7802. + OMX_U32 nSize;
  7803. + OMX_VERSIONTYPE nVersion;
  7804. + OMX_U32 nPortIndex;
  7805. + OMX_BOOL IntraRefreshVOP;
  7806. +} OMX_CONFIG_INTRAREFRESHVOPTYPE;
  7807. +
  7808. +typedef struct OMX_CONFIG_MACROBLOCKERRORMAPTYPE {
  7809. + OMX_U32 nSize;
  7810. + OMX_VERSIONTYPE nVersion;
  7811. + OMX_U32 nPortIndex;
  7812. + OMX_U32 nErrMapSize; /* Size of the Error Map in bytes */
  7813. + OMX_U8 ErrMap[1]; /* Error map hint */
  7814. +} OMX_CONFIG_MACROBLOCKERRORMAPTYPE;
  7815. +
  7816. +typedef struct OMX_CONFIG_MBERRORREPORTINGTYPE {
  7817. + OMX_U32 nSize;
  7818. + OMX_VERSIONTYPE nVersion;
  7819. + OMX_U32 nPortIndex;
  7820. + OMX_BOOL bEnabled;
  7821. +} OMX_CONFIG_MBERRORREPORTINGTYPE;
  7822. +
  7823. +typedef struct OMX_PARAM_MACROBLOCKSTYPE {
  7824. + OMX_U32 nSize;
  7825. + OMX_VERSIONTYPE nVersion;
  7826. + OMX_U32 nPortIndex;
  7827. + OMX_U32 nMacroblocks;
  7828. +} OMX_PARAM_MACROBLOCKSTYPE;
  7829. +
  7830. +
  7831. +#ifdef AVS80
  7832. +/**
  7833. + * Aspects of color.
  7834. + */
  7835. +
  7836. +// NOTE: this structure is expected to grow in the future if new color aspects are
  7837. +// added to codec bitstreams. OMX component should not require a specific nSize
  7838. +// though could verify that nSize is at least the size of the structure at the
  7839. +// time of implementation. All new fields will be added at the end of the structure
  7840. +// ensuring backward compatibility.
  7841. +
  7842. +typedef enum OMX_RANGE {
  7843. + RangeUnspecified,
  7844. + RangeFull,
  7845. + RangeLimited,
  7846. + RangeOther = 0xff,
  7847. +} OMX_RANGE;
  7848. +
  7849. +typedef enum OMX_PRIMARIES {
  7850. + PrimariesUnspecified,
  7851. + PrimariesBT709_5, // Rec.ITU-R BT.709-5 or equivalent
  7852. + PrimariesBT470_6M, // Rec.ITU-R BT.470-6 System M or equivalent
  7853. + PrimariesBT601_6_625, // Rec.ITU-R BT.601-6 625 or equivalent
  7854. + PrimariesBT601_6_525, // Rec.ITU-R BT.601-6 525 or equivalent
  7855. + PrimariesGenericFilm, // Generic Film
  7856. + PrimariesBT2020, // Rec.ITU-R BT.2020 or equivalent
  7857. + PrimariesOther = 0xff,
  7858. +} OMX_PRIMARIES;
  7859. +
  7860. +typedef enum OMX_TRANSFER {
  7861. + TransferUnspecified,
  7862. + TransferLinear, // Linear transfer characteristics
  7863. + TransferSRGB, // sRGB or equivalent
  7864. + TransferSMPTE170M, // SMPTE 170M or equivalent (e.g. BT.601/709/2020)
  7865. + TransferGamma22, // Assumed display gamma 2.2
  7866. + TransferGamma28, // Assumed display gamma 2.8
  7867. + TransferST2084, // SMPTE ST 2084 for 10/12/14/16 bit systems
  7868. + TransferHLG, // ARIB STD-B67 hybrid-log-gamma
  7869. + // transfers unlikely to be required by Android
  7870. + TransferSMPTE240M = 0x40, // SMPTE 240M
  7871. + TransferXvYCC, // IEC 61966-2-4
  7872. + TransferBT1361, // Rec.ITU-R BT.1361 extended gamut
  7873. + TransferST428, // SMPTE ST 428-1
  7874. + TransferOther = 0xff,
  7875. +} OMX_TRANSFER;
  7876. +
  7877. +typedef enum OMX_MATRIXCOEFFS {
  7878. + MatrixUnspecified,
  7879. + MatrixBT709_5, // Rec.ITU-R BT.709-5 or equivalent
  7880. + MatrixBT470_6M, // KR=0.30, KB=0.11 or equivalent
  7881. + MatrixBT601_6, // Rec.ITU-R BT.601-6 625 or equivalent
  7882. + MatrixSMPTE240M, // SMPTE 240M or equivalent
  7883. + MatrixBT2020, // Rec.ITU-R BT.2020 non-constant luminance
  7884. + MatrixBT2020Constant, // Rec.ITU-R BT.2020 constant luminance
  7885. + MatrixOther = 0xff,
  7886. +} OMX_MATRIXCOEFFS;
  7887. +
  7888. +typedef struct OMX_COLORASPECTS {
  7889. + OMX_RANGE mRange; // IN/OUT
  7890. + OMX_PRIMARIES mPrimaries; // IN/OUT
  7891. + OMX_TRANSFER mTransfer; // IN/OUT
  7892. + OMX_MATRIXCOEFFS mMatrixCoeffs; // IN/OUT
  7893. +} OMX_COLORASPECTS;
  7894. +
  7895. +typedef struct OMX_CONFIG_DESCRIBECOLORASPECTSPARAMS {
  7896. + OMX_U32 nSize; // IN
  7897. + OMX_VERSIONTYPE nVersion; // IN
  7898. + OMX_U32 nPortIndex; // IN
  7899. + OMX_BOOL bRequestingDataSpace; // IN
  7900. + OMX_BOOL bDataSpaceChanged; // IN
  7901. + OMX_U32 nPixelFormat; // IN
  7902. + OMX_U32 nDataSpace; // OUT
  7903. + OMX_COLORASPECTS sAspects; // IN/OUT
  7904. +} OMX_CONFIG_DESCRIBECOLORASPECTSPARAMS;
  7905. +#endif
  7906. +
  7907. +/**
  7908. + * AVC Slice Mode modes
  7909. + *
  7910. + * OMX_VIDEO_SLICEMODE_AVCDefault : Normal frame encoding, one slice per frame
  7911. + * OMX_VIDEO_SLICEMODE_AVCMBSlice : NAL mode, number of MBs per frame
  7912. + * OMX_VIDEO_SLICEMODE_AVCByteSlice : NAL mode, number of bytes per frame
  7913. + */
  7914. +typedef enum OMX_VIDEO_AVCSLICEMODETYPE {
  7915. + OMX_VIDEO_SLICEMODE_AVCDefault = 0,
  7916. + OMX_VIDEO_SLICEMODE_AVCMBSlice,
  7917. + OMX_VIDEO_SLICEMODE_AVCByteSlice,
  7918. + OMX_VIDEO_SLICEMODE_AVCKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  7919. + OMX_VIDEO_SLICEMODE_AVCVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  7920. + OMX_VIDEO_SLICEMODE_AVCLevelMax = 0x7FFFFFFF
  7921. +} OMX_VIDEO_AVCSLICEMODETYPE;
  7922. +
  7923. +/**
  7924. + * AVC FMO Slice Mode Params
  7925. + *
  7926. + * STRUCT MEMBERS:
  7927. + * nSize : Size of the structure in bytes
  7928. + * nVersion : OMX specification version information
  7929. + * nPortIndex : Port that this structure applies to
  7930. + * nNumSliceGroups : Specifies the number of slice groups
  7931. + * nSliceGroupMapType : Specifies the type of slice groups
  7932. + * eSliceMode : Specifies the type of slice
  7933. + */
  7934. +typedef struct OMX_VIDEO_PARAM_AVCSLICEFMO {
  7935. + OMX_U32 nSize;
  7936. + OMX_VERSIONTYPE nVersion;
  7937. + OMX_U32 nPortIndex;
  7938. + OMX_U8 nNumSliceGroups;
  7939. + OMX_U8 nSliceGroupMapType;
  7940. + OMX_VIDEO_AVCSLICEMODETYPE eSliceMode;
  7941. +} OMX_VIDEO_PARAM_AVCSLICEFMO;
  7942. +
  7943. +/**
  7944. + * AVC IDR Period Configs
  7945. + *
  7946. + * STRUCT MEMBERS:
  7947. + * nSize : Size of the structure in bytes
  7948. + * nVersion : OMX specification version information
  7949. + * nPortIndex : Port that this structure applies to
  7950. + * nIDRPeriod : Specifies periodicity of IDR frames
  7951. + * nPFrames : Specifies internal of coding Intra frames
  7952. + */
  7953. +typedef struct OMX_VIDEO_CONFIG_AVCINTRAPERIOD {
  7954. + OMX_U32 nSize;
  7955. + OMX_VERSIONTYPE nVersion;
  7956. + OMX_U32 nPortIndex;
  7957. + OMX_U32 nIDRPeriod;
  7958. + OMX_U32 nPFrames;
  7959. +} OMX_VIDEO_CONFIG_AVCINTRAPERIOD;
  7960. +
  7961. +/**
  7962. + * AVC NAL Size Configs
  7963. + *
  7964. + * STRUCT MEMBERS:
  7965. + * nSize : Size of the structure in bytes
  7966. + * nVersion : OMX specification version information
  7967. + * nPortIndex : Port that this structure applies to
  7968. + * nNaluBytes : Specifies the NAL unit size
  7969. + */
  7970. +typedef struct OMX_VIDEO_CONFIG_NALSIZE {
  7971. + OMX_U32 nSize;
  7972. + OMX_VERSIONTYPE nVersion;
  7973. + OMX_U32 nPortIndex;
  7974. + OMX_U32 nNaluBytes;
  7975. +} OMX_VIDEO_CONFIG_NALSIZE;
  7976. +
  7977. +/** @} */
  7978. +
  7979. +#ifdef __cplusplus
  7980. +}
  7981. +#endif /* __cplusplus */
  7982. +
  7983. +#endif
  7984. +/* File EOF */
  7985. +
  7986. diff --git a/encoder/include/khronos/OMX_VideoExt.h b/encoder/include/khronos/OMX_VideoExt.h
  7987. new file mode 100755
  7988. index 0000000..2c02431
  7989. --- /dev/null
  7990. +++ b/encoder/include/khronos/OMX_VideoExt.h
  7991. @@ -0,0 +1,401 @@
  7992. +/*
  7993. + * Copyright (c) 2010 The Khronos Group Inc.
  7994. + *
  7995. + * Permission is hereby granted, free of charge, to any person obtaining
  7996. + * a copy of this software and associated documentation files (the
  7997. + * "Software"), to deal in the Software without restriction, including
  7998. + * without limitation the rights to use, copy, modify, merge, publish,
  7999. + * distribute, sublicense, and/or sell copies of the Software, and to
  8000. + * permit persons to whom the Software is furnished to do so, subject
  8001. + * to the following conditions:
  8002. + * The above copyright notice and this permission notice shall be included
  8003. + * in all copies or substantial portions of the Software.
  8004. + *
  8005. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  8006. + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  8007. + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  8008. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
  8009. + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  8010. + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  8011. + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  8012. + *
  8013. + */
  8014. +
  8015. +/** OMX_VideoExt.h - OpenMax IL version 1.1.2
  8016. + * The OMX_VideoExt header file contains extensions to the
  8017. + * definitions used by both the application and the component to
  8018. + * access video items.
  8019. + */
  8020. +
  8021. +#ifndef OMX_VideoExt_h
  8022. +#define OMX_VideoExt_h
  8023. +
  8024. +#ifdef __cplusplus
  8025. +extern "C" {
  8026. +#endif /* __cplusplus */
  8027. +
  8028. +/* Each OMX header shall include all required header files to allow the
  8029. + * header to compile without errors. The includes below are required
  8030. + * for this header file to compile successfully
  8031. + */
  8032. +#include <OMX_Core.h>
  8033. +
  8034. +/** NALU Formats */
  8035. +typedef enum OMX_NALUFORMATSTYPE {
  8036. + OMX_NaluFormatStartCodes = 1,
  8037. + OMX_NaluFormatOneNaluPerBuffer = 2,
  8038. + OMX_NaluFormatOneByteInterleaveLength = 4,
  8039. + OMX_NaluFormatTwoByteInterleaveLength = 8,
  8040. + OMX_NaluFormatFourByteInterleaveLength = 16,
  8041. + OMX_NaluFormatCodingMax = 0x7FFFFFFF
  8042. +} OMX_NALUFORMATSTYPE;
  8043. +
  8044. +/** NAL Stream Format */
  8045. +typedef struct OMX_NALSTREAMFORMATTYPE{
  8046. + OMX_U32 nSize;
  8047. + OMX_VERSIONTYPE nVersion;
  8048. + OMX_U32 nPortIndex;
  8049. + OMX_NALUFORMATSTYPE eNaluFormat;
  8050. +} OMX_NALSTREAMFORMATTYPE;
  8051. +
  8052. +/** VP8 profiles */
  8053. +typedef enum OMX_VIDEO_VP8PROFILETYPE {
  8054. + OMX_VIDEO_VP8ProfileMain = 0x01,
  8055. + OMX_VIDEO_VP8ProfileUnknown = 0x6EFFFFFF,
  8056. + OMX_VIDEO_VP8ProfileMax = 0x7FFFFFFF
  8057. +} OMX_VIDEO_VP8PROFILETYPE;
  8058. +
  8059. +/** VP8 levels */
  8060. +typedef enum OMX_VIDEO_VP8LEVELTYPE {
  8061. + OMX_VIDEO_VP8Level_Version0 = 0x01,
  8062. + OMX_VIDEO_VP8Level_Version1 = 0x02,
  8063. + OMX_VIDEO_VP8Level_Version2 = 0x04,
  8064. + OMX_VIDEO_VP8Level_Version3 = 0x08,
  8065. + OMX_VIDEO_VP8LevelUnknown = 0x6EFFFFFF,
  8066. + OMX_VIDEO_VP8LevelMax = 0x7FFFFFFF
  8067. +} OMX_VIDEO_VP8LEVELTYPE;
  8068. +
  8069. +/** VP9 profiles */
  8070. +typedef enum OMX_VIDEO_VP9PROFILETYPE {
  8071. + OMX_VIDEO_VP9Profile0 = 0x1,
  8072. + OMX_VIDEO_VP9Profile1 = 0x2,
  8073. + OMX_VIDEO_VP9Profile2 = 0x4,
  8074. + OMX_VIDEO_VP9Profile3 = 0x8,
  8075. + // HDR profiles also support passing HDR metadata
  8076. + OMX_VIDEO_VP9Profile2HDR = 0x1000,
  8077. + OMX_VIDEO_VP9Profile3HDR = 0x2000,
  8078. + OMX_VIDEO_VP9ProfileUnknown = 0x6EFFFFFF,
  8079. + OMX_VIDEO_VP9ProfileMax = 0x7FFFFFFF
  8080. +} OMX_VIDEO_VP9PROFILETYPE;
  8081. +
  8082. +/** VP9 levels */
  8083. +typedef enum OMX_VIDEO_VP9LEVELTYPE {
  8084. + OMX_VIDEO_VP9Level1 = 0x1,
  8085. + OMX_VIDEO_VP9Level11 = 0x2,
  8086. + OMX_VIDEO_VP9Level2 = 0x4,
  8087. + OMX_VIDEO_VP9Level21 = 0x8,
  8088. + OMX_VIDEO_VP9Level3 = 0x10,
  8089. + OMX_VIDEO_VP9Level31 = 0x20,
  8090. + OMX_VIDEO_VP9Level4 = 0x40,
  8091. + OMX_VIDEO_VP9Level41 = 0x80,
  8092. + OMX_VIDEO_VP9Level5 = 0x100,
  8093. + OMX_VIDEO_VP9Level51 = 0x200,
  8094. + OMX_VIDEO_VP9Level52 = 0x400,
  8095. + OMX_VIDEO_VP9Level6 = 0x800,
  8096. + OMX_VIDEO_VP9Level61 = 0x1000,
  8097. + OMX_VIDEO_VP9Level62 = 0x2000,
  8098. + OMX_VIDEO_VP9LevelUnknown = 0x6EFFFFFF,
  8099. + OMX_VIDEO_VP9LevelMax = 0x7FFFFFFF
  8100. +} OMX_VIDEO_VP9LEVELTYPE;
  8101. +
  8102. +/** VP8 Param */
  8103. +typedef struct OMX_VIDEO_PARAM_VP8TYPE {
  8104. + OMX_U32 nSize;
  8105. + OMX_VERSIONTYPE nVersion;
  8106. + OMX_U32 nPortIndex;
  8107. + OMX_VIDEO_VP8PROFILETYPE eProfile;
  8108. + OMX_VIDEO_VP8LEVELTYPE eLevel;
  8109. + OMX_U32 nDCTPartitions;
  8110. + OMX_BOOL bErrorResilientMode;
  8111. +} OMX_VIDEO_PARAM_VP8TYPE;
  8112. +
  8113. +/** Structure for configuring VP8 reference frames */
  8114. +typedef struct OMX_VIDEO_VP8REFERENCEFRAMETYPE {
  8115. + OMX_U32 nSize;
  8116. + OMX_VERSIONTYPE nVersion;
  8117. + OMX_U32 nPortIndex;
  8118. + OMX_BOOL bPreviousFrameRefresh;
  8119. + OMX_BOOL bGoldenFrameRefresh;
  8120. + OMX_BOOL bAlternateFrameRefresh;
  8121. + OMX_BOOL bUsePreviousFrame;
  8122. + OMX_BOOL bUseGoldenFrame;
  8123. + OMX_BOOL bUseAlternateFrame;
  8124. +} OMX_VIDEO_VP8REFERENCEFRAMETYPE;
  8125. +
  8126. +/** Structure for querying VP8 reference frame type */
  8127. +typedef struct OMX_VIDEO_VP8REFERENCEFRAMEINFOTYPE {
  8128. + OMX_U32 nSize;
  8129. + OMX_VERSIONTYPE nVersion;
  8130. + OMX_U32 nPortIndex;
  8131. + OMX_BOOL bIsIntraFrame;
  8132. + OMX_BOOL bIsGoldenOrAlternateFrame;
  8133. +} OMX_VIDEO_VP8REFERENCEFRAMEINFOTYPE;
  8134. +
  8135. +/** Maximum number of VP8 temporal layers */
  8136. +#define OMX_VIDEO_ANDROID_MAXVP8TEMPORALLAYERS 3
  8137. +
  8138. +/** VP8 temporal layer patterns */
  8139. +typedef enum OMX_VIDEO_ANDROID_VPXTEMPORALLAYERPATTERNTYPE {
  8140. + OMX_VIDEO_VPXTemporalLayerPatternNone = 0,
  8141. + OMX_VIDEO_VPXTemporalLayerPatternWebRTC = 1,
  8142. + OMX_VIDEO_VPXTemporalLayerPatternMax = 0x7FFFFFFF
  8143. +} OMX_VIDEO_ANDROID_VPXTEMPORALLAYERPATTERNTYPE;
  8144. +
  8145. +/**
  8146. + * Android specific VP8 encoder params
  8147. + *
  8148. + * STRUCT MEMBERS:
  8149. + * nSize : Size of the structure in bytes
  8150. + * nVersion : OMX specification version information
  8151. + * nPortIndex : Port that this structure applies to
  8152. + * nKeyFrameInterval : Key frame interval in frames
  8153. + * eTemporalPattern : Type of temporal layer pattern
  8154. + * nTemporalLayerCount : Number of temporal coding layers
  8155. + * nTemporalLayerBitrateRatio : Bitrate ratio allocation between temporal
  8156. + * streams in percentage
  8157. + * nMinQuantizer : Minimum (best quality) quantizer
  8158. + * nMaxQuantizer : Maximum (worst quality) quantizer
  8159. + */
  8160. +typedef struct OMX_VIDEO_PARAM_ANDROID_VP8ENCODERTYPE {
  8161. + OMX_U32 nSize;
  8162. + OMX_VERSIONTYPE nVersion;
  8163. + OMX_U32 nPortIndex;
  8164. + OMX_U32 nKeyFrameInterval; // distance between consecutive key_frames (including one
  8165. + // of the key_frames). 0 means interval is unspecified and
  8166. + // can be freely chosen by the codec. 1 means a stream of
  8167. + // only key_frames.
  8168. +
  8169. + OMX_VIDEO_ANDROID_VPXTEMPORALLAYERPATTERNTYPE eTemporalPattern;
  8170. + OMX_U32 nTemporalLayerCount;
  8171. + OMX_U32 nTemporalLayerBitrateRatio[OMX_VIDEO_ANDROID_MAXVP8TEMPORALLAYERS];
  8172. + OMX_U32 nMinQuantizer;
  8173. + OMX_U32 nMaxQuantizer;
  8174. +} OMX_VIDEO_PARAM_ANDROID_VP8ENCODERTYPE;
  8175. +
  8176. +/** HEVC Profile enum type */
  8177. +typedef enum OMX_VIDEO_HEVCPROFILETYPE {
  8178. + OMX_VIDEO_HEVCProfileUnknown = 0x0,
  8179. + OMX_VIDEO_HEVCProfileMain = 0x1,
  8180. + OMX_VIDEO_HEVCProfileMain10 = 0x2,
  8181. + // Main10 profile with HDR SEI support.
  8182. + OMX_VIDEO_HEVCProfileMain10HDR10 = 0x1000,
  8183. + OMX_VIDEO_HEVCProfileMax = 0x7FFFFFFF
  8184. +} OMX_VIDEO_HEVCPROFILETYPE;
  8185. +
  8186. +/** HEVC Level enum type */
  8187. +typedef enum OMX_VIDEO_HEVCLEVELTYPE {
  8188. + OMX_VIDEO_HEVCLevelUnknown = 0x0,
  8189. + OMX_VIDEO_HEVCMainTierLevel1 = 0x1,
  8190. + OMX_VIDEO_HEVCHighTierLevel1 = 0x2,
  8191. + OMX_VIDEO_HEVCMainTierLevel2 = 0x4,
  8192. + OMX_VIDEO_HEVCHighTierLevel2 = 0x8,
  8193. + OMX_VIDEO_HEVCMainTierLevel21 = 0x10,
  8194. + OMX_VIDEO_HEVCHighTierLevel21 = 0x20,
  8195. + OMX_VIDEO_HEVCMainTierLevel3 = 0x40,
  8196. + OMX_VIDEO_HEVCHighTierLevel3 = 0x80,
  8197. + OMX_VIDEO_HEVCMainTierLevel31 = 0x100,
  8198. + OMX_VIDEO_HEVCHighTierLevel31 = 0x200,
  8199. + OMX_VIDEO_HEVCMainTierLevel4 = 0x400,
  8200. + OMX_VIDEO_HEVCHighTierLevel4 = 0x800,
  8201. + OMX_VIDEO_HEVCMainTierLevel41 = 0x1000,
  8202. + OMX_VIDEO_HEVCHighTierLevel41 = 0x2000,
  8203. + OMX_VIDEO_HEVCMainTierLevel5 = 0x4000,
  8204. + OMX_VIDEO_HEVCHighTierLevel5 = 0x8000,
  8205. + OMX_VIDEO_HEVCMainTierLevel51 = 0x10000,
  8206. + OMX_VIDEO_HEVCHighTierLevel51 = 0x20000,
  8207. + OMX_VIDEO_HEVCMainTierLevel52 = 0x40000,
  8208. + OMX_VIDEO_HEVCHighTierLevel52 = 0x80000,
  8209. + OMX_VIDEO_HEVCMainTierLevel6 = 0x100000,
  8210. + OMX_VIDEO_HEVCHighTierLevel6 = 0x200000,
  8211. + OMX_VIDEO_HEVCMainTierLevel61 = 0x400000,
  8212. + OMX_VIDEO_HEVCHighTierLevel61 = 0x800000,
  8213. + OMX_VIDEO_HEVCMainTierLevel62 = 0x1000000,
  8214. + OMX_VIDEO_HEVCHighTierLevel62 = 0x2000000,
  8215. + OMX_VIDEO_HEVCHighTiermax = 0x7FFFFFFF
  8216. +} OMX_VIDEO_HEVCLEVELTYPE;
  8217. +
  8218. +/** Structure for controlling HEVC video encoding */
  8219. +typedef struct OMX_VIDEO_PARAM_HEVCTYPE {
  8220. + OMX_U32 nSize;
  8221. + OMX_VERSIONTYPE nVersion;
  8222. + OMX_U32 nPortIndex;
  8223. + OMX_VIDEO_HEVCPROFILETYPE eProfile;
  8224. + OMX_VIDEO_HEVCLEVELTYPE eLevel;
  8225. + OMX_U32 nKeyFrameInterval; // distance between consecutive I-frames (including one
  8226. + // of the I frames). 0 means interval is unspecified and
  8227. + // can be freely chosen by the codec. 1 means a stream of
  8228. + // only I frames.
  8229. +} OMX_VIDEO_PARAM_HEVCTYPE;
  8230. +
  8231. +/** Structure to define if dependent slice segments should be used */
  8232. +typedef struct OMX_VIDEO_SLICESEGMENTSTYPE {
  8233. + OMX_U32 nSize;
  8234. + OMX_VERSIONTYPE nVersion;
  8235. + OMX_U32 nPortIndex;
  8236. + OMX_BOOL bDepedentSegments;
  8237. + OMX_BOOL bEnableLoopFilterAcrossSlices;
  8238. +} OMX_VIDEO_SLICESEGMENTSTYPE;
  8239. +
  8240. +/** Structure to return timestamps of rendered output frames as well as EOS
  8241. + * for tunneled components.
  8242. + */
  8243. +typedef struct OMX_VIDEO_RENDEREVENTTYPE {
  8244. + OMX_S64 nMediaTimeUs; // timestamp of rendered video frame
  8245. + OMX_S64 nSystemTimeNs; // system monotonic time at the time frame was rendered
  8246. + // Use INT64_MAX for nMediaTimeUs to signal that the EOS
  8247. + // has been reached. In this case, nSystemTimeNs MUST be
  8248. + // the system time when the last frame was rendered.
  8249. + // This MUST be done in addition to returning (and
  8250. + // following) the render information for the last frame.
  8251. +} OMX_VIDEO_RENDEREVENTTYPE;
  8252. +
  8253. +/** Dolby Vision Profile enum type */
  8254. +typedef enum OMX_VIDEO_DOLBYVISIONPROFILETYPE {
  8255. + OMX_VIDEO_DolbyVisionProfileUnknown = 0x0,
  8256. + OMX_VIDEO_DolbyVisionProfileDvavPer = 0x1,
  8257. + OMX_VIDEO_DolbyVisionProfileDvavPen = 0x2,
  8258. + OMX_VIDEO_DolbyVisionProfileDvheDer = 0x4,
  8259. + OMX_VIDEO_DolbyVisionProfileDvheDen = 0x8,
  8260. + OMX_VIDEO_DolbyVisionProfileDvheDtr = 0x10,
  8261. + OMX_VIDEO_DolbyVisionProfileDvheStn = 0x20,
  8262. + OMX_VIDEO_DolbyVisionProfileDvheDth = 0x40,
  8263. + OMX_VIDEO_DolbyVisionProfileDvheDtb = 0x80,
  8264. + OMX_VIDEO_DolbyVisionProfileMax = 0x7FFFFFFF
  8265. +} OMX_VIDEO_DOLBYVISIONPROFILETYPE;
  8266. +
  8267. +/** Dolby Vision Level enum type */
  8268. +typedef enum OMX_VIDEO_DOLBYVISIONLEVELTYPE {
  8269. + OMX_VIDEO_DolbyVisionLevelUnknown = 0x0,
  8270. + OMX_VIDEO_DolbyVisionLevelHd24 = 0x1,
  8271. + OMX_VIDEO_DolbyVisionLevelHd30 = 0x2,
  8272. + OMX_VIDEO_DolbyVisionLevelFhd24 = 0x4,
  8273. + OMX_VIDEO_DolbyVisionLevelFhd30 = 0x8,
  8274. + OMX_VIDEO_DolbyVisionLevelFhd60 = 0x10,
  8275. + OMX_VIDEO_DolbyVisionLevelUhd24 = 0x20,
  8276. + OMX_VIDEO_DolbyVisionLevelUhd30 = 0x40,
  8277. + OMX_VIDEO_DolbyVisionLevelUhd48 = 0x80,
  8278. + OMX_VIDEO_DolbyVisionLevelUhd60 = 0x100,
  8279. + OMX_VIDEO_DolbyVisionLevelmax = 0x7FFFFFFF
  8280. +} OMX_VIDEO_DOLBYVISIONLEVELTYPE;
  8281. +
  8282. +/**
  8283. + * Structure for configuring video compression intra refresh period
  8284. + *
  8285. + * STRUCT MEMBERS:
  8286. + * nSize : Size of the structure in bytes
  8287. + * nVersion : OMX specification version information
  8288. + * nPortIndex : Port that this structure applies to
  8289. + * nRefreshPeriod : Intra refreh period in frames. Value 0 means disable intra refresh
  8290. + */
  8291. +typedef struct OMX_VIDEO_CONFIG_ANDROID_INTRAREFRESHTYPE {
  8292. + OMX_U32 nSize;
  8293. + OMX_VERSIONTYPE nVersion;
  8294. + OMX_U32 nPortIndex;
  8295. + OMX_U32 nRefreshPeriod;
  8296. +} OMX_VIDEO_CONFIG_ANDROID_INTRAREFRESHTYPE;
  8297. +
  8298. +/** Maximum number of temporal layers supported by AVC/HEVC */
  8299. +#define OMX_VIDEO_ANDROID_MAXTEMPORALLAYERS 8
  8300. +
  8301. +/** temporal layer patterns */
  8302. +typedef enum OMX_VIDEO_ANDROID_TEMPORALLAYERINGPATTERNTYPE {
  8303. + OMX_VIDEO_AndroidTemporalLayeringPatternNone = 0,
  8304. + // pattern as defined by WebRTC
  8305. + OMX_VIDEO_AndroidTemporalLayeringPatternWebRTC = 1 << 0,
  8306. + // pattern where frames in any layer other than the base layer only depend on at most the very
  8307. + // last frame from each preceding layer (other than the base layer.)
  8308. + OMX_VIDEO_AndroidTemporalLayeringPatternAndroid = 1 << 1,
  8309. +} OMX_VIDEO_ANDROID_TEMPORALLAYERINGPATTERNTYPE;
  8310. +
  8311. +/**
  8312. + * Android specific param for configuration of temporal layering.
  8313. + * Android only supports temporal layering where successive layers each double the
  8314. + * previous layer's framerate.
  8315. + * NOTE: Reading this parameter at run-time SHALL return actual run-time values.
  8316. + *
  8317. + * nSize : Size of the structure in bytes
  8318. + * nVersion : OMX specification version information
  8319. + * nPortIndex : Port that this structure applies to (output port for encoders)
  8320. + * eSupportedPatterns : A bitmask of supported layering patterns
  8321. + * nLayerCountMax : Max number of temporal coding layers supported
  8322. + * by the encoder (must be at least 1, 1 meaning temporal layering
  8323. + * is NOT supported)
  8324. + * nBLayerCountMax : Max number of layers that can contain B frames
  8325. + * (0) to (nLayerCountMax - 1)
  8326. + * ePattern : Layering pattern.
  8327. + * nPLayerCountActual : Number of temporal layers to be coded with non-B frames,
  8328. + * starting from and including the base-layer.
  8329. + * (1 to nLayerCountMax - nBLayerCountActual)
  8330. + * If nPLayerCountActual is 1 and nBLayerCountActual is 0, temporal
  8331. + * layering is disabled. Otherwise, it is enabled.
  8332. + * nBLayerCountActual : Number of temporal layers to be coded with B frames,
  8333. + * starting after non-B layers.
  8334. + * (0 to nBLayerCountMax)
  8335. + * bBitrateRatiosSpecified : Flag to indicate if layer-wise bitrate
  8336. + * distribution is specified.
  8337. + * nBitrateRatios : Bitrate ratio (100 based) per layer (index 0 is base layer).
  8338. + * Honored if bBitrateRatiosSpecified is set.
  8339. + * i.e for 4 layers with desired distribution (25% 25% 25% 25%),
  8340. + * nBitrateRatio = {25, 50, 75, 100, ... }
  8341. + * Values in indices not less than 'the actual number of layers
  8342. + * minus 1' MAY be ignored and assumed to be 100.
  8343. + */
  8344. +typedef struct OMX_VIDEO_PARAM_ANDROID_TEMPORALLAYERINGTYPE {
  8345. + OMX_U32 nSize;
  8346. + OMX_VERSIONTYPE nVersion;
  8347. + OMX_U32 nPortIndex;
  8348. + OMX_VIDEO_ANDROID_TEMPORALLAYERINGPATTERNTYPE eSupportedPatterns;
  8349. + OMX_U32 nLayerCountMax;
  8350. + OMX_U32 nBLayerCountMax;
  8351. + OMX_VIDEO_ANDROID_TEMPORALLAYERINGPATTERNTYPE ePattern;
  8352. + OMX_U32 nPLayerCountActual;
  8353. + OMX_U32 nBLayerCountActual;
  8354. + OMX_BOOL bBitrateRatiosSpecified;
  8355. + OMX_U32 nBitrateRatios[OMX_VIDEO_ANDROID_MAXTEMPORALLAYERS];
  8356. +} OMX_VIDEO_PARAM_ANDROID_TEMPORALLAYERINGTYPE;
  8357. +
  8358. +/**
  8359. + * Android specific config for changing the temporal-layer count or
  8360. + * bitrate-distribution at run-time.
  8361. + *
  8362. + * nSize : Size of the structure in bytes
  8363. + * nVersion : OMX specification version information
  8364. + * nPortIndex : Port that this structure applies to (output port for encoders)
  8365. + * ePattern : Layering pattern.
  8366. + * nPLayerCountActual : Number of temporal layers to be coded with non-B frames.
  8367. + * (same OMX_VIDEO_PARAM_ANDROID_TEMPORALLAYERINGTYPE limits apply.)
  8368. + * nBLayerCountActual : Number of temporal layers to be coded with B frames.
  8369. + * (same OMX_VIDEO_PARAM_ANDROID_TEMPORALLAYERINGTYPE limits apply.)
  8370. + * bBitrateRatiosSpecified : Flag to indicate if layer-wise bitrate
  8371. + * distribution is specified.
  8372. + * nBitrateRatios : Bitrate ratio (100 based, Q16 values) per layer (0 is base layer).
  8373. + * Honored if bBitrateRatiosSpecified is set.
  8374. + * (same OMX_VIDEO_PARAM_ANDROID_TEMPORALLAYERINGTYPE limits apply.)
  8375. + */
  8376. +typedef struct OMX_VIDEO_CONFIG_ANDROID_TEMPORALLAYERINGTYPE {
  8377. + OMX_U32 nSize;
  8378. + OMX_VERSIONTYPE nVersion;
  8379. + OMX_U32 nPortIndex;
  8380. + OMX_VIDEO_ANDROID_TEMPORALLAYERINGPATTERNTYPE ePattern;
  8381. + OMX_U32 nPLayerCountActual;
  8382. + OMX_U32 nBLayerCountActual;
  8383. + OMX_BOOL bBitrateRatiosSpecified;
  8384. + OMX_U32 nBitrateRatios[OMX_VIDEO_ANDROID_MAXTEMPORALLAYERS];
  8385. +} OMX_VIDEO_CONFIG_ANDROID_TEMPORALLAYERINGTYPE;
  8386. +
  8387. +#ifdef __cplusplus
  8388. +}
  8389. +#endif /* __cplusplus */
  8390. +
  8391. +#endif /* OMX_VideoExt_h */
  8392. +/* File EOF */
  8393. diff --git a/encoder/mjpeg_encoder.cpp b/encoder/mjpeg_encoder.cpp
  8394. index 52757ce..cf54f8f 100644
  8395. --- a/encoder/mjpeg_encoder.cpp
  8396. +++ b/encoder/mjpeg_encoder.cpp
  8397. @@ -45,6 +45,21 @@ void MjpegEncoder::EncodeBuffer(int fd, size_t size, void *mem, StreamInfo const
  8398. encode_cond_var_.notify_all();
  8399. }
  8400. +void NV12ToYUV420(const uint8_t *mem, uint8_t *dst, const StreamInfo &info);
  8401. +static uint8_t *getYUV420Format(const uint8_t *mem, const StreamInfo &info)
  8402. +{
  8403. + uint32_t width = info.width;
  8404. + uint32_t height = info.height;
  8405. + int32_t buf_size = width * height + ((height * width) >> 1);
  8406. + uint8_t *buffer = new uint8_t[buf_size];
  8407. +
  8408. + if(!buffer)
  8409. + throw std::runtime_error("fail to apply memory.");
  8410. + NV12ToYUV420(mem, buffer, info);
  8411. +
  8412. + return buffer;
  8413. +}
  8414. +
  8415. void MjpegEncoder::encodeJPEG(struct jpeg_compress_struct &cinfo, EncodeItem &item, uint8_t *&encoded_buffer,
  8416. size_t &buffer_len)
  8417. {
  8418. @@ -65,7 +80,8 @@ void MjpegEncoder::encodeJPEG(struct jpeg_compress_struct &cinfo, EncodeItem &it
  8419. jpeg_start_compress(&cinfo, TRUE);
  8420. int stride2 = item.info.stride / 2;
  8421. - uint8_t *Y = (uint8_t *)item.mem;
  8422. + uint8_t *yuv420 = getYUV420Format((uint8_t *)item.mem, item.info);
  8423. + uint8_t *Y = yuv420;
  8424. uint8_t *U = (uint8_t *)Y + item.info.stride * item.info.height;
  8425. uint8_t *V = (uint8_t *)U + stride2 * (item.info.height / 2);
  8426. uint8_t *Y_max = U - item.info.stride;
  8427. @@ -89,6 +105,7 @@ void MjpegEncoder::encodeJPEG(struct jpeg_compress_struct &cinfo, EncodeItem &it
  8428. jpeg_finish_compress(&cinfo);
  8429. buffer_len = jpeg_mem_len;
  8430. + delete[] yuv420;
  8431. }
  8432. void MjpegEncoder::encodeThread(int num)
  8433. diff --git a/encoder/yuv420_encoder.cpp b/encoder/yuv420_encoder.cpp
  8434. new file mode 100755
  8435. index 0000000..cbfd276
  8436. --- /dev/null
  8437. +++ b/encoder/yuv420_encoder.cpp
  8438. @@ -0,0 +1,80 @@
  8439. +/* SPDX-License-Identifier: BSD-2-Clause */
  8440. +/*
  8441. + * Copyright (C) 2023, Starfive Technology Co., Ltd.
  8442. + *
  8443. + * yuv420_encoder.cpp - yuv420 video encoder.
  8444. + */
  8445. +
  8446. +#include <chrono>
  8447. +#include <iostream>
  8448. +#include <stdexcept>
  8449. +
  8450. +#include "yuv420_encoder.hpp"
  8451. +
  8452. +void NV12ToYUV420(const uint8_t *mem, uint8_t *dst, const StreamInfo &info);
  8453. +
  8454. +YUV420Encoder::YUV420Encoder(VideoOptions const *options) : Encoder(options), abort_(false)
  8455. +{
  8456. + LOG(2, "Opened YUV420Encoder");
  8457. + output_thread_ = std::thread(&YUV420Encoder::outputThread, this);
  8458. +}
  8459. +
  8460. +YUV420Encoder::~YUV420Encoder()
  8461. +{
  8462. + abort_ = true;
  8463. + output_thread_.join();
  8464. + LOG(2, "YUV420Encoder closed");
  8465. +}
  8466. +
  8467. +// Push the buffer onto the output queue to be "encoded" and returned.
  8468. +void YUV420Encoder::EncodeBuffer(int fd, size_t size, void *mem, StreamInfo const &info, int64_t timestamp_us)
  8469. +{
  8470. + if(!streamInfo_.width || !streamInfo_.height || !streamInfo_.stride)
  8471. + streamInfo_ = info;
  8472. + std::lock_guard<std::mutex> lock(output_mutex_);
  8473. + OutputItem item = { mem, size, timestamp_us };
  8474. + output_queue_.push(item);
  8475. + output_cond_var_.notify_one();
  8476. +}
  8477. +
  8478. +// Realistically we would probably want more of a queue as the caller's number
  8479. +// of buffers limits the amount of queueing possible here...
  8480. +void YUV420Encoder::outputThread()
  8481. +{
  8482. + OutputItem item;
  8483. + while (true)
  8484. + {
  8485. + {
  8486. + std::unique_lock<std::mutex> lock(output_mutex_);
  8487. + while (true)
  8488. + {
  8489. + using namespace std::chrono_literals;
  8490. + if (!output_queue_.empty())
  8491. + {
  8492. + item = output_queue_.front();
  8493. + output_queue_.pop();
  8494. + break;
  8495. + }
  8496. + else
  8497. + output_cond_var_.wait_for(lock, 200ms);
  8498. + if (abort_)
  8499. + return;
  8500. + }
  8501. + }
  8502. + // Ensure the input done callback happens before the output ready callback.
  8503. + // This is needed as the metadata queue gets pushed in the former, and popped
  8504. + // in the latter.
  8505. + input_done_callback_(nullptr);
  8506. +
  8507. + if(streamInfo_.width && streamInfo_.height && streamInfo_.stride)
  8508. + {
  8509. + uint8_t *yuv420 = new uint8_t[streamInfo_.width * streamInfo_.height + ((streamInfo_.height * streamInfo_.width) >> 1)];
  8510. + if(!yuv420)
  8511. + throw std::runtime_error("fail to apply memory.");
  8512. + NV12ToYUV420((uint8_t *)(item.mem), yuv420, streamInfo_);
  8513. + output_ready_callback_(yuv420, item.length, item.timestamp_us, true);
  8514. + delete[] yuv420;
  8515. + } else
  8516. + output_ready_callback_(item.mem, item.length, item.timestamp_us, true);
  8517. + }
  8518. +}
  8519. diff --git a/encoder/yuv420_encoder.hpp b/encoder/yuv420_encoder.hpp
  8520. new file mode 100755
  8521. index 0000000..7f3c680
  8522. --- /dev/null
  8523. +++ b/encoder/yuv420_encoder.hpp
  8524. @@ -0,0 +1,41 @@
  8525. +/* SPDX-License-Identifier: BSD-2-Clause */
  8526. +/*
  8527. + * Copyright (C) 2023, Starfive Technology Co., Ltd.
  8528. + *
  8529. + * yuv420_encoder.hpp - yuv420 video encoder.
  8530. + */
  8531. +
  8532. +#pragma once
  8533. +
  8534. +#include <condition_variable>
  8535. +#include <mutex>
  8536. +#include <queue>
  8537. +#include <thread>
  8538. +
  8539. +#include "core/video_options.hpp"
  8540. +#include "encoder.hpp"
  8541. +
  8542. +class YUV420Encoder : public Encoder
  8543. +{
  8544. +public:
  8545. + YUV420Encoder(VideoOptions const *options);
  8546. + ~YUV420Encoder();
  8547. + void EncodeBuffer(int fd, size_t size, void *mem, StreamInfo const &info, int64_t timestamp_us) override;
  8548. +
  8549. +private:
  8550. + StreamInfo streamInfo_;
  8551. + void outputThread();
  8552. +
  8553. + bool abort_;
  8554. + VideoOptions options_;
  8555. + struct OutputItem
  8556. + {
  8557. + void *mem;
  8558. + size_t length;
  8559. + int64_t timestamp_us;
  8560. + };
  8561. + std::queue<OutputItem> output_queue_;
  8562. + std::mutex output_mutex_;
  8563. + std::condition_variable output_cond_var_;
  8564. + std::thread output_thread_;
  8565. +};
  8566. --
  8567. 2.34.1