* [FFmpeg-devel] Refactoring UUID functionality
@ 2022-01-20 17:45 Pierre-Anthony Lemieux
2022-02-05 3:16 ` Zane van Iperen
0 siblings, 1 reply; 2+ messages in thread
From: Pierre-Anthony Lemieux @ 2022-01-20 17:45 UTC (permalink / raw)
To: FFmpeg development discussions and patches
Hi all,
It was recently suggested that UUID functionality in the codebase
could be refactored into a single library.
Below is short explainer.
I would appreciate your review/feedback before I/we start writing code.
Best,
-- Pierre
# Common UUID library
## Why
In the course of the IMF demuxer code review [^1], it was suggested
that UUID handling should be delegated to `libuuid` [^2].
It was further pointed out that:
* `libuuid`, as-is, is not a great fit for the IMF demuxer [^3]
* other parts of FFmpeg use UUIDs, e.g. `libavformat/mov.c` and
`libavcodec/cbs_sei.h`
* `libuuid` does not build on Windows
[^1] https://patchwork.ffmpeg.org/project/ffmpeg/patch/20211206031853.21739-1-pal@sandflow.com/#68513
[^2]
https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git/tree/libuuid [^3]
https://ffmpeg.org/pipermail/ffmpeg-devel/2021-December/290365.html
## Proposal
The proposal is to develop a single UUID library for use across
FFmpeg. The library would reuse (by copying) existing code whenever
possible, e.g. from libuuid. It would be implemented as
`libavutil/uuid.h` and `libavutil/uuid.c` and expose a public API,
e.g.
`int av_uuid_parse(...)`.
## Goals
The library would refactor into a single library the UUID
functionality currently in use by FFmpeg.
## Non-goals
The library is not intended to be a generic UUID library.
## Affected files
Below is an initial list of files that will probably require modifications:
* `libavcodec/cbs_sei.h`
* `libavcodec/cbs_sei_syntax_template.c`
* `libavcodec/h264_metadata_bsf.c`
* `libavcodec/vaapi_encode_h264.c`
* `libavfilter/vf_showinfo.c`
* `libavformat/imf_cpl.c`
* `libavformat/imf.h`
* `libavformat/imfdec.c`
* `libavformat/tests/imf.c`
* `libavformat/mov.c`
* `libavformat/movenc.c`
* `libavformat/smoothstreamingenc.c`
* `libavutil/hwcontext_cuda.c`
* `libavutil/hwcontext_vulkan.c`
`libavforamt/mxfenc.c` defines `mxf_write_uuid()` but it looks like
this is used to write hardcoded instance UIDs, and thus is not
really about generic UUIDs. Perhaps that function should be renamed
`mxf_write_uid()`.
## Pluses
* reduces code duplication
## Minuses
* requires touching stable FFmpeg code
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [FFmpeg-devel] Refactoring UUID functionality
2022-01-20 17:45 [FFmpeg-devel] Refactoring UUID functionality Pierre-Anthony Lemieux
@ 2022-02-05 3:16 ` Zane van Iperen
0 siblings, 0 replies; 2+ messages in thread
From: Zane van Iperen @ 2022-02-05 3:16 UTC (permalink / raw)
To: ffmpeg-devel
On 21/1/22 03:45, Pierre-Anthony Lemieux wrote:
> Hi all,
>
> It was recently suggested that UUID functionality in the codebase
> could be refactored into a single library.
>
> Below is short explainer.
>
> I would appreciate your review/feedback before I/we start writing code.
>
> Best,
>
> -- Pierre
>
I have no complaints, the approach looks good.
From what Pierre, Lynne, and myself discussed privately, basically the plan is to:
* Rip out uuid_{un,}parse() from libuuid into av_uuid_{un,}parse(), and
* Use it to dedup the existing ad-hoc UUID handling littered around the place.
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-02-05 3:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-20 17:45 [FFmpeg-devel] Refactoring UUID functionality Pierre-Anthony Lemieux
2022-02-05 3:16 ` Zane van Iperen
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git