xref: /OK3568_Linux_fs/external/rockit/tgi/sdk/include/RTVideoPacket.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /*
2  * Copyright 2021 Rockchip Electronics Co. LTD
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef SRC_RT_MEDIA_INCLUDE_RTVSTREAMBUFFER_H_
18 #define SRC_RT_MEDIA_INCLUDE_RTVSTREAMBUFFER_H_
19 
20 #include "RTAVShellBuffer.h"
21 
22 class RTVideoPacket : public RTAVShellBuffer {
23  public:
24     RTVideoPacket();
25     virtual ~RTVideoPacket() = default;
26 
27     virtual RTMediaBufferType getType();
28     virtual void reset();
29 
30     UINT64    getPts() const;
31     UINT64    getDts() const;
32     INT32     getEndOfFrame() const;
33     INT32     getTimeout() const;
34     INT32     getDuration() const;
35     INT32     getSeq() const;
36     INT32     getIsExtraData() const;
37 
38     void  setPts(const UINT64 pts);
39     void  setDts(const UINT64 dts);
40     void  setEndOfFrame(const INT32 endOfFrame);
41     void  setTimeout(const INT32 timeout);
42     void  setDuration(const INT32 duration);
43     void  setSeq(const INT32 seq);
44     void  setIsExtraData(const INT32 isExtraData);
45 
46  private:
47     void baseInit();
48 
49  private:
50     UINT64  mPts;
51     UINT64  mDts;
52     INT32   mSeq;
53     INT32   mEndOfFrame;
54     INT32   mTimeout;
55     INT32   mDuration;
56     INT32   mIsExtraData;
57 };
58 
59 RTVideoPacket* reinterpret_vpacket(RTMediaBuffer *buffer);
60 RTVideoPacket* construct_vpacket(RTMediaBuffer *buffer);
61 
62 #endif  // SRC_RT_MEDIA_INCLUDE_RTVSTREAMBUFFER_H_
63