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
26d95467
Commit
26d95467
authored
Jul 12, 2023
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
amstream: Use nameless unions/structs.
parent
d37cf9b0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
39 deletions
+38
-39
ddrawstream.c
dlls/amstream/ddrawstream.c
+38
-39
No files found.
dlls/amstream/ddrawstream.c
View file @
26d95467
...
...
@@ -18,7 +18,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#define NONAMELESSUNION
#define COBJMACROS
#include "amstream_private.h"
#include "wine/debug.h"
...
...
@@ -123,14 +122,14 @@ static HRESULT process_update(struct ddraw_sample *sample, int stride, BYTE *poi
if
(
FAILED
(
hr
))
return
hr
;
row_size
=
(
sample
->
rect
.
right
-
sample
->
rect
.
left
)
*
desc
.
ddpfPixelFormat
.
u1
.
dwRGBBitCount
/
8
;
row_size
=
(
sample
->
rect
.
right
-
sample
->
rect
.
left
)
*
desc
.
ddpfPixelFormat
.
dwRGBBitCount
/
8
;
src_row
=
pointer
;
dst_row
=
desc
.
lpSurface
;
for
(
row
=
sample
->
rect
.
top
;
row
<
sample
->
rect
.
bottom
;
++
row
)
{
memcpy
(
dst_row
,
src_row
,
row_size
);
src_row
+=
stride
;
dst_row
+=
desc
.
u1
.
lPitch
;
dst_row
+=
desc
.
lPitch
;
}
hr
=
IDirectDrawSurface_Unlock
(
sample
->
surface
,
desc
.
lpSurface
);
...
...
@@ -155,9 +154,9 @@ static BOOL is_format_compatible(struct ddraw_stream *stream,
{
if
(
stream
->
format
.
pf
.
dwFlags
&
DDPF_FOURCC
)
return
FALSE
;
if
(
stream
->
format
.
pf
.
u1
.
dwRGBBitCount
!=
connection_pf
->
u1
.
dwRGBBitCount
)
if
(
stream
->
format
.
pf
.
dwRGBBitCount
!=
connection_pf
->
dwRGBBitCount
)
return
FALSE
;
if
(
stream
->
format
.
pf
.
u1
.
dwRGBBitCount
==
16
&&
stream
->
format
.
pf
.
u3
.
dwGBitMask
!=
connection_pf
->
u3
.
dwGBitMask
)
if
(
stream
->
format
.
pf
.
dwRGBBitCount
==
16
&&
stream
->
format
.
pf
.
dwGBitMask
!=
connection_pf
->
dwGBitMask
)
return
FALSE
;
}
return
TRUE
;
...
...
@@ -551,7 +550,7 @@ static HRESULT WINAPI ddraw_IDirectDrawMediaStream_SetFormat(IDirectDrawMediaStr
TRACE
(
"flags %#lx, pixel format flags %#lx, bit count %lu, size %lux%lu.
\n
"
,
format
->
dwFlags
,
format
->
ddpfPixelFormat
.
dwFlags
,
format
->
ddpfPixelFormat
.
u1
.
dwRGBBitCount
,
format
->
dwWidth
,
format
->
dwHeight
);
format
->
ddpfPixelFormat
.
dwRGBBitCount
,
format
->
dwWidth
,
format
->
dwHeight
);
if
(
format
->
dwFlags
&
DDSD_PIXELFORMAT
)
{
...
...
@@ -560,7 +559,7 @@ static HRESULT WINAPI ddraw_IDirectDrawMediaStream_SetFormat(IDirectDrawMediaStr
if
(
format
->
ddpfPixelFormat
.
dwFlags
&
DDPF_FOURCC
)
{
if
(
!
format
->
ddpfPixelFormat
.
u1
.
dwRGBBitCount
)
if
(
!
format
->
ddpfPixelFormat
.
dwRGBBitCount
)
return
E_INVALIDARG
;
}
else
...
...
@@ -572,7 +571,7 @@ static HRESULT WINAPI ddraw_IDirectDrawMediaStream_SetFormat(IDirectDrawMediaStr
if
(
!
(
format
->
ddpfPixelFormat
.
dwFlags
&
DDPF_RGB
))
return
DDERR_INVALIDSURFACETYPE
;
switch
(
format
->
ddpfPixelFormat
.
u1
.
dwRGBBitCount
)
switch
(
format
->
ddpfPixelFormat
.
dwRGBBitCount
)
{
case
8
:
if
(
!
(
format
->
ddpfPixelFormat
.
dwFlags
&
DDPF_PALETTEINDEXED8
))
...
...
@@ -581,21 +580,21 @@ static HRESULT WINAPI ddraw_IDirectDrawMediaStream_SetFormat(IDirectDrawMediaStr
case
16
:
if
(
format
->
ddpfPixelFormat
.
dwFlags
&
DDPF_PALETTEINDEXED8
)
return
DDERR_INVALIDSURFACETYPE
;
if
((
format
->
ddpfPixelFormat
.
u2
.
dwRBitMask
!=
0x7c00
||
format
->
ddpfPixelFormat
.
u3
.
dwGBitMask
!=
0x03e0
||
format
->
ddpfPixelFormat
.
u4
.
dwBBitMask
!=
0x001f
)
&&
(
format
->
ddpfPixelFormat
.
u2
.
dwRBitMask
!=
0xf800
||
format
->
ddpfPixelFormat
.
u3
.
dwGBitMask
!=
0x07e0
||
format
->
ddpfPixelFormat
.
u4
.
dwBBitMask
!=
0x001f
))
if
((
format
->
ddpfPixelFormat
.
dwRBitMask
!=
0x7c00
||
format
->
ddpfPixelFormat
.
dwGBitMask
!=
0x03e0
||
format
->
ddpfPixelFormat
.
dwBBitMask
!=
0x001f
)
&&
(
format
->
ddpfPixelFormat
.
dwRBitMask
!=
0xf800
||
format
->
ddpfPixelFormat
.
dwGBitMask
!=
0x07e0
||
format
->
ddpfPixelFormat
.
dwBBitMask
!=
0x001f
))
return
DDERR_INVALIDSURFACETYPE
;
break
;
case
24
:
case
32
:
if
(
format
->
ddpfPixelFormat
.
dwFlags
&
DDPF_PALETTEINDEXED8
)
return
DDERR_INVALIDSURFACETYPE
;
if
(
format
->
ddpfPixelFormat
.
u2
.
dwRBitMask
!=
0xff0000
||
format
->
ddpfPixelFormat
.
u3
.
dwGBitMask
!=
0x00ff00
||
format
->
ddpfPixelFormat
.
u4
.
dwBBitMask
!=
0x0000ff
)
if
(
format
->
ddpfPixelFormat
.
dwRBitMask
!=
0xff0000
||
format
->
ddpfPixelFormat
.
dwGBitMask
!=
0x00ff00
||
format
->
ddpfPixelFormat
.
dwBBitMask
!=
0x0000ff
)
return
DDERR_INVALIDSURFACETYPE
;
break
;
default:
...
...
@@ -958,35 +957,35 @@ static HRESULT WINAPI ddraw_sink_ReceiveConnection(IPin *iface, IPin *peer, cons
if
(
IsEqualGUID
(
&
mt
->
subtype
,
&
MEDIASUBTYPE_RGB8
))
{
pf
.
dwFlags
|=
DDPF_PALETTEINDEXED8
;
pf
.
u1
.
dwRGBBitCount
=
8
;
pf
.
dwRGBBitCount
=
8
;
}
else
if
(
IsEqualGUID
(
&
mt
->
subtype
,
&
MEDIASUBTYPE_RGB555
))
{
pf
.
u1
.
dwRGBBitCount
=
16
;
pf
.
u2
.
dwRBitMask
=
0x7c00
;
pf
.
u3
.
dwGBitMask
=
0x03e0
;
pf
.
u4
.
dwBBitMask
=
0x001f
;
pf
.
dwRGBBitCount
=
16
;
pf
.
dwRBitMask
=
0x7c00
;
pf
.
dwGBitMask
=
0x03e0
;
pf
.
dwBBitMask
=
0x001f
;
}
else
if
(
IsEqualGUID
(
&
mt
->
subtype
,
&
MEDIASUBTYPE_RGB565
))
{
pf
.
u1
.
dwRGBBitCount
=
16
;
pf
.
u2
.
dwRBitMask
=
0xf800
;
pf
.
u3
.
dwGBitMask
=
0x07e0
;
pf
.
u4
.
dwBBitMask
=
0x001f
;
pf
.
dwRGBBitCount
=
16
;
pf
.
dwRBitMask
=
0xf800
;
pf
.
dwGBitMask
=
0x07e0
;
pf
.
dwBBitMask
=
0x001f
;
}
else
if
(
IsEqualGUID
(
&
mt
->
subtype
,
&
MEDIASUBTYPE_RGB24
))
{
pf
.
u1
.
dwRGBBitCount
=
24
;
pf
.
u2
.
dwRBitMask
=
0xff0000
;
pf
.
u3
.
dwGBitMask
=
0x00ff00
;
pf
.
u4
.
dwBBitMask
=
0x0000ff
;
pf
.
dwRGBBitCount
=
24
;
pf
.
dwRBitMask
=
0xff0000
;
pf
.
dwGBitMask
=
0x00ff00
;
pf
.
dwBBitMask
=
0x0000ff
;
}
else
if
(
IsEqualGUID
(
&
mt
->
subtype
,
&
MEDIASUBTYPE_RGB32
))
{
pf
.
u1
.
dwRGBBitCount
=
32
;
pf
.
u2
.
dwRBitMask
=
0xff0000
;
pf
.
u3
.
dwGBitMask
=
0x00ff00
;
pf
.
u4
.
dwBBitMask
=
0x0000ff
;
pf
.
dwRGBBitCount
=
32
;
pf
.
dwRBitMask
=
0xff0000
;
pf
.
dwGBitMask
=
0x00ff00
;
pf
.
dwBBitMask
=
0x0000ff
;
}
else
{
...
...
@@ -1776,11 +1775,11 @@ static HRESULT ddrawstreamsample_create(struct ddraw_stream *parent, IDirectDraw
{
desc
.
ddpfPixelFormat
.
dwSize
=
sizeof
(
desc
.
ddpfPixelFormat
);
desc
.
ddpfPixelFormat
.
dwFlags
=
DDPF_RGB
;
desc
.
ddpfPixelFormat
.
u1
.
dwRGBBitCount
=
32
;
desc
.
ddpfPixelFormat
.
u2
.
dwRBitMask
=
0xff0000
;
desc
.
ddpfPixelFormat
.
u3
.
dwGBitMask
=
0x00ff00
;
desc
.
ddpfPixelFormat
.
u4
.
dwBBitMask
=
0x0000ff
;
desc
.
ddpfPixelFormat
.
u5
.
dwRGBAlphaBitMask
=
0
;
desc
.
ddpfPixelFormat
.
dwRGBBitCount
=
32
;
desc
.
ddpfPixelFormat
.
dwRBitMask
=
0xff0000
;
desc
.
ddpfPixelFormat
.
dwGBitMask
=
0x00ff00
;
desc
.
ddpfPixelFormat
.
dwBBitMask
=
0x0000ff
;
desc
.
ddpfPixelFormat
.
dwRGBAlphaBitMask
=
0
;
}
desc
.
ddsCaps
.
dwCaps
=
DDSCAPS_SYSTEMMEMORY
|
DDSCAPS_OFFSCREENPLAIN
;
desc
.
lpSurface
=
NULL
;
...
...
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