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
ed06707b
Commit
ed06707b
authored
Jun 23, 2015
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jun 24, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
amstream: Create a surface if it wasn't provided in CreateSample().
parent
91e4394c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
4 deletions
+48
-4
mediastream.c
dlls/amstream/mediastream.c
+35
-2
amstream.c
dlls/amstream/tests/amstream.c
+13
-2
No files found.
dlls/amstream/mediastream.c
View file @
ed06707b
...
...
@@ -364,6 +364,7 @@ static HRESULT WINAPI DirectDrawMediaStreamImpl_IDirectDrawMediaStream_GetDirect
HRESULT
hr
=
DirectDrawCreateEx
(
NULL
,
(
void
**
)
&
This
->
ddraw
,
&
IID_IDirectDraw7
,
NULL
);
if
(
FAILED
(
hr
))
return
hr
;
IDirectDraw7_SetCooperativeLevel
(
This
->
ddraw
,
NULL
,
DDSCL_NORMAL
);
}
return
IDirectDraw7_QueryInterface
(
This
->
ddraw
,
&
IID_IDirectDraw
,
(
void
**
)
ddraw
);
...
...
@@ -979,7 +980,39 @@ static HRESULT ddrawstreamsample_create(IDirectDrawMediaStream *parent, IDirectD
IDirectDrawSurface_AddRef
(
surface
);
}
else
FIXME
(
"create ddraw surface
\n
"
);
{
DDSURFACEDESC
desc
;
IDirectDraw
*
ddraw
;
hr
=
IDirectDrawMediaStream_GetDirectDraw
(
parent
,
&
ddraw
);
if
(
FAILED
(
hr
))
{
IDirectDrawStreamSample_Release
(
&
object
->
IDirectDrawStreamSample_iface
);
return
hr
;
}
desc
.
dwSize
=
sizeof
(
desc
);
desc
.
dwFlags
=
DDSD_CAPS
|
DDSD_HEIGHT
|
DDSD_WIDTH
|
DDSD_PIXELFORMAT
;
desc
.
dwHeight
=
100
;
desc
.
dwWidth
=
100
;
desc
.
ddpfPixelFormat
.
dwSize
=
sizeof
(
desc
.
ddpfPixelFormat
);
desc
.
ddpfPixelFormat
.
dwFlags
=
DDPF_RGB
;
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
;
hr
=
IDirectDraw_CreateSurface
(
ddraw
,
&
desc
,
&
object
->
surface
,
NULL
);
IDirectDraw_Release
(
ddraw
);
if
(
FAILED
(
hr
))
{
ERR
(
"failed to create surface, 0x%08x
\n
"
,
hr
);
IDirectDrawStreamSample_Release
(
&
object
->
IDirectDrawStreamSample_iface
);
return
hr
;
}
}
if
(
rect
)
object
->
rect
=
*
rect
;
...
...
@@ -995,7 +1028,7 @@ static HRESULT ddrawstreamsample_create(IDirectDrawMediaStream *parent, IDirectD
}
}
*
ddraw_stream_sample
=
(
IDirectDrawStreamSample
*
)
&
object
->
IDirectDrawStreamSample_iface
;
*
ddraw_stream_sample
=
&
object
->
IDirectDrawStreamSample_iface
;
return
S_OK
;
}
...
...
dlls/amstream/tests/amstream.c
View file @
ed06707b
...
...
@@ -452,11 +452,13 @@ static void test_media_streams(void)
static
void
test_IDirectDrawStreamSample
(
void
)
{
DDSURFACEDESC
desc
=
{
sizeof
(
desc
)
};
IAMMultiMediaStream
*
pams
;
HRESULT
hr
;
IMediaStream
*
pvidstream
=
NULL
;
IDirectDrawMediaStream
*
pddstream
=
NULL
;
IDirectDrawStreamSample
*
pddsample
=
NULL
;
IDirectDrawSurface7
*
surface7
;
IDirectDrawSurface
*
surface
,
*
surface2
;
IDirectDraw
*
ddraw
,
*
ddraw2
;
IDirectDraw7
*
ddraw7
;
...
...
@@ -504,9 +506,18 @@ static void test_IDirectDrawStreamSample(void)
surface
=
NULL
;
hr
=
IDirectDrawStreamSample_GetSurface
(
pddsample
,
&
surface
,
&
rect
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
todo_wine
ok
(
surface
!=
NULL
,
"got %p
\n
"
,
surface
);
if
(
surface
)
hr
=
IDirectDrawSurface_QueryInterface
(
surface
,
&
IID_IDirectDrawSurface7
,
(
void
**
)
&
surface7
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
IDirectDrawSurface7_Release
(
surface7
);
hr
=
IDirectDrawSurface_GetSurfaceDesc
(
surface
,
&
desc
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
desc
.
dwWidth
==
100
,
"width %d
\n
"
,
desc
.
dwWidth
);
ok
(
desc
.
dwHeight
==
100
,
"height %d
\n
"
,
desc
.
dwHeight
);
ok
(
desc
.
ddpfPixelFormat
.
dwFlags
==
DDPF_RGB
,
"format flags %08x
\n
"
,
desc
.
ddpfPixelFormat
.
dwFlags
);
ok
(
desc
.
ddpfPixelFormat
.
dwRGBBitCount
,
"dwRGBBitCount %d
\n
"
,
desc
.
ddpfPixelFormat
.
dwRGBBitCount
);
IDirectDrawSurface_Release
(
surface
);
IDirectDrawStreamSample_Release
(
pddsample
);
...
...
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