Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
f5908390
Commit
f5908390
authored
Mar 26, 2019
by
Nikolay Sivov
Committed by
Alexandre Julliard
Mar 26, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winegstreamer: Use init-once API to initialize library.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
c46bdc94
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
39 deletions
+47
-39
gst_private.h
dlls/winegstreamer/gst_private.h
+1
-1
gstdemux.c
dlls/winegstreamer/gstdemux.c
+1
-1
gsttffilter.c
dlls/winegstreamer/gsttffilter.c
+4
-4
main.c
dlls/winegstreamer/main.c
+41
-33
No files found.
dlls/winegstreamer/gst_private.h
View file @
f5908390
...
...
@@ -43,7 +43,7 @@ IUnknown * CALLBACK Gstreamer_YUV2RGB_create(IUnknown *pUnkOuter, HRESULT *phr);
IUnknown
*
CALLBACK
Gstreamer_YUV2ARGB_create
(
IUnknown
*
pUnkOuter
,
HRESULT
*
phr
);
IUnknown
*
CALLBACK
Gstreamer_Splitter_create
(
IUnknown
*
pUnkOuter
,
HRESULT
*
phr
);
DWORD
Gstreamer_init
(
void
)
;
BOOL
init_gstreamer
(
void
)
DECLSPEC_HIDDEN
;
GstFlowReturn
got_data
(
GstPad
*
pad
,
GstObject
*
parent
,
GstBuffer
*
buf
)
DECLSPEC_HIDDEN
;
GstFlowReturn
request_buffer
(
GstPad
*
pad
,
guint64
ofs
,
guint
size
,
GstCaps
*
caps
,
GstBuffer
**
buf
)
DECLSPEC_HIDDEN
;
...
...
dlls/winegstreamer/gstdemux.c
View file @
f5908390
...
...
@@ -1230,7 +1230,7 @@ IUnknown * CALLBACK Gstreamer_Splitter_create(IUnknown *pUnkOuter, HRESULT *phr)
TRACE
(
"%p %p
\n
"
,
pUnkOuter
,
phr
);
if
(
!
Gstreamer_init
())
if
(
!
init_gstreamer
())
{
*
phr
=
E_FAIL
;
return
NULL
;
...
...
dlls/winegstreamer/gsttffilter.c
View file @
f5908390
...
...
@@ -626,7 +626,7 @@ IUnknown * CALLBACK Gstreamer_Mp3_create(IUnknown *punkouter, HRESULT *phr)
TRACE
(
"%p %p
\n
"
,
punkouter
,
phr
);
if
(
!
Gstreamer_init
())
if
(
!
init_gstreamer
())
{
*
phr
=
E_FAIL
;
return
NULL
;
...
...
@@ -769,7 +769,7 @@ IUnknown * CALLBACK Gstreamer_YUV2RGB_create(IUnknown *punkouter, HRESULT *phr)
TRACE
(
"%p %p
\n
"
,
punkouter
,
phr
);
if
(
!
Gstreamer_init
())
if
(
!
init_gstreamer
())
{
*
phr
=
E_FAIL
;
return
NULL
;
...
...
@@ -871,7 +871,7 @@ IUnknown * CALLBACK Gstreamer_YUV2ARGB_create(IUnknown *punkouter, HRESULT *phr)
TRACE
(
"%p %p
\n
"
,
punkouter
,
phr
);
if
(
!
Gstreamer_init
())
if
(
!
init_gstreamer
())
{
*
phr
=
E_FAIL
;
return
NULL
;
...
...
@@ -1004,7 +1004,7 @@ IUnknown * CALLBACK Gstreamer_AudioConvert_create(IUnknown *punkouter, HRESULT *
TRACE
(
"%p %p
\n
"
,
punkouter
,
phr
);
if
(
!
Gstreamer_init
())
if
(
!
init_gstreamer
())
{
*
phr
=
E_FAIL
;
return
NULL
;
...
...
dlls/winegstreamer/main.c
View file @
f5908390
...
...
@@ -257,41 +257,49 @@ void dump_AM_MEDIA_TYPE(const AM_MEDIA_TYPE * pmt)
TRACE
(
"
\t
%s
\n\t
%s
\n\t
...
\n\t
%s
\n
"
,
debugstr_guid
(
&
pmt
->
majortype
),
debugstr_guid
(
&
pmt
->
subtype
),
debugstr_guid
(
&
pmt
->
formattype
));
}
DWORD
Gstreamer_init
(
void
)
static
BOOL
CALLBACK
init_gstreamer_proc
(
INIT_ONCE
*
once
,
void
*
param
,
void
**
ctx
)
{
static
int
inited
;
if
(
!
inited
)
{
char
argv0
[]
=
"wine"
;
char
argv1
[]
=
"--gst-disable-registry-fork"
;
char
**
argv
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
char
*
)
*
3
);
int
argc
=
2
;
GError
*
err
=
NULL
;
TRACE
(
"initializing
\n
"
);
argv
[
0
]
=
argv0
;
argv
[
1
]
=
argv1
;
argv
[
2
]
=
NULL
;
inited
=
gst_init_check
(
&
argc
,
&
argv
,
&
err
);
HeapFree
(
GetProcessHeap
(),
0
,
argv
);
if
(
err
)
{
ERR
(
"Failed to initialize gstreamer: %s
\n
"
,
err
->
message
);
g_error_free
(
err
);
}
if
(
inited
)
{
HINSTANCE
newhandle
;
/* Unloading glib is a bad idea.. it installs atexit handlers,
* so never unload the dll after loading */
GetModuleHandleExW
(
GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS
,
(
LPCWSTR
)
hInst
,
&
newhandle
);
if
(
!
newhandle
)
ERR
(
"Could not pin module %p
\n
"
,
hInst
);
start_dispatch_thread
();
}
BOOL
*
status
=
param
;
char
argv0
[]
=
"wine"
;
char
argv1
[]
=
"--gst-disable-registry-fork"
;
char
**
argv
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
char
*
)
*
3
);
int
argc
=
2
;
GError
*
err
=
NULL
;
TRACE
(
"initializing
\n
"
);
argv
[
0
]
=
argv0
;
argv
[
1
]
=
argv1
;
argv
[
2
]
=
NULL
;
*
status
=
gst_init_check
(
&
argc
,
&
argv
,
&
err
);
HeapFree
(
GetProcessHeap
(),
0
,
argv
);
if
(
err
)
{
ERR
(
"Failed to initialize gstreamer: %s
\n
"
,
err
->
message
);
g_error_free
(
err
);
}
return
inited
;
if
(
*
status
)
{
HINSTANCE
newhandle
;
/* Unloading glib is a bad idea.. it installs atexit handlers,
* so never unload the dll after loading */
GetModuleHandleExW
(
GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS
,
(
LPCWSTR
)
hInst
,
&
newhandle
);
if
(
!
newhandle
)
ERR
(
"Could not pin module %p
\n
"
,
hInst
);
start_dispatch_thread
();
}
return
TRUE
;
}
BOOL
init_gstreamer
(
void
)
{
static
INIT_ONCE
once
=
INIT_ONCE_STATIC_INIT
;
static
BOOL
status
;
InitOnceExecuteOnce
(
&
once
,
init_gstreamer_proc
,
&
status
,
NULL
);
return
status
;
}
#define INF_SET_ID(id) \
...
...
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