Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
github_28344065
scrcpy
提交
a55cea10
S
scrcpy
项目概览
github_28344065
/
scrcpy
与 Fork 源项目一致
从无法访问的项目Fork
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
scrcpy
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
a55cea10
编写于
2月 16, 2021
作者:
R
Romain Vimont
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
scale_filter
上级
fe43453f
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
49 addition
and
12 deletion
+49
-12
app/scrcpy.1
app/scrcpy.1
+7
-0
app/src/cli.c
app/src/cli.c
+30
-6
app/src/scrcpy.c
app/src/scrcpy.c
+1
-1
app/src/scrcpy.h
app/src/scrcpy.h
+7
-2
app/src/screen.c
app/src/screen.c
+2
-2
app/src/screen.h
app/src/screen.h
+2
-1
未找到文件。
app/scrcpy.1
浏览文件 @
a55cea10
...
...
@@ -167,6 +167,13 @@ Set the initial display rotation. Possibles values are 0, 1, 2 and 3. Each incre
.BI "\-s, \-\-serial " number
The device serial number. Mandatory only if several devices are connected to adb.
.TP
.BI "\-\-scale\-filter filter
Supported filters are "none" and "trilinear".
Trilinear filtering is only available if the renderer is OpenGL 3.0+ or OpenGL
ES 2.0+.
.TP
.BI "\-\-shortcut\-mod " key[+...]][,...]
Specify the modifiers to use for scrcpy shortcuts. Possible keys are "lctrl", "rctrl", "lalt", "ralt", "lsuper" and "rsuper".
...
...
app/src/cli.c
浏览文件 @
a55cea10
...
...
@@ -103,11 +103,6 @@ scrcpy_print_usage(const char *arg0) {
" --no-key-repeat
\n
"
" Do not forward repeated key events when a key is held down.
\n
"
"
\n
"
" --no-mipmaps
\n
"
" If the renderer is OpenGL 3.0+ or OpenGL ES 2.0+, then
\n
"
" mipmaps are automatically generated to improve downscaling
\n
"
" quality. This option disables the generation of mipmaps.
\n
"
"
\n
"
" -p, --port port[:port]
\n
"
" Set the TCP port (range) used by the client to listen.
\n
"
" Default is %d:%d.
\n
"
...
...
@@ -154,6 +149,11 @@ scrcpy_print_usage(const char *arg0) {
" The device serial number. Mandatory only if several devices
\n
"
" are connected to adb.
\n
"
"
\n
"
" --scale-filter filter
\n
"
" Supported filters are
\"
none
\"
and
\"
trilinear
\"
.
\n
"
" Trilinear filtering is only available if the renderer is
\n
"
" OpenGL 3.0+ or OpenGL ES 2.0+.
\n
"
"
\n
"
" --shortcut-mod key[+...]][,...]
\n
"
" Specify the modifiers to use for scrcpy shortcuts.
\n
"
" Possible keys are
\"
lctrl
\"
,
\"
rctrl
\"
,
\"
lalt
\"
,
\"
ralt
\"
,
\n
"
...
...
@@ -641,6 +641,21 @@ guess_record_format(const char *filename) {
return
0
;
}
static
bool
parse_scale_filter
(
const
char
*
optarg
,
enum
sc_scale_filter
*
filter
)
{
if
(
!
strcmp
(
optarg
,
"none"
))
{
*
filter
=
SC_SCALE_FILTER_NONE
;
return
true
;
}
if
(
!
strcmp
(
optarg
,
"trilinear"
))
{
*
filter
=
SC_SCALE_FILTER_TRILINEAR
;
return
true
;
}
LOGE
(
"Unsupported scale filter: %s "
"(expected
\"
none
\"
or
\"
trilinear
\"
)"
,
optarg
);
return
false
;
}
#define OPT_RENDER_EXPIRED_FRAMES 1000
#define OPT_WINDOW_TITLE 1001
#define OPT_PUSH_TARGET 1002
...
...
@@ -667,6 +682,7 @@ guess_record_format(const char *filename) {
#define OPT_FORWARD_ALL_CLICKS 1023
#define OPT_LEGACY_PASTE 1024
#define OPT_ENCODER_NAME 1025
#define OPT_SCALE_FILTER 1026
bool
scrcpy_parse_args
(
struct
scrcpy_cli_args
*
args
,
int
argc
,
char
*
argv
[])
{
...
...
@@ -703,6 +719,7 @@ scrcpy_parse_args(struct scrcpy_cli_args *args, int argc, char *argv[]) {
{
"render-expired-frames"
,
no_argument
,
NULL
,
OPT_RENDER_EXPIRED_FRAMES
},
{
"rotation"
,
required_argument
,
NULL
,
OPT_ROTATION
},
{
"scale-filter"
,
required_argument
,
NULL
,
OPT_SCALE_FILTER
},
{
"serial"
,
required_argument
,
NULL
,
's'
},
{
"shortcut-mod"
,
required_argument
,
NULL
,
OPT_SHORTCUT_MOD
},
{
"show-touches"
,
no_argument
,
NULL
,
't'
},
...
...
@@ -857,7 +874,9 @@ scrcpy_parse_args(struct scrcpy_cli_args *args, int argc, char *argv[]) {
opts
->
render_driver
=
optarg
;
break
;
case
OPT_NO_MIPMAPS
:
opts
->
mipmaps
=
false
;
LOGW
(
"Deprecated option --no-mipmaps. "
"Use --scale-filter=none instead."
);
opts
->
scale_filter
=
SC_SCALE_FILTER_NONE
;
break
;
case
OPT_NO_KEY_REPEAT
:
opts
->
forward_key_repeat
=
false
;
...
...
@@ -885,6 +904,11 @@ scrcpy_parse_args(struct scrcpy_cli_args *args, int argc, char *argv[]) {
case
OPT_LEGACY_PASTE
:
opts
->
legacy_paste
=
true
;
break
;
case
OPT_SCALE_FILTER
:
if
(
!
parse_scale_filter
(
optarg
,
&
opts
->
scale_filter
))
{
return
false
;
}
break
;
default:
// getopt prints the error message on stderr
return
false
;
...
...
app/src/scrcpy.c
浏览文件 @
a55cea10
...
...
@@ -408,7 +408,7 @@ scrcpy(const struct scrcpy_options *options) {
options
->
window_y
,
options
->
window_width
,
options
->
window_height
,
options
->
window_borderless
,
options
->
rotation
,
options
->
mipmaps
))
{
options
->
rotation
,
options
->
scale_filter
))
{
goto
end
;
}
...
...
app/src/scrcpy.h
浏览文件 @
a55cea10
...
...
@@ -41,6 +41,11 @@ struct sc_port_range {
uint16_t
last
;
};
enum
sc_scale_filter
{
SC_SCALE_FILTER_NONE
,
SC_SCALE_FILTER_TRILINEAR
,
// mipmaps
};
#define SC_WINDOW_POSITION_UNDEFINED (-0x8000)
struct
scrcpy_options
{
...
...
@@ -56,6 +61,7 @@ struct scrcpy_options {
enum
sc_record_format
record_format
;
struct
sc_port_range
port_range
;
struct
sc_shortcut_mods
shortcut_mods
;
enum
sc_scale_filter
scale_filter
;
uint16_t
max_size
;
uint32_t
bit_rate
;
uint16_t
max_fps
;
...
...
@@ -75,7 +81,6 @@ struct scrcpy_options {
bool
render_expired_frames
;
bool
prefer_text
;
bool
window_borderless
;
bool
mipmaps
;
bool
stay_awake
;
bool
force_adb_forward
;
bool
disable_screensaver
;
...
...
@@ -103,6 +108,7 @@ struct scrcpy_options {
.data = {SC_MOD_LALT, SC_MOD_LSUPER}, \
.count = 2, \
}, \
.scale_filter = SC_SCALE_FILTER_TRILINEAR, \
.max_size = DEFAULT_MAX_SIZE, \
.bit_rate = DEFAULT_BIT_RATE, \
.max_fps = 0, \
...
...
@@ -122,7 +128,6 @@ struct scrcpy_options {
.render_expired_frames = false, \
.prefer_text = false, \
.window_borderless = false, \
.mipmaps = true, \
.stay_awake = false, \
.force_adb_forward = false, \
.disable_screensaver = false, \
...
...
app/src/screen.c
浏览文件 @
a55cea10
...
...
@@ -6,7 +6,6 @@
#include "events.h"
#include "icon.xpm"
#include "scrcpy.h"
#include "tiny_xpm.h"
#include "video_buffer.h"
#include "util/log.h"
...
...
@@ -229,7 +228,7 @@ screen_init_rendering(struct screen *screen, const char *window_title,
struct
size
frame_size
,
bool
always_on_top
,
int16_t
window_x
,
int16_t
window_y
,
uint16_t
window_width
,
uint16_t
window_height
,
bool
window_borderless
,
uint8_t
rotation
,
bool
mipmaps
)
{
uint8_t
rotation
,
enum
sc_scale_filter
scale_filter
)
{
screen
->
frame_size
=
frame_size
;
screen
->
rotation
=
rotation
;
if
(
rotation
)
{
...
...
@@ -283,6 +282,7 @@ screen_init_rendering(struct screen *screen, const char *window_title,
// starts with "opengl"
bool
use_opengl
=
renderer_name
&&
!
strncmp
(
renderer_name
,
"opengl"
,
6
);
bool
mipmaps
=
scale_filter
==
SC_SCALE_FILTER_TRILINEAR
;
if
(
use_opengl
)
{
struct
sc_opengl
*
gl
=
&
screen
->
gl
;
sc_opengl_init
(
gl
);
...
...
app/src/screen.h
浏览文件 @
a55cea10
...
...
@@ -9,6 +9,7 @@
#include "coords.h"
#include "opengl.h"
#include "scrcpy.h"
struct
video_buffer
;
...
...
@@ -81,7 +82,7 @@ screen_init_rendering(struct screen *screen, const char *window_title,
struct
size
frame_size
,
bool
always_on_top
,
int16_t
window_x
,
int16_t
window_y
,
uint16_t
window_width
,
uint16_t
window_height
,
bool
window_borderless
,
uint8_t
rotation
,
bool
mipmaps
);
uint8_t
rotation
,
enum
sc_scale_filter
scale_filter
);
// show the window
void
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录