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
eab18981
Commit
eab18981
authored
Oct 01, 2021
by
Zebediah Figura
Committed by
Alexandre Julliard
Oct 02, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winegstreamer: Use a single wg_parser_create() entry point.
Signed-off-by:
Zebediah Figura
<
zfigura@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
959bc428
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
51 deletions
+28
-51
gst_private.h
dlls/winegstreamer/gst_private.h
+9
-4
media_source.c
dlls/winegstreamer/media_source.c
+1
-1
quartz_parser.c
dlls/winegstreamer/quartz_parser.c
+4
-4
wg_parser.c
dlls/winegstreamer/wg_parser.c
+14
-42
No files found.
dlls/winegstreamer/gst_private.h
View file @
eab18981
...
...
@@ -149,12 +149,17 @@ struct wg_parser_event
};
C_ASSERT
(
sizeof
(
struct
wg_parser_event
)
==
40
);
enum
wg_parser_type
{
WG_PARSER_DECODEBIN
,
WG_PARSER_AVIDEMUX
,
WG_PARSER_MPEGAUDIOPARSE
,
WG_PARSER_WAVPARSE
,
};
struct
unix_funcs
{
struct
wg_parser
*
(
CDECL
*
wg_decodebin_parser_create
)(
void
);
struct
wg_parser
*
(
CDECL
*
wg_avi_parser_create
)(
void
);
struct
wg_parser
*
(
CDECL
*
wg_mpeg_audio_parser_create
)(
void
);
struct
wg_parser
*
(
CDECL
*
wg_wave_parser_create
)(
void
);
struct
wg_parser
*
(
CDECL
*
wg_parser_create
)(
enum
wg_parser_type
type
);
void
(
CDECL
*
wg_parser_destroy
)(
struct
wg_parser
*
parser
);
HRESULT
(
CDECL
*
wg_parser_connect
)(
struct
wg_parser
*
parser
,
uint64_t
file_size
);
...
...
dlls/winegstreamer/media_source.c
View file @
eab18981
...
...
@@ -1421,7 +1421,7 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_
if
(
FAILED
(
hr
=
MFAllocateWorkQueue
(
&
object
->
async_commands_queue
)))
goto
fail
;
if
(
!
(
parser
=
unix_funcs
->
wg_
decodebin_parser_create
(
)))
if
(
!
(
parser
=
unix_funcs
->
wg_
parser_create
(
WG_PARSER_DECODEBIN
)))
{
hr
=
E_OUTOFMEMORY
;
goto
fail
;
...
...
dlls/winegstreamer/quartz_parser.c
View file @
eab18981
...
...
@@ -1115,7 +1115,7 @@ HRESULT decodebin_parser_create(IUnknown *outer, IUnknown **out)
if
(
!
(
object
=
calloc
(
1
,
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
if
(
!
(
object
->
wg_parser
=
unix_funcs
->
wg_
decodebin_parser_create
(
)))
if
(
!
(
object
->
wg_parser
=
unix_funcs
->
wg_
parser_create
(
WG_PARSER_DECODEBIN
)))
{
free
(
object
);
return
E_OUTOFMEMORY
;
...
...
@@ -1646,7 +1646,7 @@ HRESULT wave_parser_create(IUnknown *outer, IUnknown **out)
if
(
!
(
object
=
calloc
(
1
,
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
if
(
!
(
object
->
wg_parser
=
unix_funcs
->
wg_
wave_parser_create
(
)))
if
(
!
(
object
->
wg_parser
=
unix_funcs
->
wg_
parser_create
(
WG_PARSER_WAVPARSE
)))
{
free
(
object
);
return
E_OUTOFMEMORY
;
...
...
@@ -1732,7 +1732,7 @@ HRESULT avi_splitter_create(IUnknown *outer, IUnknown **out)
if
(
!
(
object
=
calloc
(
1
,
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
if
(
!
(
object
->
wg_parser
=
unix_funcs
->
wg_
avi_parser_create
(
)))
if
(
!
(
object
->
wg_parser
=
unix_funcs
->
wg_
parser_create
(
WG_PARSER_AVIDEMUX
)))
{
free
(
object
);
return
E_OUTOFMEMORY
;
...
...
@@ -1839,7 +1839,7 @@ HRESULT mpeg_splitter_create(IUnknown *outer, IUnknown **out)
if
(
!
(
object
=
calloc
(
1
,
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
if
(
!
(
object
->
wg_parser
=
unix_funcs
->
wg_
mpeg_audio_parser_create
(
)))
if
(
!
(
object
->
wg_parser
=
unix_funcs
->
wg_
parser_create
(
WG_PARSER_MPEGAUDIOPARSE
)))
{
free
(
object
);
return
E_OUTOFMEMORY
;
...
...
dlls/winegstreamer/wg_parser.c
View file @
eab18981
...
...
@@ -49,9 +49,11 @@ typedef enum
GST_DEBUG_CATEGORY_STATIC
(
wine
);
#define GST_CAT_DEFAULT wine
typedef
BOOL
(
*
init_gst_cb
)(
struct
wg_parser
*
parser
);
struct
wg_parser
{
BOOL
(
*
init_gst
)(
struct
wg_parser
*
parser
)
;
init_gst_cb
init_gst
;
struct
wg_parser_stream
**
streams
;
unsigned
int
stream_count
;
...
...
@@ -1844,8 +1846,16 @@ static BOOL wave_parser_init_gst(struct wg_parser *parser)
return
TRUE
;
}
static
struct
wg_parser
*
wg_parser_create
(
void
)
static
struct
wg_parser
*
CDECL
wg_parser_create
(
enum
wg_parser_type
type
)
{
static
const
init_gst_cb
init_funcs
[]
=
{
[
WG_PARSER_DECODEBIN
]
=
decodebin_parser_init_gst
,
[
WG_PARSER_AVIDEMUX
]
=
avi_parser_init_gst
,
[
WG_PARSER_MPEGAUDIOPARSE
]
=
mpeg_audio_parser_init_gst
,
[
WG_PARSER_WAVPARSE
]
=
wave_parser_init_gst
,
};
struct
wg_parser
*
parser
;
if
(
!
(
parser
=
calloc
(
1
,
sizeof
(
*
parser
))))
...
...
@@ -1856,47 +1866,12 @@ static struct wg_parser *wg_parser_create(void)
pthread_cond_init
(
&
parser
->
read_cond
,
NULL
);
pthread_cond_init
(
&
parser
->
read_done_cond
,
NULL
);
parser
->
flushing
=
true
;
parser
->
init_gst
=
init_funcs
[
type
];
GST_DEBUG
(
"Created winegstreamer parser %p.
\n
"
,
parser
);
return
parser
;
}
static
struct
wg_parser
*
CDECL
wg_decodebin_parser_create
(
void
)
{
struct
wg_parser
*
parser
;
if
((
parser
=
wg_parser_create
()))
parser
->
init_gst
=
decodebin_parser_init_gst
;
return
parser
;
}
static
struct
wg_parser
*
CDECL
wg_avi_parser_create
(
void
)
{
struct
wg_parser
*
parser
;
if
((
parser
=
wg_parser_create
()))
parser
->
init_gst
=
avi_parser_init_gst
;
return
parser
;
}
static
struct
wg_parser
*
CDECL
wg_mpeg_audio_parser_create
(
void
)
{
struct
wg_parser
*
parser
;
if
((
parser
=
wg_parser_create
()))
parser
->
init_gst
=
mpeg_audio_parser_init_gst
;
return
parser
;
}
static
struct
wg_parser
*
CDECL
wg_wave_parser_create
(
void
)
{
struct
wg_parser
*
parser
;
if
((
parser
=
wg_parser_create
()))
parser
->
init_gst
=
wave_parser_init_gst
;
return
parser
;
}
static
void
CDECL
wg_parser_destroy
(
struct
wg_parser
*
parser
)
{
if
(
parser
->
bus
)
...
...
@@ -1915,10 +1890,7 @@ static void CDECL wg_parser_destroy(struct wg_parser *parser)
static
const
struct
unix_funcs
funcs
=
{
wg_decodebin_parser_create
,
wg_avi_parser_create
,
wg_mpeg_audio_parser_create
,
wg_wave_parser_create
,
wg_parser_create
,
wg_parser_destroy
,
wg_parser_connect
,
...
...
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