Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
尘离序散
obs-studio
提交
a7af7ccb
O
obs-studio
项目概览
尘离序散
/
obs-studio
与 Fork 源项目一致
从无法访问的项目Fork
通知
30
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
obs-studio
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a7af7ccb
编写于
10月 14, 2014
作者:
M
Manuel Kroeber
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add monitor selection and basic properties
上级
ff2c7bd9
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
94 addition
and
11 deletion
+94
-11
plugins/win-capture/data/locale/en-US.ini
plugins/win-capture/data/locale/en-US.ini
+2
-0
plugins/win-capture/monitor-capture.c
plugins/win-capture/monitor-capture.c
+92
-11
未找到文件。
plugins/win-capture/data/locale/en-US.ini
浏览文件 @
a7af7ccb
...
...
@@ -7,3 +7,5 @@ WindowCapture.Priority.Class="Window Class"
WindowCapture.Priority.Exe
=
"Executable Name"
CaptureCursor
=
"Capture Cursor"
Compatibility
=
"Multi-adapter Compatibility"
Monitor
=
"Monitor"
PrimaryMonitor
=
"Primary Monitor"
plugins/win-capture/monitor-capture.c
浏览文件 @
a7af7ccb
...
...
@@ -2,6 +2,11 @@
#include "dc-capture.h"
#define TEXT_MONITOR_CAPTURE obs_module_text("MonitorCapture")
#define TEXT_CAPTURE_CURSOR obs_module_text("CaptureCursor")
#define TEXT_COMPATIBILITY obs_module_text("Compatibility")
#define TEXT_MONITOR obs_module_text("Monitor")
#define TEXT_PRIMARY_MONITOR obs_module_text("PrimaryMonitor")
struct
monitor_capture
{
obs_source_t
*
source
;
...
...
@@ -75,6 +80,7 @@ static void update_monitor(struct monitor_capture *capture,
static
inline
void
update_settings
(
struct
monitor_capture
*
capture
,
obs_data_t
*
settings
)
{
capture
->
monitor
=
(
int
)
obs_data_get_int
(
settings
,
"monitor"
);
capture
->
capture_cursor
=
obs_data_get_bool
(
settings
,
"capture_cursor"
);
capture
->
compatibility
=
obs_data_get_bool
(
settings
,
"compatibility"
);
...
...
@@ -110,6 +116,12 @@ static void monitor_capture_defaults(obs_data_t *settings)
obs_data_set_default_bool
(
settings
,
"compatibility"
,
false
);
}
static
void
monitor_capture_update
(
void
*
data
,
obs_data_t
*
settings
)
{
struct
monitor_capture
*
mc
=
data
;
update_settings
(
mc
,
settings
);
}
static
void
*
monitor_capture_create
(
obs_data_t
*
settings
,
obs_source_t
*
source
)
{
struct
monitor_capture
*
capture
;
...
...
@@ -158,16 +170,85 @@ static uint32_t monitor_capture_height(void *data)
return
capture
->
data
.
height
;
}
static
BOOL
CALLBACK
enum_monitor_props
(
HMONITOR
handle
,
HDC
hdc
,
LPRECT
rect
,
LPARAM
param
)
{
UNUSED_PARAMETER
(
hdc
);
UNUSED_PARAMETER
(
rect
);
obs_property_t
*
monitor_list
=
(
obs_property_t
*
)
param
;
MONITORINFO
mi
;
size_t
monitor_id
=
0
;
struct
dstr
monitor_desc
=
{
0
};
struct
dstr
resolution
=
{
0
};
struct
dstr
format_string
=
{
0
};
monitor_id
=
obs_property_list_item_count
(
monitor_list
);
mi
.
cbSize
=
sizeof
(
mi
);
GetMonitorInfo
(
handle
,
&
mi
);
dstr_catf
(
&
resolution
,
"%dx%d @ %d,%d"
,
mi
.
rcMonitor
.
right
-
mi
.
rcMonitor
.
left
,
mi
.
rcMonitor
.
bottom
-
mi
.
rcMonitor
.
top
,
mi
.
rcMonitor
.
left
,
mi
.
rcMonitor
.
top
);
dstr_copy
(
&
format_string
,
"%s %d: %s"
);
if
(
mi
.
dwFlags
==
MONITORINFOF_PRIMARY
)
{
dstr_catf
(
&
format_string
,
" (%s)"
,
TEXT_PRIMARY_MONITOR
);
}
dstr_catf
(
&
monitor_desc
,
format_string
.
array
,
TEXT_MONITOR
,
monitor_id
,
resolution
.
array
);
obs_property_list_add_int
(
monitor_list
,
monitor_desc
.
array
,
(
int
)
monitor_id
);
dstr_free
(
&
monitor_desc
);
dstr_free
(
&
resolution
);
dstr_free
(
&
format_string
);
return
TRUE
;
}
static
obs_properties_t
*
monitor_capture_properties
(
void
*
unused
)
{
UNUSED_PARAMETER
(
unused
);
obs_properties_t
*
props
=
obs_properties_create
();
obs_property_t
*
monitors
=
obs_properties_add_list
(
props
,
"monitor"
,
TEXT_MONITOR
,
OBS_COMBO_TYPE_LIST
,
OBS_COMBO_FORMAT_INT
);
obs_property_t
*
compatmode
=
obs_properties_add_bool
(
props
,
"compatibility"
,
TEXT_COMPATIBILITY
);
obs_property_t
*
capture_cursor
=
obs_properties_add_bool
(
props
,
"capture_cursor"
,
TEXT_CAPTURE_CURSOR
);
EnumDisplayMonitors
(
NULL
,
NULL
,
enum_monitor_props
,
(
LPARAM
)
monitors
);
return
props
;
}
struct
obs_source_info
monitor_capture_info
=
{
.
id
=
"monitor_capture"
,
.
type
=
OBS_SOURCE_TYPE_INPUT
,
.
output_flags
=
OBS_SOURCE_VIDEO
|
OBS_SOURCE_CUSTOM_DRAW
,
.
get_name
=
monitor_capture_getname
,
.
create
=
monitor_capture_create
,
.
destroy
=
monitor_capture_destroy
,
.
video_render
=
monitor_capture_render
,
.
video_tick
=
monitor_capture_tick
,
.
get_width
=
monitor_capture_width
,
.
get_height
=
monitor_capture_height
,
.
get_defaults
=
monitor_capture_defaults
.
id
=
"monitor_capture"
,
.
type
=
OBS_SOURCE_TYPE_INPUT
,
.
output_flags
=
OBS_SOURCE_VIDEO
|
OBS_SOURCE_CUSTOM_DRAW
,
.
get_name
=
monitor_capture_getname
,
.
create
=
monitor_capture_create
,
.
destroy
=
monitor_capture_destroy
,
.
video_render
=
monitor_capture_render
,
.
video_tick
=
monitor_capture_tick
,
.
update
=
monitor_capture_update
,
.
get_width
=
monitor_capture_width
,
.
get_height
=
monitor_capture_height
,
.
get_defaults
=
monitor_capture_defaults
,
.
get_properties
=
monitor_capture_properties
};
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录