bool vframe_bound;
bool ip_mode;
u32 stream_frame_size; //for stream base
+ u32 hdr10p_data_size;
+ char *hdr10p_data_buf;
} /*PIC_t */;
#define MAX_TILE_COL_NUM 10
&& p_sei[2] == 0x3C
&& p_sei[3] == 0x00
&& p_sei[4] == 0x01
- && p_sei[5] == 0x04)
+ && p_sei[5] == 0x04) {
+ char *new_buf;
hevc->sei_present_flag |= SEI_HDR10PLUS_MASK;
+ new_buf = vzalloc(payload_size);
+ if (new_buf) {
+ memcpy(new_buf, p_sei, payload_size);
+ pic->hdr10p_data_buf = new_buf;
+ pic->hdr10p_data_size = payload_size;
+ } else {
+ hevc_print(hevc, 0,
+ "%s:hdr10p data vzalloc size(%d) fail\n",
+ __func__, payload_size);
+ pic->hdr10p_data_buf = NULL;
+ pic->hdr10p_data_size = 0;
+ }
+ }
break;
case SEI_MasteringDisplayColorVolume:
vdec_v4l_set_hdr_infos(ctx, &hdr);
}
+ if ((hevc->sei_present_flag & SEI_HDR10PLUS_MASK) && (pic->hdr10p_data_buf != NULL)
+ && (pic->hdr10p_data_size != 0)) {
+ char *new_buf;
+ new_buf = vzalloc(pic->hdr10p_data_size);
+
+ if (new_buf) {
+ memcpy(new_buf, pic->hdr10p_data_buf, pic->hdr10p_data_size);
+ if (get_dbg_flag(hevc) & H265_DEBUG_BUFMGR_MORE) {
+ hevc_print(hevc, 0,
+ "hdr10p data: (size %d)\n",
+ pic->hdr10p_data_size);
+ for (i = 0; i < pic->hdr10p_data_size; i++) {
+ hevc_print_cont(hevc, 0,
+ "%02x ", pic->hdr10p_data_buf[i]);
+ if (((i + 1) & 0xf) == 0)
+ hevc_print_cont(hevc, 0, "\n");
+ }
+ hevc_print_cont(hevc, 0, "\n");
+ }
+
+ vf->hdr10p_data_size = pic->hdr10p_data_size;
+ vf->hdr10p_data_buf = new_buf;
+ } else {
+ hevc_print(hevc, 0,
+ "%s:hdr10p data vzalloc size(%d) fail\n",
+ __func__, pic->hdr10p_data_size);
+ vf->hdr10p_data_buf = NULL;
+ vf->hdr10p_data_size = 0;
+ }
+
+ vfree(pic->hdr10p_data_buf);
+ pic->hdr10p_data_buf = NULL;
+ pic->hdr10p_data_size = 0;
+ }
+
vf->sidebind_type = hevc->sidebind_type;
vf->sidebind_channel_id = hevc->sidebind_channel_id;
}
kfifo_put(&hevc->newframe_q, (const struct vframe_s *)vf);
spin_lock_irqsave(&lock, flags);
+ if (vf->hdr10p_data_buf) {
+ vfree(vf->hdr10p_data_buf);
+ vf->hdr10p_data_buf = NULL;
+ vf->hdr10p_data_size = 0;
+ }
+
if (index_top != 0xff
&& index_top < MAX_REF_PIC_NUM
&& hevc->m_PIC[index_top]) {
/*aux data check*/
struct aux_data_check_mgr_t adc;
+
+ u32 hdr10p_data_size;
+ char hdr10p_data_buf[PAGE_SIZE];
+ bool hdr10p_data_valid;
};
/* common decoder vframe provider name to use default vfm path */
return -ENOMEM;
}
+ if ((vdec->hdr10p_data_valid == true) &&
+ (vdec->hdr10p_data_size != 0)) {
+ char *new_buf;
+ new_buf = vzalloc(vdec->hdr10p_data_size);
+ if (new_buf) {
+ memcpy(new_buf, vdec->hdr10p_data_buf, vdec->hdr10p_data_size);
+ chunk->hdr10p_data_buf = new_buf;
+ chunk->hdr10p_data_size = vdec->hdr10p_data_size;
+ } else {
+ pr_err("%s:hdr10p data vzalloc size(%d) failed\n",
+ __func__, vdec->hdr10p_data_size);
+ chunk->hdr10p_data_buf = NULL;
+ chunk->hdr10p_data_size = 0;
+ }
+ } else {
+ chunk->hdr10p_data_buf = NULL;
+ chunk->hdr10p_data_size = 0;
+ }
+ vdec->hdr10p_data_valid = false;
+
chunk->magic = 0x4b554843;
if (vdec->pts_valid) {
chunk->pts = vdec->pts;
bool timestamp_valid;
u64 sequence;
struct vframe_block_list_s *block;
+ u32 hdr10p_data_size;
+ char *hdr10p_data_buf;
};
#define VDEC_INPUT_TARGET_VLD 0
/* vdec sync. */
struct fence *fence;
+
+ /* hdr10 plus data */
+ u32 hdr10p_data_size;
+ char *hdr10p_data_buf;
} PIC_BUFFER_CONFIG;
enum BITSTREAM_PROFILE {
vdec_v4l_set_hdr_infos(ctx, &hdr);
}
+ if ((pbi->chunk != NULL) && (pbi->chunk->hdr10p_data_buf != NULL)
+ && (pbi->chunk->hdr10p_data_size != 0)) {
+ char *new_buf;
+ int i = 0;
+ new_buf = vzalloc(pbi->chunk->hdr10p_data_size);
+
+ if (new_buf) {
+ memcpy(new_buf, pbi->chunk->hdr10p_data_buf, pbi->chunk->hdr10p_data_size);
+ if (debug & VP9_DEBUG_BUFMGR_MORE) {
+ vp9_print(pbi, VP9_DEBUG_BUFMGR_MORE,
+ "hdr10p data: (size %d)\n",
+ pbi->chunk->hdr10p_data_size);
+ for (i = 0; i < pbi->chunk->hdr10p_data_size; i++) {
+ vp9_print(pbi, VP9_DEBUG_BUFMGR_MORE,
+ "%02x ", pbi->chunk->hdr10p_data_buf[i]);
+ if (((i + 1) & 0xf) == 0)
+ vp9_print(pbi, VP9_DEBUG_BUFMGR_MORE, "\n");
+ }
+ vp9_print(pbi, VP9_DEBUG_BUFMGR_MORE, "\n");
+ }
+
+ vf->hdr10p_data_size = pbi->chunk->hdr10p_data_size;
+ vf->hdr10p_data_buf = new_buf;
+ } else {
+ vp9_print(pbi, 0, "%s:hdr10p data vzalloc size(%d) fail\n",
+ __func__, pbi->chunk->hdr10p_data_size);
+ vf->hdr10p_data_size = pbi->chunk->hdr10p_data_size;
+ vf->hdr10p_data_buf = new_buf;
+ }
+
+ vfree(pbi->chunk->hdr10p_data_buf);
+ pbi->chunk->hdr10p_data_buf = NULL;
+ pbi->chunk->hdr10p_data_size = 0;
+ }
+
vf->sidebind_type = pbi->sidebind_type;
vf->sidebind_channel_id = pbi->sidebind_channel_id;
}
vf->fence = NULL;
}
+ if (vf->hdr10p_data_buf) {
+ vfree(vf->hdr10p_data_buf);
+ vf->hdr10p_data_buf = NULL;
+ vf->hdr10p_data_size = 0;
+ }
+
kfifo_put(&pbi->newframe_q, (const struct vframe_s *)vf);
pbi->vf_put_count++;
if (index < pbi->used_buf_num) {
} else
r = -EINVAL;
break;
+ case AMSTREAM_SET_PTR_HDR10P_DATA:
+ if ((this->type & PORT_TYPE_VIDEO) && (this->type & PORT_TYPE_FRAME)) {
+ if (!parm.pointer || (parm.len <= 0) ||
+ (parm.len > PAGE_SIZE)) {
+ r = -EINVAL;
+ } else {
+ r = copy_from_user(priv->vdec->hdr10p_data_buf,
+ parm.pointer, parm.len);
+ if (r) {
+ priv->vdec->hdr10p_data_size = 0;
+ priv->vdec->hdr10p_data_valid = false;
+ r = -EINVAL;
+ } else {
+ priv->vdec->hdr10p_data_size = parm.len;
+ priv->vdec->hdr10p_data_valid = true;
+ }
+ }
+ } else
+ r = -EINVAL;
+ break;
default:
r = -ENOIOCTLCMD;
break;