Quoting James Almer (2024-02-02 13:56:31)
> I wrote a function like this some time ago, but i lost the patch by 
> accident during a migration.
> 
> The way i approached it was making the return codes reflect if the 
> conversion was lossless or not, as in, custom -> native is lossless only 
> if channels have no custom names (and possible only if the ids are 
> within UINT64_MAX and in order).

> Anything to Unspec is always lossy, etc.

Unless the source is custom with every channel unknown.

> Custom -> Ambi: Possible only if it contains ambi channels. Lossless.
> Custom -> Native: Possible only if has no ambi channels and all ids < 64 
> and in order. Lossy if it has custom names, otherwise lossless.
> Ambi -> Custom: Lossless.
> Ambi -> Native: Not possible.
> Native -> Custom: Lossless.
> Native -> Ambi: Not possible.
> Any -> Unspec: Possible but lossy.
> 
> So 0 for lossless, 1 for lossy, ENOSYS for not possible.

That sounds good to me.

Might also have a flags argument that forces lossless, and for future
extensions.

-- 
Anton Khirnov
_______________________________________________
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".

Reply via email to