File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 6565#include " rtp/rtpdec_h264.h"
6666#include " rtp/rtpenc_h264.h"
6767#include " tv.h"
68+ #include " types.h" // for UYVY, RGBA, v210, RGB
6869#include " ug_runtime_error.hpp"
6970#include " utils/color_out.h"
7071#include " utils/debug.h" // for debug_file_dump
@@ -2011,7 +2012,16 @@ configure_videotoolbox_hevc(AVCodecContext * /*codec_ctx*/,
20112012 if (param->lavc_opts .find (" profile" ) == param->lavc_opts .end ()) {
20122013 // enforce AV_PROFILE_HEVC_REXT, otherwise we will get Main10
20132014 // profile (10-bit 4:2:0) - even for UYVY
2014- param->lavc_opts [" profile" ] = " rext" ;
2015+ const char *profile = " rext" ;
2016+ // but user may requested :subsampling=420 -> use main[10] :
2017+ if (av_pixfmt_get_subsampling (param->av_pix_fmt ) == SUBS_420) {
2018+ profile = av_pix_fmt_desc_get (param->av_pix_fmt )
2019+ ->comp [0 ]
2020+ .depth == DEPTH8
2021+ ? " main"
2022+ : " main10" ;
2023+ }
2024+ param->lavc_opts [" profile" ] = profile;
20152025 }
20162026}
20172027
You can’t perform that action at this time.
0 commit comments