AVPKit
IMediaData.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 IMEDIADATA_H_
21 #define IMEDIADATA_H_
22 
23 #include <com/avpkit/core/AVPKit.h>
24 #include <com/avpkit/ferry/RefCounted.h>
25 #include <com/avpkit/ferry/IBuffer.h>
26 #include <com/avpkit/core/IRational.h>
27 
28 namespace com { namespace avpkit { namespace core {
29 
33 class VS_API_AVPKIT IMediaData: public com::avpkit::ferry::RefCounted
34 {
35 public:
41  virtual int64_t getTimeStamp()=0;
42 
48  virtual void setTimeStamp(int64_t aTimeStamp)=0;
49 
57  virtual IRational* getTimeBase()=0;
58 
64  virtual void setTimeBase(IRational *aBase)=0;
65 
72 
78  virtual int32_t getSize()=0;
79 
85  virtual bool isKey()=0;
86 
87  /*
88  * Added for 3.2
89  */
104  virtual void setData(com::avpkit::ferry::IBuffer* buffer)=0;
105 
106 protected:
107  IMediaData();
108  virtual ~IMediaData();
109 };
110 
111 }}}
112 
113 #endif /* IMEDIADATA_H_ */
The parent class of all media objects than can be gotten from an IStream.
Definition: IMediaData.h:34
virtual void setData(com::avpkit::ferry::IBuffer *buffer)=0
Sets the underlying buffer used by this object.
virtual void setTimeStamp(int64_t aTimeStamp)=0
Set the time stamp for this object in getTimeBase() units.
virtual void setTimeBase(IRational *aBase)=0
Set the time base that time stamps of this object are represented in.
virtual int32_t getSize()=0
Get the size in bytes of the raw data available for this object.
virtual IRational * getTimeBase()=0
Get the time base that time stamps of this object are represented in.
virtual bool isKey()=0
Is this object a key object? i.e.
virtual com::avpkit::ferry::IBuffer * getData()=0
Get any underlying raw data available for this object.
virtual int64_t getTimeStamp()=0
Get the time stamp of this object in getTimeBase() units.
This class wraps represents a Rational number for the AVPKit.
Definition: IRational.h:43
Allows Java code to get data from a native buffers, and optionally modify native memory directly.
Definition: IBuffer.h:54
Parent of all Ferry objects – it mains reference counts in native code.
Definition: RefCounted.h:85
WARNING: Do not use logging in this class, and do not set any static file variables to values other t...