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
98310d21
Commit
98310d21
authored
Aug 18, 2023
by
Ziqing Hui
Committed by
Alexandre Julliard
Nov 21, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winestreamer: Introduce media_sink_write_stream.
parent
96da5a8a
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
91 additions
and
0 deletions
+91
-0
gst_private.h
dlls/winegstreamer/gst_private.h
+1
-0
main.c
dlls/winegstreamer/main.c
+23
-0
media_sink.c
dlls/winegstreamer/media_sink.c
+25
-0
unix_private.h
dlls/winegstreamer/unix_private.h
+1
-0
unixlib.h
dlls/winegstreamer/unixlib.h
+9
-0
wg_muxer.c
dlls/winegstreamer/wg_muxer.c
+6
-0
wg_parser.c
dlls/winegstreamer/wg_parser.c
+26
-0
No files found.
dlls/winegstreamer/gst_private.h
View file @
98310d21
...
...
@@ -115,6 +115,7 @@ void wg_muxer_destroy(wg_muxer_t muxer);
HRESULT
wg_muxer_add_stream
(
wg_muxer_t
muxer
,
UINT32
stream_id
,
const
struct
wg_format
*
format
);
HRESULT
wg_muxer_start
(
wg_muxer_t
muxer
);
HRESULT
wg_muxer_push_sample
(
wg_muxer_t
muxer
,
struct
wg_sample
*
sample
,
UINT32
stream_id
);
HRESULT
wg_muxer_read_data
(
wg_muxer_t
muxer
,
void
*
buffer
,
UINT32
*
size
,
UINT64
*
offset
);
unsigned
int
wg_format_get_bytes_for_uncompressed
(
wg_video_format
format
,
unsigned
int
width
,
unsigned
int
height
);
unsigned
int
wg_format_get_max_size
(
const
struct
wg_format
*
format
);
...
...
dlls/winegstreamer/main.c
View file @
98310d21
...
...
@@ -544,6 +544,29 @@ HRESULT wg_muxer_push_sample(wg_muxer_t muxer, struct wg_sample *sample, UINT32
return
S_OK
;
}
HRESULT
wg_muxer_read_data
(
wg_muxer_t
muxer
,
void
*
buffer
,
UINT32
*
size
,
UINT64
*
offset
)
{
struct
wg_muxer_read_data_params
params
=
{
.
muxer
=
muxer
,
.
buffer
=
buffer
,
.
size
=
*
size
,
.
offset
=
UINT64_MAX
,
};
NTSTATUS
status
;
TRACE
(
"muxer %#I64x, buffer %p, size %u.
\n
"
,
muxer
,
buffer
,
*
size
);
if
(
SUCCEEDED
(
status
=
WINE_UNIX_CALL
(
unix_wg_muxer_read_data
,
&
params
)))
{
*
size
=
params
.
size
;
*
offset
=
params
.
offset
;
TRACE
(
"Read %u bytes, offset %#I64x.
\n
"
,
*
size
,
*
offset
);
}
return
HRESULT_FROM_NT
(
status
);
}
#define ALIGN(n, alignment) (((n) + (alignment) - 1) & ~((alignment) - 1))
unsigned
int
wg_format_get_stride
(
const
struct
wg_format
*
format
)
...
...
dlls/winegstreamer/media_sink.c
View file @
98310d21
...
...
@@ -542,6 +542,28 @@ static HRESULT media_sink_queue_stream_event(struct media_sink *media_sink, Medi
return
S_OK
;
}
static
HRESULT
media_sink_write_stream
(
struct
media_sink
*
media_sink
)
{
BYTE
buffer
[
1024
];
UINT32
size
=
sizeof
(
buffer
);
ULONG
written
;
QWORD
offset
;
HRESULT
hr
;
while
(
SUCCEEDED
(
hr
=
wg_muxer_read_data
(
media_sink
->
muxer
,
buffer
,
&
size
,
&
offset
)))
{
if
(
offset
!=
UINT64_MAX
&&
FAILED
(
hr
=
IMFByteStream_SetCurrentPosition
(
media_sink
->
bytestream
,
offset
)))
return
hr
;
if
(
FAILED
(
hr
=
IMFByteStream_Write
(
media_sink
->
bytestream
,
buffer
,
size
,
&
written
)))
return
hr
;
size
=
sizeof
(
buffer
);
}
return
S_OK
;
}
static
HRESULT
media_sink_start
(
struct
media_sink
*
media_sink
)
{
HRESULT
hr
;
...
...
@@ -577,6 +599,9 @@ static HRESULT media_sink_process(struct media_sink *media_sink, IMFSample *samp
TRACE
(
"media_sink %p, sample %p, stream_id %u.
\n
"
,
media_sink
,
sample
,
stream_id
);
if
(
FAILED
(
hr
=
media_sink_write_stream
(
media_sink
)))
WARN
(
"Failed to write output samples to stream, hr %#lx.
\n
"
,
hr
);
if
(
FAILED
(
hr
=
wg_sample_create_mf
(
sample
,
&
wg_sample
)))
return
hr
;
...
...
dlls/winegstreamer/unix_private.h
View file @
98310d21
...
...
@@ -70,6 +70,7 @@ extern NTSTATUS wg_muxer_destroy(void *args) DECLSPEC_HIDDEN;
extern
NTSTATUS
wg_muxer_add_stream
(
void
*
args
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
wg_muxer_start
(
void
*
args
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
wg_muxer_push_sample
(
void
*
args
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
wg_muxer_read_data
(
void
*
args
)
DECLSPEC_HIDDEN
;
/* wg_allocator.c */
...
...
dlls/winegstreamer/unixlib.h
View file @
98310d21
...
...
@@ -392,6 +392,14 @@ struct wg_muxer_push_sample_params
UINT32
stream_id
;
};
struct
wg_muxer_read_data_params
{
wg_muxer_t
muxer
;
void
*
buffer
;
UINT32
size
;
UINT64
offset
;
};
enum
unix_funcs
{
unix_wg_init_gstreamer
,
...
...
@@ -437,6 +445,7 @@ enum unix_funcs
unix_wg_muxer_add_stream
,
unix_wg_muxer_start
,
unix_wg_muxer_push_sample
,
unix_wg_muxer_read_data
,
unix_wg_funcs_count
,
};
...
...
dlls/winegstreamer/wg_muxer.c
View file @
98310d21
...
...
@@ -451,3 +451,9 @@ NTSTATUS wg_muxer_push_sample(void *args)
return
STATUS_SUCCESS
;
}
NTSTATUS
wg_muxer_read_data
(
void
*
args
)
{
GST_FIXME
(
"Not implemented."
);
return
STATUS_NOT_IMPLEMENTED
;
}
dlls/winegstreamer/wg_parser.c
View file @
98310d21
...
...
@@ -1921,6 +1921,7 @@ const unixlib_entry_t __wine_unix_call_funcs[] =
X
(
wg_muxer_add_stream
),
X
(
wg_muxer_start
),
X
(
wg_muxer_push_sample
),
X
(
wg_muxer_read_data
),
};
C_ASSERT
(
ARRAYSIZE
(
__wine_unix_call_funcs
)
==
unix_wg_funcs_count
);
...
...
@@ -2181,6 +2182,30 @@ NTSTATUS wow64_wg_muxer_push_sample(void *args)
return
wg_muxer_push_sample
(
&
params
);
}
NTSTATUS
wow64_wg_muxer_read_data
(
void
*
args
)
{
struct
{
wg_muxer_t
muxer
;
PTR32
buffer
;
UINT32
size
;
UINT64
offset
;
}
*
params32
=
args
;
struct
wg_muxer_read_data_params
params
=
{
.
muxer
=
params32
->
muxer
,
.
buffer
=
ULongToPtr
(
params32
->
buffer
),
.
size
=
params32
->
size
,
.
offset
=
params32
->
offset
,
};
NTSTATUS
ret
;
ret
=
wg_muxer_read_data
(
&
params
);
params32
->
size
=
params
.
size
;
params32
->
offset
=
params
.
offset
;
return
ret
;
}
const
unixlib_entry_t
__wine_unix_call_wow64_funcs
[]
=
{
#define X64(name) [unix_ ## name] = wow64_ ## name
...
...
@@ -2227,6 +2252,7 @@ const unixlib_entry_t __wine_unix_call_wow64_funcs[] =
X64
(
wg_muxer_add_stream
),
X
(
wg_muxer_start
),
X64
(
wg_muxer_push_sample
),
X64
(
wg_muxer_read_data
),
};
C_ASSERT
(
ARRAYSIZE
(
__wine_unix_call_wow64_funcs
)
==
unix_wg_funcs_count
);
...
...
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