ตัวแปลงรหัสสื่อ
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
ตั้งแต่ Android 10 (API ระดับ 29) ขึ้นไป จะมีเมธอดใน
MediaCodecInfo
ที่
แสดงข้อมูลเพิ่มเติมเกี่ยวกับตัวแปลงรหัส
isSoftwareOnly()
- แสดงค่าเป็นจริงหากตัวแปลงรหัสทำงานในซอฟต์แวร์เท่านั้น ตัวแปลงรหัสซอฟต์แวร์ไม่รับประกันประสิทธิภาพการแสดงผล
isHardwareAccelerated()
- แสดงค่าเป็น "จริง" หากฮาร์ดแวร์เร่งตัวแปลงรหัส
isVendor()
- แสดงผลเป็นจริงหากผู้จำหน่ายอุปกรณ์เป็นผู้จัดหาตัวแปลงรหัส หรือเป็นเท็จหากแพลตฟอร์ม Android เป็นผู้จัดหา
isAlias()
MediaCodecList
อาจมีรายการเพิ่มเติมสำหรับโคเดกพื้นฐานเดียวกัน
โดยใช้ชื่อโคเดกสำรอง (ชื่อแทน) เมธอดนี้จะแสดงผลเป็น "จริง" หาก
โคเดกในรายการนี้เป็นนามแฝงของโคเดกอื่น
นอกจากนี้
MediaCodec.getCanonicalName()
ยังแสดงชื่อตัวแปลงรหัสพื้นฐานสำหรับตัวแปลงรหัสที่สร้างผ่านนามแฝงด้วย
คะแนนประสิทธิภาพแสดงถึงความสามารถของตัวแปลงรหัสในการแสดงวิดีโอที่ความสูง ความกว้าง และอัตราเฟรมที่เฉพาะเจาะจง
เช่น UHD_60
จุดประสิทธิภาพ
แสดงถึงวิดีโอความละเอียดสูงพิเศษ (3840x2160 พิกเซล) ที่แสดงผลที่ 60 เฟรม
ต่อวินาที
เมธอด
MediaCodecInfo.VideoCapabilities.getSupportedPerformancePoints()
จะแสดงรายการของ
PerformancePoint
รายการที่ตัวแปลงรหัสสามารถแสดงหรือบันทึกได้
คุณสามารถตรวจสอบว่าPerformancePoint
ครอบคลุมอีกPerformancePoint
หรือไม่โดยโทรไปที่
PerformancePoint.covers(PerformancePoint)
เช่น UHD_60.covers(UHD_50)
จะแสดงผลเป็นจริง
เรามีรายการจุดประสิทธิภาพสำหรับตัวแปลงรหัสที่เร่งด้วยฮาร์ดแวร์ทั้งหมด
รายการนี้อาจว่างเปล่าหากตัวแปลงรหัสไม่เป็นไปตามจุดประสิทธิภาพแม้แต่มาตรฐานต่ำสุด
โปรดทราบว่าอุปกรณ์ที่อัปเกรดเป็น Android 10 (API ระดับ 29) ขึ้นไปโดยไม่ได้
อัปเดตรูปภาพของผู้ให้บริการจะไม่มีข้อมูลคะแนนประสิทธิภาพ เนื่องจาก
ข้อมูลนี้มาจาก HAL ของผู้ให้บริการ ในกรณีนี้ getSupportedPerformancePoints()
จะแสดงผลเป็นค่าว่าง
ตัวอย่างเนื้อหาและโค้ดในหน้าเว็บนี้ขึ้นอยู่กับใบอนุญาตที่อธิบายไว้ในใบอนุญาตการใช้เนื้อหา Java และ OpenJDK เป็นเครื่องหมายการค้าหรือเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-08-27 UTC
[null,null,["อัปเดตล่าสุด 2025-08-27 UTC"],[],[],null,["Beginning with Android 10 (API level 29) and higher, there are methods in\n[`MediaCodecInfo`](/reference/android/media/MediaCodecInfo) that\nreveal more information about a codec:\n\n[`isSoftwareOnly()`](/reference/android/media/MediaCodecInfo#isSoftwareOnly)\n: Returns true if the codec runs in software only. Software codecs make no\n guarantees about rendering performance.\n\n[`isHardwareAccelerated()`](/reference/android/media/MediaCodecInfo#isHardwareAccelerated)\n: Returns true if a codec is accelerated by hardware.\n\n[`isVendor()`](/reference/android/media/MediaCodecInfo#isVendor)\n: Returns true if the codec is provided by the device vendor or false if provided\n by the Android platform.\n\n[`isAlias()`](/reference/android/media/MediaCodecInfo#isAlias)\n: `MediaCodecList` may contain additional entries for the same underlying codec\n using an alternate codec name/s (alias/es). This method returns true if the\n codec in this entry is an alias for another codec.\n\nIn addition,\n[`MediaCodec.getCanonicalName()`](/reference/android/media/MediaCodecInfo#getCanonicalName)\nreturns the underlying codec name for codecs created via an alias.\n\nPerformance Points\n\nA *performance point* represents a codec's ability to render video at a specific\nheight, width and frame rate. For example, the `UHD_60` performance point\nrepresents Ultra High Definition video (3840x2160 pixels) rendered at 60 frames\nper second.\n\nThe method\n[`MediaCodecInfo.VideoCapabilities.getSupportedPerformancePoints()`](/reference/android/media/MediaCodecInfo.VideoCapabilities#getSupportedPerformancePoints())\nreturns a list of\n[`PerformancePoint`](/reference/android/media/MediaCodecInfo.VideoCapabilities.PerformancePoint)\nentries that the codec can render or capture.\n\nYou can check whether a given `PerformancePoint` covers another by calling\n[`PerformancePoint.covers(PerformancePoint)`](/reference/android/media/MediaCodecInfo.VideoCapabilities.PerformancePoint#covers(android.media.MediaCodecInfo.VideoCapabilities.PerformancePoint)).\nFor example, `UHD_60.covers(UHD_50)` returns true.\n\nA list of performance points is provided for all hardware-accelerated codecs.\nThis could be an empty list if the codec does not meet even the lowest standard\nperformance point.\n\nNote that devices which have been upgraded to Android 10 (API level 29) and higher without\nupdating the vendor image will not have performance point data, because this\ndata comes from the vendor HAL. In this case, `getSupportedPerformancePoints()`\nreturns null."]]