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
c90a36e3
Commit
c90a36e3
authored
Feb 13, 2020
by
Zebediah Figura
Committed by
Alexandre Julliard
Feb 16, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winegstreamer: Read samples synchronously in push_data().
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
5c057693
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
72 deletions
+23
-72
gst_cbs.c
dlls/winegstreamer/gst_cbs.c
+0
-9
gst_cbs.h
dlls/winegstreamer/gst_cbs.h
+0
-5
gstdemux.c
dlls/winegstreamer/gstdemux.c
+23
-58
No files found.
dlls/winegstreamer/gst_cbs.c
View file @
c90a36e3
...
...
@@ -227,15 +227,6 @@ void unknown_type_wrapper(GstElement *bin, GstPad *pad, GstCaps *caps, gpointer
call_cb
(
&
cbdata
);
}
void
release_sample_wrapper
(
gpointer
data
)
{
struct
cb_data
cbdata
=
{
RELEASE_SAMPLE
};
cbdata
.
u
.
release_sample_data
.
data
=
data
;
call_cb
(
&
cbdata
);
}
gboolean
query_sink_wrapper
(
GstPad
*
pad
,
GstObject
*
parent
,
GstQuery
*
query
)
{
struct
cb_data
cbdata
=
{
QUERY_SINK
};
...
...
dlls/winegstreamer/gst_cbs.h
View file @
c90a36e3
...
...
@@ -42,7 +42,6 @@ enum CB_TYPE {
REMOVED_DECODED_PAD
,
AUTOPLUG_BLACKLIST
,
UNKNOWN_TYPE
,
RELEASE_SAMPLE
,
QUERY_SINK
};
...
...
@@ -122,9 +121,6 @@ struct cb_data {
GstCaps
*
caps
;
gpointer
user
;
}
unknown_type_data
;
struct
release_sample_data
{
gpointer
data
;
}
release_sample_data
;
struct
query_sink_data
{
GstPad
*
pad
;
GstObject
*
parent
;
...
...
@@ -159,7 +155,6 @@ GstFlowReturn got_data_wrapper(GstPad *pad, GstObject *parent, GstBuffer *buf) D
void
removed_decoded_pad_wrapper
(
GstElement
*
bin
,
GstPad
*
pad
,
gpointer
user
)
DECLSPEC_HIDDEN
;
GstAutoplugSelectResult
autoplug_blacklist_wrapper
(
GstElement
*
bin
,
GstPad
*
pad
,
GstCaps
*
caps
,
GstElementFactory
*
fact
,
gpointer
user
)
DECLSPEC_HIDDEN
;
void
unknown_type_wrapper
(
GstElement
*
bin
,
GstPad
*
pad
,
GstCaps
*
caps
,
gpointer
user
)
DECLSPEC_HIDDEN
;
void
release_sample_wrapper
(
gpointer
data
)
DECLSPEC_HIDDEN
;
void
Gstreamer_transform_pad_added_wrapper
(
GstElement
*
filter
,
GstPad
*
pad
,
gpointer
user
)
DECLSPEC_HIDDEN
;
gboolean
query_sink_wrapper
(
GstPad
*
pad
,
GstObject
*
parent
,
GstQuery
*
query
)
DECLSPEC_HIDDEN
;
...
...
dlls/winegstreamer/gstdemux.c
View file @
c90a36e3
...
...
@@ -97,8 +97,6 @@ static inline struct gstdemux *impl_from_strmbase_filter(struct strmbase_filter
return
CONTAINING_RECORD
(
iface
,
struct
gstdemux
,
filter
);
}
static
const
char
*
media_quark_string
=
"media-sample"
;
static
const
WCHAR
wcsInputPinName
[]
=
{
'i'
,
'n'
,
'p'
,
'u'
,
't'
,
' '
,
'p'
,
'i'
,
'n'
,
0
};
static
const
IMediaSeekingVtbl
GST_Seeking_Vtbl
;
static
const
IQualityControlVtbl
GSTOutPin_QualityControl_Vtbl
;
...
...
@@ -744,21 +742,20 @@ static gboolean event_sink(GstPad *pad, GstObject *parent, GstEvent *event)
}
}
static
void
release_sample
(
void
*
data
)
{
ULONG
ret
;
ret
=
IMediaSample_Release
((
IMediaSample
*
)
data
);
TRACE
(
"Releasing %p returns %u
\n
"
,
data
,
ret
);
}
static
DWORD
CALLBACK
push_data
(
LPVOID
iface
)
{
LONGLONG
maxlen
,
curlen
;
struct
gstdemux
*
This
=
iface
;
IMediaSample
*
buf
;
DWORD_PTR
us
er
;
GstMapInfo
mapping
;
GstBuffer
*
buff
er
;
HRESULT
hr
;
if
(
!
(
buffer
=
gst_buffer_new_allocate
(
NULL
,
16384
,
NULL
)))
{
ERR
(
"Failed to allocate memory.
\n
"
);
return
0
;
}
IBaseFilter_AddRef
(
&
This
->
filter
.
IBaseFilter_iface
);
if
(
!
This
->
stop
)
...
...
@@ -768,51 +765,30 @@ static DWORD CALLBACK push_data(LPVOID iface)
TRACE
(
"Starting..
\n
"
);
for
(;;)
{
REFERENCE_TIME
tStart
,
tStop
;
ULONG
len
;
GstBuffer
*
gstbuf
;
gsize
bufsize
;
BYTE
*
data
;
int
ret
;
hr
=
IMemAllocator_GetBuffer
(
This
->
alloc
,
&
buf
,
NULL
,
NULL
,
0
);
if
(
FAILED
(
hr
))
break
;
if
(
This
->
nextofs
>=
maxlen
)
break
;
len
=
IMediaSample_GetSize
(
buf
);
if
(
This
->
nextofs
+
len
>
maxlen
)
len
=
maxlen
-
This
->
nextofs
;
tStart
=
MEDIATIME_FROM_BYTES
(
This
->
nextofs
);
tStop
=
tStart
+
MEDIATIME_FROM_BYTES
(
len
);
IMediaSample_SetTime
(
buf
,
&
tStart
,
&
tStop
);
len
=
min
(
16384
,
maxlen
-
This
->
nextofs
);
hr
=
IAsyncReader_Request
(
This
->
reader
,
buf
,
0
);
if
(
FAILED
(
hr
))
{
IMediaSample_Release
(
buf
);
if
(
!
gst_buffer_map_range
(
buffer
,
-
1
,
len
,
&
mapping
,
GST_MAP_WRITE
))
{
ERR
(
"Failed to map buffer.
\n
"
);
break
;
}
This
->
nextofs
+=
len
;
hr
=
IAsyncReader_WaitForNext
(
This
->
reader
,
-
1
,
&
buf
,
&
user
);
if
(
FAILED
(
hr
)
||
!
buf
)
{
if
(
buf
)
IMediaSample_Release
(
buf
);
hr
=
IAsyncReader_SyncRead
(
This
->
reader
,
This
->
nextofs
,
len
,
mapping
.
data
)
;
gst_buffer_unmap
(
buffer
,
&
mapping
);
if
(
hr
!=
S_OK
)
{
ERR
(
"Failed to read data, hr %#x.
\n
"
,
hr
);
break
;
}
IMediaSample_GetPointer
(
buf
,
&
data
);
bufsize
=
IMediaSample_GetActualDataLength
(
buf
);
gstbuf
=
gst_buffer_new_wrapped_full
(
0
,
data
,
bufsize
,
0
,
bufsize
,
buf
,
release_sample_wrapper
);
IMediaSample_AddRef
(
buf
);
gst_mini_object_set_qdata
(
GST_MINI_OBJECT
(
gstbuf
),
g_quark_from_static_string
(
media_quark_string
),
buf
,
release_sample_wrapper
);
if
(
!
gstbuf
)
{
IMediaSample_Release
(
buf
);
break
;
}
gstbuf
->
duration
=
gstbuf
->
pts
=
-
1
;
ret
=
gst_pad_push
(
This
->
my_src
,
gstbuf
);
This
->
nextofs
+=
len
;
buffer
->
duration
=
buffer
->
pts
=
-
1
;
ret
=
gst_pad_push
(
This
->
my_src
,
buffer
);
if
(
ret
>=
0
)
hr
=
S_OK
;
else
...
...
@@ -825,14 +801,9 @@ static DWORD CALLBACK push_data(LPVOID iface)
break
;
}
gst_
pad_push_event
(
This
->
my_src
,
gst_event_new_eos
()
);
gst_
buffer_unref
(
buffer
);
TRACE
(
"Almost stopping.. %08x
\n
"
,
hr
);
do
{
IAsyncReader_WaitForNext
(
This
->
reader
,
0
,
&
buf
,
&
user
);
if
(
buf
)
IMediaSample_Release
(
buf
);
}
while
(
buf
);
gst_pad_push_event
(
This
->
my_src
,
gst_event_new_eos
());
TRACE
(
"Stopping.. %08x
\n
"
,
hr
);
...
...
@@ -2332,12 +2303,6 @@ void CALLBACK perform_cb(TP_CALLBACK_INSTANCE *instance, void *user)
unknown_type
(
data
->
bin
,
data
->
pad
,
data
->
caps
,
data
->
user
);
break
;
}
case
RELEASE_SAMPLE
:
{
struct
release_sample_data
*
data
=
&
cbdata
->
u
.
release_sample_data
;
release_sample
(
data
->
data
);
break
;
}
case
QUERY_SINK
:
{
struct
query_sink_data
*
data
=
&
cbdata
->
u
.
query_sink_data
;
...
...
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