2
1

More than 3 years have passed since last update.

ドメインモデルから見るAV Foundationの設計思想と概念

Last updated at Posted at 2020-01-08

はじめに

AV Foundationについてどういう設計思想/概念で成り立っているか調査した。

オブジェクト図から明らかになるドメインモデル

f:id:objectiveworker:20140923124147p:plain

オブジェクト図である。関係が複雑であみの目の様になっているが、以下の通りに分類するとAV Foundationの設計思想が分かる。

  • 紫:再生制御
    • AVPlayer
    • AVPlayerItem
  • 黄:レンダリング前のポストエフェクト
    • AVVideoCompositing
    • MTAudioProcessingTapRef
  • 緑:特殊効果
    • AVMutableAudioMixInputParameters
    • AVMutableVideoCompositionLayerInstruction
    • AVMutableAudioMix
    • AVMutableVideoCompositionInstruction
    • AVMutableVideoComposition
    • AVVideoCompositing
  • 水:編集中のメディアファイル
    • AVMutableComposition
    • AVMutableCompositionTrack
  • 赤:元のメディアファイル、素材
    • AVAsset
    • AVAssetTrack

つまり、5つのレイヤーに関心毎を分離して自由に組み合わせれる様になっているのである。

これは動画アプリの事を考えれば当たり前で、元ファイルからいろいろ試行錯誤しながら編集してそれぞれを比較したいし、いろいろ特殊効果を検討したい、という要件を考えればこういうモデルに行き着くだろう。

オブジェクト図から明らかになるドメインモデル その2

f:id:objectiveworker:20140923124310p:plain

順序は逆になるが普通の再生中のオブジェクト図を示す。
AVPlayerクラスはクロックの更新をしているだけで、現在再生位置はAVPlayerItemが保持している。

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1