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
89763f0e
Commit
89763f0e
authored
Nov 25, 2016
by
Nikolay Sivov
Committed by
Alexandre Julliard
Nov 25, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
strmbase: Allocate sample list as a part of queue structure.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
16dead4d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
22 deletions
+15
-22
outputqueue.c
dlls/strmbase/outputqueue.c
+12
-21
strmbase.h
include/wine/strmbase.h
+3
-1
No files found.
dlls/strmbase/outputqueue.c
View file @
89763f0e
...
...
@@ -49,7 +49,7 @@ static DWORD WINAPI OutputQueue_InitialThreadProc(LPVOID data)
static
void
OutputQueue_FreeSamples
(
OutputQueue
*
pOutputQueue
)
{
struct
list
*
cursor
,
*
cursor2
;
LIST_FOR_EACH_SAFE
(
cursor
,
cursor2
,
pOutputQueue
->
SampleList
)
LIST_FOR_EACH_SAFE
(
cursor
,
cursor2
,
&
pOutputQueue
->
SampleList
)
{
QueuedEvent
*
qev
=
LIST_ENTRY
(
cursor
,
QueuedEvent
,
entry
);
list_remove
(
cursor
);
...
...
@@ -86,14 +86,7 @@ HRESULT WINAPI OutputQueue_Construct(
This
->
bBatchExact
=
bBatchExact
;
InitializeCriticalSection
(
&
This
->
csQueue
);
This
->
csQueue
.
DebugInfo
->
Spare
[
0
]
=
(
DWORD_PTR
)(
__FILE__
": OutputQueue.csQueue"
);
This
->
SampleList
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
struct
list
));
if
(
!
This
->
SampleList
)
{
OutputQueue_Destroy
(
This
);
*
ppOutputQueue
=
NULL
;
return
E_OUTOFMEMORY
;
}
list_init
(
This
->
SampleList
);
list_init
(
&
This
->
SampleList
);
This
->
pInputPin
=
pInputPin
;
IPin_AddRef
(
&
pInputPin
->
pin
.
IPin_iface
);
...
...
@@ -130,8 +123,6 @@ HRESULT WINAPI OutputQueue_Destroy(OutputQueue *pOutputQueue)
DeleteCriticalSection
(
&
pOutputQueue
->
csQueue
);
CloseHandle
(
pOutputQueue
->
hProcessQueue
);
HeapFree
(
GetProcessHeap
(),
0
,
pOutputQueue
->
SampleList
);
IPin_Release
(
&
pOutputQueue
->
pInputPin
->
pin
.
IPin_iface
);
HeapFree
(
GetProcessHeap
(),
0
,
pOutputQueue
);
return
S_OK
;
...
...
@@ -168,11 +159,11 @@ HRESULT WINAPI OutputQueue_ReceiveMultiple(OutputQueue *pOutputQueue, IMediaSamp
qev
->
type
=
SAMPLE_PACKET
;
qev
->
pSample
=
ppSamples
[
i
];
IMediaSample_AddRef
(
ppSamples
[
i
]);
list_add_tail
(
pOutputQueue
->
SampleList
,
&
qev
->
entry
);
list_add_tail
(
&
pOutputQueue
->
SampleList
,
&
qev
->
entry
);
(
*
nSamplesProcessed
)
++
;
}
if
(
!
pOutputQueue
->
bBatchExact
||
list_count
(
pOutputQueue
->
SampleList
)
>=
pOutputQueue
->
lBatchSize
)
if
(
!
pOutputQueue
->
bBatchExact
||
list_count
(
&
pOutputQueue
->
SampleList
)
>=
pOutputQueue
->
lBatchSize
)
SetEvent
(
pOutputQueue
->
hProcessQueue
);
LeaveCriticalSection
(
&
pOutputQueue
->
csQueue
);
}
...
...
@@ -190,7 +181,7 @@ VOID WINAPI OutputQueue_SendAnyway(OutputQueue *pOutputQueue)
if
(
pOutputQueue
->
hThread
)
{
EnterCriticalSection
(
&
pOutputQueue
->
csQueue
);
if
(
!
list_empty
(
pOutputQueue
->
SampleList
))
if
(
!
list_empty
(
&
pOutputQueue
->
SampleList
))
{
pOutputQueue
->
bSendAnyway
=
TRUE
;
SetEvent
(
pOutputQueue
->
hProcessQueue
);
...
...
@@ -213,7 +204,7 @@ VOID WINAPI OutputQueue_EOS(OutputQueue *pOutputQueue)
}
qev
->
type
=
EOS_PACKET
;
qev
->
pSample
=
NULL
;
list_add_tail
(
pOutputQueue
->
SampleList
,
&
qev
->
entry
);
list_add_tail
(
&
pOutputQueue
->
SampleList
,
&
qev
->
entry
);
}
else
{
...
...
@@ -235,14 +226,14 @@ DWORD WINAPI OutputQueueImpl_ThreadProc(OutputQueue *pOutputQueue)
do
{
EnterCriticalSection
(
&
pOutputQueue
->
csQueue
);
if
(
!
list_empty
(
pOutputQueue
->
SampleList
)
&&
if
(
!
list_empty
(
&
pOutputQueue
->
SampleList
)
&&
(
!
pOutputQueue
->
bBatchExact
||
list_count
(
pOutputQueue
->
SampleList
)
>=
pOutputQueue
->
lBatchSize
||
list_count
(
&
pOutputQueue
->
SampleList
)
>=
pOutputQueue
->
lBatchSize
||
pOutputQueue
->
bSendAnyway
)
)
{
while
(
!
list_empty
(
pOutputQueue
->
SampleList
))
while
(
!
list_empty
(
&
pOutputQueue
->
SampleList
))
{
IMediaSample
**
ppSamples
;
LONG
nSamples
;
...
...
@@ -251,10 +242,10 @@ DWORD WINAPI OutputQueueImpl_ThreadProc(OutputQueue *pOutputQueue)
int
i
=
0
;
/* First Pass Process Samples */
i
=
list_count
(
pOutputQueue
->
SampleList
);
i
=
list_count
(
&
pOutputQueue
->
SampleList
);
ppSamples
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
IMediaSample
*
)
*
i
);
nSamples
=
0
;
LIST_FOR_EACH_SAFE
(
cursor
,
cursor2
,
pOutputQueue
->
SampleList
)
LIST_FOR_EACH_SAFE
(
cursor
,
cursor2
,
&
pOutputQueue
->
SampleList
)
{
QueuedEvent
*
qev
=
LIST_ENTRY
(
cursor
,
QueuedEvent
,
entry
);
if
(
qev
->
type
==
SAMPLE_PACKET
)
...
...
@@ -278,7 +269,7 @@ DWORD WINAPI OutputQueueImpl_ThreadProc(OutputQueue *pOutputQueue)
HeapFree
(
GetProcessHeap
(),
0
,
ppSamples
);
/* Process Non-Samples */
LIST_FOR_EACH_SAFE
(
cursor
,
cursor2
,
pOutputQueue
->
SampleList
)
LIST_FOR_EACH_SAFE
(
cursor
,
cursor2
,
&
pOutputQueue
->
SampleList
)
{
QueuedEvent
*
qev
=
LIST_ENTRY
(
cursor
,
QueuedEvent
,
entry
);
if
(
qev
->
type
==
EOS_PACKET
)
...
...
include/wine/strmbase.h
View file @
89763f0e
...
...
@@ -19,6 +19,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "wine/list.h"
HRESULT
WINAPI
CopyMediaType
(
AM_MEDIA_TYPE
*
pDest
,
const
AM_MEDIA_TYPE
*
pSrc
);
void
WINAPI
FreeMediaType
(
AM_MEDIA_TYPE
*
pMediaType
);
AM_MEDIA_TYPE
*
WINAPI
CreateMediaType
(
AM_MEDIA_TYPE
const
*
pSrc
);
...
...
@@ -351,7 +353,7 @@ typedef struct tagOutputQueue {
BOOL
bTerminate
;
BOOL
bSendAnyway
;
struct
list
*
SampleList
;
struct
list
SampleList
;
const
struct
OutputQueueFuncTable
*
pFuncsTable
;
}
OutputQueue
;
...
...
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