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
8ad97c1c
Commit
8ad97c1c
authored
Apr 02, 2024
by
Rémi Bernon
Committed by
Alexandre Julliard
Apr 29, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mf/session: Introduce new (allocate|release)_output_samples helpers.
parent
acfa237c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
28 deletions
+41
-28
session.c
dlls/mf/session.c
+41
-28
No files found.
dlls/mf/session.c
View file @
8ad97c1c
...
@@ -3172,45 +3172,59 @@ static HRESULT transform_get_external_output_sample(const struct media_session *
...
@@ -3172,45 +3172,59 @@ static HRESULT transform_get_external_output_sample(const struct media_session *
return
hr
;
return
hr
;
}
}
static
HRESULT
transform_node_pull_samples
(
const
struct
media_session
*
session
,
struct
topo_node
*
node
)
static
HRESULT
allocate_output_samples
(
const
struct
media_session
*
session
,
struct
topo_node
*
node
,
MFT_OUTPUT_DATA_BUFFER
*
buffers
)
{
{
MFT_OUTPUT_STREAM_INFO
stream_info
;
HRESULT
hr
;
MFT_OUTPUT_DATA_BUFFER
*
buffers
;
UINT
i
;
HRESULT
hr
=
E_UNEXPECTED
;
DWORD
status
=
0
;
unsigned
int
i
;
if
(
!
(
buffers
=
calloc
(
node
->
u
.
transform
.
output_count
,
sizeof
(
*
buffers
))))
return
E_OUTOFMEMORY
;
for
(
i
=
0
;
i
<
node
->
u
.
transform
.
output_count
;
++
i
)
for
(
i
=
0
;
i
<
node
->
u
.
transform
.
output_count
;
++
i
)
{
{
MFT_OUTPUT_STREAM_INFO
stream_info
=
{
0
};
buffers
[
i
].
dwStreamID
=
transform_node_get_stream_id
(
node
,
TRUE
,
i
);
buffers
[
i
].
dwStreamID
=
transform_node_get_stream_id
(
node
,
TRUE
,
i
);
buffers
[
i
].
pSample
=
NULL
;
buffers
[
i
].
dwStatus
=
0
;
buffers
[
i
].
pEvents
=
NULL
;
memset
(
&
stream_info
,
0
,
sizeof
(
stream_info
));
if
(
FAILED
(
hr
=
IMFTransform_GetOutputStreamInfo
(
node
->
object
.
transform
,
buffers
[
i
].
dwStreamID
,
&
stream_info
)))
if
(
FAILED
(
hr
=
IMFTransform_GetOutputStreamInfo
(
node
->
object
.
transform
,
buffers
[
i
].
dwStreamID
,
&
stream_info
)))
break
;
return
hr
;
if
(
!
(
stream_info
.
dwFlags
&
(
MFT_OUTPUT_STREAM_PROVIDES_SAMPLES
|
MFT_OUTPUT_STREAM_CAN_PROVIDE_SAMPLES
))
if
(
!
(
stream_info
.
dwFlags
&
(
MFT_OUTPUT_STREAM_PROVIDES_SAMPLES
|
MFT_OUTPUT_STREAM_CAN_PROVIDE_SAMPLES
)))
&&
FAILED
(
hr
=
transform_get_external_output_sample
(
session
,
node
,
i
,
&
stream_info
,
&
buffers
[
i
].
pSample
)))
{
return
hr
;
if
(
FAILED
(
hr
=
transform_get_external_output_sample
(
session
,
node
,
i
,
&
stream_info
,
&
buffers
[
i
].
pSample
)))
break
;
}
}
}
if
(
SUCCEEDED
(
hr
))
return
S_OK
;
hr
=
IMFTransform_ProcessOutput
(
node
->
object
.
transform
,
0
,
node
->
u
.
transform
.
output_count
,
buffers
,
&
status
);
}
static
void
release_output_samples
(
struct
topo_node
*
node
,
MFT_OUTPUT_DATA_BUFFER
*
buffers
)
{
UINT
i
;
/* Collect returned samples for all streams. */
for
(
i
=
0
;
i
<
node
->
u
.
transform
.
output_count
;
++
i
)
for
(
i
=
0
;
i
<
node
->
u
.
transform
.
output_count
;
++
i
)
{
{
struct
transform_stream
*
stream
=
&
node
->
u
.
transform
.
outputs
[
i
];
if
(
buffers
[
i
].
pSample
)
IMFSample_Release
(
buffers
[
i
].
pSample
);
if
(
buffers
[
i
].
pEvents
)
if
(
buffers
[
i
].
pEvents
)
IMFCollection_Release
(
buffers
[
i
].
pEvents
);
IMFCollection_Release
(
buffers
[
i
].
pEvents
);
}
}
static
HRESULT
transform_node_pull_samples
(
const
struct
media_session
*
session
,
struct
topo_node
*
node
)
{
MFT_OUTPUT_DATA_BUFFER
*
buffers
;
DWORD
status
;
HRESULT
hr
;
UINT
i
;
if
(
!
(
buffers
=
calloc
(
node
->
u
.
transform
.
output_count
,
sizeof
(
*
buffers
))))
return
E_OUTOFMEMORY
;
if
(
FAILED
(
hr
=
allocate_output_samples
(
session
,
node
,
buffers
)))
goto
done
;
status
=
0
;
hr
=
IMFTransform_ProcessOutput
(
node
->
object
.
transform
,
0
,
node
->
u
.
transform
.
output_count
,
buffers
,
&
status
);
for
(
i
=
0
;
i
<
node
->
u
.
transform
.
output_count
;
++
i
)
{
struct
transform_stream
*
stream
=
&
node
->
u
.
transform
.
outputs
[
i
];
if
(
SUCCEEDED
(
hr
)
&&
!
(
buffers
[
i
].
dwStatus
&
MFT_OUTPUT_DATA_BUFFER_NO_SAMPLE
))
if
(
SUCCEEDED
(
hr
)
&&
!
(
buffers
[
i
].
dwStatus
&
MFT_OUTPUT_DATA_BUFFER_NO_SAMPLE
))
{
{
...
@@ -3219,11 +3233,10 @@ static HRESULT transform_node_pull_samples(const struct media_session *session,
...
@@ -3219,11 +3233,10 @@ static HRESULT transform_node_pull_samples(const struct media_session *session,
if
(
FAILED
(
hr
=
transform_stream_push_sample
(
stream
,
buffers
[
i
].
pSample
)))
if
(
FAILED
(
hr
=
transform_stream_push_sample
(
stream
,
buffers
[
i
].
pSample
)))
WARN
(
"Failed to queue output sample, hr %#lx
\n
"
,
hr
);
WARN
(
"Failed to queue output sample, hr %#lx
\n
"
,
hr
);
}
}
if
(
buffers
[
i
].
pSample
)
IMFSample_Release
(
buffers
[
i
].
pSample
);
}
}
done:
release_output_samples
(
node
,
buffers
);
free
(
buffers
);
free
(
buffers
);
return
hr
;
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