author | jintao xu <jintao.xu@amlogic.com> | 2019-07-31 03:01:32 (GMT) |
---|---|---|
committer | Zhi Zhou <zhi.zhou@amlogic.com> | 2019-11-23 13:45:55 (GMT) |
commit | e8335f3266cead9dff3b939d3e579d56bb8d2257 (patch) | |
tree | 03fe53e9f14cc93fec85d8a9fadd811a5cb09171 | |
parent | eb60dc7c1afead3b78b738a5c832df322b43b950 (diff) | |
download | media_modules-e8335f3266cead9dff3b939d3e579d56bb8d2257.zip media_modules-e8335f3266cead9dff3b939d3e579d56bb8d2257.tar.gz media_modules-e8335f3266cead9dff3b939d3e579d56bb8d2257.tar.bz2 |
media_modlue: add v4lvideo path [1/1]
PD#SWPL-5996
Problem:
add v4lvideo path
Solution:
add v4lvideo path
Verify:
U212
Change-Id: I1cab775e74b8365a7995a2b479a21bd0a5979564
Signed-off-by: jintao xu <jintao.xu@amlogic.com>
-rw-r--r-- | drivers/frame_provider/decoder/utils/vdec.c | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/drivers/frame_provider/decoder/utils/vdec.c b/drivers/frame_provider/decoder/utils/vdec.c index 54f9051..3d3ecec 100644 --- a/drivers/frame_provider/decoder/utils/vdec.c +++ b/drivers/frame_provider/decoder/utils/vdec.c @@ -33,6 +33,7 @@ #include <linux/amlogic/media/vfm/vframe_provider.h> #include <linux/amlogic/media/vfm/vframe_receiver.h> #include <linux/amlogic/media/video_sink/ionvideo_ext.h> +#include <linux/amlogic/media/video_sink/v4lvideo_ext.h> #include <linux/amlogic/media/vfm/vfm_ext.h> /*for VDEC_DEBUG_SUPPORT*/ #include <linux/time.h> @@ -113,6 +114,9 @@ static DEFINE_SPINLOCK(vdec_spin_lock); #define DISABLE_FRAME_INFO 2 static int frameinfo_flag = 0; +static int v4lvideo_add_di = 1; +static int max_di_instance = 1; + //static int path_debug = 0; static struct vframe_qos_s *frame_info_buf_in = NULL; @@ -2203,12 +2207,48 @@ s32 vdec_init(struct vdec_s *vdec, int is_4k) snprintf(vdec->vfm_map_chain, VDEC_MAP_NAME_SIZE, "%s %s", vdec->vf_provider_name, "amvideo"); + snprintf(vdec->vfm_map_id, VDEC_MAP_NAME_SIZE, + "vdec-map-%d", vdec->id); } else if (p->frame_base_video_path == FRAME_BASE_PATH_V4L_VIDEO) { snprintf(vdec->vfm_map_chain, VDEC_MAP_NAME_SIZE, "%s %s %s", vdec->vf_provider_name, vdec->vf_receiver_name, "amvideo"); snprintf(vdec->vfm_map_id, VDEC_MAP_NAME_SIZE, "vdec-map-%d", vdec->id); + } else if (p->frame_base_video_path == + FRAME_BASE_PATH_DI_V4LVIDEO) { + r = v4lvideo_assign_map(&vdec->vf_receiver_name, + &vdec->vf_receiver_inst); + if (r < 0) { + pr_err("V4lVideo frame receiver allocation failed.\n"); + mutex_lock(&vdec_mutex); + inited_vcodec_num--; + mutex_unlock(&vdec_mutex); + goto error; + } + if (!v4lvideo_add_di || vdec_secure(vdec)) + snprintf(vdec->vfm_map_chain, VDEC_MAP_NAME_SIZE, + "%s %s", vdec->vf_provider_name, + vdec->vf_receiver_name); + else { + if (vdec->vf_receiver_inst == 0) + snprintf(vdec->vfm_map_chain, VDEC_MAP_NAME_SIZE, + "%s %s %s", vdec->vf_provider_name, + "deinterlace", + vdec->vf_receiver_name); + else if (vdec->vf_receiver_inst < max_di_instance) + snprintf(vdec->vfm_map_chain, VDEC_MAP_NAME_SIZE, + "%s %s%d %s", vdec->vf_provider_name, + "dimulti.", + vdec->vf_receiver_inst, + vdec->vf_receiver_name); + else + snprintf(vdec->vfm_map_chain, VDEC_MAP_NAME_SIZE, + "%s %s", vdec->vf_provider_name, + vdec->vf_receiver_name); + } + snprintf(vdec->vfm_map_id, VDEC_MAP_NAME_SIZE, + "vdec-map-%d", vdec->id); } if (vfm_map_add(vdec->vfm_map_id, @@ -5081,6 +5121,14 @@ module_param(disable_switch_single_to_mult, int, 0664); module_param(frameinfo_flag, int, 0664); MODULE_PARM_DESC(frameinfo_flag, "\n frameinfo_flag\n"); +module_param(v4lvideo_add_di, int, 0664); +MODULE_PARM_DESC(v4lvideo_add_di, + "\n v4lvideo_add_di\n"); + +module_param(max_di_instance, int, 0664); +MODULE_PARM_DESC(max_di_instance, + "\n max_di_instance\n"); + /* *module_init(vdec_module_init); *module_exit(vdec_module_exit); |