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
b2ea55a0
Commit
b2ea55a0
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: Introduce a new set_sample_flags_from_buffer helper.
parent
19e27e95
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
21 deletions
+26
-21
wg_transform.c
dlls/winegstreamer/wg_transform.c
+26
-21
No files found.
dlls/winegstreamer/wg_transform.c
View file @
b2ea55a0
...
...
@@ -796,6 +796,31 @@ static NTSTATUS copy_buffer(GstBuffer *buffer, GstCaps *caps, struct wg_sample *
return
STATUS_SUCCESS
;
}
static
void
set_sample_flags_from_buffer
(
struct
wg_sample
*
sample
,
GstBuffer
*
buffer
,
gsize
total_size
)
{
if
(
GST_BUFFER_PTS_IS_VALID
(
buffer
))
{
sample
->
flags
|=
WG_SAMPLE_FLAG_HAS_PTS
;
sample
->
pts
=
GST_BUFFER_PTS
(
buffer
)
/
100
;
}
if
(
GST_BUFFER_DURATION_IS_VALID
(
buffer
))
{
GstClockTime
duration
=
GST_BUFFER_DURATION
(
buffer
)
/
100
;
duration
=
(
duration
*
sample
->
size
)
/
total_size
;
GST_BUFFER_DURATION
(
buffer
)
-=
duration
*
100
;
if
(
GST_BUFFER_PTS_IS_VALID
(
buffer
))
GST_BUFFER_PTS
(
buffer
)
+=
duration
*
100
;
sample
->
flags
|=
WG_SAMPLE_FLAG_HAS_DURATION
;
sample
->
duration
=
duration
;
}
if
(
!
GST_BUFFER_FLAG_IS_SET
(
buffer
,
GST_BUFFER_FLAG_DELTA_UNIT
))
sample
->
flags
|=
WG_SAMPLE_FLAG_SYNC_POINT
;
if
(
GST_BUFFER_FLAG_IS_SET
(
buffer
,
GST_BUFFER_FLAG_DISCONT
))
sample
->
flags
|=
WG_SAMPLE_FLAG_DISCONTINUITY
;
}
static
NTSTATUS
read_transform_output_data
(
GstBuffer
*
buffer
,
GstCaps
*
caps
,
gsize
plane_align
,
struct
wg_sample
*
sample
)
{
...
...
@@ -828,27 +853,7 @@ static NTSTATUS read_transform_output_data(GstBuffer *buffer, GstCaps *caps, gsi
return
status
;
}
if
(
GST_BUFFER_PTS_IS_VALID
(
buffer
))
{
sample
->
flags
|=
WG_SAMPLE_FLAG_HAS_PTS
;
sample
->
pts
=
GST_BUFFER_PTS
(
buffer
)
/
100
;
}
if
(
GST_BUFFER_DURATION_IS_VALID
(
buffer
))
{
GstClockTime
duration
=
GST_BUFFER_DURATION
(
buffer
)
/
100
;
duration
=
(
duration
*
sample
->
size
)
/
total_size
;
GST_BUFFER_DURATION
(
buffer
)
-=
duration
*
100
;
if
(
GST_BUFFER_PTS_IS_VALID
(
buffer
))
GST_BUFFER_PTS
(
buffer
)
+=
duration
*
100
;
sample
->
flags
|=
WG_SAMPLE_FLAG_HAS_DURATION
;
sample
->
duration
=
duration
;
}
if
(
!
GST_BUFFER_FLAG_IS_SET
(
buffer
,
GST_BUFFER_FLAG_DELTA_UNIT
))
sample
->
flags
|=
WG_SAMPLE_FLAG_SYNC_POINT
;
if
(
GST_BUFFER_FLAG_IS_SET
(
buffer
,
GST_BUFFER_FLAG_DISCONT
))
sample
->
flags
|=
WG_SAMPLE_FLAG_DISCONTINUITY
;
set_sample_flags_from_buffer
(
sample
,
buffer
,
total_size
);
if
(
needs_copy
)
{
...
...
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