Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
github_28344065
scrcpy
提交
205d9808
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,发现更多精彩内容 >>
提交
205d9808
编写于
2月 23, 2021
作者:
R
Romain Vimont
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
wip_everything_broken
上级
f13febe8
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
19 addition
and
10 deletion
+19
-10
app/src/screen.c
app/src/screen.c
+19
-10
未找到文件。
app/src/screen.c
浏览文件 @
205d9808
...
@@ -520,16 +520,17 @@ screen_set_rotation(struct screen *screen, unsigned rotation) {
...
@@ -520,16 +520,17 @@ screen_set_rotation(struct screen *screen, unsigned rotation) {
// recreate the texture and resize the window if the frame size has changed
// recreate the texture and resize the window if the frame size has changed
static
bool
static
bool
prepare_for_frame
(
struct
screen
*
screen
,
struct
size
new_frame_size
)
{
prepare_for_frame
(
struct
screen
*
screen
,
struct
size
original_frame_size
,
if
(
screen
->
frame_size
.
width
!=
new_frame_size
.
width
struct
size
frame_size
)
{
||
screen
->
frame_size
.
height
!=
new_frame_size
.
height
)
{
if
(
screen
->
frame_size
.
width
!=
original_frame_size
.
width
||
screen
->
frame_size
.
height
!=
original_frame_size
.
height
)
{
// frame dimension changed, destroy texture
// frame dimension changed, destroy texture
SDL_DestroyTexture
(
screen
->
texture
);
SDL_DestroyTexture
(
screen
->
texture
);
screen
->
frame_size
=
new
_frame_size
;
screen
->
frame_size
=
original
_frame_size
;
struct
size
new_content_size
=
struct
size
new_content_size
=
get_rotated_size
(
new
_frame_size
,
screen
->
rotation
);
get_rotated_size
(
original
_frame_size
,
screen
->
rotation
);
set_content_size
(
screen
,
new_content_size
);
set_content_size
(
screen
,
new_content_size
);
screen_update_content_rect
(
screen
);
screen_update_content_rect
(
screen
);
...
@@ -568,14 +569,22 @@ update_texture(struct screen *screen, const AVFrame *frame) {
...
@@ -568,14 +569,22 @@ update_texture(struct screen *screen, const AVFrame *frame) {
static
bool
static
bool
screen_update_frame
(
struct
screen
*
screen
)
{
screen_update_frame
(
struct
screen
*
screen
)
{
struct
video_buffer
*
vb
=
screen
->
use_swscale
?
&
screen
->
resizer_vb
const
AVFrame
*
frame
;
:
screen
->
vb
;
struct
size
original_frame_size
;
const
AVFrame
*
frame
=
video_buffer_consumer_take_frame
(
vb
);
if
(
screen
->
use_swscale
)
{
frame
=
sc_resizer_consumer_take_frame
(
&
screen
->
resizer
,
&
original_frame_size
);
}
else
{
frame
=
video_buffer_consumer_take_frame
(
screen
->
vb
);
original_frame_size
.
width
=
frame
->
width
;
original_frame_size
.
height
=
frame
->
height
;
}
struct
size
frame_size
=
{
frame
->
width
,
frame
->
height
};
fps_counter_add_rendered_frame
(
screen
->
fps_counter
);
fps_counter_add_rendered_frame
(
screen
->
fps_counter
);
struct
size
new_frame_size
=
{
frame
->
width
,
frame
->
height
};
if
(
!
prepare_for_frame
(
screen
,
original_frame_size
,
frame_size
))
{
if
(
!
prepare_for_frame
(
screen
,
new_frame_size
))
{
return
false
;
return
false
;
}
}
update_texture
(
screen
,
frame
);
update_texture
(
screen
,
frame
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录