pixelflux 1.4.4__tar.gz → 1.4.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of pixelflux might be problematic. Click here for more details.
- {pixelflux-1.4.4/pixelflux.egg-info → pixelflux-1.4.5}/PKG-INFO +1 -1
- {pixelflux-1.4.4 → pixelflux-1.4.5}/pixelflux/screen_capture_module.cpp +75 -38
- {pixelflux-1.4.4 → pixelflux-1.4.5/pixelflux.egg-info}/PKG-INFO +1 -1
- {pixelflux-1.4.4 → pixelflux-1.4.5}/setup.py +1 -1
- {pixelflux-1.4.4 → pixelflux-1.4.5}/LICENSE +0 -0
- {pixelflux-1.4.4 → pixelflux-1.4.5}/MANIFEST.in +0 -0
- {pixelflux-1.4.4 → pixelflux-1.4.5}/README.md +0 -0
- {pixelflux-1.4.4 → pixelflux-1.4.5}/pixelflux/__init__.py +0 -0
- {pixelflux-1.4.4 → pixelflux-1.4.5}/pixelflux/__pycache__/__init__.cpython-311.pyc +0 -0
- {pixelflux-1.4.4 → pixelflux-1.4.5}/pixelflux/include/cuda.h +0 -0
- {pixelflux-1.4.4 → pixelflux-1.4.5}/pixelflux/include/nvEncodeAPI.h +0 -0
- {pixelflux-1.4.4 → pixelflux-1.4.5}/pixelflux/include/stb_image.h +0 -0
- {pixelflux-1.4.4 → pixelflux-1.4.5}/pixelflux/include/xxhash.c +0 -0
- {pixelflux-1.4.4 → pixelflux-1.4.5}/pixelflux/include/xxhash.h +0 -0
- {pixelflux-1.4.4 → pixelflux-1.4.5}/pixelflux.egg-info/SOURCES.txt +0 -0
- {pixelflux-1.4.4 → pixelflux-1.4.5}/pixelflux.egg-info/dependency_links.txt +0 -0
- {pixelflux-1.4.4 → pixelflux-1.4.5}/pixelflux.egg-info/top_level.txt +0 -0
- {pixelflux-1.4.4 → pixelflux-1.4.5}/pyproject.toml +0 -0
- {pixelflux-1.4.4 → pixelflux-1.4.5}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: pixelflux
|
|
3
|
-
Version: 1.4.
|
|
3
|
+
Version: 1.4.5
|
|
4
4
|
Summary: A performant web native pixel delivery pipeline for diverse sources, blending VNC-inspired parallel processing of pixel buffers with flexible modern encoding formats.
|
|
5
5
|
Home-page: https://github.com/linuxserver/pixelflux
|
|
6
6
|
Author: Linuxserver.io
|
|
@@ -148,6 +148,19 @@ struct VaapiEncoderState {
|
|
|
148
148
|
unsigned int frame_count = 0;
|
|
149
149
|
};
|
|
150
150
|
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* @brief Custom X11 error handler specifically for the XShmAttach call.
|
|
154
|
+
* This function is temporarily installed as the X11 error handler. It catches
|
|
155
|
+
* any error, sets the g_shm_attach_failed flag to true, and returns 0 to
|
|
156
|
+
* signal that the error has been "handled," preventing program termination.
|
|
157
|
+
*/
|
|
158
|
+
static bool g_shm_attach_failed = false;
|
|
159
|
+
static int shm_attach_error_handler(Display* dpy, XErrorEvent* ev) {
|
|
160
|
+
g_shm_attach_failed = true;
|
|
161
|
+
return 0;
|
|
162
|
+
}
|
|
163
|
+
|
|
151
164
|
/**
|
|
152
165
|
* @brief Manages a pool of H.264 encoders and associated picture buffers.
|
|
153
166
|
* This struct provides thread-safe storage and management for x264 encoder
|
|
@@ -1873,16 +1886,21 @@ void ScreenCaptureModule::capture_loop() {
|
|
|
1873
1886
|
auto next_frame_time =
|
|
1874
1887
|
std::chrono::high_resolution_clock::now() + target_frame_duration_seconds;
|
|
1875
1888
|
|
|
1889
|
+
const int MAX_ATTACH_ATTEMPTS = 5;
|
|
1890
|
+
const int RETRY_BACKOFF_MS = 500;
|
|
1876
1891
|
char* display_env = std::getenv("DISPLAY");
|
|
1877
1892
|
const char* display_name = display_env ? display_env : ":0";
|
|
1878
1893
|
Display* display = XOpenDisplay(display_name);
|
|
1894
|
+
|
|
1879
1895
|
if (!display) {
|
|
1880
1896
|
std::cerr << "Error: Failed to open X display " << display_name << std::endl;
|
|
1881
1897
|
return;
|
|
1882
1898
|
}
|
|
1899
|
+
|
|
1883
1900
|
Window root_window = DefaultRootWindow(display);
|
|
1884
1901
|
int screen = DefaultScreen(display);
|
|
1885
1902
|
XWindowAttributes attributes;
|
|
1903
|
+
|
|
1886
1904
|
if (XGetWindowAttributes(display, root_window, &attributes)) {
|
|
1887
1905
|
if (local_capture_width_actual > attributes.width) {
|
|
1888
1906
|
local_capture_width_actual = attributes.width;
|
|
@@ -1907,6 +1925,7 @@ void ScreenCaptureModule::capture_loop() {
|
|
|
1907
1925
|
XCloseDisplay(display);
|
|
1908
1926
|
return;
|
|
1909
1927
|
}
|
|
1928
|
+
|
|
1910
1929
|
std::cout << "X Shared Memory Extension available." << std::endl;
|
|
1911
1930
|
|
|
1912
1931
|
if (local_current_capture_cursor) {
|
|
@@ -1915,55 +1934,73 @@ void ScreenCaptureModule::capture_loop() {
|
|
|
1915
1934
|
XCloseDisplay(display);
|
|
1916
1935
|
return;
|
|
1917
1936
|
}
|
|
1918
|
-
|
|
1919
1937
|
std::cout << "XFixes Extension available." << std::endl;
|
|
1920
1938
|
}
|
|
1921
1939
|
|
|
1922
1940
|
XShmSegmentInfo shminfo;
|
|
1923
|
-
memset(&shminfo, 0, sizeof(shminfo));
|
|
1924
1941
|
XImage* shm_image = nullptr;
|
|
1942
|
+
bool shm_setup_complete = false;
|
|
1925
1943
|
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
}
|
|
1944
|
+
for (int attempt = 1; attempt <= MAX_ATTACH_ATTEMPTS; ++attempt) {
|
|
1945
|
+
memset(&shminfo, 0, sizeof(shminfo));
|
|
1946
|
+
shm_image = XShmCreateImage(display, DefaultVisual(display, screen), DefaultDepth(display, screen),
|
|
1947
|
+
ZPixmap, nullptr, &shminfo, local_capture_width_actual,
|
|
1948
|
+
local_capture_height_actual);
|
|
1949
|
+
if (!shm_image) {
|
|
1950
|
+
std::cerr << "Attempt " << attempt << ": XShmCreateImage failed." << std::endl;
|
|
1951
|
+
if (attempt < MAX_ATTACH_ATTEMPTS) std::this_thread::sleep_for(std::chrono::milliseconds(RETRY_BACKOFF_MS));
|
|
1952
|
+
continue;
|
|
1953
|
+
}
|
|
1937
1954
|
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
return;
|
|
1946
|
-
}
|
|
1955
|
+
shminfo.shmid = shmget(IPC_PRIVATE, static_cast<size_t>(shm_image->bytes_per_line) * shm_image->height, IPC_CREAT | 0600);
|
|
1956
|
+
if (shminfo.shmid < 0) {
|
|
1957
|
+
perror("shmget");
|
|
1958
|
+
XDestroyImage(shm_image);
|
|
1959
|
+
if (attempt < MAX_ATTACH_ATTEMPTS) std::this_thread::sleep_for(std::chrono::milliseconds(RETRY_BACKOFF_MS));
|
|
1960
|
+
continue;
|
|
1961
|
+
}
|
|
1947
1962
|
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1963
|
+
shminfo.shmaddr = (char*)shmat(shminfo.shmid, nullptr, 0);
|
|
1964
|
+
if (shminfo.shmaddr == (char*)-1) {
|
|
1965
|
+
perror("shmat");
|
|
1966
|
+
shmctl(shminfo.shmid, IPC_RMID, 0);
|
|
1967
|
+
XDestroyImage(shm_image);
|
|
1968
|
+
if (attempt < MAX_ATTACH_ATTEMPTS) std::this_thread::sleep_for(std::chrono::milliseconds(RETRY_BACKOFF_MS));
|
|
1969
|
+
continue;
|
|
1970
|
+
}
|
|
1971
|
+
|
|
1972
|
+
shminfo.readOnly = False;
|
|
1973
|
+
shm_image->data = shminfo.shmaddr;
|
|
1974
|
+
g_shm_attach_failed = false;
|
|
1975
|
+
XErrorHandler old_handler = XSetErrorHandler(shm_attach_error_handler);
|
|
1976
|
+
XShmAttach(display, &shminfo);
|
|
1977
|
+
XSync(display, False);
|
|
1978
|
+
XSetErrorHandler(old_handler);
|
|
1979
|
+
|
|
1980
|
+
if (g_shm_attach_failed) {
|
|
1981
|
+
std::cerr << "Attempt " << attempt << "/" << MAX_ATTACH_ATTEMPTS << ": XShmAttach failed with an X server error." << std::endl;
|
|
1982
|
+
shmdt(shminfo.shmaddr);
|
|
1983
|
+
shmctl(shminfo.shmid, IPC_RMID, 0);
|
|
1984
|
+
XDestroyImage(shm_image);
|
|
1985
|
+
if (attempt < MAX_ATTACH_ATTEMPTS) {
|
|
1986
|
+
std::this_thread::sleep_for(std::chrono::milliseconds(RETRY_BACKOFF_MS));
|
|
1987
|
+
}
|
|
1988
|
+
continue;
|
|
1989
|
+
}
|
|
1990
|
+
|
|
1991
|
+
shm_setup_complete = true;
|
|
1992
|
+
break;
|
|
1955
1993
|
}
|
|
1956
|
-
shminfo.readOnly = False;
|
|
1957
|
-
shm_image->data = shminfo.shmaddr;
|
|
1958
1994
|
|
|
1959
|
-
if (!
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1995
|
+
if (!shm_setup_complete) {
|
|
1996
|
+
std::cerr << "ERROR: Failed to set up XShm after " << MAX_ATTACH_ATTEMPTS << " attempts. Exiting capture thread." << std::endl;
|
|
1997
|
+
if (display) {
|
|
1998
|
+
XCloseDisplay(display);
|
|
1999
|
+
display = nullptr;
|
|
2000
|
+
}
|
|
2001
|
+
return;
|
|
1966
2002
|
}
|
|
2003
|
+
|
|
1967
2004
|
std::cout << "XShm setup complete for " << local_capture_width_actual
|
|
1968
2005
|
<< "x" << local_capture_height_actual << "." << std::endl;
|
|
1969
2006
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: pixelflux
|
|
3
|
-
Version: 1.4.
|
|
3
|
+
Version: 1.4.5
|
|
4
4
|
Summary: A performant web native pixel delivery pipeline for diverse sources, blending VNC-inspired parallel processing of pixel buffers with flexible modern encoding formats.
|
|
5
5
|
Home-page: https://github.com/linuxserver/pixelflux
|
|
6
6
|
Author: Linuxserver.io
|
|
@@ -48,7 +48,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
|
|
|
48
48
|
long_description = fh.read()
|
|
49
49
|
setup(
|
|
50
50
|
name="pixelflux",
|
|
51
|
-
version="1.4.
|
|
51
|
+
version="1.4.5",
|
|
52
52
|
author="Linuxserver.io",
|
|
53
53
|
author_email="pypi@linuxserver.io",
|
|
54
54
|
description="A performant web native pixel delivery pipeline for diverse sources, blending VNC-inspired parallel processing of pixel buffers with flexible modern encoding formats.",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|