語言

StreamConfigurationMap.IsOutputSupportedFor 方法

定義

多載

名稱 Description
IsOutputSupportedFor(Surface)

判斷 在 surface 當前狀態下是否適合作為輸出包含在 a CameraDevice#createCaptureSession(SessionConfiguration) capture session 中。

IsOutputSupportedFor(Class)

判斷輸出串流是否能將特定類別設定為消費者。

IsOutputSupportedFor(Int32)

判斷輸出表面是否能傳遞 CameraDevice#createCaptureSession(SessionConfiguration) createCaptureSession特定使用者定義格式。

IsOutputSupportedFor(Surface)

判斷 在 surface 當前狀態下是否適合作為輸出包含在 a 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 否則

屬性

例外狀況

如果 surface 是 null

若 Surface 端點不再有效

備註

判斷 在 surface 當前狀態下是否適合作為輸出包含在 a CameraDevice#createCaptureSession(SessionConfiguration) capture session 中。

並非所有曲面都能與 CameraDevice使用 ,且並非所有配置 surface 都相容。 提供 的 surface 某些類別與一般相容 CameraDevice (參見 #isOutputSupportedFor(Class),但調用者有責任將 置 surface 於與 相容的狀態 CameraDevice。

特定surface不相容的原因可能是:<ul><li>使用李未列出的><#getOutputFormats格式 使用 李未列出#getOutputSizes<>surface的格式/大小組合 本身尚未能服務新生產者。

</li></ul>

即使 Surface 的精確尺寸與相機支援的尺寸不符,只要該格式(或類別)被支援且相機裝置支援的尺寸等於或小於該格式的 1080p,來自柔性來源的曲面仍會回傳為真。 若使用 Surface 來建立擷取會話,其大小會四捨五入至最接近支援大小,低於或等於 1080p。 彈性來源包括 SurfaceView、SurfaceTexture 和 ImageReader。

這並非一份詳盡的清單;請參閱該類別的文件,了解更多可能的不相容原因。

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

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於

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 - 推薦用於影像處理或串流至外部資源(如檔案或網路) <liandroid.media.MediaRecorder> - 推薦用於錄影(簡單易用) <liandroid.media.MediaCodec> - 推薦用於錄影(使用較複雜,但更靈活) <liandroid.view.SurfaceHolder> - 推薦用於低android.view.SurfaceView<>android.graphics.SurfaceTexture功耗相機預覽- 推薦用於 OpenGL 加速的預覽處理或 android.view.TextureView</ul 合成>

一般來說,這表示從該類別建立 可能Surface提供一個適合與 一起使用CameraDevice#createCaptureSession(SessionConfiguration)的生產端點。

由於上述類別並非全部都支援所有格式與大小組合的輸出,因此應以 #isOutputSupportedFor(Surface)查詢特定組合。

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

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於

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

傳回

true 當 a surface 與此 format 結合時,將被支援為 CameraDevice#createCaptureSession(SessionConfiguration)

屬性

例外狀況

若影像格式不是來自其中之一 ImageFormat 或的命名常數 PixelFormat

備註

判斷輸出表面是否能傳遞 CameraDevice#createCaptureSession(SessionConfiguration) createCaptureSession特定使用者定義格式。

此方法判斷輸出format是否由相機裝置支援;每個輸出surface目標本身可能支援或不支援該輸出。format 請參閱提供表面的類別以提供更多文件。

這些格式 true 在由 返回 #getOutputSizes的結果中必定存在。

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

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

另請參閱

適用於