Commit Graph

370 Commits (a17f1116ced777302563dd591d1405636102fb83)
 

Author SHA1 Message Date
Pierre Gordon a17f1116ce Bump version to 1.5
Signed-off-by: Romain Vimont <rom@rom1v.com>
6 years ago
Romain Vimont e4cf152b26 Update links to v1.5 in README and BUILD 6 years ago
Romain Vimont bd32016632 Improve features presentation in README 6 years ago
Romain Vimont 77b620e1d0 Merge branch 'record' into dev (#292)
Record screen to file
6 years ago
Romain Vimont 22ff03f2f7 Do not queue invalid PTS
Configuration packets produced by MediaCodec have no valid PTS, and do
not produce frame. Do not queue their (invalid) PTS not to break the
matching between frames and their PTS.
6 years ago
Romain Vimont 60afb46c8d Store queue of PTS for pending frames
Several frames may be read by read_packet() before they are consumed
(returned by av_read_frame()), so we need to store the PTS of frames in
order, so that the right PTS is assigned to the right frame.
6 years ago
Romain Vimont 345f8858d3 Send frame meta only if recording is enabled
The client needs the PTS for each frame only if recording is enabled.
Otherwise, the PTS are not necessary, and the protocol is more
straighforward.
6 years ago
Romain Vimont 22bf0c19d6 Rename --output-file to --record
To record the screen to a local file:

    scrcpy --record file.mp4
6 years ago
Romain Vimont 70579dc709 Wrap receiver state into separate struct
For readability, wrap the state of the receiver in a separate struct
receiver_state.
6 years ago
Romain Vimont e562837c0b Avoid partial header reads
Use net_recv_all() to avoid partial reads for the "meta" header (this
would break the whole stream).
6 years ago
Romain Vimont ebe998cf78 Move buffer reader functions to buffer_util.h 6 years ago
Romain Vimont b98eb7d0fa Support AVStream.codec for old FFmpeg versions
AVStream.codec has been deprecated in favor of AVStream.codecpar.

Due to the FFmpeg/Libav split, this happened in two separate versions:
 - 57.33.100 for FFmpeg
 - 57.5.0 for Libav
6 years ago
yuchenlin e361b49b4a recorder: use av_oformat_next to support older FFmpeg
Signed-off-by: yuchenlin <npes87184@gmail.com>
6 years ago
Romain Vimont d0e090e1f9 Reenable custom SDL signal handlers
This partially reverts commit f00c6c5b13.

On Ctrl+C, we need to execute cleanup code. For instance, if recording
is enabled, we need to write MP4 file trailer on exit.

Custom SDL signal handlers were disabled because it leaded to process
hanging on Ctrl+C during network calls on initialization, but now it
seems to work correctly, the network calls return immediately on signal.
6 years ago
Romain Vimont 475912a39c Do not transmit MediaCodec flags
Since PTS handling has been fixed, the recorder do not associate a PTS
to a wrong frame anymore, so PTS of "configuration packets" (which never
produce a frame), are never read by the recorder. Therefore, there is no
need to ignore them explicitly, so we can remove the MediaCodec flags
completely.
6 years ago
Romain Vimont 27e8a9a79d Assign PTS to the right frame
The PTS was read from the socket and set as the current one even before
the frame was consumed, so it could be assigned to the previous frame
"in advance".

Store the PTS for the current frame and the last PTS read from the
packet header of the next frame in separate fields.

As a side-effect, this fixes the warning on quit:

> Application provided invalid, non monotonically increasing dts to
> muxer in stream 0: 17164020 >= 17164020
6 years ago
Romain Vimont 61db575861 Decode and push frame before recording
Handle display before recording, to reduce latency.
6 years ago
Romain Vimont 2cd99e7205 Only set valid PTS/DTS
When the PTS is valid, set both PTS and DTS to avoid FFmpeg warnings.

Since configuration packets have no PTS, do not record these packets.
6 years ago
Romain Vimont 27686e9361 Add recorder
Implement recording in a separate "class".
6 years ago
Ivan Gorinov d706c5df39 Enable video output file, with pts set by server 6 years ago
Romain Vimont b5c64c0f5a Fix SDL 2.0.9 for Windows
Add missing version upgrade in cross_winXX.txt files.
6 years ago
Romain Vimont a5787dccd6 Update SDL (2.0.9) for Windows
Include the last version of SDL in Windows releases.
6 years ago
Romain Vimont cb3cf801c8 Extract bit operations to buffer_util.h
Move util functions to a reusable separate header.
6 years ago
Romain Vimont b1d2c2c640 Explain how to install up-to-date meson
On Ubuntu 16.04, meson is 0.29, while scrcpy requires >= 0.37.

Explain how to install a newer version from pip3.
6 years ago
Romain Vimont 9160d465ec Add feature test macro to declare kill()
Avoid the following warning on some systems:

> warning: implicit declaration of function 'kill'
> [-Wimplicit-function-declaration]
6 years ago
Romain Vimont 5c739874a4 Fix memory leak on error
On decode error, unref the packet.
6 years ago
Romain Vimont d061c30965 Replace Ctrl by Meta for volume shortcuts on MacOS
Ctrl+UP and Ctrl+DOWN are already used by the window manager on MacOS.

Use Cmd key instead (like on VLC).
6 years ago
Romain Vimont 5bf1261364 Refactor to support Meta in shortcuts
Move the Ctrl and Meta key down checks to each shortcut individually, so
that we can add a shortcut involving Meta.
6 years ago
Romain Vimont facbbced9e
Merge pull request #310 from npes87184/master
fix text memory leak
6 years ago
yuchenlin 96056e3213 input_manager: fix potential memory leak on text
Fix potential memory leak when controller_push_event failed.

Signed-off-by: yuchenlin <npes87184@gmail.com>
6 years ago
Romain Vimont 0b92b93358 Capture Alt and Meta keys
Alt and Meta keys should not be forwarded to the device. For now, they
are not used for shortcuts, but they could be.
6 years ago
Romain Vimont c20245630e Factorize Windows command building
Extract command line building to a separate method.
6 years ago
Romain Vimont b882322f73 Work around Os.write() not updating position
ByteBuffer position is not updated as expected by Os.write() on old
Android versions. Count the remaining bytes manually.

Fixes <https://github.com/Genymobile/scrcpy/issues/291>.
6 years ago
Romain Vimont 8875955921 Support paths containing spaces on Windows
Quote the arguments of "adb push" to support paths which contain spaces
on Windows.

Fixes <https://github.com/Genymobile/scrcpy/issues/288>.
6 years ago
Romain Vimont ff4430b2a3 Declare fun(void) functions with no parameters
This is not C++.
6 years ago
Romain Vimont cea176c210 Update links to v1.4 in README and BUILD 6 years ago
Romain Vimont f613752606 Update platform-tools (28.0.1) for Windows
Include the latest version of adb in Windows releases.
6 years ago
Romain Vimont 24d107d017 Bump version to 1.4 6 years ago
Romain Vimont 66d1f81f56 Merge branch 'master' into dev 6 years ago
Romain Vimont 411aa4fcfd Handle alpha and space chars as raw events
To handle special chars, text is handled as text input instead of key
events. However, this breaks the separation of DOWN and UP key events.

As a compromise, send letters and space as key events, to preserve
original DOWN/UP events, but send other text input events as text, to be
able to send "special" characters.

Fixes <https://github.com/Genymobile/scrcpy/issues/87>.

Suggested-by: pete1414
Suggested-by: King-Slide <kingslide@gmail.com>
6 years ago
Romain Vimont 78d5a4d8a1 Add link to Gentoo Ebuild in README 6 years ago
Romain Vimont 52e2c60190
Merge pull request #261 from npes87184/dev
prevent closing console right after process error in windows
6 years ago
yuchenlin 140b1ef6a5 prevent closing console right after process error in windows
Signed-off-by: yuchenlin <npes87184@gmail.com>
6 years ago
Romain Vimont eca99d5af7 Fix header guard name 6 years ago
Romain Vimont 6a1fb070f7 Merge branch 'npes87184:dev' into dev (#254)
Return specific error for missing adb binary on Windows
6 years ago
yuchenlin 27bed948d4 Use specific error for missing binary on Windows
Signed-off-by: yuchenlin <npes87184@gmail.com>
Signed-off-by: Romain Vimont <rom@rom1v.com>
6 years ago
Romain Vimont 66def38b73 Avoid additional buffer copy in userspace
Directly send the data from MediaCodec buffers to the LocalSocket,
without an intermediate copy in userspace.
6 years ago
Romain Vimont a60aef5aaf Merge branch 'philippsandhaus:master' into dev (#252)
Added new command line parameter to start in fullscreen
6 years ago
Romain Vimont 28015c3ee4 Present fullscreen option in README 6 years ago
Philipp Sandhaus af9808cf02 Add option to start in fullscreen
Signed-off-by: Romain Vimont <rom@rom1v.com>
6 years ago