AVPKit
IMediaDataWrapper.h
1 /*******************************************************************************
2  * Copyright (c) 2024, 2026, Olivier Ayache. All rights reserved.
3  *
4  * This file is part of AVPKit.
5  *
6  * AVPKit is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU Lesser General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * AVPKit is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with AVPKit. If not, see <http://www.gnu.org/licenses/>.
18  *******************************************************************************/
19 
20 #ifndef IMEDIADATAWRAPPER_H_
21 #define IMEDIADATAWRAPPER_H_
22 
23 #include <com/avpkit/core/AVPKit.h>
24 #include <com/avpkit/core/IMediaData.h>
25 
26 namespace com { namespace avpkit { namespace core {
27 
37 class VS_API_AVPKIT IMediaDataWrapper: public IMediaData
38 {
39 public:
40 #ifndef SWIG
46  virtual IMediaData* get()=0;
47 #endif
53  virtual void wrap(IMediaData* aObj)=0;
54 
62  virtual void setKey(bool aIsKey)=0;
63 
70  static IMediaDataWrapper* make(IMediaData* obj);
71 
72  /*
73  * Added for 1.23
74  */
75 
76 #ifndef SWIG
83  virtual IMediaData* unwrap()=0;
84 #endif
85 
86 protected:
88  virtual ~IMediaDataWrapper();
89 };
90 
91 }}}
92 
93 #endif /* IMEDIADATAWRAPPER_H_ */
This class wraps an IMediaData object, but then allows you to set new TimeStamps and TimeBases.
virtual void setKey(bool aIsKey)=0
Allows you to reset whether the wrapper things this is key or not.
virtual IMediaData * get()=0
Return the object being wrapped.
virtual IMediaData * unwrap()=0
Gets the non IMediaDataWrapper object ultimately wrapped in this wrapper, or null if there isn't one.
virtual void wrap(IMediaData *aObj)=0
Set an object to wrap, or null to release the old object.
The parent class of all media objects than can be gotten from an IStream.
Definition: IMediaData.h:34
WARNING: Do not use logging in this class, and do not set any static file variables to values other t...