-
-
Notifications
You must be signed in to change notification settings - Fork 11.2k
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
[HELP] Creating libscrcpy (input-only) #1355
Comments
I tried calling the action_home function; but unfortunately, nothing happens to the device. |
The idea of the library is to provide only the interaction with the device as a library, so that we can write an alternative UI (or other specific apps). So it must be independant of the SDL UI. In particular, To create a proper lib, the protocol between the lib and the UI must be defined so that it is independant of any UI.
How do you call it? From where? |
Yes; I understand; I do not mind keeping SDL as a dependency. The SDL GUI is very fast; What I can do is to create custom window around it. The only problem now I face is the lag in
Interesting; edit: re reading what you have said; It seems like I cannot pass a keycode.
What I am trying to achieve is to keep the SDL UI as is, and recreate the adb lib used by scrcpy; that is the
As you might know; the necessity of the fast lib is because of the development of So, what I have done:
cd x
cd app/a172ced@@scrcpy@exe Now convert all the Recompile gcc -L$(realpath .) -shared -o libinput_manager.so src_input_manager.c.o -lSDL -lSDL2 -lavcodec -lavformat -lsrc_cli.c.o -lsrc_scrcpy.c.o -lsrc_recorder.c.o -lsrc_file_handler.c.o -lsrc_opengl.c.o -lsrc_device.c.o -lsrc_stream.c.o -lsrc_util_net.c.o -lsrc_receiver.c.o -lsrc_sys_unix_command.c.o -lsrc_screen.c.o -lsrc_event_converter.c.o -lsrc_server.c.o -lsrc_util_str_util.c.o -lsrc_controller.c.o -lsrc_command.c.o -lsrc_fps_counter.c.o -lsrc_tiny_xpm.c.o -lsrc_input_manager.c.o -lsrc_main.c.o -lsrc_control_msg.c.o -lsrc_video_buffer.c.o -lsrc_device_msg.c.o -lsrc_decoder.c.o Then open my python interpreter as a part of test LD_LIBRARY_PATH=$(realpath .) python Python 3.8.2 (default, Apr 8 2020, 14:31:25)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from ctypes import *
>>> scrcpy_input_manager = CDLL('./libinput_manager.so')
>>> scrcpy_input_manager.action_home()
Segmentation Fault
Python 3.8.2 (default, Apr 8 2020, 14:31:25)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from ctypes import *
>>> scrcpy_input_manager = CDLL('./libinput_manager.so')
>>> scrcpy_input_manager.action_home(1)
0
In the seconf case; it gives 0 which might be the Any help from your side is appreciated. 😅 What all I have tried and found out
This started giving me the suspicion if I can write a command to
|
I forgot to mention; I also converted all the |
Yes
Exactly
This is the part I am not understanding; What is protocol; and which socket? In this case. I got this output
Does
nc -l localhost 27183
55
555
keyevent or something like that? I apologize if I am disturbing you. Consider this as my poor curious questions. 😃 |
I made a cross-platform full-function client of the scrcpy server v1.18. py-scrcpy-client |
Hello
I am currently under the process of creating libscrcpy; (although I have poor knowledge of C)
I am reimplementing
scrcpy
's input controller #1271I came across a method
If scrcpy is running; and scrcpy-server is on the device;
Can anyone provide a test method to see if the function is actually getting called.
By test method; I am looking forward to get the function signature and a sample call of the function; Also; if there are any other function to be bootstrapped before calling this method please let me know
@rom1v
The text was updated successfully, but these errors were encountered: