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
0c9e8e65
Commit
0c9e8e65
authored
Jul 24, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Jul 27, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winegstreamer: Use a fixed size type for wg_sample data pointer.
parent
7c814a3e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
11 deletions
+16
-11
unix_private.h
dlls/winegstreamer/unix_private.h
+5
-0
unixlib.h
dlls/winegstreamer/unixlib.h
+1
-1
wg_allocator.c
dlls/winegstreamer/wg_allocator.c
+3
-3
wg_sample.c
dlls/winegstreamer/wg_sample.c
+3
-3
wg_transform.c
dlls/winegstreamer/wg_transform.c
+4
-4
No files found.
dlls/winegstreamer/unix_private.h
View file @
0c9e8e65
...
...
@@ -59,6 +59,11 @@ extern NTSTATUS wg_transform_flush(void *args) DECLSPEC_HIDDEN;
/* wg_allocator.c */
static
inline
BYTE
*
wg_sample_data
(
struct
wg_sample
*
sample
)
{
return
(
BYTE
*
)(
UINT_PTR
)
sample
->
data
;
}
/* wg_allocator_release_sample can be used to release any sample that was requested. */
typedef
struct
wg_sample
*
(
*
wg_allocator_request_sample_cb
)(
gsize
size
,
void
*
context
);
extern
GstAllocator
*
wg_allocator_create
(
void
)
DECLSPEC_HIDDEN
;
...
...
dlls/winegstreamer/unixlib.h
View file @
0c9e8e65
...
...
@@ -182,7 +182,7 @@ struct wg_sample
UINT32
flags
;
UINT32
max_size
;
UINT32
size
;
BYTE
*
data
;
UINT64
data
;
/* pointer to user memory */
};
struct
wg_parser_buffer
...
...
dlls/winegstreamer/wg_allocator.c
View file @
0c9e8e65
...
...
@@ -96,7 +96,7 @@ static void release_memory_sample(WgAllocator *allocator, WgMemory *memory, bool
if
(
memory
->
written
&&
!
discard_data
)
{
GST_WARNING
(
"Copying %#zx bytes from sample %p, back to memory %p"
,
memory
->
written
,
sample
,
memory
);
memcpy
(
get_unix_memory_data
(
memory
),
memory
->
sample
->
data
,
memory
->
written
);
memcpy
(
get_unix_memory_data
(
memory
),
wg_sample_data
(
memory
->
sample
)
,
memory
->
written
);
}
memory
->
sample
=
NULL
;
...
...
@@ -120,7 +120,7 @@ static gpointer wg_allocator_map(GstMemory *gst_memory, GstMapInfo *info, gsize
else
{
InterlockedIncrement
(
&
memory
->
sample
->
refcount
);
info
->
data
=
memory
->
sample
->
data
;
info
->
data
=
wg_sample_data
(
memory
->
sample
)
;
}
if
(
info
->
flags
&
GST_MAP_WRITE
)
memory
->
written
=
max
(
memory
->
written
,
maxsize
);
...
...
@@ -143,7 +143,7 @@ static void wg_allocator_unmap(GstMemory *gst_memory, GstMapInfo *info)
pthread_mutex_lock
(
&
allocator
->
mutex
);
if
(
memory
->
sample
&&
info
->
data
==
memory
->
sample
->
data
)
if
(
memory
->
sample
&&
info
->
data
==
wg_sample_data
(
memory
->
sample
)
)
{
InterlockedDecrement
(
&
memory
->
sample
->
refcount
);
pthread_cond_signal
(
&
allocator
->
release_cond
);
...
...
dlls/winegstreamer/wg_sample.c
View file @
0c9e8e65
...
...
@@ -104,7 +104,7 @@ HRESULT wg_sample_create_mf(IMFSample *mf_sample, struct wg_sample **out)
goto
fail
;
IMFSample_AddRef
((
sample
->
u
.
mf
.
sample
=
mf_sample
));
sample
->
wg_sample
.
data
=
buffer
;
sample
->
wg_sample
.
data
=
(
UINT_PTR
)
buffer
;
sample
->
wg_sample
.
size
=
current_length
;
sample
->
wg_sample
.
max_size
=
max_length
;
sample
->
ops
=
&
mf_sample_ops
;
...
...
@@ -159,7 +159,7 @@ HRESULT wg_sample_create_quartz(IMediaSample *media_sample, struct wg_sample **o
return
E_OUTOFMEMORY
;
IMediaSample_AddRef
((
sample
->
u
.
quartz
.
sample
=
media_sample
));
sample
->
wg_sample
.
data
=
buffer
;
sample
->
wg_sample
.
data
=
(
UINT_PTR
)
buffer
;
sample
->
wg_sample
.
size
=
current_length
;
sample
->
wg_sample
.
max_size
=
max_length
;
sample
->
ops
=
&
quartz_sample_ops
;
...
...
@@ -207,7 +207,7 @@ HRESULT wg_sample_create_dmo(IMediaBuffer *media_buffer, struct wg_sample **out)
goto
fail
;
IMediaBuffer_AddRef
((
sample
->
u
.
dmo
.
buffer
=
media_buffer
));
sample
->
wg_sample
.
data
=
buffer
;
sample
->
wg_sample
.
data
=
(
UINT_PTR
)
buffer
;
sample
->
wg_sample
.
size
=
length
;
sample
->
wg_sample
.
max_size
=
max_length
;
sample
->
ops
=
&
dmo_sample_ops
;
...
...
dlls/winegstreamer/wg_transform.c
View file @
0c9e8e65
...
...
@@ -577,7 +577,7 @@ NTSTATUS wg_transform_push_data(void *args)
return
STATUS_SUCCESS
;
}
if
(
!
(
buffer
=
gst_buffer_new_wrapped_full
(
GST_MEMORY_FLAG_READONLY
,
sample
->
data
,
sample
->
max_size
,
if
(
!
(
buffer
=
gst_buffer_new_wrapped_full
(
GST_MEMORY_FLAG_READONLY
,
wg_sample_data
(
sample
)
,
sample
->
max_size
,
0
,
sample
->
size
,
sample
,
wg_sample_free_notify
)))
{
GST_ERROR
(
"Failed to allocate input buffer"
);
...
...
@@ -627,7 +627,7 @@ static NTSTATUS copy_video_buffer(GstBuffer *buffer, GstCaps *caps, gsize plane_
return
STATUS_BUFFER_TOO_SMALL
;
}
if
(
!
(
dst_buffer
=
gst_buffer_new_wrapped_full
(
0
,
sample
->
data
,
sample
->
max_size
,
if
(
!
(
dst_buffer
=
gst_buffer_new_wrapped_full
(
0
,
wg_sample_data
(
sample
)
,
sample
->
max_size
,
0
,
sample
->
max_size
,
0
,
NULL
)))
{
GST_ERROR
(
"Failed to wrap wg_sample into GstBuffer"
);
...
...
@@ -673,7 +673,7 @@ static NTSTATUS copy_buffer(GstBuffer *buffer, GstCaps *caps, struct wg_sample *
sample
->
size
=
sample
->
max_size
;
}
memcpy
(
sample
->
data
,
info
.
data
,
sample
->
size
);
memcpy
(
wg_sample_data
(
sample
)
,
info
.
data
,
sample
->
size
);
gst_buffer_unmap
(
buffer
,
&
info
);
if
(
sample
->
flags
&
WG_SAMPLE_FLAG_INCOMPLETE
)
...
...
@@ -697,7 +697,7 @@ static NTSTATUS read_transform_output_data(GstBuffer *buffer, GstCaps *caps, gsi
sample
->
size
=
0
;
return
STATUS_UNSUCCESSFUL
;
}
needs_copy
=
info
.
data
!=
sample
->
data
;
needs_copy
=
info
.
data
!=
wg_sample_data
(
sample
)
;
total_size
=
sample
->
size
=
info
.
size
;
gst_buffer_unmap
(
buffer
,
&
info
);
...
...
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