קודקים של מדיה
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
החל מ-Android 10 (רמת API 29) ומעלה, יש שיטות ב-MediaCodecInfo
שמציגות מידע נוסף על קודק:
isSoftwareOnly()
- הפונקציה מחזירה את הערך true אם הקודק פועל רק בתוכנה. אין שום ערובה לביצועי רינדור טובים בשימוש בתוכנות codec.
isHardwareAccelerated()
- הפונקציה מחזירה את הערך True אם קודק מואץ על ידי חומרה.
isVendor()
- הפונקציה מחזירה True אם רכיב ה-codec מסופק על ידי ספק המכשיר, או False אם הוא מסופק על ידי פלטפורמת Android.
isAlias()
MediaCodecList
עשוי להכיל רשומות נוספות לאותו קודק בסיסי, באמצעות שם/שמות קודק חלופיים (כינוי/ים). השיטה הזו מחזירה true אם הקודק ברשומה הזו הוא כינוי לקודק אחר.
בנוסף, הפונקציה MediaCodec.getCanonicalName()
מחזירה את שם הקודק הבסיסי של קודקים שנוצרו באמצעות כינוי.
נקודת ביצועים מייצגת את היכולת של קודק לעבד סרטון בגובה, ברוחב ובקצב פריימים ספציפיים. לדוגמה, נקודת הביצועים UHD_60
מייצגת סרטון באיכות אולטרה גבוהה (3840x2160 פיקסלים) שמוצג ב-60 פריימים לשנייה.
השיטה MediaCodecInfo.VideoCapabilities.getSupportedPerformancePoints()
מחזירה רשימה של רשומות PerformancePoint
שהקודק יכול לעבד או ללכוד.
כדי לבדוק אם PerformancePoint
מסוים מכסה PerformancePoint.covers(PerformancePoint)
אחר, אפשר להתקשר אל PerformancePoint.covers(PerformancePoint)
.
לדוגמה, הפונקציה UHD_60.covers(UHD_50)
מחזירה true.
מוצגת רשימה של נקודות ביצועים לכל רכיבי ה-codec עם האצת חומרה.
יכול להיות שהרשימה הזו תהיה ריקה אם הקודק לא עומד אפילו בנקודת הביצועים הנמוכה ביותר.
שימו לב: במכשירים ששודרגו ל-Android 10 (רמת API 29) ומעלה בלי לעדכן את תמונת הספק, לא יהיו נתונים של נקודות ביצועים, כי הנתונים האלה מגיעים מ-HAL של הספק. במקרה כזה, הפונקציה getSupportedPerformancePoints()
מחזירה ערך null.
דוגמאות התוכן והקוד שבדף הזה כפופות לרישיונות המפורטים בקטע רישיון לתוכן. Java ו-OpenJDK הם סימנים מסחריים או סימנים מסחריים רשומים של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-08-27 (שעון UTC).
[[["התוכן קל להבנה","easyToUnderstand","thumb-up"],["התוכן עזר לי לפתור בעיה","solvedMyProblem","thumb-up"],["סיבה אחרת","otherUp","thumb-up"]],[["חסרים לי מידע או פרטים","missingTheInformationINeed","thumb-down"],["התוכן מורכב מדי או עם יותר מדי שלבים","tooComplicatedTooManySteps","thumb-down"],["התוכן לא עדכני","outOfDate","thumb-down"],["בעיה בתרגום","translationIssue","thumb-down"],["בעיה בדוגמאות/בקוד","samplesCodeIssue","thumb-down"],["סיבה אחרת","otherDown","thumb-down"]],["עדכון אחרון: 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."]]