forked from Sascha-L/WPF-MediaKit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSamplePool.h
33 lines (28 loc) · 961 Bytes
/
SamplePool.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
//////////////////////////////////////////////////////////////////////////
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//////////////////////////////////////////////////////////////////////////
#pragma once
// Manages a list of allocated samples.
class SamplePool
{
public:
SamplePool();
virtual ~SamplePool();
HRESULT Initialize(VideoSampleList& samples);
HRESULT Clear();
HRESULT GetSample(IMFSample **ppSample); // Does not block.
HRESULT ReturnSample(IMFSample *pSample);
BOOL AreSamplesPending();
private:
CritSec m_lock;
VideoSampleList m_VideoSampleQueue; // Available queue
BOOL m_bInitialized;
DWORD m_cPending;
};