语言

StreamConfigurationMap.IsOutputSupportedFor 方法

定义

重载

名称 说明
IsOutputSupportedFor(Surface)

确定其当前状态是否 surface 适合作为输出包含在 CameraDevice#createCaptureSession(SessionConfiguration) capture session 其中。

IsOutputSupportedFor(Class)

确定是否可以使用特定类作为使用者配置输出流。

IsOutputSupportedFor(Int32)

确定是否可以传递 CameraDevice#createCaptureSession(SessionConfiguration) createCaptureSession具有特定用户定义格式的输出图面。

IsOutputSupportedFor(Surface)

确定其当前状态是否 surface 适合作为输出包含在 CameraDevice#createCaptureSession(SessionConfiguration) capture session 其中。

[Android.Runtime.Register("isOutputSupportedFor", "(Landroid/view/Surface;)Z", "")]
public bool IsOutputSupportedFor(Android.Views.Surface? surface);
[<Android.Runtime.Register("isOutputSupportedFor", "(Landroid/view/Surface;)Z", "")>]
member this.IsOutputSupportedFor : Android.Views.Surface -> bool

参数

surface
Surface

非nullSurface 对象引用

返回

true如果支持,则为 ;否则为 false

特性

例外

if surface was null

如果Surface终结点不再有效,则

注解

确定其当前状态是否 surface 适合作为输出包含在 CameraDevice#createCaptureSession(SessionConfiguration) capture session 其中。

并非所有图面都可用于 CameraDevice兼容,并非所有配置 surface 都兼容。 提供某些 surface 类与一般类兼容 CameraDevice (请参阅 #isOutputSupportedFor(Class),但调用方有责任将状态置于 surface 与该 CameraDevice状态兼容的状态。

surface具体不兼容的原因可能是:<ul><li>Using a format that not listed by#getOutputFormats< li>Using a format/size combination that not listed by#getOutputSizes< li>The surface itself the itself is not in a state where it can service a new producer.

</li></ul>

即使Surface的确切大小与相机支持的大小不匹配,并且相机设备支持的大小等于或小于 1080p,来自灵活源的图面也会返回 true。 如果此类Surface用于创建捕获会话,则其大小将舍入为最接近支持的大小,小于或等于 1080p。 灵活的源包括 SurfaceView、SurfaceTexture 和 ImageReader。

这不是详尽的列表;有关不兼容的进一步原因,请参阅特定类的文档。

Java文档android.hardware.camera2.params.StreamConfigurationMap.isOutputSupportedFor(android.view.Surface)。

本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。

适用于

IsOutputSupportedFor(Class)

确定是否可以使用特定类作为使用者配置输出流。

[Android.Runtime.Register("isOutputSupportedFor", "(Ljava/lang/Class;)Z", "")]
[Java.Interop.JavaTypeParameters(new System.String[] { "T" })]
public static bool IsOutputSupportedFor(Java.Lang.Class? klass);
[<Android.Runtime.Register("isOutputSupportedFor", "(Ljava/lang/Class;)Z", "")>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "T" })>]
static member IsOutputSupportedFor : Java.Lang.Class -> bool

参数

klass
Class

非nullClass 对象引用

返回

true 如果此类作为输出受支持, false 则为 ;否则为

特性

注解

确定是否可以使用特定类作为使用者配置输出流。

以下列表通常可用于输出:<ul><li>android.media.ImageReader - 建议用于图像处理或流式传输到外部资源(如文件或网络)li - 推荐用于录制视频(简单使用)<>liandroid.media.MediaRecorder< - 建议使用 li>android.media.MediaCodec 录制视频(更复杂,更灵活)<li>android.view.SurfaceHolder - 建议使用 liandroid.view.SurfaceView< 的低功率相机预览>android.graphics.SurfaceTexture- 建议使用 android.view.TextureView</ul 进行 OpenGL 加速预览处理或组合>

一般说来,这意味着从该类创建一个 Surface 生成者终结点 可能 提供适合用于 CameraDevice#createCaptureSession(SessionConfiguration)该类的生成者终结点。

由于上述所有类都支持所有格式和大小组合的输出,因此应查询 #isOutputSupportedFor(Surface)特定组合。

Java文档android.hardware.camera2.params.StreamConfigurationMap.isOutputSupportedFor(java.lang.Class<T>)。

本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。

适用于

IsOutputSupportedFor(Int32)

确定是否可以传递 CameraDevice#createCaptureSession(SessionConfiguration) createCaptureSession具有特定用户定义格式的输出图面。

[Android.Runtime.Register("isOutputSupportedFor", "(I)Z", "")]
public bool IsOutputSupportedFor(int format);
[<Android.Runtime.Register("isOutputSupportedFor", "(I)Z", "")>]
member this.IsOutputSupportedFor : int -> bool

参数

format
Int32

来自任一格式 ImageFormat 或 PixelFormat

返回

将支持通过 <a0/> 使用 with 的 iff

特性

例外

如果图像格式不是定义命名常量,则为ImageFormatPixelFormat

注解

确定是否可以传递 CameraDevice#createCaptureSession(SessionConfiguration) createCaptureSession具有特定用户定义格式的输出图面。

此方法确定相机设备支持输出 format ;每个输出 surface 目标可能或可能本身都支持该输出 format。 请参阅提供其他文档图面的类。

保证此返回 true 的格式存在于返回的结果中 #getOutputSizes。

Java文档android.hardware.camera2.params.StreamConfigurationMap.isOutputSupportedFor(int)。

本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。

另请参阅

适用于