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

【Function request】 multiple screenshots #21

Open
NakanoSanku opened this issue May 7, 2024 · 6 comments
Open

【Function request】 multiple screenshots #21

NakanoSanku opened this issue May 7, 2024 · 6 comments
Assignees
Labels

Comments

@NakanoSanku
Copy link

Considering multiple screenshots? Android devices have multiple virtual screens, which means droidcast can only capture the home screen,i want screenshot based on display id

image

@rayworks
Copy link
Owner

rayworks commented May 9, 2024

@NakanoSanku
After investigation, I found that it's feasible to do it and filter by the displayId. However if the display is a monitor connected with a phone, the screenshot under portrait mode will be distorted. 'Cause the dimension info of display is changed.

What's your use case ? Will adding an extra parameter (e.g. display_id) in the script solve your problem ?

@NakanoSanku
Copy link
Author

i think so.

@rayworks
Copy link
Owner

rayworks commented May 9, 2024

You can try and play with this branch.
Currently only the Python script (automation3.py) is available for testing.

@rayworks rayworks self-assigned this May 10, 2024
@NakanoSanku
Copy link
Author

cool ! it is can work!but may occur can't get display_id condition
like

❯ adb shell
Welcome! If you need help getting started, check out our developer FAQ page at:

    https://g.126.fm/04jewvw

We're committed to making our emulator as useful as possible for developers,
so if you have any specific requirements or features that you'd like to see
in the emulator, please let us know. We're always open to new ideas and suggestions.
You can find our contact information on the FAQ page as well.

Thanks for using our emulator, happy coding!
se.apk exec app_process / com.rayworks.droidcast.Main --port=2000 --display_id=2                                      <
com.rayworks.droidcast.Main | Port set to 2000
>>> DroidCast main entry
>>> Dimension: Point(720, 1280)
>>> Screen rotation: 1
>>><<< displayIds [4619827820427265280, 4619827144452474627, 4619826888814064386]
>>> bmp generated.
Bitmap generated with resolution 1280:720, process id 5611 | thread id 5626
Bitmap final dimens : 1280|720
^C

[16:57]  Shell                                                                                    xSIGINT 1m 44s 493ms
 ~
❯ adb shell
Welcome! If you need help getting started, check out our developer FAQ page at:

    https://g.126.fm/04jewvw

We're committed to making our emulator as useful as possible for developers,
so if you have any specific requirements or features that you'd like to see
in the emulator, please let us know. We're always open to new ideas and suggestions.
You can find our contact information on the FAQ page as well.

Thanks for using our emulator, happy coding!
se.apk exec app_process / com.rayworks.droidcast.Main --port=2000 --display_id=1                                      <
com.rayworks.droidcast.Main | Port set to 2000
>>> DroidCast main entry
>>> Dimension: Point(720, 1280)
>>> Screen rotation: 1
>>><<< displayIds [4619827820427265280, 4619827144452474627, 4619826888814064386]
>>> bmp generated.
Bitmap generated with resolution 1280:720, process id 5648 | thread id 5663
Bitmap final dimens : 1280|720

@NakanoSanku
Copy link
Author

ok,this is my problem ,must use adb shell dumpsys SurfaceFlinger --display-id get Display id

❯ adb shell dumpsys SurfaceFlinger --display-id
Display 4619827144452474627 (HWC display 3): port=3 pnpId=GGL displayName="mumuscreen003"
Display 4619827820427265280 (HWC display 0): port=0 pnpId=GGL displayName="mumuscreen000"
Display 4619826948029188612 (HWC display 4): port=4 pnpId=GGL displayName="mumuscreen004"

@NakanoSanku
Copy link
Author

screenshot size always use id=0’s size

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants