xref: /rockchip-linux_mpp/kmpp/base/inc/kmpp_packet_impl.h (revision 437bfbeb9567cca9cd9080e3f6954aa9d6a94f18)
1 /* SPDX-License-Identifier: Apache-2.0 OR MIT */
2 /*
3  * Copyright (c) 2025 Rockchip Electronics Co., Ltd.
4  */
5 
6 #ifndef __KMPP_PACKET_IMPL_H__
7 #define __KMPP_PACKET_IMPL_H__
8 
9 #include "kmpp_packet.h"
10 
11 #define KMPP_PACKET_FLAG_EOS        (0x00000001)
12 #define KMPP_PACKET_FLAG_EXTRA_DATA (0x00000002)
13 #define KMPP_PACKET_FLAG_INTERNAL   (0x00000004)
14 #define KMPP_PACKET_FLAG_EXTERNAL   (0x00000008)
15 #define KMPP_PACKET_FLAG_INTRA      (0x00000010)
16 #define KMPP_PACKET_FLAG_PARTITION  (0x00000020)
17 #define KMPP_PACKET_FLAG_EOI        (0x00000040)
18 
19 typedef struct RingBufPool_t {
20     rk_u32 r_pos;
21     rk_u32 w_pos;
22     rk_u32 len;
23     rk_u32 use_len;
24     void *buf_base;
25     MppBuffer buf;
26     rk_u32 init_done;
27     rk_u32 min_buf_size;
28     rk_u32 l_r_pos;
29     rk_u32 l_w_pos;
30     rk_u32 max_use_len;
31 } RingBufPool;
32 
33 typedef struct RingBuf_t {
34     MppBuffer buf;
35     void *buf_start;
36     RingBufPool *ring_pool;
37     rk_u32 start_offset;
38     rk_u32 r_pos;
39     rk_u32 use_len;
40     rk_u32 size;
41     rk_u32 cir_flag;
42 } RingBuf;
43 
44 typedef struct KmppPacketImpl_t {
45     const char *name;
46     rk_s32 size;
47     rk_s32 length;
48     rk_s64 pts;
49     rk_s64 dts;
50     rk_u32 status;
51     rk_u32 flag;
52     rk_u32 temporal_id;
53     KmppShmPtr data;
54     KmppShmPtr pos;
55     KmppShmPtr buffer;
56     RingBuf buf;
57 } KmppPacketImpl;
58 
59 typedef struct KmppPacketPriv_t {
60     KmppMeta    meta;
61 } KmppPacketPriv;
62 
63 #endif /* __KMPP_PACKET_IMPL_H__ */