mirror of
https://github.com/nyanmisaka/mpp.git
synced 2025-12-26 11:17:44 +01:00
refactor[enc]: Use KmppShmPtr to represent osd buffer
Change-Id: I2211b806d4b4a065faf1f0fa5a240e104bbb30ab Signed-off-by: xiaoxu.chen <xiaoxu.chen@rock-chips.com>
This commit is contained in:
parent
0ce028aaa9
commit
54bdc5ddbc
3 changed files with 25 additions and 9 deletions
|
|
@ -1460,11 +1460,6 @@ typedef struct MppEncOSDData2_t {
|
|||
} MppEncOSDData2;
|
||||
|
||||
/* kmpp osd configure */
|
||||
typedef struct MppOsdBuf_t {
|
||||
RK_S32 fd;
|
||||
void *buf;
|
||||
} MppOsdBuf;
|
||||
|
||||
typedef struct EncOSDInvCfg_t {
|
||||
RK_U32 yg_inv_en;
|
||||
RK_U32 uvrb_inv_en;
|
||||
|
|
@ -1473,7 +1468,7 @@ typedef struct EncOSDInvCfg_t {
|
|||
RK_U32 uv_sw_inv_en;
|
||||
RK_U32 inv_size;
|
||||
RK_U32 inv_stride;
|
||||
MppOsdBuf inv_buf;
|
||||
KmppShmPtr inv_buf;
|
||||
} EncOSDInvCfg;
|
||||
|
||||
typedef struct EncOSDAlphaCfg_t {
|
||||
|
|
@ -1508,7 +1503,7 @@ typedef struct MppEncOSDRegion3_t {
|
|||
EncOSDInvCfg inv_cfg;
|
||||
EncOSDAlphaCfg alpha_cfg;
|
||||
EncOSDQpCfg qp_cfg;
|
||||
MppOsdBuf osd_buf;
|
||||
KmppShmPtr osd_buf;
|
||||
RK_U8 lut[8]; //vuy vuy alpha
|
||||
} MppEncOSDRegion3;
|
||||
|
||||
|
|
|
|||
11
kmpp/kmpp.c
11
kmpp/kmpp.c
|
|
@ -320,6 +320,17 @@ static MPP_RET put_frame(Kmpp *ctx, MppFrame frame)
|
|||
ctx->mApi->control(ctx, MPP_ENC_SET_ROI_CFG, &roi_data0);
|
||||
}
|
||||
}
|
||||
|
||||
/* set osd */
|
||||
{
|
||||
MppEncOSDData3 *osd_data3 = NULL;
|
||||
|
||||
mpp_meta_get_ptr(meta, KEY_OSD_DATA3, (void**)&osd_data3);
|
||||
if (osd_data3) {
|
||||
osd_data3->change = 1;
|
||||
ctx->mApi->control(ctx, MPP_ENC_SET_OSD_DATA_CFG, osd_data3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ptr = kmpp_obj_to_shm(ctx->mKframe);
|
||||
|
|
|
|||
|
|
@ -6,6 +6,10 @@
|
|||
#define MODULE_TAG "vepu511_common"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "kmpp_obj.h"
|
||||
#include "kmpp_buffer.h"
|
||||
|
||||
#include "mpp_log.h"
|
||||
#include "mpp_common.h"
|
||||
#include "vepu511_common.h"
|
||||
|
|
@ -41,6 +45,8 @@ MPP_RET vepu511_set_osd(Vepu511OsdCfg * cfg, Vepu511Osd *osd_reg)
|
|||
Vepu511OsdRegion *reg = &osd_reg->osd_regions[i];
|
||||
VepuFmtCfg fmt_cfg;
|
||||
MppFrameFormat fmt = region->fmt;
|
||||
KmppBuffer buffer = NULL;
|
||||
KmppBufCfg buf_cfg = NULL;
|
||||
|
||||
vepu5xx_set_fmt(&fmt_cfg, fmt);
|
||||
reg->cfg0.osd_en = region->enable;
|
||||
|
|
@ -66,8 +72,12 @@ MPP_RET vepu511_set_osd(Vepu511OsdCfg * cfg, Vepu511Osd *osd_reg)
|
|||
reg->cfg8.osd_qp_min = region->qp_cfg.qp_min;
|
||||
reg->cfg8.osd_qp_prj = region->qp_cfg.qp_prj;
|
||||
|
||||
if (region->osd_buf.buf)
|
||||
reg->osd_st_addr = mpp_buffer_get_fd(region->osd_buf.buf);
|
||||
kmpp_obj_get_by_sptr_f(&buffer, ®ion->osd_buf);
|
||||
if (buffer) {
|
||||
buf_cfg = kmpp_buffer_to_cfg(buffer);
|
||||
kmpp_buf_cfg_get_fd(buf_cfg, (RK_S32 *)®->osd_st_addr);
|
||||
}
|
||||
memcpy(reg->lut, region->lut, sizeof(region->lut));
|
||||
}
|
||||
|
||||
regs->osd_whi_cfg0.osd_csc_yr = 77;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue