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
799c7704
Commit
799c7704
authored
Nov 02, 2021
by
Zebediah Figura
Committed by
Alexandre Julliard
Nov 02, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winegstreamer: Implement IWMHeaderInfo::GetAttributeByName(L"Duration").
Signed-off-by:
Zebediah Figura
<
zfigura@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
399ccc03
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
172 additions
and
3 deletions
+172
-3
wm_reader.c
dlls/winegstreamer/wm_reader.c
+41
-3
wmvcore.c
dlls/wmvcore/tests/wmvcore.c
+131
-0
No files found.
dlls/winegstreamer/wm_reader.c
View file @
799c7704
...
...
@@ -874,9 +874,47 @@ static HRESULT WINAPI header_info_GetAttributeByIndex(IWMHeaderInfo3 *iface, WOR
static
HRESULT
WINAPI
header_info_GetAttributeByName
(
IWMHeaderInfo3
*
iface
,
WORD
*
stream_number
,
const
WCHAR
*
name
,
WMT_ATTR_DATATYPE
*
type
,
BYTE
*
value
,
WORD
*
size
)
{
FIXME
(
"iface %p, stream_number %p, name %s, type %p, value %p, size %p, stub!
\n
"
,
iface
,
stream_number
,
debugstr_w
(
name
),
type
,
value
,
size
);
return
E_NOTIMPL
;
struct
wm_reader
*
reader
=
impl_from_IWMHeaderInfo3
(
iface
);
const
WORD
req_size
=
*
size
;
TRACE
(
"reader %p, stream_number %p, name %s, type %p, value %p, size %u.
\n
"
,
reader
,
stream_number
,
debugstr_w
(
name
),
type
,
value
,
*
size
);
if
(
!
stream_number
)
return
E_INVALIDARG
;
if
(
!
wcscmp
(
name
,
L"Duration"
))
{
QWORD
duration
;
if
(
*
stream_number
)
{
WARN
(
"Requesting duration for stream %u, returning ASF_E_NOTFOUND.
\n
"
,
*
stream_number
);
return
ASF_E_NOTFOUND
;
}
*
size
=
sizeof
(
QWORD
);
if
(
!
value
)
{
*
type
=
WMT_TYPE_QWORD
;
return
S_OK
;
}
if
(
req_size
<
*
size
)
return
ASF_E_BUFFERTOOSMALL
;
*
type
=
WMT_TYPE_QWORD
;
EnterCriticalSection
(
&
reader
->
cs
);
duration
=
wg_parser_stream_get_duration
(
wg_parser_get_stream
(
reader
->
wg_parser
,
0
));
LeaveCriticalSection
(
&
reader
->
cs
);
TRACE
(
"Returning duration %s.
\n
"
,
debugstr_time
(
duration
));
memcpy
(
value
,
&
duration
,
sizeof
(
QWORD
));
return
S_OK
;
}
else
{
FIXME
(
"Unknown attribute %s.
\n
"
,
debugstr_w
(
name
));
return
ASF_E_NOTFOUND
;
}
}
static
HRESULT
WINAPI
header_info_SetAttribute
(
IWMHeaderInfo3
*
iface
,
WORD
stream_number
,
...
...
dlls/wmvcore/tests/wmvcore.c
View file @
799c7704
...
...
@@ -420,6 +420,135 @@ static const IStreamVtbl stream_vtbl =
stream_Clone
,
};
static
void
test_reader_attributes
(
IWMProfile
*
profile
)
{
WORD
size
,
stream_number
,
ret_stream_number
;
IWMHeaderInfo
*
header_info
;
IWMStreamConfig
*
config
;
WMT_ATTR_DATATYPE
type
;
ULONG
count
,
i
;
QWORD
duration
;
DWORD
dword
;
HRESULT
hr
;
IWMProfile_QueryInterface
(
profile
,
&
IID_IWMHeaderInfo
,
(
void
**
)
&
header_info
);
hr
=
IWMProfile_GetStreamCount
(
profile
,
&
count
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
count
==
2
,
"Got count %u.
\n
"
,
count
);
for
(
i
=
0
;
i
<
count
;
++
i
)
{
hr
=
IWMProfile_GetStream
(
profile
,
i
,
&
config
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IWMStreamConfig_GetStreamNumber
(
config
,
&
stream_number
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ret_stream_number
=
stream_number
;
size
=
sizeof
(
DWORD
);
type
=
0xdeadbeef
;
dword
=
0xdeadbeef
;
hr
=
IWMHeaderInfo_GetAttributeByName
(
header_info
,
&
ret_stream_number
,
L"WM/VideoFrameRate"
,
&
type
,
(
BYTE
*
)
&
dword
,
&
size
);
ok
(
hr
==
ASF_E_NOTFOUND
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
type
==
0xdeadbeef
,
"Got type %#x.
\n
"
,
type
);
ok
(
size
==
sizeof
(
DWORD
),
"Got size %u.
\n
"
,
size
);
ok
(
dword
==
0xdeadbeef
,
"Got frame rate %u.
\n
"
,
dword
);
ok
(
ret_stream_number
==
stream_number
,
"Expected stream number %u, got %u.
\n
"
,
stream_number
,
ret_stream_number
);
size
=
sizeof
(
QWORD
);
type
=
0xdeadbeef
;
duration
=
0xdeadbeef
;
hr
=
IWMHeaderInfo_GetAttributeByName
(
header_info
,
&
ret_stream_number
,
L"Duration"
,
&
type
,
(
BYTE
*
)
&
duration
,
&
size
);
ok
(
hr
==
ASF_E_NOTFOUND
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
type
==
0xdeadbeef
,
"Got type %#x.
\n
"
,
type
);
ok
(
size
==
sizeof
(
QWORD
),
"Got size %u.
\n
"
,
size
);
ok
(
ret_stream_number
==
stream_number
,
"Expected stream number %u, got %u.
\n
"
,
stream_number
,
ret_stream_number
);
IWMStreamConfig_Release
(
config
);
}
/* WM/VideoFrameRate with a NULL stream number. */
size
=
sizeof
(
DWORD
);
type
=
0xdeadbeef
;
dword
=
0xdeadbeef
;
hr
=
IWMHeaderInfo_GetAttributeByName
(
header_info
,
NULL
,
L"WM/VideoFrameRate"
,
&
type
,
(
BYTE
*
)
&
dword
,
&
size
);
ok
(
hr
==
E_INVALIDARG
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
type
==
0xdeadbeef
,
"Got type %#x.
\n
"
,
type
);
ok
(
size
==
sizeof
(
DWORD
),
"Got size %u.
\n
"
,
size
);
ok
(
dword
==
0xdeadbeef
,
"Got frame rate %u.
\n
"
,
dword
);
/* And with a zero stream number. */
stream_number
=
0
;
size
=
sizeof
(
DWORD
);
type
=
0xdeadbeef
;
dword
=
0xdeadbeef
;
hr
=
IWMHeaderInfo_GetAttributeByName
(
header_info
,
&
stream_number
,
L"WM/VideoFrameRate"
,
&
type
,
(
BYTE
*
)
&
dword
,
&
size
);
ok
(
hr
==
ASF_E_NOTFOUND
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
type
==
0xdeadbeef
,
"Got type %#x.
\n
"
,
type
);
ok
(
size
==
sizeof
(
DWORD
),
"Got size %u.
\n
"
,
size
);
ok
(
dword
==
0xdeadbeef
,
"Got frame rate %u.
\n
"
,
dword
);
ok
(
stream_number
==
0
,
"Got stream number %u.
\n
"
,
stream_number
);
/* Duration with a NULL stream number. */
size
=
sizeof
(
QWORD
);
type
=
0xdeadbeef
;
duration
=
0xdeadbeef
;
hr
=
IWMHeaderInfo_GetAttributeByName
(
header_info
,
NULL
,
L"Duration"
,
&
type
,
(
BYTE
*
)
&
duration
,
&
size
);
ok
(
hr
==
E_INVALIDARG
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
type
==
0xdeadbeef
,
"Got type %#x.
\n
"
,
type
);
ok
(
size
==
sizeof
(
QWORD
),
"Got size %u.
\n
"
,
size
);
ok
(
duration
==
0xdeadbeef
,
"Got duration %I64u.
\n
"
,
duration
);
/* And with a zero stream number. */
size
=
sizeof
(
QWORD
);
type
=
0xdeadbeef
;
duration
=
0xdeadbeef
;
hr
=
IWMHeaderInfo_GetAttributeByName
(
header_info
,
&
stream_number
,
L"Duration"
,
&
type
,
(
BYTE
*
)
&
duration
,
&
size
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
type
==
WMT_TYPE_QWORD
,
"Got type %#x.
\n
"
,
type
);
ok
(
size
==
sizeof
(
QWORD
),
"Got size %u.
\n
"
,
size
);
ok
(
duration
==
20460000
,
"Got duration %I64u.
\n
"
,
duration
);
ok
(
stream_number
==
0
,
"Got stream number %u.
\n
"
,
stream_number
);
/* Pass a too-small size. */
size
=
sizeof
(
QWORD
)
-
1
;
type
=
0xdeadbeef
;
duration
=
0xdeadbeef
;
hr
=
IWMHeaderInfo_GetAttributeByName
(
header_info
,
&
stream_number
,
L"Duration"
,
&
type
,
(
BYTE
*
)
&
duration
,
&
size
);
ok
(
hr
==
ASF_E_BUFFERTOOSMALL
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
type
==
0xdeadbeef
,
"Got type %#x.
\n
"
,
type
);
ok
(
size
==
sizeof
(
QWORD
),
"Got size %u.
\n
"
,
size
);
ok
(
duration
==
0xdeadbeef
,
"Got duration %I64u.
\n
"
,
duration
);
ok
(
stream_number
==
0
,
"Got stream number %u.
\n
"
,
stream_number
);
/* Pass a NULL buffer. */
size
=
0xdead
;
type
=
0xdeadbeef
;
hr
=
IWMHeaderInfo_GetAttributeByName
(
header_info
,
&
stream_number
,
L"Duration"
,
&
type
,
NULL
,
&
size
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
type
==
WMT_TYPE_QWORD
,
"Got type %#x.
\n
"
,
type
);
ok
(
size
==
sizeof
(
QWORD
),
"Got size %u.
\n
"
,
size
);
ok
(
stream_number
==
0
,
"Got stream number %u.
\n
"
,
stream_number
);
IWMHeaderInfo_Release
(
header_info
);
}
static
void
test_sync_reader_streaming
(
void
)
{
DWORD
size
,
flags
,
output_number
,
expect_output_number
;
...
...
@@ -596,6 +725,8 @@ static void test_sync_reader_streaming(void)
&
pts
,
&
duration
,
&
flags
,
NULL
,
NULL
);
ok
(
hr
==
NS_E_NO_MORE_SAMPLES
,
"Got hr %#x.
\n
"
,
hr
);
test_reader_attributes
(
profile
);
hr
=
IWMSyncReader_Close
(
reader
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
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