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
8f3cc76e
Commit
8f3cc76e
authored
Aug 22, 2005
by
Christian Costa
Committed by
Alexandre Julliard
Aug 22, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Return S_OK when committing/decomitting an already
committed/decommitted allocator. Add corresponding test case. Improve traces.
parent
eafa666b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
82 additions
and
10 deletions
+82
-10
memallocator.c
dlls/quartz/memallocator.c
+9
-9
.cvsignore
dlls/quartz/tests/.cvsignore
+1
-0
Makefile.in
dlls/quartz/tests/Makefile.in
+2
-1
memallocator.c
dlls/quartz/tests/memallocator.c
+70
-0
No files found.
dlls/quartz/memallocator.c
View file @
8f3cc76e
...
...
@@ -116,7 +116,7 @@ static HRESULT BaseMemAllocator_Init(HRESULT (* fnAlloc)(IMemAllocator *), HRESU
static
HRESULT
WINAPI
BaseMemAllocator_QueryInterface
(
IMemAllocator
*
iface
,
REFIID
riid
,
LPVOID
*
ppv
)
{
BaseMemAllocator
*
This
=
(
BaseMemAllocator
*
)
iface
;
TRACE
(
"(%
s, %p)
\n
"
,
qzdebugstr_guid
(
riid
),
ppv
);
TRACE
(
"(%
p)->(%s, %p)
\n
"
,
This
,
qzdebugstr_guid
(
riid
),
ppv
);
*
ppv
=
NULL
;
...
...
@@ -170,7 +170,7 @@ static HRESULT WINAPI BaseMemAllocator_SetProperties(IMemAllocator * iface, ALLO
BaseMemAllocator
*
This
=
(
BaseMemAllocator
*
)
iface
;
HRESULT
hr
;
TRACE
(
"(%p
, %p)
\n
"
,
pRequest
,
pActual
);
TRACE
(
"(%p
)->(%p, %p)
\n
"
,
This
,
pRequest
,
pActual
);
EnterCriticalSection
(
&
This
->
csState
);
{
...
...
@@ -207,7 +207,7 @@ static HRESULT WINAPI BaseMemAllocator_GetProperties(IMemAllocator * iface, ALLO
BaseMemAllocator
*
This
=
(
BaseMemAllocator
*
)
iface
;
HRESULT
hr
=
S_OK
;
TRACE
(
"(%p)
\n
"
,
pProps
);
TRACE
(
"(%p)
->(%p)
\n
"
,
This
,
pProps
);
EnterCriticalSection
(
&
This
->
csState
);
{
...
...
@@ -232,14 +232,14 @@ static HRESULT WINAPI BaseMemAllocator_Commit(IMemAllocator * iface)
BaseMemAllocator
*
This
=
(
BaseMemAllocator
*
)
iface
;
HRESULT
hr
;
TRACE
(
"(
)
\n
"
);
TRACE
(
"(
%p)->()
\n
"
,
This
);
EnterCriticalSection
(
&
This
->
csState
);
{
if
(
!
This
->
pProps
)
hr
=
VFW_E_SIZENOTSET
;
else
if
(
This
->
bCommitted
)
hr
=
VFW_E_ALREADY_COMMITTED
;
hr
=
S_OK
;
else
if
(
This
->
bDecommitQueued
)
{
This
->
bDecommitQueued
=
FALSE
;
...
...
@@ -272,12 +272,12 @@ static HRESULT WINAPI BaseMemAllocator_Decommit(IMemAllocator * iface)
BaseMemAllocator
*
This
=
(
BaseMemAllocator
*
)
iface
;
HRESULT
hr
;
TRACE
(
"(
)
\n
"
);
TRACE
(
"(
%p)->()
\n
"
,
This
);
EnterCriticalSection
(
&
This
->
csState
);
{
if
(
!
This
->
bCommitted
)
hr
=
VFW_E_NOT_COMMITTED
;
hr
=
S_OK
;
else
{
if
(
!
list_empty
(
&
This
->
used_list
))
...
...
@@ -315,7 +315,7 @@ static HRESULT WINAPI BaseMemAllocator_GetBuffer(IMemAllocator * iface, IMediaSa
/* NOTE: The pStartTime and pEndTime parameters are not applied to the sample.
* The allocator might use these values to determine which buffer it retrieves */
TRACE
(
"(%p
, %p, %p, %lx)
\n
"
,
pSample
,
pStartTime
,
pEndTime
,
dwFlags
);
TRACE
(
"(%p
)->(%p, %p, %p, %lx)
\n
"
,
This
,
pSample
,
pStartTime
,
pEndTime
,
dwFlags
);
*
pSample
=
NULL
;
...
...
@@ -360,7 +360,7 @@ static HRESULT WINAPI BaseMemAllocator_ReleaseBuffer(IMemAllocator * iface, IMed
StdMediaSample2
*
pStdSample
=
(
StdMediaSample2
*
)
pSample
;
HRESULT
hr
=
S_OK
;
TRACE
(
"(%p)
\n
"
,
pSample
);
TRACE
(
"(%p)
->(%p)
\n
"
,
This
,
pSample
);
/* FIXME: make sure that sample is currently on the used list */
...
...
dlls/quartz/tests/.cvsignore
View file @
8f3cc76e
Makefile
filtergraph.ok
memallocator.ok
testlist.c
dlls/quartz/tests/Makefile.in
View file @
8f3cc76e
...
...
@@ -7,7 +7,8 @@ IMPORTS = ole32 user32 gdi32 kernel32
EXTRALIBS
=
-lstrmiids
CTESTS
=
\
filtergraph.c
filtergraph.c
\
memallocator.c
@MAKE_TEST_RULES@
...
...
dlls/quartz/tests/memallocator.c
0 → 100644
View file @
8f3cc76e
/*
* Unit tests for Direct Show functions
*
* Copyright (C) 2005 Christian Costa
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <assert.h>
#define COBJMACROS
#include "wine/test.h"
#include "uuids.h"
#include "dshow.h"
#include "control.h"
static
void
CommitDecommitTest
()
{
IMemAllocator
*
pMemAllocator
;
HRESULT
hr
;
hr
=
CoCreateInstance
(
&
CLSID_MemoryAllocator
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IMemAllocator
,
(
LPVOID
*
)
&
pMemAllocator
);
ok
(
hr
==
S_OK
,
"Unable to create memory allocator %lx
\n
"
,
hr
);
if
(
hr
==
S_OK
)
{
ALLOCATOR_PROPERTIES
RequestedProps
;
ALLOCATOR_PROPERTIES
ActualProps
;
RequestedProps
.
cBuffers
=
1
;
RequestedProps
.
cbBuffer
=
65536
;
RequestedProps
.
cbAlign
=
1
;
RequestedProps
.
cbPrefix
=
0
;
hr
=
IMemAllocator_SetProperties
(
pMemAllocator
,
&
RequestedProps
,
&
ActualProps
);
ok
(
hr
==
S_OK
,
"SetProperties returned: %lx
\n
"
,
hr
);
hr
=
IMemAllocator_Commit
(
pMemAllocator
);
ok
(
hr
==
S_OK
,
"Commit returned: %lx
\n
"
,
hr
);
hr
=
IMemAllocator_Commit
(
pMemAllocator
);
ok
(
hr
==
S_OK
,
"Commit returned: %lx
\n
"
,
hr
);
hr
=
IMemAllocator_Decommit
(
pMemAllocator
);
ok
(
hr
==
S_OK
,
"Decommit returned: %lx
\n
"
,
hr
);
hr
=
IMemAllocator_Decommit
(
pMemAllocator
);
ok
(
hr
==
S_OK
,
"Cecommit returned: %lx
\n
"
,
hr
);
IMemAllocator_Release
(
pMemAllocator
);
}
}
START_TEST
(
memallocator
)
{
CoInitialize
(
NULL
);
CommitDecommitTest
();
}
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