高度な使用方法
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
以下のセクションでは、ライブラリの通常の動作には必要のない、高度な使用方法の概要を説明します。
サポートされているその他のトレーサー
Tuning Fork は複数のトレーサーをサポートしています。次のインストゥルメント キーを持つトレーサーがサポートされています。
- フレーム開始間の時間(
PACED_FRAME_TIME
)
- CPU 時間: フレームの開始からフレームの CPU 作業終了までの時間(
CPU_TIME
)
- GPU 時間: GPU が前のフレームを処理する時間(
GPU_TIME
)
- CPU 時間と GPU 時間の最大値として定義される未加工フレーム時間(
RAW_FRAME_TIME
)。このオプションは、Swappy または VSync によって含まれる待機時間が含まれないという点で PACED_FRAME_TIME
と異なります。
これらインストゥルメント キーについては、リファレンス マニュアルをご覧ください。
これらのキーの一部は、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()
を呼び出す必要があります。また、メインスレッドとは別のスレッドで呼び出す必要があります(これを行うユーティリティ関数については 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."]]