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
ba3e3d0c
Commit
ba3e3d0c
authored
Sep 14, 2022
by
Rémi Bernon
Committed by
Alexandre Julliard
Oct 13, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winegstreamer: Create wg_sample from IMFSample within of wg_transform_read_mf.
parent
4845d46d
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
39 additions
and
85 deletions
+39
-85
color_convert.c
dlls/winegstreamer/color_convert.c
+2
-14
gst_private.h
dlls/winegstreamer/gst_private.h
+2
-2
h264_decoder.c
dlls/winegstreamer/h264_decoder.c
+2
-14
resampler.c
dlls/winegstreamer/resampler.c
+2
-15
video_processor.c
dlls/winegstreamer/video_processor.c
+2
-14
wg_sample.c
dlls/winegstreamer/wg_sample.c
+27
-11
wma_decoder.c
dlls/winegstreamer/wma_decoder.c
+2
-15
No files found.
dlls/winegstreamer/color_convert.c
View file @
ba3e3d0c
...
...
@@ -545,7 +545,6 @@ static HRESULT WINAPI transform_ProcessOutput(IMFTransform *iface, DWORD flags,
{
struct
color_convert
*
impl
=
impl_from_IMFTransform
(
iface
);
MFT_OUTPUT_STREAM_INFO
info
;
struct
wg_sample
*
wg_sample
;
HRESULT
hr
;
TRACE
(
"iface %p, flags %#lx, count %lu, samples %p, status %p.
\n
"
,
iface
,
flags
,
count
,
samples
,
status
);
...
...
@@ -563,21 +562,10 @@ static HRESULT WINAPI transform_ProcessOutput(IMFTransform *iface, DWORD flags,
if
(
FAILED
(
hr
=
IMFTransform_GetOutputStreamInfo
(
iface
,
0
,
&
info
)))
return
hr
;
if
(
FAILED
(
hr
=
wg_sample_create_mf
(
samples
[
0
].
pSample
,
&
wg_sample
)))
return
hr
;
if
(
wg_sample
->
max_size
<
info
.
cbSize
)
{
wg_sample_release
(
wg_sample
);
return
MF_E_BUFFERTOOSMALL
;
}
if
(
SUCCEEDED
(
hr
=
wg_transform_read_mf
(
impl
->
wg_transform
,
wg_sample
,
NULL
,
&
samples
[
0
].
dwStatus
)))
if
(
SUCCEEDED
(
hr
=
wg_transform_read_mf
(
impl
->
wg_transform
,
samples
->
pSample
,
info
.
cbSize
,
NULL
,
&
samples
->
dwStatus
)))
wg_sample_queue_flush
(
impl
->
wg_sample_queue
,
false
);
wg_sample_release
(
wg_sample
);
return
hr
;
}
...
...
dlls/winegstreamer/gst_private.h
View file @
ba3e3d0c
...
...
@@ -134,8 +134,8 @@ HRESULT wg_transform_push_mf(struct wg_transform *transform, IMFSample *sample,
struct
wg_sample_queue
*
queue
);
HRESULT
wg_transform_push_quartz
(
struct
wg_transform
*
transform
,
struct
wg_sample
*
sample
,
struct
wg_sample_queue
*
queue
);
HRESULT
wg_transform_read_mf
(
struct
wg_transform
*
transform
,
struct
wg_s
ample
*
sample
,
struct
wg_format
*
format
,
DWORD
*
flags
);
HRESULT
wg_transform_read_mf
(
struct
wg_transform
*
transform
,
IMFS
ample
*
sample
,
DWORD
sample_size
,
struct
wg_format
*
format
,
DWORD
*
flags
);
HRESULT
wg_transform_read_quartz
(
struct
wg_transform
*
transform
,
struct
wg_sample
*
sample
);
HRESULT
winegstreamer_stream_handler_create
(
REFIID
riid
,
void
**
obj
);
...
...
dlls/winegstreamer/h264_decoder.c
View file @
ba3e3d0c
...
...
@@ -592,7 +592,6 @@ static HRESULT WINAPI transform_ProcessOutput(IMFTransform *iface, DWORD flags,
MFT_OUTPUT_DATA_BUFFER
*
samples
,
DWORD
*
status
)
{
struct
h264_decoder
*
decoder
=
impl_from_IMFTransform
(
iface
);
struct
wg_sample
*
wg_sample
;
struct
wg_format
wg_format
;
UINT32
sample_size
;
UINT64
frame_rate
;
...
...
@@ -617,21 +616,10 @@ static HRESULT WINAPI transform_ProcessOutput(IMFTransform *iface, DWORD flags,
decoder
->
wg_format
.
u
.
video
.
height
,
&
sample_size
)))
return
hr
;
if
(
FAILED
(
hr
=
wg_sample_create_mf
(
samples
[
0
].
pSample
,
&
wg_sample
)))
return
hr
;
if
(
wg_sample
->
max_size
<
sample_size
)
{
wg_sample_release
(
wg_sample
);
return
MF_E_BUFFERTOOSMALL
;
}
if
(
SUCCEEDED
(
hr
=
wg_transform_read_mf
(
decoder
->
wg_transform
,
wg_sample
,
&
wg_format
,
&
samples
[
0
].
dwStatus
)))
if
(
SUCCEEDED
(
hr
=
wg_transform_read_mf
(
decoder
->
wg_transform
,
samples
->
pSample
,
sample_size
,
&
wg_format
,
&
samples
->
dwStatus
)))
wg_sample_queue_flush
(
decoder
->
wg_sample_queue
,
false
);
wg_sample_release
(
wg_sample
);
if
(
hr
==
MF_E_TRANSFORM_STREAM_CHANGE
)
{
decoder
->
wg_format
=
wg_format
;
...
...
dlls/winegstreamer/resampler.c
View file @
ba3e3d0c
...
...
@@ -526,7 +526,6 @@ static HRESULT WINAPI transform_ProcessOutput(IMFTransform *iface, DWORD flags,
{
struct
resampler
*
impl
=
impl_from_IMFTransform
(
iface
);
MFT_OUTPUT_STREAM_INFO
info
;
struct
wg_sample
*
wg_sample
;
HRESULT
hr
;
TRACE
(
"iface %p, flags %#lx, count %lu, samples %p, status %p.
\n
"
,
iface
,
flags
,
count
,
samples
,
status
);
...
...
@@ -547,22 +546,10 @@ static HRESULT WINAPI transform_ProcessOutput(IMFTransform *iface, DWORD flags,
if
(
FAILED
(
hr
=
IMFTransform_GetOutputStreamInfo
(
iface
,
0
,
&
info
)))
return
hr
;
if
(
FAILED
(
hr
=
wg_sample_create_mf
(
samples
[
0
].
pSample
,
&
wg_sample
)))
return
hr
;
wg_sample
->
size
=
0
;
if
(
wg_sample
->
max_size
<
info
.
cbSize
)
{
wg_sample_release
(
wg_sample
);
return
MF_E_BUFFERTOOSMALL
;
}
if
(
SUCCEEDED
(
hr
=
wg_transform_read_mf
(
impl
->
wg_transform
,
wg_sample
,
NULL
,
&
samples
[
0
].
dwStatus
)))
if
(
SUCCEEDED
(
hr
=
wg_transform_read_mf
(
impl
->
wg_transform
,
samples
->
pSample
,
info
.
cbSize
,
NULL
,
&
samples
->
dwStatus
)))
wg_sample_queue_flush
(
impl
->
wg_sample_queue
,
false
);
wg_sample_release
(
wg_sample
);
return
hr
;
}
...
...
dlls/winegstreamer/video_processor.c
View file @
ba3e3d0c
...
...
@@ -526,7 +526,6 @@ static HRESULT WINAPI video_processor_ProcessOutput(IMFTransform *iface, DWORD f
{
struct
video_processor
*
impl
=
impl_from_IMFTransform
(
iface
);
MFT_OUTPUT_STREAM_INFO
info
;
struct
wg_sample
*
wg_sample
;
HRESULT
hr
;
TRACE
(
"iface %p, flags %#lx, count %lu, samples %p, status %p.
\n
"
,
iface
,
flags
,
count
,
samples
,
status
);
...
...
@@ -544,21 +543,10 @@ static HRESULT WINAPI video_processor_ProcessOutput(IMFTransform *iface, DWORD f
if
(
FAILED
(
hr
=
IMFTransform_GetOutputStreamInfo
(
iface
,
0
,
&
info
)))
return
hr
;
if
(
FAILED
(
hr
=
wg_sample_create_mf
(
samples
[
0
].
pSample
,
&
wg_sample
)))
return
hr
;
if
(
wg_sample
->
max_size
<
info
.
cbSize
)
{
wg_sample_release
(
wg_sample
);
return
MF_E_BUFFERTOOSMALL
;
}
if
(
SUCCEEDED
(
hr
=
wg_transform_read_mf
(
impl
->
wg_transform
,
wg_sample
,
NULL
,
&
samples
[
0
].
dwStatus
)))
if
(
SUCCEEDED
(
hr
=
wg_transform_read_mf
(
impl
->
wg_transform
,
samples
->
pSample
,
info
.
cbSize
,
NULL
,
&
samples
->
dwStatus
)))
wg_sample_queue_flush
(
impl
->
wg_sample_queue
,
false
);
wg_sample_release
(
wg_sample
);
return
hr
;
}
...
...
dlls/winegstreamer/wg_sample.c
View file @
ba3e3d0c
...
...
@@ -285,34 +285,50 @@ HRESULT wg_transform_push_mf(struct wg_transform *transform, IMFSample *sample,
return
hr
;
}
HRESULT
wg_transform_read_mf
(
struct
wg_transform
*
transform
,
struct
wg_sample
*
wg_
sample
,
struct
wg_format
*
format
,
DWORD
*
flags
)
HRESULT
wg_transform_read_mf
(
struct
wg_transform
*
transform
,
IMFSample
*
sample
,
DWORD
sample_size
,
struct
wg_format
*
format
,
DWORD
*
flags
)
{
struct
sample
*
sample
=
unsafe_mf_from_wg_sample
(
wg_sample
);
struct
wg_sample
*
wg_sample
;
IMFMediaBuffer
*
buffer
;
HRESULT
hr
;
TRACE_
(
mfplat
)(
"transform %p, wg_sample %p, format %p, flags %p.
\n
"
,
transform
,
wg_sample
,
format
,
flags
);
TRACE_
(
mfplat
)(
"transform %p, sample %p, format %p, flags %p.
\n
"
,
transform
,
sample
,
format
,
flags
);
if
(
FAILED
(
hr
=
wg_sample_create_mf
(
sample
,
&
wg_sample
)))
return
hr
;
wg_sample
->
size
=
0
;
if
(
wg_sample
->
max_size
<
sample_size
)
{
wg_sample_release
(
wg_sample
);
return
MF_E_BUFFERTOOSMALL
;
}
if
(
FAILED
(
hr
=
wg_transform_read_data
(
transform
,
wg_sample
,
format
)))
{
if
(
hr
==
MF_E_TRANSFORM_STREAM_CHANGE
&&
!
format
)
FIXME
(
"Unexpected stream format change!
\n
"
);
wg_sample_release
(
wg_sample
);
return
hr
;
}
if
(
FAILED
(
hr
=
IMFMediaBuffer_SetCurrentLength
(
sample
->
u
.
mf
.
buffer
,
wg_sample
->
size
)))
return
hr
;
if
(
wg_sample
->
flags
&
WG_SAMPLE_FLAG_INCOMPLETE
)
*
flags
|=
MFT_OUTPUT_DATA_BUFFER_INCOMPLETE
;
if
(
wg_sample
->
flags
&
WG_SAMPLE_FLAG_HAS_PTS
)
IMFSample_SetSampleTime
(
sample
->
u
.
mf
.
sample
,
wg_sample
->
pts
);
IMFSample_SetSampleTime
(
sample
,
wg_sample
->
pts
);
if
(
wg_sample
->
flags
&
WG_SAMPLE_FLAG_HAS_DURATION
)
IMFSample_SetSampleDuration
(
sample
->
u
.
mf
.
sample
,
wg_sample
->
duration
);
IMFSample_SetSampleDuration
(
sample
,
wg_sample
->
duration
);
if
(
wg_sample
->
flags
&
WG_SAMPLE_FLAG_SYNC_POINT
)
IMFSample_SetUINT32
(
sample
->
u
.
mf
.
sample
,
&
MFSampleExtension_CleanPoint
,
1
);
IMFSample_SetUINT32
(
sample
,
&
MFSampleExtension_CleanPoint
,
1
);
return
S_OK
;
if
(
SUCCEEDED
(
hr
=
IMFSample_ConvertToContiguousBuffer
(
sample
,
&
buffer
)))
{
hr
=
IMFMediaBuffer_SetCurrentLength
(
buffer
,
wg_sample
->
size
);
IMFMediaBuffer_Release
(
buffer
);
}
wg_sample_release
(
wg_sample
);
return
hr
;
}
HRESULT
wg_transform_push_quartz
(
struct
wg_transform
*
transform
,
struct
wg_sample
*
wg_sample
,
...
...
dlls/winegstreamer/wma_decoder.c
View file @
ba3e3d0c
...
...
@@ -548,7 +548,6 @@ static HRESULT WINAPI transform_ProcessOutput(IMFTransform *iface, DWORD flags,
{
struct
wma_decoder
*
decoder
=
impl_from_IMFTransform
(
iface
);
MFT_OUTPUT_STREAM_INFO
info
;
struct
wg_sample
*
wg_sample
;
HRESULT
hr
;
TRACE
(
"iface %p, flags %#lx, count %lu, samples %p, status %p.
\n
"
,
iface
,
flags
,
count
,
samples
,
status
);
...
...
@@ -569,22 +568,10 @@ static HRESULT WINAPI transform_ProcessOutput(IMFTransform *iface, DWORD flags,
if
(
FAILED
(
hr
=
IMFTransform_GetOutputStreamInfo
(
iface
,
0
,
&
info
)))
return
hr
;
if
(
FAILED
(
hr
=
wg_sample_create_mf
(
samples
[
0
].
pSample
,
&
wg_sample
)))
return
hr
;
wg_sample
->
size
=
0
;
if
(
wg_sample
->
max_size
<
info
.
cbSize
)
{
wg_sample_release
(
wg_sample
);
return
MF_E_BUFFERTOOSMALL
;
}
if
(
SUCCEEDED
(
hr
=
wg_transform_read_mf
(
decoder
->
wg_transform
,
wg_sample
,
NULL
,
&
samples
[
0
].
dwStatus
)))
if
(
SUCCEEDED
(
hr
=
wg_transform_read_mf
(
decoder
->
wg_transform
,
samples
->
pSample
,
info
.
cbSize
,
NULL
,
&
samples
->
dwStatus
)))
wg_sample_queue_flush
(
decoder
->
wg_sample_queue
,
false
);
wg_sample_release
(
wg_sample
);
return
hr
;
}
...
...
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