Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gdigrab revert #8

Merged
merged 4 commits into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,11 @@ jobs:
./configure --host=aarch64-w64-mingw32 --prefix=${{ github.workspace }}/local --enable-pic --extra-cflags="-mfpu=neon" --cross-prefix=aarch64-w64-mingw32- --enable-shared --enable-static
make -j16
make install
- uses: actions/checkout@v3
- uses: actions/checkout@v3
with:
repository: FFmpeg/FFmpeg
path: ffmpeg
ref: 419145c11bb3310539eb975751291bcf023e9170
# d7ac7101ee8c70a253f7caf400d9ae3870880d7f is causing build issues, no gdigrab by window handle
- name: build ffmpeg
run: |
# /opt/llvm-mingw/aarch64-w64-mingw32/
Expand All @@ -53,9 +52,9 @@ jobs:
# curl https://download.videolan.org/pub/contrib/dxva2api.h -o /opt/llvm-mingw/aarch64-w64-mingw32/include/dxva2api.h

cd ffmpeg
# reverting d7ac7101ee8c70a253f7caf400d9ae3870880d7f
# this commit is causing build issues for dubious typecast, no way to consistently revert it without deep cloning repository
# git revert -n d7ac7101ee8c70a253f7caf400d9ae3870880d7f
# sed -i 's/0x020100/0x030000/' ./configure
git apply ../revert-d7ac710.patch
export PKG_CONFIG_LIBDIR=${{ github.workspace }}/local/lib/pkgconfig
./configure --pkg-config=/usr/bin/x86_64-pc-linux-gnu-pkg-config --pkgconfigdir=${{ github.workspace }}/local/lib/pkgconfig --cross-prefix=aarch64-w64-mingw32- --arch=arm64 --target-os=mingw32 --enable-sdl --disable-doc --prefix=${{ github.workspace }}/local --disable-static --enable-shared --enable-libx264 --enable-gpl --enable-nonfree

Expand Down
68 changes: 68 additions & 0 deletions revert-d7ac710.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
diff --git a/Changelog b/Changelog
index a1b09027bb..67ef92eb02 100644
--- a/Changelog
+++ b/Changelog
@@ -9,7 +9,6 @@ version <next>:
- aap filter
- demuxing, decoding, filtering, encoding, and muxing in the
ffmpeg CLI now all run in parallel
-- enable gdigrab device to grab a window using the hwnd=HANDLER syntax

version 6.1:
- libaribcaption decoder
diff --git a/doc/indevs.texi b/doc/indevs.texi
index a0c684f545..863536a34d 100644
--- a/doc/indevs.texi
+++ b/doc/indevs.texi
@@ -722,7 +722,7 @@ Win32 GDI-based screen capture device.

This device allows you to capture a region of the display on Windows.

-Amongst options for the imput filenames are such elements as:
+There are two options for the input filename:
@example
desktop
@end example
@@ -730,13 +730,9 @@ or
@example
title=@var{window_title}
@end example
-or
-@example
-hwnd=@var{window_hwnd}
-@end example

The first option will capture the entire desktop, or a fixed region of the
-desktop. The second and third options will instead capture the contents of a single
+desktop. The second option will instead capture the contents of a single
window, regardless of its position on the screen.

For example, to grab the entire desktop using @command{ffmpeg}:
diff --git a/libavdevice/gdigrab.c b/libavdevice/gdigrab.c
index 41ef370f2b..c069232472 100644
--- a/libavdevice/gdigrab.c
+++ b/libavdevice/gdigrab.c
@@ -273,22 +273,9 @@ gdigrab_read_header(AVFormatContext *s1)
}
} else if (!strcmp(filename, "desktop")) {
hwnd = NULL;
- } else if (!strncmp(filename, "hwnd=", 5)) {
- name = filename + 5;
- char *p;
-
- hwnd = strtol(name, &p, 0);
-
- if (p == NULL || p == name || p[0] == '\0')
- {
- av_log(s1, AV_LOG_ERROR,
- "Invalid window handle '%s', must be a valid integer.\n", name);
- ret = AVERROR(EINVAL);
- goto error;
- }
} else {
av_log(s1, AV_LOG_ERROR,
- "Please use \"desktop\", \"title=<windowname>\" or \"hwnd=<hwnd>\" to specify your target.\n");
+ "Please use \"desktop\" or \"title=<windowname>\" to specify your target.\n");
ret = AVERROR(EIO);
goto error;
}