Skip to content

Commit 8bcc0eb

Browse files
Deva Ramasubramaniandastin1015
authored andcommitted
msm: vidc: Allow client to request sps/pps per IDR frame
Expose SET_SPS_PPS_FOR_IDR to allow client request sps/pper per IDR frame. Change-Id: I0316d751bd1e0b412972cba9d4d59b142500a51d Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
1 parent 55b01cf commit 8bcc0eb

2 files changed

Lines changed: 30 additions & 1 deletion

File tree

drivers/video/msm/vidc/common/enc/venc.c

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2010-2012, Code Aurora Forum. All rights reserved.
1+
/* Copyright (c) 2010-2012, The Linux Foundation. All rights reserved.
22
*
33
* This program is free software; you can redistribute it and/or modify
44
* it under the terms of the GNU General Public License version 2 and
@@ -1646,6 +1646,31 @@ static long vid_enc_ioctl(struct file *file,
16461646
}
16471647
break;
16481648
}
1649+
case VEN_IOCTL_SET_SPS_PPS_FOR_IDR:
1650+
{
1651+
struct vcd_property_hdr vcd_property_hdr;
1652+
struct vcd_property_sps_pps_for_idr_enable idr_enable;
1653+
u32 vcd_status = VCD_ERR_FAIL;
1654+
u32 enabled = 1;
1655+
1656+
if (copy_from_user(&venc_msg, arg, sizeof(venc_msg)))
1657+
return -EFAULT;
1658+
1659+
vcd_property_hdr.prop_id = VCD_I_ENABLE_SPS_PPS_FOR_IDR;
1660+
vcd_property_hdr.sz = sizeof(idr_enable);
1661+
1662+
if (copy_from_user(&enabled, venc_msg.in, sizeof(u32)))
1663+
return -EFAULT;
1664+
1665+
idr_enable.sps_pps_for_idr_enable_flag = enabled;
1666+
vcd_status = vcd_set_property(client_ctx->vcd_handle,
1667+
&vcd_property_hdr, &idr_enable);
1668+
if (vcd_status) {
1669+
pr_err("Setting sps/pps per IDR failed");
1670+
return -EIO;
1671+
}
1672+
break;
1673+
}
16491674
case VEN_IOCTL_SET_AC_PREDICTION:
16501675
case VEN_IOCTL_GET_AC_PREDICTION:
16511676
case VEN_IOCTL_SET_RVLC:

include/linux/msm_vidc_enc.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,10 @@ struct venc_ioctl_msg{
456456
#define VEN_IOCTL_SET_SLICE_DELIVERY_MODE \
457457
_IO(VEN_IOCTLBASE_ENC, 50)
458458

459+
/*IOCTL params:SET: InputData - unsigned int, OutputData - NULL*/
460+
#define VEN_IOCTL_SET_SPS_PPS_FOR_IDR \
461+
_IOW(VEN_IOCTLBASE_ENC, 51, struct venc_ioctl_msg)
462+
459463
struct venc_switch{
460464
unsigned char status;
461465
};

0 commit comments

Comments
 (0)