1 // Created by: Kirill GAVRILOV
2 // Copyright (c) 2019 OPEN CASCADE SAS
4 // This file is part of Open CASCADE Technology software library.
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.
12 // Alternatively, this file may be used under the terms of Open CASCADE
13 // commercial license or contractual agreement.
15 #ifndef _Media_BufferPool_HeaderFile
16 #define _Media_BufferPool_HeaderFile
18 #include <Standard_Transient.hxx>
19 #include <Standard_Type.hxx>
24 //! AVBufferPool wrapper.
25 class Media_BufferPool : public Standard_Transient
27 DEFINE_STANDARD_RTTIEXT(Media_BufferPool, Standard_Transient)
31 Standard_EXPORT Media_BufferPool();
34 Standard_EXPORT ~Media_BufferPool();
36 //! Release the pool (reference-counted buffer will be released when needed).
37 Standard_EXPORT void Release();
39 //! (Re-)initialize the pool.
40 Standard_EXPORT bool Init (int theBufferSize);
42 //! Return buffer size within the pool.
43 int BufferSize() const { return myBufferSize; }
45 //! Get new buffer from the pool.
46 Standard_EXPORT AVBufferRef* GetBuffer();
51 Media_BufferPool (const Media_BufferPool& theCopy);
52 Media_BufferPool& operator=(const Media_BufferPool& theCopy);
61 #endif // _Media_BufferPool_HeaderFile