Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions videodecoder/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,38 @@
<string>MPEG-4 Video (MEncoder)</string>
</dict>

<!-- Vidvox HAP codecs -->
<dict>
<key>CodecType</key>
<string>Hap1</string>
<key>CodecName</key>
<string>HAP</string>
</dict>
<dict>
<key>CodecType</key>
<string>Hap5</string>
<key>CodecName</key>
<string>HAP Alpha</string>
</dict>
<dict>
<key>CodecType</key>
<string>HapY</string>
<key>CodecName</key>
<string>HAP Q</string>
</dict>
<dict>
<key>CodecType</key>
<string>HapM</string>
<key>CodecName</key>
<string>HAP Q Alpha</string>
</dict>
<dict>
<key>CodecType</key>
<string>HapA</string>
<key>CodecName</key>
<string>HAP Alpha Only</string>
</dict>

<!-- Fallback type set by formatreader -->
<dict>
<key>CodecType</key>
Expand Down
9 changes: 9 additions & 0 deletions videodecoder/videodecoder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ class VideoDecoder: NSObject, MEVideoDecoder {
0x4d50_3431: AV_CODEC_ID_MSMPEG4V1, // 'MP41'
0x4d50_3432: AV_CODEC_ID_MSMPEG4V2, // 'MP42'
0x4d50_3433: AV_CODEC_ID_MSMPEG4V3, // 'MP43'
0x4861_7031: AV_CODEC_ID_HAP, // 'Hap1'
0x4861_7035: AV_CODEC_ID_HAP, // 'Hap5'
0x4861_7059: AV_CODEC_ID_HAP, // 'HapY'
0x4861_704D: AV_CODEC_ID_HAP, // 'HapM'
0x4861_7041: AV_CODEC_ID_HAP, // 'HapA'
]

// Supported pixel formats for QuickTime animation. Non-paletised only.
Expand Down Expand Up @@ -215,6 +220,10 @@ class VideoDecoder: NSObject, MEVideoDecoder {
}
}
}
case AV_CODEC_ID_HAP:
// HAP outputs RGB0 (Hap1/HapY), RGBA (Hap5/HapM), or GRAY8 (HapA).
// FFmpeg's hapdec.c sets pix_fmt internally; no extradata needed.
params.pointee.color_range = AVCOL_RANGE_JPEG
default:
// Shouldn't get here
logger.error(
Expand Down