Stephen Hutchinson: > On 8/28/22 8:41 PM, Andreas Rheinhardt wrote: >> This will make frameprops a global on-off which overrides everything >> else even if some of the "else" stuff has been enabled explicitly. Worse >> yet, if you want to disable everything except exactly one field, you >> have to leave frameprops enabled and disable everything else explicitly. >> >> Why not use a bitfield (with AV_OPT_TYPE_FLAGS and AV_OPT_TYPE_CONST)? >> These properties certainly seem like a bitfield and the above would be >> easily achievable with it. >> > > How are flags supposed to be set to on by default? With av_dict_set or > a different mechanism? Because the closest I was able to get¹, > > if(avs->flags & AVISYNTH_FRAMEPROP_FIELD_ORDER | > AVISYNTH_FRAMEPROP_DEFAULT) { > > ends up correctly setting the flags that should be on by default, > with the new sar flag able to be enabled or disabled, but the ones > flagged as default refuse to be disabled now. > > ¹https://github.com/qyot27/FFmpeg/commit/6d3d6108145f9c7ac2dfcdaf09852b7472f6ca7f >
{ "avisynth_flags", "set flags related to reading frame properties from script (AviSynth+ v3.7.1 or higher)", OFFSET(flags), AV_OPT_TYPE_FLAGS, {.i64 = 1}, 0, 1, AV_OPT_FLAG_DECODING_PARAM, "flags" }, This is wrong. It should be { "avisynth_flags", "set flags related to reading frame properties from script (AviSynth+ v3.7.1 or higher)", OFFSET(flags), AV_OPT_TYPE_FLAGS, {.i64 = AVISYNTH_FRAMEPROP_FIELD_ORDER | AVISYNTH_FRAMEPROP_RANGE | AVISYNTH_FRAMEPROP_PRIMARIES | AVISYNTH_FRAMEPROP_TRANSFER | AVISYNTH_FRAMEPROP_MATRIX | AVISYNTH_FRAMEPROP_CHROMA_LOCATION}, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM, "flags" } The default option should be removed. Users can then set the options via avisynth_flags=+sar-range or via avisynth_flags=matrix or however they wish. The AVISYNTH_FRAMEPROP_DEFAULT should also be removed (at least, it should not be part of the bitfield, but you can of course add a define (or an enum value) equivalent to the default value I used above and you can use that for the default value above); to know whether field order should be exported, you simply query via "if (avs->flags & AVISYNTH_FRAMEPROP_FIELD_ORDER)". For this it is of course important that the default value is a combination of other bits of the bitfield and not a bit of its own. - Andreas _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".