vsrc_1 = {
	vsrc_id = 1,
	vsrc_status = 0,
	mode = "auto",
	hdr_mode = "linear", -- options: "linear", "2x" or "3x"
	fps = %%vi0_fps%%,
	bits = 0,
}

chan_0 = {
	id = 0,
	vsrc = vsrc_1,
	vsrc_ctx = 0,
	img_stats_src_chan = "chan_0",
	sensor_ctrl = 1,
	max_padding_width = 0,
	idsp_fps = %%vi0_fps%%,
	lens_warp = 0,
	max_main_input_width = 0, -- 0: VIN raw width
	blend_left = 0,
	blend_right = 0,
	mctf_cmpr = 1,
	mctf_10bit_ref = 0,
	main_burst_tile = 1,
	extra_downscale = 0,
	main = {
		max_output = {1920, 1920}, -- maximum output width height of each source buffer.
		input      = {%%vi0_x%%, %%vi0_y%%, %%vi0_width%%, %%vi0_height%%}, -- cropped from vsrc
		output     = {0, 0, %%main_width%%, %%main_height%%}, -- output offset is in the canvas coordinate.
	},
	third = {
		max_output = {1920, 1920},
		input      = {0, 0, %%main_width%%, %%main_height%%},
		output     = {0, 0, %%ve1_width%%, %%ve1_height%%}, -- B
	},
	fourth = {
		max_output = {1920, 1920},
		input      = {0, 0, %%main_width%%, %%main_height%%},
		output     = {0, 0, %%ve2_width%%, %%ve2_height%%}, -- A max 2560 = 1280*2
	},
	second = {
		max_output = {1920, 1920},
		input	   = {0, 0, %%main_width%%, %%main_height%%}, -- cropped from main buffer
		output     = {0, 0, %%ve3_width%%, %%ve3_height%%}, -- C max 1440 = 720*2
	},
	fifth = {
		max_output = {1920, 1920},
		input      = {0, 0, %%main_width%%, %%main_height%%},
		output     = {0, 0, %%ve4_width%%, %%ve4_height%%},
	},
}

-- limit
-- 1.n 2048 main
-- 2.c 720 second
-- 3.b 2048 third
-- 4.a 1280 fourth
-- 5.d 2048 fifth MJPEG
-- 6.e 2048 sixth

stream_0 = {
	id = 0,
	max_size = {1920, 1920},
	max_M = 1,
	fast_seek_enable = 0,
	two_ref_enable = 0,
	max_svct_layers_minus_1 = 0,
	max_num_minus_1_ltrs = 0,
	codec_enable = 0, -- 0: H264/H265/MJPEG; 1: H265/MJPEG; 2: H264/MJPEG; 3: MJPEG
}

stream_1 = {
	id = 1,
	max_size = {1920, 1920},
	max_M = 1,
	fast_seek_enable = 0,
	two_ref_enable = 0,
	max_svct_layers_minus_1 = 0,
	max_num_minus_1_ltrs = 0,
	codec_enable = 0, -- 0: H264/H265/MJPEG; 1: H265/MJPEG; 2: H264/MJPEG; 3: MJPEG
}

stream_2 = {
	id = 2,
	max_size = {1280, 1280},
	max_M = 1,
	fast_seek_enable = 0,
	two_ref_enable = 0,
	max_svct_layers_minus_1 = 0,
	max_num_minus_1_ltrs = 0,
	codec_enable = 0, -- 0: H264/H265/MJPEG; 1: H265/MJPEG; 2: H264/MJPEG; 3: MJPEG
}

stream_3 = {
	id = 3,
	max_size = {1280, 1280},
	max_M = 1,
	fast_seek_enable = 0,
	two_ref_enable = 0,
	max_svct_layers_minus_1 = 0,
	max_num_minus_1_ltrs = 0,
	codec_enable = 0, -- 0: H264/H265/MJPEG; 1: H265/MJPEG; 2: H264/MJPEG; 3: MJPEG
}

-- MJPEG
stream_4 = {
	id = 4,
	max_size = {1280, 1280},
	max_M = 1,
	fast_seek_enable = 0,
	two_ref_enable = 0,
	max_svct_layers_minus_1 = 0,
	max_num_minus_1_ltrs = 0,
	codec_enable = 3, -- 0: H264/H265/MJPEG; 1: H265/MJPEG; 2: H264/MJPEG; 3: MJPEG
}

-- Preview
stream_5 = {
	id = 5,
	max_size = {1920, 1920},
	max_M = 1,
	fast_seek_enable = 0,
	two_ref_enable = 0,
	max_svct_layers_minus_1 = 0,
	max_num_minus_1_ltrs = 0,
	codec_enable = 3, -- 0: H264/H265/MJPEG; 1: H265/MJPEG; 2: H264/MJPEG; 3: MJPEG
}

stream_6 = {
	id = 6,
	max_size = {1920, 1920},
	max_M = 1,
	fast_seek_enable = 0,
	two_ref_enable = 0,
	max_svct_layers_minus_1 = 0,
	max_num_minus_1_ltrs = 0,
	codec_enable = 3, -- 0: H264/H265/MJPEG; 1: H265/MJPEG; 2: H264/MJPEG; 3: MJPEG
}

stream_7 = {
	id = 7,
	max_size = {1280, 1280},
	max_M = 1,
	fast_seek_enable = 0,
	two_ref_enable = 0,
	max_svct_layers_minus_1 = 0,
	max_num_minus_1_ltrs = 0,
	codec_enable = 3, -- 0: H264/H265/MJPEG; 1: H265/MJPEG; 2: H264/MJPEG; 3: MJPEG
}

stream_8 = {
	id = 8,
	max_size = {1280, 1280},
	max_M = 1,
	fast_seek_enable = 0,
	two_ref_enable = 0,
	max_svct_layers_minus_1 = 0,
	max_num_minus_1_ltrs = 0,
	codec_enable = 3, -- 0: H264/H265/MJPEG; 1: H265/MJPEG; 2: H264/MJPEG; 3: MJPEG
}

_resource_config_ = {
	version = 1,
	log_level = 0, -- 0: error; 1: warning; 2: info; 3: debug
	channels = {
		chan_0,
	},
	canvas = {
		{
			type = "encode",
			size = {0, 0},
			source = {"chan_0.%%canvas_0%%",},
			extra_dram_buf = 1,
			frame_rate = %%vi0_fps%%,
		},
		{
			type = "encode",
			size = {0, 0},
			source = {"chan_0.%%canvas_1%%",},
			extra_dram_buf = 1,
			frame_rate = %%vi0_fps%%,
		},
		{
			type = "encode",
			size = {0, 0},
			source = {"chan_0.%%canvas_2%%",},
			extra_dram_buf = 1,
			frame_rate = %%vi0_fps%%,
		},
		{
			type = "encode",
			size = {0, 0},
			source = {"chan_0.%%canvas_3%%",},
			extra_dram_buf = 1,
			frame_rate = %%vi0_fps%%,
		},
		{
			type = "encode",
			size = {0, 0},
			source = {"chan_0.fifth",},
			extra_dram_buf = 0,
			frame_rate = %%vi0_fps%%,
		},
	},
	streams = {
		stream_0,
		stream_1,
		stream_2,
		stream_3,
		stream_4,
		stream_5,
		stream_6,
		stream_7,
		stream_8,
	},
}

return _resource_config_

