Media Codec
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
Android 10(API レベル 29)以降では、コーデックに関する詳細情報を取得するメソッドが MediaCodecInfo
に追加されました。
isSoftwareOnly()
- コーデックがソフトウェア内でのみ実行されている場合は true を返します。ソフトウェア コーデックは、レンダリング パフォーマンスについて保証しません。
isHardwareAccelerated()
- コーデックがハードウェア アクセラレーションを使用している場合は true を返します。
isVendor()
- コーデックがデバイス ベンダーによって提供されている場合は true を返し、Android プラットフォームによって提供されている場合は false を返します。
isAlias()
代替コーデック名(エイリアス)を使用している場合、MediaCodecList
には、1 つの基盤コーデックに対して複数のエントリが含まれている可能性があります。このエントリのコーデックが別のコーデックのエイリアスである場合、このメソッドは true を返します。
また、MediaCodec.getCanonicalName()
はエイリアス経由で作成されたコーデックの基盤コーデック名を返します。
「パフォーマンス ポイント」とは、特定の高さ、幅、フレームレートで動画をレンダリングするコーデックの能力を示します。たとえば、UHD_60
パフォーマンス ポイントは、60 fps でレンダリングされた Ultra HD 動画(3840x2160 ピクセル)を示します。
メソッド MediaCodecInfo.VideoCapabilities.getSupportedPerformancePoints()
は、コーデックがレンダリングまたはキャプチャできる PerformancePoint
エントリのリストを返します。
PerformancePoint
が別の PerformancePoint
をカバーしているかどうかを確認できます。PerformancePoint.covers(PerformancePoint)
たとえば、UHD_60.covers(UHD_50)
は true を返します。
パフォーマンス ポイントのリストには、すべてのハードウェア アクセラレーション コーデックが含まれています。コーデックが最も低い標準パフォーマンス ポイントでさえ満たさない場合、空のリストになることがあります。
パフォーマンス ポイントに関するデータはベンダー HAL から提供されるため、ベンダー イメージを更新せずに Android 10(API レベル 29)以降にアップグレードしたデバイスの場合、パフォーマンス ポイントに関するデータがありません。この場合、getSupportedPerformancePoints()
は null を返します。
このページのコンテンツやコードサンプルは、コンテンツ ライセンスに記載のライセンスに従います。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."]]