0031501: Foundation Classes, Message_Printer - remove theToPutEndl argument -- use...
[occt.git] / src / Media / Media_BufferPool.hxx
1 // Created by: Kirill GAVRILOV
2 // Copyright (c) 2019 OPEN CASCADE SAS
3 //
4 // This file is part of Open CASCADE Technology software library.
5 //
6 // This library is free software; you can redistribute it and/or modify it under
7 // the terms of the GNU Lesser General Public License version 2.1 as published
8 // by the Free Software Foundation, with special exception defined in the file
9 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
10 // distribution for complete text of the license and disclaimer of any warranty.
11 //
12 // Alternatively, this file may be used under the terms of Open CASCADE
13 // commercial license or contractual agreement.
14
15 #ifndef _Media_BufferPool_HeaderFile
16 #define _Media_BufferPool_HeaderFile
17
18 #include <Standard_Transient.hxx>
19 #include <Standard_Type.hxx>
20
21 struct AVBufferPool;
22 struct AVBufferRef;
23
24 //! AVBufferPool wrapper.
25 class Media_BufferPool : public Standard_Transient
26 {
27   DEFINE_STANDARD_RTTIEXT(Media_BufferPool, Standard_Transient)
28 public:
29
30   //! Empty constructor
31   Standard_EXPORT Media_BufferPool();
32
33   //! Destructor
34   Standard_EXPORT ~Media_BufferPool();
35
36   //! Release the pool (reference-counted buffer will be released when needed).
37   Standard_EXPORT void Release();
38
39   //! (Re-)initialize the pool.
40   Standard_EXPORT bool Init (int theBufferSize);
41
42   //! Return buffer size within the pool.
43   int BufferSize() const { return myBufferSize; }
44
45   //! Get new buffer from the pool.
46   Standard_EXPORT AVBufferRef* GetBuffer();
47
48 private:
49
50   // prevent copies
51   Media_BufferPool           (const Media_BufferPool& theCopy);
52   Media_BufferPool& operator=(const Media_BufferPool& theCopy);
53
54 protected:
55
56   AVBufferPool* myPool;
57   int           myBufferSize;
58
59 };
60
61 #endif // _Media_BufferPool_HeaderFile