Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.

Commit

Permalink
decoder_vt: add ProRes support
Browse files Browse the repository at this point in the history
  • Loading branch information
ubitux committed Dec 16, 2021
1 parent 75bbe75 commit eb14cb1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Added
- Add ProRes support in VideoToolbox decoder

### Changed
- Player has been ported from GLEW/GLFW3 to SDL2

Expand Down
15 changes: 15 additions & 0 deletions src/decoder_vt.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ static CFDictionaryRef decoder_config_create(CMVideoCodecType codec_type,
CFSTR("EnableHardwareAcceleratedVideoDecoder"),
kCFBooleanTrue);

if (avctx->codec_id != AV_CODEC_ID_H264 && avctx->codec_id != AV_CODEC_ID_HEVC)
return config_info;

if (avctx->extradata_size) {
CFMutableDictionaryRef avc_info;

Expand Down Expand Up @@ -432,6 +435,18 @@ static int vtdec_init(struct decoder_ctx *dec_ctx, const struct sxplayer_opts *o
switch (avctx->codec_id) {
case AV_CODEC_ID_H264: cm_codec_type = kCMVideoCodecType_H264; break;
case AV_CODEC_ID_HEVC: cm_codec_type = kCMVideoCodecType_HEVC; break;
case AV_CODEC_ID_PRORES:
switch (avctx->codec_tag) {
case MKTAG('a','p','c','n'): cm_codec_type = kCMVideoCodecType_AppleProRes422; break;
case MKTAG('a','p','c','h'): cm_codec_type = kCMVideoCodecType_AppleProRes422HQ; break;
case MKTAG('a','p','c','s'): cm_codec_type = kCMVideoCodecType_AppleProRes422LT; break;
case MKTAG('a','p','c','o'): cm_codec_type = kCMVideoCodecType_AppleProRes422Proxy; break;
case MKTAG('a','p','4','x'):
case MKTAG('a','p','4','h'): cm_codec_type = kCMVideoCodecType_AppleProRes4444; break;
default:
return AVERROR_DECODER_NOT_FOUND;
}
break;
default:
return AVERROR_DECODER_NOT_FOUND;
}
Expand Down

0 comments on commit eb14cb1

Please sign in to comment.