Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
d54399b6
Commit
d54399b6
authored
Feb 16, 2024
by
Rémi Bernon
Committed by
Alexandre Julliard
Apr 16, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winegstreamer: Split read_transform_output_data in two helpers.
parent
4a6a3b90
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
12 deletions
+40
-12
wg_transform.c
dlls/winegstreamer/wg_transform.c
+40
-12
No files found.
dlls/winegstreamer/wg_transform.c
View file @
d54399b6
...
...
@@ -770,7 +770,7 @@ static NTSTATUS copy_video_buffer(GstBuffer *buffer, GstCaps *caps, gsize plane_
return
status
;
}
static
NTSTATUS
copy_buffer
(
GstBuffer
*
buffer
,
GstCaps
*
caps
,
struct
wg_sample
*
sample
,
static
NTSTATUS
copy_buffer
(
GstBuffer
*
buffer
,
struct
wg_sample
*
sample
,
gsize
*
total_size
)
{
GstMapInfo
info
;
...
...
@@ -839,8 +839,8 @@ static bool sample_needs_buffer_copy(struct wg_sample *sample, GstBuffer *buffer
return
needs_copy
;
}
static
NTSTATUS
read_transform_output_
data
(
GstBuffer
*
buffer
,
GstCaps
*
caps
,
gsize
plane_align
,
struct
wg_sample
*
sample
)
static
NTSTATUS
read_transform_output_
video
(
struct
wg_sample
*
sample
,
GstBuffer
*
buffer
,
GstCaps
*
caps
,
gsize
plane_align
)
{
gsize
total_size
;
NTSTATUS
status
;
...
...
@@ -848,10 +848,8 @@ static NTSTATUS read_transform_output_data(GstBuffer *buffer, GstCaps *caps, gsi
if
(
!
(
needs_copy
=
sample_needs_buffer_copy
(
sample
,
buffer
,
&
total_size
)))
status
=
STATUS_SUCCESS
;
else
if
(
stream_type_from_caps
(
caps
)
==
GST_STREAM_TYPE_VIDEO
)
status
=
copy_video_buffer
(
buffer
,
caps
,
plane_align
,
sample
,
&
total_size
);
else
status
=
copy_
buffer
(
buffer
,
caps
,
sample
,
&
total_size
);
status
=
copy_
video_buffer
(
buffer
,
caps
,
plane_align
,
sample
,
&
total_size
);
if
(
status
)
{
...
...
@@ -863,12 +861,37 @@ static NTSTATUS read_transform_output_data(GstBuffer *buffer, GstCaps *caps, gsi
set_sample_flags_from_buffer
(
sample
,
buffer
,
total_size
);
if
(
needs_copy
)
GST_WARNING
(
"Copied %u bytes, sample %p, flags %#x"
,
sample
->
size
,
sample
,
sample
->
flags
);
else
if
(
sample
->
flags
&
WG_SAMPLE_FLAG_INCOMPLETE
)
GST_ERROR
(
"Partial read %u bytes, sample %p, flags %#x"
,
sample
->
size
,
sample
,
sample
->
flags
);
else
GST_INFO
(
"Read %u bytes, sample %p, flags %#x"
,
sample
->
size
,
sample
,
sample
->
flags
);
return
STATUS_SUCCESS
;
}
static
NTSTATUS
read_transform_output
(
struct
wg_sample
*
sample
,
GstBuffer
*
buffer
)
{
gsize
total_size
;
NTSTATUS
status
;
bool
needs_copy
;
if
(
!
(
needs_copy
=
sample_needs_buffer_copy
(
sample
,
buffer
,
&
total_size
)))
status
=
STATUS_SUCCESS
;
else
status
=
copy_buffer
(
buffer
,
sample
,
&
total_size
);
if
(
status
)
{
if
(
stream_type_from_caps
(
caps
)
==
GST_STREAM_TYPE_VIDEO
)
GST_WARNING
(
"Copied %u bytes, sample %p, flags %#x"
,
sample
->
size
,
sample
,
sample
->
flags
);
else
GST_INFO
(
"Copied %u bytes, sample %p, flags %#x"
,
sample
->
size
,
sample
,
sample
->
flags
);
GST_ERROR
(
"Failed to copy buffer %"
GST_PTR_FORMAT
,
buffer
);
sample
->
size
=
0
;
return
status
;
}
set_sample_flags_from_buffer
(
sample
,
buffer
,
total_size
);
if
(
needs_copy
)
GST_INFO
(
"Copied %u bytes, sample %p, flags %#x"
,
sample
->
size
,
sample
,
sample
->
flags
);
else
if
(
sample
->
flags
&
WG_SAMPLE_FLAG_INCOMPLETE
)
GST_ERROR
(
"Partial read %u bytes, sample %p, flags %#x"
,
sample
->
size
,
sample
,
sample
->
flags
);
else
...
...
@@ -959,8 +982,13 @@ NTSTATUS wg_transform_read_data(void *args)
return
STATUS_SUCCESS
;
}
if
((
status
=
read_transform_output_data
(
output_buffer
,
output_caps
,
transform
->
attrs
.
output_plane_align
,
sample
)))
if
(
stream_type_from_caps
(
output_caps
)
==
GST_STREAM_TYPE_VIDEO
)
status
=
read_transform_output_video
(
sample
,
output_buffer
,
output_caps
,
transform
->
attrs
.
output_plane_align
);
else
status
=
read_transform_output
(
sample
,
output_buffer
);
if
(
status
)
{
wg_allocator_release_sample
(
transform
->
allocator
,
sample
,
false
);
return
status
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment