* [FFmpeg-devel] [PATCH 1/2] avutil/file_open: Fix build error with wasi
[not found] <20240628044601.60376-1-quinkblack@foxmail.com>
@ 2024-06-28 4:45 ` Zhao Zhili
2024-06-30 5:30 ` Mark Harris
2024-06-28 4:46 ` [FFmpeg-devel] [PATCH] configure: Fix Apple framework dependencies in .pc file Zhao Zhili
2024-06-28 4:46 ` [FFmpeg-devel] [PATCH 2/2] avformat/file: guard fd_dup by FD_PROTOCOL or PIPE_PROTOCOL Zhao Zhili
2 siblings, 1 reply; 6+ messages in thread
From: Zhao Zhili @ 2024-06-28 4:45 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Zhao Zhili
From: Zhao Zhili <zhilizhao@tencent.com>
Don't assume tempnam is available when !HAVE_MKSTEMP. Check tempnam
explicitly in configure.
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
---
configure | 2 ++
libavutil/file_open.c | 2 +-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/configure b/configure
index 7685c95fbb..bd3c1d4838 100755
--- a/configure
+++ b/configure
@@ -2413,6 +2413,7 @@ SYSTEM_FUNCS="
sysconf
sysctl
sysctlbyname
+ tempnam
usleep
UTGetOSTypeFromString
VirtualAlloc
@@ -6548,6 +6549,7 @@ check_struct "sys/stat.h" "struct stat" st_mtim.tv_nsec -D_BSD_SOURCE
check_func strerror_r
check_func sysconf
check_func sysctl
+check_func tempnam
check_func usleep
check_func_headers conio.h kbhit
diff --git a/libavutil/file_open.c b/libavutil/file_open.c
index 24ef33e3da..eef6d83706 100644
--- a/libavutil/file_open.c
+++ b/libavutil/file_open.c
@@ -112,7 +112,7 @@ int avpriv_tempfile(const char *prefix, char **filename, int log_offset, void *l
{
FileLogContext file_log_ctx = { &file_log_ctx_class, log_offset, log_ctx };
int fd = -1;
-#if !HAVE_MKSTEMP
+#if HAVE_TEMPNAM
void *ptr= tempnam(NULL, prefix);
if(!ptr)
ptr= tempnam(".", prefix);
--
2.42.0
_______________________________________________
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] 6+ messages in thread
* [FFmpeg-devel] [PATCH] configure: Fix Apple framework dependencies in .pc file
[not found] <20240628044601.60376-1-quinkblack@foxmail.com>
2024-06-28 4:45 ` [FFmpeg-devel] [PATCH 1/2] avutil/file_open: Fix build error with wasi Zhao Zhili
@ 2024-06-28 4:46 ` Zhao Zhili
2024-07-05 8:43 ` Zhao Zhili
2024-06-28 4:46 ` [FFmpeg-devel] [PATCH 2/2] avformat/file: guard fd_dup by FD_PROTOCOL or PIPE_PROTOCOL Zhao Zhili
2 siblings, 1 reply; 6+ messages in thread
From: Zhao Zhili @ 2024-06-28 4:46 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Zhao Zhili
From: Zhao Zhili <zhilizhao@tencent.com>
configure use "-Wl,-framework,foo" and "-framework foo" to specify
dependencies on Apple frameworks. These two styles essentially do
the same thing when build ffmpeg. However, they do make difference
when generate pkg-config files. Some tools interact with pkg-config
cannot handle "-Wl,-framework,foo" in Libs field, e.g., cmake with
pkg_check_modules.
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
---
configure | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/configure b/configure
index 3bca638459..a09c92cfb2 100755
--- a/configure
+++ b/configure
@@ -7033,7 +7033,7 @@ enabled openal && { check_pkg_config openal "openal >= 1.1" "AL/al.h"
{ test_cpp_condition "AL/al.h" "defined(AL_VERSION_1_1)" ||
die "ERROR: openal must be installed and version must be 1.1 or compatible"; }
enabled opencl && { check_pkg_config opencl OpenCL CL/cl.h clEnqueueNDRangeKernel ||
- check_lib opencl OpenCL/cl.h clEnqueueNDRangeKernel -Wl,-framework,OpenCL ||
+ check_lib opencl OpenCL/cl.h clEnqueueNDRangeKernel "-framework OpenCL" ||
check_lib opencl CL/cl.h clEnqueueNDRangeKernel -lOpenCL ||
die "ERROR: opencl not found"; } &&
{ test_cpp_condition "OpenCL/cl.h" "defined(CL_VERSION_1_2)" ||
@@ -7041,8 +7041,8 @@ enabled opencl && { check_pkg_config opencl OpenCL CL/cl.h clEnqueueN
die "ERROR: opencl must be installed and version must be 1.2 or compatible"; }
enabled opengl && { check_lib opengl GL/glx.h glXGetProcAddress "-lGL" ||
check_lib opengl windows.h wglGetProcAddress "-lopengl32 -lgdi32" ||
- check_lib opengl OpenGL/gl3.h glGetError "-Wl,-framework,OpenGL" ||
- check_lib opengl ES2/gl.h glGetError "-isysroot=${sysroot} -Wl,-framework,OpenGLES" ||
+ check_lib opengl OpenGL/gl3.h glGetError "-framework OpenGL" ||
+ check_lib opengl ES2/gl.h glGetError "-isysroot=${sysroot} -framework OpenGLES" ||
die "ERROR: opengl not found."
}
enabled omx_rpi && { test_code cc OMX_Core.h OMX_IndexConfigBrcmVideoRequestIFrame ||
@@ -7110,12 +7110,12 @@ if enabled decklink; then
fi
enabled securetransport &&
- check_func SecIdentityCreate "-Wl,-framework,CoreFoundation -Wl,-framework,Security" &&
- check_lib securetransport "Security/SecureTransport.h Security/Security.h" "SSLCreateContext" "-Wl,-framework,CoreFoundation -Wl,-framework,Security" ||
+ check_func SecIdentityCreate "-framework CoreFoundation -framework Security" &&
+ check_lib securetransport "Security/SecureTransport.h Security/Security.h" "SSLCreateContext" "-framework CoreFoundation -framework Security" ||
disable securetransport
enabled securetransport &&
- check_func SecItemImport "-Wl,-framework,CoreFoundation -Wl,-framework,Security"
+ check_func SecItemImport "-framework CoreFoundation -framework Security"
enabled schannel &&
check_func_headers "windows.h security.h" InitializeSecurityContext -DSECURITY_WIN32 -lsecur32 &&
--
2.42.0
_______________________________________________
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] 6+ messages in thread
* [FFmpeg-devel] [PATCH 2/2] avformat/file: guard fd_dup by FD_PROTOCOL or PIPE_PROTOCOL
[not found] <20240628044601.60376-1-quinkblack@foxmail.com>
2024-06-28 4:45 ` [FFmpeg-devel] [PATCH 1/2] avutil/file_open: Fix build error with wasi Zhao Zhili
2024-06-28 4:46 ` [FFmpeg-devel] [PATCH] configure: Fix Apple framework dependencies in .pc file Zhao Zhili
@ 2024-06-28 4:46 ` Zhao Zhili
2 siblings, 0 replies; 6+ messages in thread
From: Zhao Zhili @ 2024-06-28 4:46 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Zhao Zhili
From: Zhao Zhili <zhilizhao@tencent.com>
fd_dup is unused when fd and pipe have been disabled. This also
fix build error with wasi since 'dup' isn't available.
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
---
libavformat/file.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/libavformat/file.c b/libavformat/file.c
index 3fc1e741f2..6a66040b65 100644
--- a/libavformat/file.c
+++ b/libavformat/file.c
@@ -193,6 +193,7 @@ static int file_check(URLContext *h, int mask)
return ret;
}
+#if CONFIG_FD_PROTOCOL || CONFIG_PIPE_PROTOCOL
static int fd_dup(URLContext *h, int oldfd)
{
int newfd;
@@ -215,6 +216,7 @@ static int fd_dup(URLContext *h, int oldfd)
#endif
return newfd;
}
+#endif
static int file_close(URLContext *h)
{
--
2.42.0
_______________________________________________
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] 6+ messages in thread
* Re: [FFmpeg-devel] [PATCH 1/2] avutil/file_open: Fix build error with wasi
2024-06-28 4:45 ` [FFmpeg-devel] [PATCH 1/2] avutil/file_open: Fix build error with wasi Zhao Zhili
@ 2024-06-30 5:30 ` Mark Harris
0 siblings, 0 replies; 6+ messages in thread
From: Mark Harris @ 2024-06-30 5:30 UTC (permalink / raw)
To: FFmpeg development discussions and patches
> From: Zhao Zhili <zhilizhao@tencent.com>
>
> Don't assume tempnam is available when !HAVE_MKSTEMP. Check tempnam
> explicitly in configure.
>
> Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
> ---
> configure | 2 ++
> libavutil/file_open.c | 2 +-
> 2 files changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/configure b/configure
> index 7685c95fbb..bd3c1d4838 100755
> --- a/configure
> +++ b/configure
> @@ -2413,6 +2413,7 @@ SYSTEM_FUNCS="
> sysconf
> sysctl
> sysctlbyname
> + tempnam
> usleep
> UTGetOSTypeFromString
> VirtualAlloc
> @@ -6548,6 +6549,7 @@ check_struct "sys/stat.h" "struct stat" st_mtim.tv_nsec -D_BSD_SOURCE
> check_func strerror_r
> check_func sysconf
> check_func sysctl
> +check_func tempnam
> check_func usleep
>
> check_func_headers conio.h kbhit
> diff --git a/libavutil/file_open.c b/libavutil/file_open.c
> index 24ef33e3da..eef6d83706 100644
> --- a/libavutil/file_open.c
> +++ b/libavutil/file_open.c
> @@ -112,7 +112,7 @@ int avpriv_tempfile(const char *prefix, char **filename, int log_offset, void *l
> {
> FileLogContext file_log_ctx = { &file_log_ctx_class, log_offset, log_ctx };
> int fd = -1;
> -#if !HAVE_MKSTEMP
> +#if HAVE_TEMPNAM
If neither HAVE_TEMPNAM nor HAVE_MKSTEMP are defined, this will get
the file name from an uninitialized buffer. If both are defined it
will not compile because len will be undefined.
- Mark
> void *ptr= tempnam(NULL, prefix);
> if(!ptr)
> ptr= tempnam(".", prefix);
> --
> 2.42.0
_______________________________________________
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] 6+ messages in thread
* Re: [FFmpeg-devel] [PATCH] configure: Fix Apple framework dependencies in .pc file
2024-06-28 4:46 ` [FFmpeg-devel] [PATCH] configure: Fix Apple framework dependencies in .pc file Zhao Zhili
@ 2024-07-05 8:43 ` Zhao Zhili
0 siblings, 0 replies; 6+ messages in thread
From: Zhao Zhili @ 2024-07-05 8:43 UTC (permalink / raw)
To: FFmpeg development discussions and patches
> On Jun 28, 2024, at 12:46, Zhao Zhili <quinkblack@foxmail.com> wrote:
>
> From: Zhao Zhili <zhilizhao@tencent.com>
>
> configure use "-Wl,-framework,foo" and "-framework foo" to specify
> dependencies on Apple frameworks. These two styles essentially do
> the same thing when build ffmpeg. However, they do make difference
> when generate pkg-config files. Some tools interact with pkg-config
> cannot handle "-Wl,-framework,foo" in Libs field, e.g., cmake with
> pkg_check_modules.
>
> Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
> ---
> configure | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/configure b/configure
> index 3bca638459..a09c92cfb2 100755
> --- a/configure
> +++ b/configure
> @@ -7033,7 +7033,7 @@ enabled openal && { check_pkg_config openal "openal >= 1.1" "AL/al.h"
> { test_cpp_condition "AL/al.h" "defined(AL_VERSION_1_1)" ||
> die "ERROR: openal must be installed and version must be 1.1 or compatible"; }
> enabled opencl && { check_pkg_config opencl OpenCL CL/cl.h clEnqueueNDRangeKernel ||
> - check_lib opencl OpenCL/cl.h clEnqueueNDRangeKernel -Wl,-framework,OpenCL ||
> + check_lib opencl OpenCL/cl.h clEnqueueNDRangeKernel "-framework OpenCL" ||
> check_lib opencl CL/cl.h clEnqueueNDRangeKernel -lOpenCL ||
> die "ERROR: opencl not found"; } &&
> { test_cpp_condition "OpenCL/cl.h" "defined(CL_VERSION_1_2)" ||
> @@ -7041,8 +7041,8 @@ enabled opencl && { check_pkg_config opencl OpenCL CL/cl.h clEnqueueN
> die "ERROR: opencl must be installed and version must be 1.2 or compatible"; }
> enabled opengl && { check_lib opengl GL/glx.h glXGetProcAddress "-lGL" ||
> check_lib opengl windows.h wglGetProcAddress "-lopengl32 -lgdi32" ||
> - check_lib opengl OpenGL/gl3.h glGetError "-Wl,-framework,OpenGL" ||
> - check_lib opengl ES2/gl.h glGetError "-isysroot=${sysroot} -Wl,-framework,OpenGLES" ||
> + check_lib opengl OpenGL/gl3.h glGetError "-framework OpenGL" ||
> + check_lib opengl ES2/gl.h glGetError "-isysroot=${sysroot} -framework OpenGLES" ||
> die "ERROR: opengl not found."
> }
> enabled omx_rpi && { test_code cc OMX_Core.h OMX_IndexConfigBrcmVideoRequestIFrame ||
> @@ -7110,12 +7110,12 @@ if enabled decklink; then
> fi
>
> enabled securetransport &&
> - check_func SecIdentityCreate "-Wl,-framework,CoreFoundation -Wl,-framework,Security" &&
> - check_lib securetransport "Security/SecureTransport.h Security/Security.h" "SSLCreateContext" "-Wl,-framework,CoreFoundation -Wl,-framework,Security" ||
> + check_func SecIdentityCreate "-framework CoreFoundation -framework Security" &&
> + check_lib securetransport "Security/SecureTransport.h Security/Security.h" "SSLCreateContext" "-framework CoreFoundation -framework Security" ||
> disable securetransport
>
> enabled securetransport &&
> - check_func SecItemImport "-Wl,-framework,CoreFoundation -Wl,-framework,Security"
> + check_func SecItemImport "-framework CoreFoundation -framework Security"
>
> enabled schannel &&
> check_func_headers "windows.h security.h" InitializeSecurityContext -DSECURITY_WIN32 -lsecur32 &&
> --
> 2.42.0
>
Ping.
_______________________________________________
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] 6+ messages in thread
* [FFmpeg-devel] [PATCH] configure: Fix Apple framework dependencies in .pc file
@ 2024-06-25 9:06 Zhao Zhili
0 siblings, 0 replies; 6+ messages in thread
From: Zhao Zhili @ 2024-06-25 9:06 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Zhao Zhili
From: Zhao Zhili <zhilizhao@tencent.com>
configure use "-Wl,-framework,foo" and "-framework foo" to specify
dependencies on Apple frameworks. These two styles essentially do
the same thing when build ffmpeg. However, they do make difference
when generate pkg-config files. Some tools interact with pkg-config
cannot handle "-Wl,-framework,foo" in Libs field, e.g., cmake with
pkg_check_modules.
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
---
configure | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/configure b/configure
index 3bca638459..a09c92cfb2 100755
--- a/configure
+++ b/configure
@@ -7033,7 +7033,7 @@ enabled openal && { check_pkg_config openal "openal >= 1.1" "AL/al.h"
{ test_cpp_condition "AL/al.h" "defined(AL_VERSION_1_1)" ||
die "ERROR: openal must be installed and version must be 1.1 or compatible"; }
enabled opencl && { check_pkg_config opencl OpenCL CL/cl.h clEnqueueNDRangeKernel ||
- check_lib opencl OpenCL/cl.h clEnqueueNDRangeKernel -Wl,-framework,OpenCL ||
+ check_lib opencl OpenCL/cl.h clEnqueueNDRangeKernel "-framework OpenCL" ||
check_lib opencl CL/cl.h clEnqueueNDRangeKernel -lOpenCL ||
die "ERROR: opencl not found"; } &&
{ test_cpp_condition "OpenCL/cl.h" "defined(CL_VERSION_1_2)" ||
@@ -7041,8 +7041,8 @@ enabled opencl && { check_pkg_config opencl OpenCL CL/cl.h clEnqueueN
die "ERROR: opencl must be installed and version must be 1.2 or compatible"; }
enabled opengl && { check_lib opengl GL/glx.h glXGetProcAddress "-lGL" ||
check_lib opengl windows.h wglGetProcAddress "-lopengl32 -lgdi32" ||
- check_lib opengl OpenGL/gl3.h glGetError "-Wl,-framework,OpenGL" ||
- check_lib opengl ES2/gl.h glGetError "-isysroot=${sysroot} -Wl,-framework,OpenGLES" ||
+ check_lib opengl OpenGL/gl3.h glGetError "-framework OpenGL" ||
+ check_lib opengl ES2/gl.h glGetError "-isysroot=${sysroot} -framework OpenGLES" ||
die "ERROR: opengl not found."
}
enabled omx_rpi && { test_code cc OMX_Core.h OMX_IndexConfigBrcmVideoRequestIFrame ||
@@ -7110,12 +7110,12 @@ if enabled decklink; then
fi
enabled securetransport &&
- check_func SecIdentityCreate "-Wl,-framework,CoreFoundation -Wl,-framework,Security" &&
- check_lib securetransport "Security/SecureTransport.h Security/Security.h" "SSLCreateContext" "-Wl,-framework,CoreFoundation -Wl,-framework,Security" ||
+ check_func SecIdentityCreate "-framework CoreFoundation -framework Security" &&
+ check_lib securetransport "Security/SecureTransport.h Security/Security.h" "SSLCreateContext" "-framework CoreFoundation -framework Security" ||
disable securetransport
enabled securetransport &&
- check_func SecItemImport "-Wl,-framework,CoreFoundation -Wl,-framework,Security"
+ check_func SecItemImport "-framework CoreFoundation -framework Security"
enabled schannel &&
check_func_headers "windows.h security.h" InitializeSecurityContext -DSECURITY_WIN32 -lsecur32 &&
--
2.42.0
_______________________________________________
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] 6+ messages in thread
end of thread, other threads:[~2024-07-05 8:43 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20240628044601.60376-1-quinkblack@foxmail.com>
2024-06-28 4:45 ` [FFmpeg-devel] [PATCH 1/2] avutil/file_open: Fix build error with wasi Zhao Zhili
2024-06-30 5:30 ` Mark Harris
2024-06-28 4:46 ` [FFmpeg-devel] [PATCH] configure: Fix Apple framework dependencies in .pc file Zhao Zhili
2024-07-05 8:43 ` Zhao Zhili
2024-06-28 4:46 ` [FFmpeg-devel] [PATCH 2/2] avformat/file: guard fd_dup by FD_PROTOCOL or PIPE_PROTOCOL Zhao Zhili
2024-06-25 9:06 [FFmpeg-devel] [PATCH] configure: Fix Apple framework dependencies in .pc file Zhao Zhili
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