ios - CMVideoFormatDescriptionGetCleanAperture() swift error -
i can't cmvideoformatdescriptiongetcleanaperture() function work. using
var videodescriptionref = port.formatdescription cmvideoformatdescriptionref var cleanaperture = cmvideoformatdescriptiongetcleanaperture(videodescriptionref, true) or
var cleanaperture = cmvideoformatdescriptiongetcleanaperture(port.formatdescription, true) gives me next errors, respectively:
cannot convert expression's type 'cmvideoformatdescriptionref' type 'cmvideoformatdescriptionref' and sec is
could not find overlad '__conversion' accepts supplied arguments does know how prepare these or can point out errors in getting format description retrieving clean aperture?
cmformatdescription not have fellow member takeunretainedvalue. fellow member of unmanaged<t>. need define unmanaged variable first, value , retain it.
as not know how created port.formatdescription, here illustration formatdescription created pps/sps avc video.
// create receiving unmanaged variable var formatdescription: unmanaged<cmvideoformatdescription>? // phone call not annotated method, method fill in formatdescription unmanaged<t> allow result = cmvideoformatdescriptioncreatefromh264parametersets(nil, uint(parametersets.count), parametersets, parametersetsizes, 4, &formatdescription) // check result, yada yada yada before continuing // can retain value allow formatdescriptionref = formatdescription!.takeunretainedvalue() cmvideoformatdescriptionref // , can ever want in swift without caring anymore. var cleanaperture = cmvideoformatdescriptiongetcleanaperture(formatdescriptionref, 1) create unmanaged type use unmanaged type in not annotated method retain value work without thinking how created it. so adjust code create port.formatdescription unmanaged , should good.
ios swift avfoundation
No comments:
Post a Comment