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
62068a4d
Commit
62068a4d
authored
Jan 31, 2023
by
Paul Gofman
Committed by
Alexandre Julliard
Feb 07, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winegstreamer: Implement _GetInputStatus() for aac decoder transform.
parent
1e3d4a1d
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
77 additions
and
2 deletions
+77
-2
transform.c
dlls/mf/tests/transform.c
+28
-0
aac_decoder.c
dlls/winegstreamer/aac_decoder.c
+14
-2
gst_private.h
dlls/winegstreamer/gst_private.h
+1
-0
main.c
dlls/winegstreamer/main.c
+16
-0
unix_private.h
dlls/winegstreamer/unix_private.h
+1
-0
unixlib.h
dlls/winegstreamer/unixlib.h
+7
-0
wg_parser.c
dlls/winegstreamer/wg_parser.c
+1
-0
wg_transform.c
dlls/winegstreamer/wg_transform.c
+9
-0
No files found.
dlls/mf/tests/transform.c
View file @
62068a4d
...
@@ -2373,6 +2373,7 @@ static void test_aac_decoder(void)
...
@@ -2373,6 +2373,7 @@ static void test_aac_decoder(void)
IMFMediaType
*
media_type
;
IMFMediaType
*
media_type
;
IMFTransform
*
transform
;
IMFTransform
*
transform
;
const
BYTE
*
aacenc_data
;
const
BYTE
*
aacenc_data
;
DWORD
flags
;
HRESULT
hr
;
HRESULT
hr
;
hr
=
CoInitialize
(
NULL
);
hr
=
CoInitialize
(
NULL
);
...
@@ -2452,10 +2453,23 @@ static void test_aac_decoder(void)
...
@@ -2452,10 +2453,23 @@ static void test_aac_decoder(void)
ok
(
aacenc_data_len
==
24861
,
"got length %lu
\n
"
,
aacenc_data_len
);
ok
(
aacenc_data_len
==
24861
,
"got length %lu
\n
"
,
aacenc_data_len
);
input_sample
=
create_sample
(
aacenc_data
+
sizeof
(
DWORD
),
*
(
DWORD
*
)
aacenc_data
);
input_sample
=
create_sample
(
aacenc_data
+
sizeof
(
DWORD
),
*
(
DWORD
*
)
aacenc_data
);
flags
=
0
;
hr
=
IMFTransform_GetInputStatus
(
transform
,
0
,
&
flags
);
ok
(
hr
==
S_OK
,
"Got %#lx
\n
"
,
hr
);
ok
(
flags
==
MFT_INPUT_STATUS_ACCEPT_DATA
,
"Got flags %#lx.
\n
"
,
flags
);
hr
=
IMFTransform_ProcessInput
(
transform
,
0
,
input_sample
,
0
);
hr
=
IMFTransform_ProcessInput
(
transform
,
0
,
input_sample
,
0
);
ok
(
hr
==
S_OK
,
"ProcessInput returned %#lx
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"ProcessInput returned %#lx
\n
"
,
hr
);
flags
=
0xdeadbeef
;
hr
=
IMFTransform_GetInputStatus
(
transform
,
0
,
&
flags
);
ok
(
hr
==
S_OK
,
"Got %#lx
\n
"
,
hr
);
ok
(
!
flags
,
"Got flags %#lx.
\n
"
,
flags
);
hr
=
IMFTransform_ProcessInput
(
transform
,
0
,
input_sample
,
0
);
hr
=
IMFTransform_ProcessInput
(
transform
,
0
,
input_sample
,
0
);
ok
(
hr
==
MF_E_NOTACCEPTING
,
"ProcessInput returned %#lx
\n
"
,
hr
);
ok
(
hr
==
MF_E_NOTACCEPTING
,
"ProcessInput returned %#lx
\n
"
,
hr
);
flags
=
0xdeadbeef
;
hr
=
IMFTransform_GetInputStatus
(
transform
,
0
,
&
flags
);
ok
(
hr
==
S_OK
,
"Got %#lx
\n
"
,
hr
);
ok
(
!
flags
,
"Got flags %#lx.
\n
"
,
flags
);
/* As output_info.dwFlags doesn't have MFT_OUTPUT_STREAM_CAN_PROVIDE_SAMPLES
/* As output_info.dwFlags doesn't have MFT_OUTPUT_STREAM_CAN_PROVIDE_SAMPLES
* IMFTransform_ProcessOutput needs a sample or returns MF_E_TRANSFORM_NEED_MORE_INPUT */
* IMFTransform_ProcessOutput needs a sample or returns MF_E_TRANSFORM_NEED_MORE_INPUT */
...
@@ -2463,11 +2477,19 @@ static void test_aac_decoder(void)
...
@@ -2463,11 +2477,19 @@ static void test_aac_decoder(void)
hr
=
check_mft_process_output
(
transform
,
NULL
,
&
output_status
);
hr
=
check_mft_process_output
(
transform
,
NULL
,
&
output_status
);
ok
(
hr
==
E_INVALIDARG
,
"ProcessOutput returned %#lx
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"ProcessOutput returned %#lx
\n
"
,
hr
);
ok
(
output_status
==
0
,
"got output[0].dwStatus %#lx
\n
"
,
output_status
);
ok
(
output_status
==
0
,
"got output[0].dwStatus %#lx
\n
"
,
output_status
);
flags
=
0xdeadbeef
;
hr
=
IMFTransform_GetInputStatus
(
transform
,
0
,
&
flags
);
ok
(
hr
==
S_OK
,
"Got %#lx
\n
"
,
hr
);
ok
(
!
flags
,
"Got flags %#lx.
\n
"
,
flags
);
hr
=
IMFTransform_ProcessInput
(
transform
,
0
,
input_sample
,
0
);
hr
=
IMFTransform_ProcessInput
(
transform
,
0
,
input_sample
,
0
);
ok
(
hr
==
MF_E_NOTACCEPTING
,
"ProcessInput returned %#lx
\n
"
,
hr
);
ok
(
hr
==
MF_E_NOTACCEPTING
,
"ProcessInput returned %#lx
\n
"
,
hr
);
hr
=
IMFTransform_ProcessMessage
(
transform
,
MFT_MESSAGE_COMMAND_DRAIN
,
0
);
hr
=
IMFTransform_ProcessMessage
(
transform
,
MFT_MESSAGE_COMMAND_DRAIN
,
0
);
ok
(
hr
==
S_OK
,
"ProcessMessage returned %#lx
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"ProcessMessage returned %#lx
\n
"
,
hr
);
flags
=
0xdeadbeef
;
hr
=
IMFTransform_GetInputStatus
(
transform
,
0
,
&
flags
);
ok
(
hr
==
S_OK
,
"Got %#lx
\n
"
,
hr
);
ok
(
!
flags
,
"Got flags %#lx.
\n
"
,
flags
);
hr
=
IMFTransform_ProcessInput
(
transform
,
0
,
input_sample
,
0
);
hr
=
IMFTransform_ProcessInput
(
transform
,
0
,
input_sample
,
0
);
ok
(
hr
==
MF_E_NOTACCEPTING
,
"ProcessInput returned %#lx
\n
"
,
hr
);
ok
(
hr
==
MF_E_NOTACCEPTING
,
"ProcessInput returned %#lx
\n
"
,
hr
);
...
@@ -2487,6 +2509,12 @@ static void test_aac_decoder(void)
...
@@ -2487,6 +2509,12 @@ static void test_aac_decoder(void)
winetest_pop_context
();
winetest_pop_context
();
}
}
ok
(
hr
==
MF_E_TRANSFORM_NEED_MORE_INPUT
,
"ProcessOutput returned %#lx
\n
"
,
hr
);
ok
(
hr
==
MF_E_TRANSFORM_NEED_MORE_INPUT
,
"ProcessOutput returned %#lx
\n
"
,
hr
);
flags
=
0
;
hr
=
IMFTransform_GetInputStatus
(
transform
,
0
,
&
flags
);
ok
(
hr
==
S_OK
,
"Got %#lx
\n
"
,
hr
);
ok
(
flags
==
MFT_INPUT_STATUS_ACCEPT_DATA
,
"Got flags %#lx.
\n
"
,
flags
);
ok
(
output_status
==
MFT_OUTPUT_DATA_BUFFER_NO_SAMPLE
,
"got output[0].dwStatus %#lx
\n
"
,
output_status
);
ok
(
output_status
==
MFT_OUTPUT_DATA_BUFFER_NO_SAMPLE
,
"got output[0].dwStatus %#lx
\n
"
,
output_status
);
ret
=
IMFSample_Release
(
output_sample
);
ret
=
IMFSample_Release
(
output_sample
);
ok
(
ret
==
0
,
"Release returned %lu
\n
"
,
ret
);
ok
(
ret
==
0
,
"Release returned %lu
\n
"
,
ret
);
...
...
dlls/winegstreamer/aac_decoder.c
View file @
62068a4d
...
@@ -500,8 +500,20 @@ static HRESULT WINAPI transform_GetOutputCurrentType(IMFTransform *iface, DWORD
...
@@ -500,8 +500,20 @@ static HRESULT WINAPI transform_GetOutputCurrentType(IMFTransform *iface, DWORD
static
HRESULT
WINAPI
transform_GetInputStatus
(
IMFTransform
*
iface
,
DWORD
id
,
DWORD
*
flags
)
static
HRESULT
WINAPI
transform_GetInputStatus
(
IMFTransform
*
iface
,
DWORD
id
,
DWORD
*
flags
)
{
{
FIXME
(
"iface %p, id %#lx, flags %p stub!
\n
"
,
iface
,
id
,
flags
);
struct
aac_decoder
*
decoder
=
impl_from_IMFTransform
(
iface
);
return
E_NOTIMPL
;
bool
accepts_input
;
HRESULT
hr
;
TRACE
(
"iface %p, id %#lx, flags %p.
\n
"
,
iface
,
id
,
flags
);
if
(
!
decoder
->
wg_transform
)
return
MF_E_TRANSFORM_TYPE_NOT_SET
;
if
(
FAILED
(
hr
=
wg_transform_get_status
(
decoder
->
wg_transform
,
&
accepts_input
)))
return
hr
;
*
flags
=
accepts_input
?
MFT_INPUT_STATUS_ACCEPT_DATA
:
0
;
return
S_OK
;
}
}
static
HRESULT
WINAPI
transform_GetOutputStatus
(
IMFTransform
*
iface
,
DWORD
*
flags
)
static
HRESULT
WINAPI
transform_GetOutputStatus
(
IMFTransform
*
iface
,
DWORD
*
flags
)
...
...
dlls/winegstreamer/gst_private.h
View file @
62068a4d
...
@@ -104,6 +104,7 @@ struct wg_transform *wg_transform_create(const struct wg_format *input_format,
...
@@ -104,6 +104,7 @@ struct wg_transform *wg_transform_create(const struct wg_format *input_format,
const
struct
wg_format
*
output_format
);
const
struct
wg_format
*
output_format
);
void
wg_transform_destroy
(
struct
wg_transform
*
transform
);
void
wg_transform_destroy
(
struct
wg_transform
*
transform
);
bool
wg_transform_set_output_format
(
struct
wg_transform
*
transform
,
struct
wg_format
*
format
);
bool
wg_transform_set_output_format
(
struct
wg_transform
*
transform
,
struct
wg_format
*
format
);
bool
wg_transform_get_status
(
struct
wg_transform
*
transform
,
bool
*
accepts_input
);
unsigned
int
wg_format_get_max_size
(
const
struct
wg_format
*
format
);
unsigned
int
wg_format_get_max_size
(
const
struct
wg_format
*
format
);
...
...
dlls/winegstreamer/main.c
View file @
62068a4d
...
@@ -384,6 +384,22 @@ HRESULT wg_transform_read_data(struct wg_transform *transform, struct wg_sample
...
@@ -384,6 +384,22 @@ HRESULT wg_transform_read_data(struct wg_transform *transform, struct wg_sample
return
params
.
result
;
return
params
.
result
;
}
}
bool
wg_transform_get_status
(
struct
wg_transform
*
transform
,
bool
*
accepts_input
)
{
struct
wg_transform_get_status_params
params
=
{
.
transform
=
transform
,
};
TRACE
(
"transform %p, accepts_input %p.
\n
"
,
transform
,
accepts_input
);
if
(
WINE_UNIX_CALL
(
unix_wg_transform_get_status
,
&
params
))
return
false
;
*
accepts_input
=
params
.
accepts_input
;
return
true
;
}
bool
wg_transform_set_output_format
(
struct
wg_transform
*
transform
,
struct
wg_format
*
format
)
bool
wg_transform_set_output_format
(
struct
wg_transform
*
transform
,
struct
wg_format
*
format
)
{
{
struct
wg_transform_set_output_format_params
params
=
struct
wg_transform_set_output_format_params
params
=
...
...
dlls/winegstreamer/unix_private.h
View file @
62068a4d
...
@@ -37,6 +37,7 @@ extern NTSTATUS wg_transform_destroy(void *args) DECLSPEC_HIDDEN;
...
@@ -37,6 +37,7 @@ extern NTSTATUS wg_transform_destroy(void *args) DECLSPEC_HIDDEN;
extern
NTSTATUS
wg_transform_set_output_format
(
void
*
args
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
wg_transform_set_output_format
(
void
*
args
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
wg_transform_push_data
(
void
*
args
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
wg_transform_push_data
(
void
*
args
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
wg_transform_read_data
(
void
*
args
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
wg_transform_read_data
(
void
*
args
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
wg_transform_get_status
(
void
*
args
)
DECLSPEC_HIDDEN
;
/* wg_allocator_release_sample can be used to release any sample that was requested. */
/* wg_allocator_release_sample can be used to release any sample that was requested. */
typedef
struct
wg_sample
*
(
*
wg_allocator_request_sample_cb
)(
gsize
size
,
void
*
context
);
typedef
struct
wg_sample
*
(
*
wg_allocator_request_sample_cb
)(
gsize
size
,
void
*
context
);
...
...
dlls/winegstreamer/unixlib.h
View file @
62068a4d
...
@@ -310,6 +310,12 @@ struct wg_transform_set_output_format_params
...
@@ -310,6 +310,12 @@ struct wg_transform_set_output_format_params
const
struct
wg_format
*
format
;
const
struct
wg_format
*
format
;
};
};
struct
wg_transform_get_status_params
{
struct
wg_transform
*
transform
;
UINT32
accepts_input
;
};
enum
unix_funcs
enum
unix_funcs
{
{
unix_wg_parser_create
,
unix_wg_parser_create
,
...
@@ -343,6 +349,7 @@ enum unix_funcs
...
@@ -343,6 +349,7 @@ enum unix_funcs
unix_wg_transform_push_data
,
unix_wg_transform_push_data
,
unix_wg_transform_read_data
,
unix_wg_transform_read_data
,
unix_wg_transform_get_status
,
};
};
#endif
/* __WINE_WINEGSTREAMER_UNIXLIB_H */
#endif
/* __WINE_WINEGSTREAMER_UNIXLIB_H */
dlls/winegstreamer/wg_parser.c
View file @
62068a4d
...
@@ -1815,4 +1815,5 @@ const unixlib_entry_t __wine_unix_call_funcs[] =
...
@@ -1815,4 +1815,5 @@ const unixlib_entry_t __wine_unix_call_funcs[] =
X
(
wg_transform_push_data
),
X
(
wg_transform_push_data
),
X
(
wg_transform_read_data
),
X
(
wg_transform_read_data
),
X
(
wg_transform_get_status
),
};
};
dlls/winegstreamer/wg_transform.c
View file @
62068a4d
...
@@ -931,3 +931,12 @@ NTSTATUS wg_transform_read_data(void *args)
...
@@ -931,3 +931,12 @@ NTSTATUS wg_transform_read_data(void *args)
wg_allocator_release_sample
(
transform
->
allocator
,
sample
,
discard_data
);
wg_allocator_release_sample
(
transform
->
allocator
,
sample
,
discard_data
);
return
STATUS_SUCCESS
;
return
STATUS_SUCCESS
;
}
}
NTSTATUS
wg_transform_get_status
(
void
*
args
)
{
struct
wg_transform_get_status_params
*
params
=
args
;
struct
wg_transform
*
transform
=
params
->
transform
;
params
->
accepts_input
=
gst_atomic_queue_length
(
transform
->
input_queue
)
<
transform
->
input_max_length
;
return
STATUS_SUCCESS
;
}
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