Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
尘离序散
obs-studio
提交
888a7ad3
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,发现更多精彩内容 >>
未验证
提交
888a7ad3
编写于
9月 16, 2019
作者:
J
Jim
提交者:
GitHub
9月 16, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2071 from jpark37/mjpeg-default-range
win-dshow: Fix color range when using FFmpeg decode
上级
4ff11957
f60b820f
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
20 addition
and
15 deletion
+20
-15
plugins/win-dshow/ffmpeg-decode.c
plugins/win-dshow/ffmpeg-decode.c
+12
-10
plugins/win-dshow/ffmpeg-decode.h
plugins/win-dshow/ffmpeg-decode.h
+1
-0
plugins/win-dshow/win-dshow.cpp
plugins/win-dshow/win-dshow.cpp
+7
-5
未找到文件。
plugins/win-dshow/ffmpeg-decode.c
浏览文件 @
888a7ad3
...
...
@@ -273,11 +273,11 @@ bool ffmpeg_decode_audio(struct ffmpeg_decode *decode, uint8_t *data,
bool
ffmpeg_decode_video
(
struct
ffmpeg_decode
*
decode
,
uint8_t
*
data
,
size_t
size
,
long
long
*
ts
,
enum
video_range_type
range
,
struct
obs_source_frame2
*
frame
,
bool
*
got_output
)
{
AVPacket
packet
=
{
0
};
int
got_frame
=
false
;
enum
video_format
new_format
;
AVFrame
*
out_frame
;
int
ret
;
...
...
@@ -337,17 +337,17 @@ bool ffmpeg_decode_video(struct ffmpeg_decode *decode, uint8_t *data,
frame
->
linesize
[
i
]
=
decode
->
frame
->
linesize
[
i
];
}
new_format
=
convert_pixel_format
(
decode
->
frame
->
format
);
if
(
new_format
!=
frame
->
format
)
{
bool
success
;
frame
->
format
=
convert_pixel_format
(
decode
->
frame
->
format
);
frame
->
format
=
new_format
;
frame
->
range
=
decode
->
frame
->
color_range
==
AVCOL_RANGE_JPEG
?
VIDEO_RANGE_FULL
:
VIDEO_RANGE_DEFAULT
;
if
(
range
==
VIDEO_RANGE_DEFAULT
)
{
range
=
(
decode
->
frame
->
color_range
==
AVCOL_RANGE_JPEG
)
?
VIDEO_RANGE_FULL
:
VIDEO_RANGE_PARTIAL
;
}
success
=
video_format_get_parameters
(
VIDEO_CS_601
,
frame
->
range
,
frame
->
color_matrix
,
if
(
range
!=
frame
->
range
)
{
const
bool
success
=
video_format_get_parameters
(
VIDEO_CS_601
,
range
,
frame
->
color_matrix
,
frame
->
color_range_min
,
frame
->
color_range_max
);
if
(
!
success
)
{
blog
(
LOG_ERROR
,
...
...
@@ -356,6 +356,8 @@ bool ffmpeg_decode_video(struct ffmpeg_decode *decode, uint8_t *data,
VIDEO_CS_601
);
return
false
;
}
frame
->
range
=
range
;
}
*
ts
=
decode
->
frame
->
pkt_pts
;
...
...
plugins/win-dshow/ffmpeg-decode.h
浏览文件 @
888a7ad3
...
...
@@ -58,6 +58,7 @@ extern bool ffmpeg_decode_audio(struct ffmpeg_decode *decode, uint8_t *data,
extern
bool
ffmpeg_decode_video
(
struct
ffmpeg_decode
*
decode
,
uint8_t
*
data
,
size_t
size
,
long
long
*
ts
,
enum
video_range_type
range
,
struct
obs_source_frame2
*
frame
,
bool
*
got_output
);
...
...
plugins/win-dshow/win-dshow.cpp
浏览文件 @
888a7ad3
...
...
@@ -178,6 +178,7 @@ struct DShowInput {
VideoConfig
videoConfig
;
AudioConfig
audioConfig
;
video_range_type
range
;
obs_source_frame2
frame
;
obs_source_audio
audio
;
...
...
@@ -481,7 +482,7 @@ void DShowInput::OnEncodedVideoData(enum AVCodecID id, unsigned char *data,
bool
got_output
;
bool
success
=
ffmpeg_decode_video
(
video_decoder
,
data
,
size
,
&
ts
,
&
frame
,
&
got_output
);
range
,
&
frame
,
&
got_output
);
if
(
!
success
)
{
blog
(
LOG_WARNING
,
"Error decoding video"
);
return
;
...
...
@@ -1079,13 +1080,14 @@ inline bool DShowInput::Activate(obs_data_t *settings)
if
(
!
device
.
ConnectFilters
())
return
false
;
enum
video_colorspace
cs
=
GetColorSpace
(
settings
);
frame
.
range
=
GetColorRange
(
settings
);
if
(
device
.
Start
()
!=
Result
::
Success
)
return
false
;
bool
success
=
video_format_get_parameters
(
cs
,
frame
.
range
,
enum
video_colorspace
cs
=
GetColorSpace
(
settings
);
range
=
GetColorRange
(
settings
);
frame
.
range
=
range
;
bool
success
=
video_format_get_parameters
(
cs
,
range
,
frame
.
color_matrix
,
frame
.
color_range_min
,
frame
.
color_range_max
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录