mirror of
https://github.com/Genymobile/scrcpy.git
synced 2026-03-06 20:24:27 +01:00
Compare commits
19 Commits
cmd_macos.
...
issue702
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8d75422d21 | ||
|
|
8a08ca0f3d | ||
|
|
44fb692a64 | ||
|
|
3f77c29c95 | ||
|
|
9a50b65b33 | ||
|
|
c05056343b | ||
|
|
9bcee4ea42 | ||
|
|
c28619e4e8 | ||
|
|
8969444ff2 | ||
|
|
b54f0bfe48 | ||
|
|
0aec1e502e | ||
|
|
c3a58ad10f | ||
|
|
b0184f2869 | ||
|
|
e2ac996183 | ||
|
|
5e4ccfd832 | ||
|
|
53b6ee2cf4 | ||
|
|
26213f1031 | ||
|
|
96b5067cbf | ||
|
|
421e4be399 |
6
BUILD.md
6
BUILD.md
@@ -234,10 +234,10 @@ You can then [run](README.md#run) _scrcpy_.
|
||||
|
||||
## Prebuilt server
|
||||
|
||||
- [`scrcpy-server-v1.9.jar`][direct-scrcpy-server]
|
||||
_(SHA-256: ad7e539f100e48259b646f26982bc63e0a60a81ac87ae135e242855bef69bd1a)_
|
||||
- [`scrcpy-server-v1.10.jar`][direct-scrcpy-server]
|
||||
_(SHA-256: cbeb1a4e046f1392c1dc73c3ccffd7f86dec4636b505556ea20929687a119390)_
|
||||
|
||||
[direct-scrcpy-server]: https://github.com/Genymobile/scrcpy/releases/download/v1.9/scrcpy-server-v1.9.jar
|
||||
[direct-scrcpy-server]: https://github.com/Genymobile/scrcpy/releases/download/v1.10/scrcpy-server-v1.10.jar
|
||||
|
||||
Download the prebuilt server somewhere, and specify its path during the Meson
|
||||
configuration:
|
||||
|
||||
@@ -100,37 +100,38 @@ dist-win32: build-server build-win32 build-win32-noconsole
|
||||
cp "$(SERVER_BUILD_DIR)"/server/scrcpy-server.jar "$(DIST)/$(WIN32_TARGET_DIR)/"
|
||||
cp "$(WIN32_BUILD_DIR)"/app/scrcpy.exe "$(DIST)/$(WIN32_TARGET_DIR)/"
|
||||
cp "$(WIN32_NOCONSOLE_BUILD_DIR)"/app/scrcpy.exe "$(DIST)/$(WIN32_TARGET_DIR)/scrcpy-noconsole.exe"
|
||||
cp prebuilt-deps/ffmpeg-4.1.3-win32-shared/bin/avutil-56.dll "$(DIST)/$(WIN32_TARGET_DIR)/"
|
||||
cp prebuilt-deps/ffmpeg-4.1.3-win32-shared/bin/avcodec-58.dll "$(DIST)/$(WIN32_TARGET_DIR)/"
|
||||
cp prebuilt-deps/ffmpeg-4.1.3-win32-shared/bin/avformat-58.dll "$(DIST)/$(WIN32_TARGET_DIR)/"
|
||||
cp prebuilt-deps/ffmpeg-4.1.3-win32-shared/bin/swresample-3.dll "$(DIST)/$(WIN32_TARGET_DIR)/"
|
||||
cp prebuilt-deps/ffmpeg-4.1.4-win32-shared/bin/avutil-56.dll "$(DIST)/$(WIN32_TARGET_DIR)/"
|
||||
cp prebuilt-deps/ffmpeg-4.1.4-win32-shared/bin/avcodec-58.dll "$(DIST)/$(WIN32_TARGET_DIR)/"
|
||||
cp prebuilt-deps/ffmpeg-4.1.4-win32-shared/bin/avformat-58.dll "$(DIST)/$(WIN32_TARGET_DIR)/"
|
||||
cp prebuilt-deps/ffmpeg-4.1.4-win32-shared/bin/swresample-3.dll "$(DIST)/$(WIN32_TARGET_DIR)/"
|
||||
cp prebuilt-deps/ffmpeg-4.1.4-win32-shared/bin/swscale-5.dll "$(DIST)/$(WIN32_TARGET_DIR)/"
|
||||
cp prebuilt-deps/platform-tools/adb.exe "$(DIST)/$(WIN32_TARGET_DIR)/"
|
||||
cp prebuilt-deps/platform-tools/AdbWinApi.dll "$(DIST)/$(WIN32_TARGET_DIR)/"
|
||||
cp prebuilt-deps/platform-tools/AdbWinUsbApi.dll "$(DIST)/$(WIN32_TARGET_DIR)/"
|
||||
cp prebuilt-deps/SDL2-2.0.8/i686-w64-mingw32/bin/SDL2.dll "$(DIST)/$(WIN32_TARGET_DIR)/"
|
||||
cp prebuilt-deps/SDL2-2.0.10/i686-w64-mingw32/bin/SDL2.dll "$(DIST)/$(WIN32_TARGET_DIR)/"
|
||||
|
||||
dist-win64: build-server build-win64 build-win64-noconsole
|
||||
mkdir -p "$(DIST)/$(WIN64_TARGET_DIR)"
|
||||
cp "$(SERVER_BUILD_DIR)"/server/scrcpy-server.jar "$(DIST)/$(WIN64_TARGET_DIR)/"
|
||||
cp "$(WIN64_BUILD_DIR)"/app/scrcpy.exe "$(DIST)/$(WIN64_TARGET_DIR)/"
|
||||
cp "$(WIN64_NOCONSOLE_BUILD_DIR)"/app/scrcpy.exe "$(DIST)/$(WIN64_TARGET_DIR)/scrcpy-noconsole.exe"
|
||||
cp prebuilt-deps/ffmpeg-4.1.3-win64-shared/bin/avutil-56.dll "$(DIST)/$(WIN64_TARGET_DIR)/"
|
||||
cp prebuilt-deps/ffmpeg-4.1.3-win64-shared/bin/avcodec-58.dll "$(DIST)/$(WIN64_TARGET_DIR)/"
|
||||
cp prebuilt-deps/ffmpeg-4.1.3-win64-shared/bin/avformat-58.dll "$(DIST)/$(WIN64_TARGET_DIR)/"
|
||||
cp prebuilt-deps/ffmpeg-4.1.3-win64-shared/bin/swresample-3.dll "$(DIST)/$(WIN64_TARGET_DIR)/"
|
||||
cp prebuilt-deps/ffmpeg-4.1.3-win64-shared/bin/swscale-5.dll "$(DIST)/$(WIN64_TARGET_DIR)/"
|
||||
cp prebuilt-deps/ffmpeg-4.1.4-win64-shared/bin/avutil-56.dll "$(DIST)/$(WIN64_TARGET_DIR)/"
|
||||
cp prebuilt-deps/ffmpeg-4.1.4-win64-shared/bin/avcodec-58.dll "$(DIST)/$(WIN64_TARGET_DIR)/"
|
||||
cp prebuilt-deps/ffmpeg-4.1.4-win64-shared/bin/avformat-58.dll "$(DIST)/$(WIN64_TARGET_DIR)/"
|
||||
cp prebuilt-deps/ffmpeg-4.1.4-win64-shared/bin/swresample-3.dll "$(DIST)/$(WIN64_TARGET_DIR)/"
|
||||
cp prebuilt-deps/ffmpeg-4.1.4-win64-shared/bin/swscale-5.dll "$(DIST)/$(WIN64_TARGET_DIR)/"
|
||||
cp prebuilt-deps/platform-tools/adb.exe "$(DIST)/$(WIN64_TARGET_DIR)/"
|
||||
cp prebuilt-deps/platform-tools/AdbWinApi.dll "$(DIST)/$(WIN64_TARGET_DIR)/"
|
||||
cp prebuilt-deps/platform-tools/AdbWinUsbApi.dll "$(DIST)/$(WIN64_TARGET_DIR)/"
|
||||
cp prebuilt-deps/SDL2-2.0.8/x86_64-w64-mingw32/bin/SDL2.dll "$(DIST)/$(WIN64_TARGET_DIR)/"
|
||||
cp prebuilt-deps/SDL2-2.0.10/x86_64-w64-mingw32/bin/SDL2.dll "$(DIST)/$(WIN64_TARGET_DIR)/"
|
||||
|
||||
zip-win32: dist-win32
|
||||
cd "$(DIST)"; \
|
||||
zip -r "$(WIN32_TARGET)" "$(WIN32_TARGET_DIR)"
|
||||
cd "$(DIST)/$(WIN32_TARGET_DIR)"; \
|
||||
zip -r "../$(WIN32_TARGET)" .
|
||||
|
||||
zip-win64: dist-win64
|
||||
cd "$(DIST)"; \
|
||||
zip -r "$(WIN64_TARGET)" "$(WIN64_TARGET_DIR)"
|
||||
cd "$(DIST)/$(WIN64_TARGET_DIR)"; \
|
||||
zip -r "../$(WIN64_TARGET)" .
|
||||
|
||||
sums:
|
||||
cd "$(DIST)"; \
|
||||
|
||||
25
README.md
25
README.md
@@ -1,4 +1,4 @@
|
||||
# scrcpy (v1.9)
|
||||
# scrcpy (v1.10)
|
||||
|
||||
This application provides display and control of Android devices connected on
|
||||
USB (or [over TCP/IP][article-tcpip]). It does not require any _root_ access.
|
||||
@@ -6,6 +6,17 @@ It works on _GNU/Linux_, _Windows_ and _macOS_.
|
||||
|
||||

|
||||
|
||||
It focuses on:
|
||||
|
||||
- **lightness** (native, displays only the device screen)
|
||||
- **performance** (30~60fps)
|
||||
- **quality** (1920×1080 or above)
|
||||
- **low latency** ([35~70ms][lowlatency])
|
||||
- **low startup time** (~1 second to display the first image)
|
||||
- **non-intrusiveness** (nothing is left installed on the device)
|
||||
|
||||
[lowlatency]: https://github.com/Genymobile/scrcpy/pull/646
|
||||
|
||||
|
||||
## Requirements
|
||||
|
||||
@@ -51,13 +62,13 @@ For Gentoo, an [Ebuild] is available: [`scrcpy/`][ebuild-link].
|
||||
For Windows, for simplicity, prebuilt archives with all the dependencies
|
||||
(including `adb`) are available:
|
||||
|
||||
- [`scrcpy-win32-v1.9.zip`][direct-win32]
|
||||
_(SHA-256: 3234f7fbcc26b9e399f50b5ca9ed085708954c87fda1b0dd32719d6e7dd861ef)_
|
||||
- [`scrcpy-win64-v1.9.zip`][direct-win64]
|
||||
_(SHA-256: 0088eca1811ea7c7ac350d636c8465b266e6c830bb268770ff88fddbb493077e)_
|
||||
- [`scrcpy-win32-v1.10.zip`][direct-win32]
|
||||
_(SHA-256: f98b400b3764404b33b212e9762dd6f1593ddb766c1480fc2609c94768e4a8e1)_
|
||||
- [`scrcpy-win64-v1.10.zip`][direct-win64]
|
||||
_(SHA-256: 95de34575d873c7e95dfcfb5e74d0f6af4f70b2a5bc6fde0f48d1a05480e3a44)_
|
||||
|
||||
[direct-win32]: https://github.com/Genymobile/scrcpy/releases/download/v1.9/scrcpy-win32-v1.9.zip
|
||||
[direct-win64]: https://github.com/Genymobile/scrcpy/releases/download/v1.9/scrcpy-win64-v1.9.zip
|
||||
[direct-win32]: https://github.com/Genymobile/scrcpy/releases/download/v1.10/scrcpy-win32-v1.10.zip
|
||||
[direct-win64]: https://github.com/Genymobile/scrcpy/releases/download/v1.10/scrcpy-win64-v1.10.zip
|
||||
|
||||
You can also [build the app manually][BUILD].
|
||||
|
||||
|
||||
@@ -150,6 +150,9 @@ tests = [
|
||||
'tests/test_device_msg_deserialize.c',
|
||||
'src/device_msg.c'
|
||||
]],
|
||||
['test_queue', [
|
||||
'tests/test_queue.c',
|
||||
]],
|
||||
['test_strutil', [
|
||||
'tests/test_strutil.c',
|
||||
'src/str_util.c'
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include <unistd.h>
|
||||
|
||||
// To define a circular buffer type of 20 ints:
|
||||
// typedef CBUF(int, 20) my_cbuf_t;
|
||||
// struct cbuf_int CBUF(int, 20);
|
||||
//
|
||||
// data has length CAP + 1 to distinguish empty vs full.
|
||||
#define CBUF(TYPE, CAP) { \
|
||||
@@ -35,7 +35,7 @@
|
||||
(PCBUF)->head = ((PCBUF)->head + 1) % cbuf_size_(PCBUF); \
|
||||
} \
|
||||
ok; \
|
||||
}) \
|
||||
})
|
||||
|
||||
#define cbuf_take(PCBUF, PITEM) \
|
||||
({ \
|
||||
|
||||
75
app/src/queue.h
Normal file
75
app/src/queue.h
Normal file
@@ -0,0 +1,75 @@
|
||||
// generic intrusive FIFO queue
|
||||
#ifndef QUEUE_H
|
||||
#define QUEUE_H
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
#include <SDL2/SDL_assert.h>
|
||||
|
||||
// To define a queue type of "struct foo":
|
||||
// struct queue_foo QUEUE(struct foo);
|
||||
#define QUEUE(TYPE) { \
|
||||
TYPE *first; \
|
||||
TYPE *last; \
|
||||
}
|
||||
|
||||
#define queue_init(PQ) \
|
||||
(void) ((PQ)->first = (PQ)->last = NULL)
|
||||
|
||||
#define queue_is_empty(PQ) \
|
||||
!(PQ)->first
|
||||
|
||||
// NEXTFIELD is the field in the ITEM type used for intrusive linked-list
|
||||
//
|
||||
// For example:
|
||||
// struct foo {
|
||||
// int value;
|
||||
// struct foo *next;
|
||||
// };
|
||||
//
|
||||
// // define the type "struct my_queue"
|
||||
// struct my_queue QUEUE(struct foo);
|
||||
//
|
||||
// struct my_queue queue;
|
||||
// queue_init(&queue);
|
||||
//
|
||||
// struct foo v1 = { .value = 42 };
|
||||
// struct foo v2 = { .value = 27 };
|
||||
//
|
||||
// queue_push(&queue, next, v1);
|
||||
// queue_push(&queue, next, v2);
|
||||
//
|
||||
// struct foo *foo;
|
||||
// queue_take(&queue, next, &foo);
|
||||
// assert(foo->value == 42);
|
||||
// queue_take(&queue, next, &foo);
|
||||
// assert(foo->value == 27);
|
||||
// assert(queue_is_empty(&queue));
|
||||
//
|
||||
|
||||
// push a new item into the queue
|
||||
#define queue_push(PQ, NEXTFIELD, ITEM) \
|
||||
(void) ({ \
|
||||
(ITEM)->NEXTFIELD = NULL; \
|
||||
if (queue_is_empty(PQ)) { \
|
||||
(PQ)->first = (PQ)->last = (ITEM); \
|
||||
} else { \
|
||||
(PQ)->last->NEXTFIELD = (ITEM); \
|
||||
(PQ)->last = (ITEM); \
|
||||
} \
|
||||
})
|
||||
|
||||
// take the next item and remove it from the queue (the queue must not be empty)
|
||||
// the result is stored in *(PITEM)
|
||||
// (without typeof(), we could not store a local variable having the correct
|
||||
// type so that we can "return" it)
|
||||
#define queue_take(PQ, NEXTFIELD, PITEM) \
|
||||
(void) ({ \
|
||||
SDL_assert(!queue_is_empty(PQ)); \
|
||||
*(PITEM) = (PQ)->first; \
|
||||
(PQ)->first = (PQ)->first->NEXTFIELD; \
|
||||
})
|
||||
// no need to update (PQ)->last if the queue is left empty:
|
||||
// (PQ)->last is undefined if !(PQ)->first anyway
|
||||
|
||||
#endif
|
||||
@@ -37,7 +37,6 @@ record_packet_new(const AVPacket *packet) {
|
||||
SDL_free(rec);
|
||||
return NULL;
|
||||
}
|
||||
rec->next = NULL;
|
||||
return rec;
|
||||
}
|
||||
|
||||
@@ -47,60 +46,13 @@ record_packet_delete(struct record_packet *rec) {
|
||||
SDL_free(rec);
|
||||
}
|
||||
|
||||
static void
|
||||
recorder_queue_init(struct recorder_queue *queue) {
|
||||
queue->first = NULL;
|
||||
// queue->last is undefined if queue->first == NULL
|
||||
}
|
||||
|
||||
static inline bool
|
||||
recorder_queue_is_empty(struct recorder_queue *queue) {
|
||||
return !queue->first;
|
||||
}
|
||||
|
||||
static bool
|
||||
recorder_queue_push(struct recorder_queue *queue, const AVPacket *packet) {
|
||||
struct record_packet *rec = record_packet_new(packet);
|
||||
if (!rec) {
|
||||
LOGC("Could not allocate record packet");
|
||||
return false;
|
||||
}
|
||||
rec->next = NULL;
|
||||
|
||||
if (recorder_queue_is_empty(queue)) {
|
||||
queue->first = queue->last = rec;
|
||||
} else {
|
||||
// chain rec after the (current) last packet
|
||||
queue->last->next = rec;
|
||||
// the last packet is now rec
|
||||
queue->last = rec;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
static inline struct record_packet *
|
||||
recorder_queue_take(struct recorder_queue *queue) {
|
||||
SDL_assert(!recorder_queue_is_empty(queue));
|
||||
|
||||
struct record_packet *rec = queue->first;
|
||||
SDL_assert(rec);
|
||||
|
||||
queue->first = rec->next;
|
||||
// no need to update queue->last if the queue is left empty:
|
||||
// queue->last is undefined if queue->first == NULL
|
||||
|
||||
return rec;
|
||||
}
|
||||
|
||||
static void
|
||||
recorder_queue_clear(struct recorder_queue *queue) {
|
||||
struct record_packet *rec = queue->first;
|
||||
while (rec) {
|
||||
struct record_packet *current = rec;
|
||||
rec = rec->next;
|
||||
record_packet_delete(current);
|
||||
while (!queue_is_empty(queue)) {
|
||||
struct record_packet *rec;
|
||||
queue_take(queue, next, &rec);
|
||||
record_packet_delete(rec);
|
||||
}
|
||||
queue->first = NULL;
|
||||
}
|
||||
|
||||
bool
|
||||
@@ -129,7 +81,7 @@ recorder_init(struct recorder *recorder,
|
||||
return false;
|
||||
}
|
||||
|
||||
recorder_queue_init(&recorder->queue);
|
||||
queue_init(&recorder->queue);
|
||||
recorder->stopped = false;
|
||||
recorder->failed = false;
|
||||
recorder->format = format;
|
||||
@@ -267,22 +219,13 @@ recorder_rescale_packet(struct recorder *recorder, AVPacket *packet) {
|
||||
|
||||
bool
|
||||
recorder_write(struct recorder *recorder, AVPacket *packet) {
|
||||
SDL_assert(packet->pts != AV_NOPTS_VALUE);
|
||||
if (!recorder->header_written) {
|
||||
if (packet->pts != AV_NOPTS_VALUE) {
|
||||
LOGE("The first packet is not a config packet");
|
||||
return false;
|
||||
}
|
||||
bool ok = recorder_write_header(recorder, packet);
|
||||
if (!ok) {
|
||||
return false;
|
||||
}
|
||||
recorder->header_written = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (packet->pts == AV_NOPTS_VALUE) {
|
||||
// ignore config packets
|
||||
return true;
|
||||
}
|
||||
|
||||
recorder_rescale_packet(recorder, packet);
|
||||
@@ -296,20 +239,20 @@ run_recorder(void *data) {
|
||||
for (;;) {
|
||||
mutex_lock(recorder->mutex);
|
||||
|
||||
while (!recorder->stopped &&
|
||||
recorder_queue_is_empty(&recorder->queue)) {
|
||||
while (!recorder->stopped && queue_is_empty(&recorder->queue)) {
|
||||
cond_wait(recorder->queue_cond, recorder->mutex);
|
||||
}
|
||||
|
||||
// if stopped is set, continue to process the remaining events (to
|
||||
// finish the recording) before actually stopping
|
||||
|
||||
if (recorder->stopped && recorder_queue_is_empty(&recorder->queue)) {
|
||||
if (recorder->stopped && queue_is_empty(&recorder->queue)) {
|
||||
mutex_unlock(recorder->mutex);
|
||||
break;
|
||||
}
|
||||
|
||||
struct record_packet *rec = recorder_queue_take(&recorder->queue);
|
||||
struct record_packet *rec;
|
||||
queue_take(&recorder->queue, next, &rec);
|
||||
|
||||
mutex_unlock(recorder->mutex);
|
||||
|
||||
@@ -369,9 +312,15 @@ recorder_push(struct recorder *recorder, const AVPacket *packet) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ok = recorder_queue_push(&recorder->queue, packet);
|
||||
struct record_packet *rec = record_packet_new(packet);
|
||||
if (!rec) {
|
||||
LOGC("Could not allocate record packet");
|
||||
return false;
|
||||
}
|
||||
|
||||
queue_push(&recorder->queue, next, rec);
|
||||
cond_signal(recorder->queue_cond);
|
||||
|
||||
mutex_unlock(recorder->mutex);
|
||||
return ok;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include <SDL2/SDL_thread.h>
|
||||
|
||||
#include "common.h"
|
||||
#include "queue.h"
|
||||
|
||||
enum recorder_format {
|
||||
RECORDER_FORMAT_MP4 = 1,
|
||||
@@ -18,10 +19,7 @@ struct record_packet {
|
||||
struct record_packet *next;
|
||||
};
|
||||
|
||||
struct recorder_queue {
|
||||
struct record_packet *first;
|
||||
struct record_packet *last; // undefined if first is NULL
|
||||
};
|
||||
struct recorder_queue QUEUE(struct record_packet);
|
||||
|
||||
struct recorder {
|
||||
char *filename;
|
||||
|
||||
@@ -69,15 +69,6 @@ notify_stopped(void) {
|
||||
SDL_PushEvent(&stop_event);
|
||||
}
|
||||
|
||||
static bool
|
||||
process_config_packet(struct stream *stream, AVPacket *packet) {
|
||||
if (stream->recorder && !recorder_push(stream->recorder, packet)) {
|
||||
LOGE("Could not send config packet to recorder");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
process_frame(struct stream *stream, AVPacket *packet) {
|
||||
if (stream->decoder && !decoder_push(stream->decoder, packet)) {
|
||||
@@ -157,13 +148,7 @@ stream_push_packet(struct stream *stream, AVPacket *packet) {
|
||||
}
|
||||
}
|
||||
|
||||
if (is_config) {
|
||||
// config packet
|
||||
bool ok = process_config_packet(stream, packet);
|
||||
if (!ok) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if (!is_config) {
|
||||
// data packet
|
||||
bool ok = stream_parse(stream, packet);
|
||||
|
||||
|
||||
38
app/tests/test_queue.c
Normal file
38
app/tests/test_queue.c
Normal file
@@ -0,0 +1,38 @@
|
||||
#include <assert.h>
|
||||
|
||||
#include <queue.h>
|
||||
|
||||
struct foo {
|
||||
int value;
|
||||
struct foo *next;
|
||||
};
|
||||
|
||||
static void test_queue(void) {
|
||||
struct my_queue QUEUE(struct foo) queue;
|
||||
queue_init(&queue);
|
||||
|
||||
assert(queue_is_empty(&queue));
|
||||
|
||||
struct foo v1 = { .value = 42 };
|
||||
struct foo v2 = { .value = 27 };
|
||||
|
||||
queue_push(&queue, next, &v1);
|
||||
queue_push(&queue, next, &v2);
|
||||
|
||||
struct foo *foo;
|
||||
|
||||
assert(!queue_is_empty(&queue));
|
||||
queue_take(&queue, next, &foo);
|
||||
assert(foo->value == 42);
|
||||
|
||||
assert(!queue_is_empty(&queue));
|
||||
queue_take(&queue, next, &foo);
|
||||
assert(foo->value == 27);
|
||||
|
||||
assert(queue_is_empty(&queue));
|
||||
}
|
||||
|
||||
int main(void) {
|
||||
test_queue();
|
||||
return 0;
|
||||
}
|
||||
@@ -7,7 +7,7 @@ buildscript {
|
||||
jcenter()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:3.3.0'
|
||||
classpath 'com.android.tools.build:gradle:3.4.2'
|
||||
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
// in the individual module build.gradle files
|
||||
|
||||
@@ -15,6 +15,6 @@ cpu = 'i686'
|
||||
endian = 'little'
|
||||
|
||||
[properties]
|
||||
prebuilt_ffmpeg_shared = 'ffmpeg-4.1.3-win32-shared'
|
||||
prebuilt_ffmpeg_dev = 'ffmpeg-4.1.3-win32-dev'
|
||||
prebuilt_sdl2 = 'SDL2-2.0.8/i686-w64-mingw32'
|
||||
prebuilt_ffmpeg_shared = 'ffmpeg-4.1.4-win32-shared'
|
||||
prebuilt_ffmpeg_dev = 'ffmpeg-4.1.4-win32-dev'
|
||||
prebuilt_sdl2 = 'SDL2-2.0.10/i686-w64-mingw32'
|
||||
|
||||
@@ -15,6 +15,6 @@ cpu = 'x86_64'
|
||||
endian = 'little'
|
||||
|
||||
[properties]
|
||||
prebuilt_ffmpeg_shared = 'ffmpeg-4.1.3-win64-shared'
|
||||
prebuilt_ffmpeg_dev = 'ffmpeg-4.1.3-win64-dev'
|
||||
prebuilt_sdl2 = 'SDL2-2.0.8/x86_64-w64-mingw32'
|
||||
prebuilt_ffmpeg_shared = 'ffmpeg-4.1.4-win64-shared'
|
||||
prebuilt_ffmpeg_dev = 'ffmpeg-4.1.4-win64-dev'
|
||||
prebuilt_sdl2 = 'SDL2-2.0.10/x86_64-w64-mingw32'
|
||||
|
||||
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
3
gradle/wrapper/gradle-wrapper.properties
vendored
3
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,6 +1,5 @@
|
||||
#Thu Apr 18 11:45:59 CEST 2019
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.5.1-all.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
|
||||
|
||||
116
gradlew
vendored
116
gradlew
vendored
@@ -1,4 +1,20 @@
|
||||
#!/usr/bin/env bash
|
||||
#!/usr/bin/env sh
|
||||
|
||||
#
|
||||
# Copyright 2015 the original author or authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# https://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
##
|
||||
@@ -6,42 +22,6 @@
|
||||
##
|
||||
##############################################################################
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS=""
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
|
||||
warn ( ) {
|
||||
echo "$*"
|
||||
}
|
||||
|
||||
die ( ) {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
}
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
case "`uname`" in
|
||||
CYGWIN* )
|
||||
cygwin=true
|
||||
;;
|
||||
Darwin* )
|
||||
darwin=true
|
||||
;;
|
||||
MINGW* )
|
||||
msys=true
|
||||
;;
|
||||
esac
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
# Resolve links: $0 may be a link
|
||||
PRG="$0"
|
||||
@@ -60,6 +40,46 @@ cd "`dirname \"$PRG\"`/" >/dev/null
|
||||
APP_HOME="`pwd -P`"
|
||||
cd "$SAVED" >/dev/null
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
|
||||
warn () {
|
||||
echo "$*"
|
||||
}
|
||||
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
}
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
nonstop=false
|
||||
case "`uname`" in
|
||||
CYGWIN* )
|
||||
cygwin=true
|
||||
;;
|
||||
Darwin* )
|
||||
darwin=true
|
||||
;;
|
||||
MINGW* )
|
||||
msys=true
|
||||
;;
|
||||
NONSTOP* )
|
||||
nonstop=true
|
||||
;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
@@ -85,7 +105,7 @@ location of your Java installation."
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
|
||||
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
|
||||
MAX_FD_LIMIT=`ulimit -H -n`
|
||||
if [ $? -eq 0 ] ; then
|
||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
||||
@@ -150,11 +170,19 @@ if $cygwin ; then
|
||||
esac
|
||||
fi
|
||||
|
||||
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
|
||||
function splitJvmOpts() {
|
||||
JVM_OPTS=("$@")
|
||||
# Escape application args
|
||||
save () {
|
||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
||||
echo " "
|
||||
}
|
||||
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
|
||||
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
|
||||
APP_ARGS=$(save "$@")
|
||||
|
||||
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
|
||||
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
||||
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
||||
|
||||
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
|
||||
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
|
||||
cd "$(dirname "$0")"
|
||||
fi
|
||||
|
||||
exec "$JAVACMD" "$@"
|
||||
|
||||
30
gradlew.bat
vendored
30
gradlew.bat
vendored
@@ -1,3 +1,19 @@
|
||||
@rem
|
||||
@rem Copyright 2015 the original author or authors.
|
||||
@rem
|
||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@rem you may not use this file except in compliance with the License.
|
||||
@rem You may obtain a copy of the License at
|
||||
@rem
|
||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||
@rem
|
||||
@rem Unless required by applicable law or agreed to in writing, software
|
||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%" == "" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@@ -8,14 +24,14 @@
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS=
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%" == "" set DIRNAME=.
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
@@ -46,10 +62,9 @@ echo location of your Java installation.
|
||||
goto fail
|
||||
|
||||
:init
|
||||
@rem Get command-line arguments, handling Windowz variants
|
||||
@rem Get command-line arguments, handling Windows variants
|
||||
|
||||
if not "%OS%" == "Windows_NT" goto win9xME_args
|
||||
if "%@eval[2+2]" == "4" goto 4NT_args
|
||||
|
||||
:win9xME_args
|
||||
@rem Slurp the command line arguments.
|
||||
@@ -60,11 +75,6 @@ set _SKIP=2
|
||||
if "x%~1" == "x" goto execute
|
||||
|
||||
set CMD_LINE_ARGS=%*
|
||||
goto execute
|
||||
|
||||
:4NT_args
|
||||
@rem Get arguments from the 4NT Shell from JP Software
|
||||
set CMD_LINE_ARGS=%$
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
project('scrcpy', 'c',
|
||||
version: '1.9',
|
||||
version: '1.10',
|
||||
meson_version: '>= 0.37',
|
||||
default_options: 'c_std=c11')
|
||||
|
||||
|
||||
@@ -10,31 +10,31 @@ prepare-win32: prepare-sdl2 prepare-ffmpeg-shared-win32 prepare-ffmpeg-dev-win32
|
||||
prepare-win64: prepare-sdl2 prepare-ffmpeg-shared-win64 prepare-ffmpeg-dev-win64 prepare-adb
|
||||
|
||||
prepare-ffmpeg-shared-win32:
|
||||
@./prepare-dep https://ffmpeg.zeranoe.com/builds/win32/shared/ffmpeg-4.1.3-win32-shared.zip \
|
||||
8ea472d673370d5e87517a75587abfa6f189ee4f82e8da21fdbc49d0db0c1a89 \
|
||||
ffmpeg-4.1.3-win32-shared
|
||||
@./prepare-dep https://ffmpeg.zeranoe.com/builds/win32/shared/ffmpeg-4.1.4-win32-shared.zip \
|
||||
596608277f6b937c3dea7c46e854665d75b3de56790bae07f655ca331440f003 \
|
||||
ffmpeg-4.1.4-win32-shared
|
||||
|
||||
prepare-ffmpeg-dev-win32:
|
||||
@./prepare-dep https://ffmpeg.zeranoe.com/builds/win32/dev/ffmpeg-4.1.3-win32-dev.zip \
|
||||
e16d3150b6ccf0b71908f5b964cb8c051d79053c8f5cd6d777d617ab4f03613a \
|
||||
ffmpeg-4.1.3-win32-dev
|
||||
@./prepare-dep https://ffmpeg.zeranoe.com/builds/win32/dev/ffmpeg-4.1.4-win32-dev.zip \
|
||||
a80c86e263cfad26e202edfa5e6e939a2c88843ae26f031d3e0d981a39fd03fb \
|
||||
ffmpeg-4.1.4-win32-dev
|
||||
|
||||
prepare-ffmpeg-shared-win64:
|
||||
@./prepare-dep https://ffmpeg.zeranoe.com/builds/win64/shared/ffmpeg-4.1.3-win64-shared.zip \
|
||||
0b974578e07d974c4bafb36c7ed0b46e46b001d38b149455089c13b57ddefe5d \
|
||||
ffmpeg-4.1.3-win64-shared
|
||||
@./prepare-dep https://ffmpeg.zeranoe.com/builds/win64/shared/ffmpeg-4.1.4-win64-shared.zip \
|
||||
a90889871de2cab8a79b392591313a188189a353f69dde1db98aebe20b280989 \
|
||||
ffmpeg-4.1.4-win64-shared
|
||||
|
||||
prepare-ffmpeg-dev-win64:
|
||||
@./prepare-dep https://ffmpeg.zeranoe.com/builds/win64/dev/ffmpeg-4.1.3-win64-dev.zip \
|
||||
334b473467db096a5b74242743592a73e120a137232794508e4fc55593696a5b \
|
||||
ffmpeg-4.1.3-win64-dev
|
||||
@./prepare-dep https://ffmpeg.zeranoe.com/builds/win64/dev/ffmpeg-4.1.4-win64-dev.zip \
|
||||
6c9d53f9e94ce1821e975ec668e5b9d6e9deb4a45d0d7e30264685d3dfbbb068 \
|
||||
ffmpeg-4.1.4-win64-dev
|
||||
|
||||
prepare-sdl2:
|
||||
@./prepare-dep https://libsdl.org/release/SDL2-devel-2.0.8-mingw.tar.gz \
|
||||
ffff7305d634aff5e1df5b7bb935435c3a02c8b03ad94a1a2be9169a558a7961 \
|
||||
SDL2-2.0.8
|
||||
@./prepare-dep https://libsdl.org/release/SDL2-devel-2.0.10-mingw.tar.gz \
|
||||
a90a7cddaec4996f4d7be6d80c57ec69b062e132bffc513965f99217f603274a \
|
||||
SDL2-2.0.10
|
||||
|
||||
prepare-adb:
|
||||
@./prepare-dep https://dl.google.com/android/repository/platform-tools_r29.0.1-windows.zip \
|
||||
2334f92cf571fd2d9bf6ff7c637765bee5d8323e0bd8e051e15927d87b54b4e8 \
|
||||
@./prepare-dep https://dl.google.com/android/repository/platform-tools_r29.0.2-windows.zip \
|
||||
d78f02e5e2c9c4c1d046dcd4e6fbdf586e5f57ef66eb0da5c2b49d745d85d5ee \
|
||||
platform-tools
|
||||
|
||||
@@ -6,8 +6,8 @@ android {
|
||||
applicationId "com.genymobile.scrcpy"
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 29
|
||||
versionCode 10
|
||||
versionName "1.9"
|
||||
versionCode 11
|
||||
versionName "1.10"
|
||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
buildTypes {
|
||||
|
||||
Reference in New Issue
Block a user