* [FFmpeg-devel] [PATCH] avformat/avio: Schedule AVIODirContext to become an opaque type
@ 2022-09-26 11:50 Andreas Rheinhardt
2022-10-02 16:26 ` Andreas Rheinhardt
0 siblings, 1 reply; 2+ messages in thread
From: Andreas Rheinhardt @ 2022-09-26 11:50 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
Users can't make anything with its content.
Making it opaque might allow us to avoid one level of indirection.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
doc/APIchanges | 3 +++
libavformat/avio.c | 6 ++++++
libavformat/avio.h | 4 ++++
libavformat/version_major.h | 1 +
4 files changed, 14 insertions(+)
diff --git a/doc/APIchanges b/doc/APIchanges
index b0a41c9e37..195e3b82d4 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -14,6 +14,9 @@ libavutil: 2021-04-27
API changes, most recent first:
+2022-09-26 - xxxxxxxxxx - lavf 59.yy.100 - avio.h
+ Make AVIODirContext an opaque type in a future major version bump.
+
2022-09-26 - xxxxxxxxxx - lavc 59.48.100 - avcodec.h
Deprecate avcodec_enum_to_chroma_pos() and avcodec_chroma_pos_to_enum().
Use av_chroma_location_enum_to_pos() or av_chroma_location_pos_to_enum()
diff --git a/libavformat/avio.c b/libavformat/avio.c
index 4846bbd8c6..ab1c19a58d 100644
--- a/libavformat/avio.c
+++ b/libavformat/avio.c
@@ -528,6 +528,12 @@ int ffurl_delete(const char *url)
return ret;
}
+#if !FF_API_AVIODIRCONTEXT
+struct AVIODirContext {
+ struct URLContext *url_context;
+};
+#endif
+
int avio_open_dir(AVIODirContext **s, const char *url, AVDictionary **options)
{
URLContext *h = NULL;
diff --git a/libavformat/avio.h b/libavformat/avio.h
index 36c3d7b430..7e4aa9a1c8 100644
--- a/libavformat/avio.h
+++ b/libavformat/avio.h
@@ -101,9 +101,13 @@ typedef struct AVIODirEntry {
int64_t filemode; /**< Unix file mode, -1 if unknown. */
} AVIODirEntry;
+#if FF_API_AVIODIRCONTEXT
typedef struct AVIODirContext {
struct URLContext *url_context;
} AVIODirContext;
+#else
+typedef struct AVIODirContext AVIODirContext;
+#endif
/**
* Different data types that can be returned via the AVIO
diff --git a/libavformat/version_major.h b/libavformat/version_major.h
index 099a17873f..86af3ee4a5 100644
--- a/libavformat/version_major.h
+++ b/libavformat/version_major.h
@@ -47,6 +47,7 @@
#define FF_HLS_TS_OPTIONS (LIBAVFORMAT_VERSION_MAJOR < 60)
#define FF_API_AVSTREAM_CLASS (LIBAVFORMAT_VERSION_MAJOR > 59)
#define FF_API_GET_END_PTS (LIBAVFORMAT_VERSION_MAJOR < 60)
+#define FF_API_AVIODIRCONTEXT (LIBAVFORMAT_VERSION_MAJOR < 60)
#define FF_API_R_FRAME_RATE 1
--
2.34.1
_______________________________________________
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] [PATCH] avformat/avio: Schedule AVIODirContext to become an opaque type
2022-09-26 11:50 [FFmpeg-devel] [PATCH] avformat/avio: Schedule AVIODirContext to become an opaque type Andreas Rheinhardt
@ 2022-10-02 16:26 ` Andreas Rheinhardt
0 siblings, 0 replies; 2+ messages in thread
From: Andreas Rheinhardt @ 2022-10-02 16:26 UTC (permalink / raw)
To: ffmpeg-devel
Andreas Rheinhardt:
> Users can't make anything with its content.
> Making it opaque might allow us to avoid one level of indirection.
>
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
> doc/APIchanges | 3 +++
> libavformat/avio.c | 6 ++++++
> libavformat/avio.h | 4 ++++
> libavformat/version_major.h | 1 +
> 4 files changed, 14 insertions(+)
>
> diff --git a/doc/APIchanges b/doc/APIchanges
> index b0a41c9e37..195e3b82d4 100644
> --- a/doc/APIchanges
> +++ b/doc/APIchanges
> @@ -14,6 +14,9 @@ libavutil: 2021-04-27
>
> API changes, most recent first:
>
> +2022-09-26 - xxxxxxxxxx - lavf 59.yy.100 - avio.h
> + Make AVIODirContext an opaque type in a future major version bump.
> +
> 2022-09-26 - xxxxxxxxxx - lavc 59.48.100 - avcodec.h
> Deprecate avcodec_enum_to_chroma_pos() and avcodec_chroma_pos_to_enum().
> Use av_chroma_location_enum_to_pos() or av_chroma_location_pos_to_enum()
> diff --git a/libavformat/avio.c b/libavformat/avio.c
> index 4846bbd8c6..ab1c19a58d 100644
> --- a/libavformat/avio.c
> +++ b/libavformat/avio.c
> @@ -528,6 +528,12 @@ int ffurl_delete(const char *url)
> return ret;
> }
>
> +#if !FF_API_AVIODIRCONTEXT
> +struct AVIODirContext {
> + struct URLContext *url_context;
> +};
> +#endif
> +
> int avio_open_dir(AVIODirContext **s, const char *url, AVDictionary **options)
> {
> URLContext *h = NULL;
> diff --git a/libavformat/avio.h b/libavformat/avio.h
> index 36c3d7b430..7e4aa9a1c8 100644
> --- a/libavformat/avio.h
> +++ b/libavformat/avio.h
> @@ -101,9 +101,13 @@ typedef struct AVIODirEntry {
> int64_t filemode; /**< Unix file mode, -1 if unknown. */
> } AVIODirEntry;
>
> +#if FF_API_AVIODIRCONTEXT
> typedef struct AVIODirContext {
> struct URLContext *url_context;
> } AVIODirContext;
> +#else
> +typedef struct AVIODirContext AVIODirContext;
> +#endif
>
> /**
> * Different data types that can be returned via the AVIO
> diff --git a/libavformat/version_major.h b/libavformat/version_major.h
> index 099a17873f..86af3ee4a5 100644
> --- a/libavformat/version_major.h
> +++ b/libavformat/version_major.h
> @@ -47,6 +47,7 @@
> #define FF_HLS_TS_OPTIONS (LIBAVFORMAT_VERSION_MAJOR < 60)
> #define FF_API_AVSTREAM_CLASS (LIBAVFORMAT_VERSION_MAJOR > 59)
> #define FF_API_GET_END_PTS (LIBAVFORMAT_VERSION_MAJOR < 60)
> +#define FF_API_AVIODIRCONTEXT (LIBAVFORMAT_VERSION_MAJOR < 60)
>
>
> #define FF_API_R_FRAME_RATE 1
Will apply this patchset tomorrow unless there are objections.
- 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-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-10-02 16:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-26 11:50 [FFmpeg-devel] [PATCH] avformat/avio: Schedule AVIODirContext to become an opaque type Andreas Rheinhardt
2022-10-02 16:26 ` Andreas Rheinhardt
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