שימוש מתקדם
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
בקטעים הבאים מפורטים נושאים מתקדמים לשימוש בספרייה, שלא נדרשים לפעולה רגילה שלה.
כלי מעקב נתמכים אחרים
הכלי Tuning Fork תומך בכמה כלי מעקב. יש תמיכה ב-Tracers עם מפתחות המכשירים הבאים:
- הזמן בין התחלות של פריים (נקרא
PACED_FRAME_TIME
)
- זמן CPU: הזמן שחלף בין תחילת הפריים לסיום העבודה של ה-CPU על הפריים (נקרא
CPU_TIME
)
- זמן GPU: הזמן שנדרש ל-GPU לטפל בפריים הקודם (נקרא
GPU_TIME
)
- זמן הפריים הגולמי, שמוגדר כזמן המקסימלי של CPU ו-GPU (נקרא
RAW_FRAME_TIME
). ההבדל בין האפשרות הזו לבין PACED_FRAME_TIME
הוא שהאפשרות הזו לא כוללת זמן המתנה שכלול על ידי Swappy או VSync.
אפשר למצוא את המפתחות של הכלים האלה במסמכי העיון.
חלק מהמפתחות האלה משמשים באופן אוטומטי כשמפעילים את ספריית Android Frame Pacing, אבל אם לא מפעילים את הספרייה הזו, צריך להשתמש בהם באופן מפורש.
קבלת פרמטרים של אמינות
TFErrorCode TuningFork_getFidelityParameters(const CProtobufSerialization*
defaultParams, CProtobufSerialization* params, uint32_t
timeout_ms);
אם מעבירים את fidelity_params_callback
אל TuningFork_init
בהגדרות או שהספרייה נמצאת במצב מותאם, אין צורך להפעיל את הפונקציה הזו.
הפונקציה הזו יוצרת קשר עם שרת כדי לאחזר פרמטרים של נאמנות. הפונקציה נחסמת עד שאחד מהמקרים הבאים מתרחש:
- הפרמטרים של הנאמנות מאוחזרים, עם ערך החזרה של
TFERROR_OK
ו-returnedParams
, והפרמטרים נשמרים. במקרה כזה, כל נתוני הטיקים הבאים משויכים ל-returnedParams
.
- עוברים
timeout_ms
מילי-שניות, וערך ההחזרה הוא TFERROR_TIMEOUT
. במקרה כזה, כל נתוני הטיקים הבאים משויכים ל-defaultFidelityParams
.
צריך לקרוא לפונקציה TuningFork_init()
לפני הפונקציה הזו, ולקרוא לה ב-thread נפרד מה-thread הראשי (במאמר TuningFork_startFidelityParamDownloadThread()
מוסבר על פונקציית כלי עזר שעושה את זה בשבילכם). אפשר לקרוא לפונקציה הזו שוב, למשל בזמן טעינת הרמה, כדי לאחזר שוב מהשרת פרמטרים של דיוק. כך אפשר לעדכן פרמטרים באופן דינמי במקום לטעון אותם מחדש רק בהפעלה. אם מורידים פרמטרים חדשים של דיוק או משתמשים בברירת מחדל חדשה, כל נתוני הטיקים הקודמים נשלחים.
דוגמאות התוכן והקוד שבדף הזה כפופות לרישיונות המפורטים בקטע רישיון לתוכן. Java ו-OpenJDK הם סימנים מסחריים או סימנים מסחריים רשומים של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-08-26 (שעון UTC).
[null,null,["עדכון אחרון: 2025-08-26 (שעון UTC)."],[],[],null,["The following sections outline advanced usage topics not needed for normal\noperation of the library.\n\nOther supported tracers\n\nTuning Fork supports multiple tracers. Tracers with the following instrument\nkeys are supported:\n\n- Time between frame starts (called `PACED_FRAME_TIME`)\n- CPU Time: Time between the start of the frame and the end of the CPU work for the frame (called `CPU_TIME`)\n- GPU Time: Time for the previous frame to be handled by the GPU (called `GPU_TIME`)\n- The raw frame time, defined as the maximum of the CPU and GPU time (called `RAW_FRAME_TIME`). The difference between this option and `PACED_FRAME_TIME` is that this option does not include any wait time included by Swappy or VSync.\n\nYou can find these instrument keys in the\n[reference documentation](/games/sdk/reference/performance-tuner/custom-engine).\nSome of these keys are used automatically when you enable the Android Frame\nPacing library, but if you are not enabling this library, you should use them\nexplicitly.\n\nGet fidelity parameters\n\n[`TFErrorCode TuningFork_getFidelityParameters(const CProtobufSerialization*\ndefaultParams, CProtobufSerialization* params, uint32_t\ntimeout_ms);`](/games/sdk/reference/performance-tuner/custom-engine/group/tuningfork#tuningfork_getfidelityparameters)\n\nIf you pass `fidelity_params_callback` to `TuningFork_init` in settings or the\nlibrary is in scaled mode, you do not need to call this function.\n\nThis function contacts a server to retrieve fidelity parameters. It blocks until\none of the following occurs:\n\n- Fidelity parameters are retrieved, with a return value of `TFERROR_OK` and `returnedParams` store the parameters. In this case, all subsequent tick data is associated with `returnedParams`.\n- A number of milliseconds equal to `timeout_ms` passes, with a return value of `TFERROR_TIMEOUT`. In this case, all subsequent tick data is associated with `defaultFidelityParams`.\n\nYou must call `TuningFork_init()` before this function, and you must call it on\na separate thread from the main thread (see\n[`TuningFork_startFidelityParamDownloadThread()`](/games/sdk/reference/performance-tuner/custom-engine/group/tuningfork-extra#tuningfork_startfidelityparamdownloadthread)\nfor a utility function that does this for you). You can call this function\nagain, for example at level-loading time, to retrieve fidelity parameters from\nthe server again. This allows you to dynamically update parameters rather than\nhaving to reload them only at start-up. If new fidelity parameters are\ndownloaded or a new default is used, all previous tick data is submitted."]]