Lines Matching refs:hdl

1275 	return container_of(ctrl->handler, struct cx2341x_handler, hdl);  in to_cxhdl()
1278 static int cx2341x_hdl_api(struct cx2341x_handler *hdl, in cx2341x_hdl_api() argument
1290 return hdl->func(hdl->priv, cmd, args, 0, data); in cx2341x_hdl_api()
1301 struct cx2341x_handler *hdl = to_cxhdl(ctrl); in cx2341x_try_ctrl() local
1308 int gop = hdl->video_gop_size->val; in cx2341x_try_ctrl()
1315 hdl->video_gop_size->val = gop; in cx2341x_try_ctrl()
1321 hdl->video_encoding->val = in cx2341x_try_ctrl()
1322 (hdl->stream_type->val == V4L2_MPEG_STREAM_TYPE_MPEG1_SS || in cx2341x_try_ctrl()
1323 hdl->stream_type->val == V4L2_MPEG_STREAM_TYPE_MPEG1_VCD) ? in cx2341x_try_ctrl()
1326 if (hdl->video_encoding->val == V4L2_MPEG_VIDEO_ENCODING_MPEG_1) in cx2341x_try_ctrl()
1328 hdl->video_bitrate_mode->val = in cx2341x_try_ctrl()
1331 if (hdl->video_bitrate_mode->val == V4L2_MPEG_VIDEO_BITRATE_MODE_VBR && in cx2341x_try_ctrl()
1332 hdl->video_bitrate_peak->val < hdl->video_bitrate->val) in cx2341x_try_ctrl()
1333 hdl->video_bitrate_peak->val = hdl->video_bitrate->val; in cx2341x_try_ctrl()
1349 struct cx2341x_handler *hdl = to_cxhdl(ctrl); in cx2341x_s_ctrl() local
1356 if (hdl->ops && hdl->ops->s_stream_vbi_fmt) in cx2341x_s_ctrl()
1357 return hdl->ops->s_stream_vbi_fmt(hdl, val); in cx2341x_s_ctrl()
1361 return cx2341x_hdl_api(hdl, in cx2341x_s_ctrl()
1365 return cx2341x_hdl_api(hdl, CX2341X_ENC_SET_GOP_CLOSURE, 1, val); in cx2341x_s_ctrl()
1368 return cx2341x_hdl_api(hdl, CX2341X_ENC_MUTE_AUDIO, 1, val); in cx2341x_s_ctrl()
1371 return cx2341x_hdl_api(hdl, in cx2341x_s_ctrl()
1375 return cx2341x_hdl_api(hdl, CX2341X_ENC_MISC, 2, 7, val); in cx2341x_s_ctrl()
1379 props = (hdl->audio_sampling_freq->val << 0) | in cx2341x_s_ctrl()
1380 (hdl->audio_mode->val << 8) | in cx2341x_s_ctrl()
1381 (hdl->audio_mode_extension->val << 10) | in cx2341x_s_ctrl()
1382 (hdl->audio_crc->val << 14); in cx2341x_s_ctrl()
1383 if (hdl->audio_emphasis->val == V4L2_MPEG_AUDIO_EMPHASIS_CCITT_J17) in cx2341x_s_ctrl()
1386 props |= hdl->audio_emphasis->val << 12; in cx2341x_s_ctrl()
1388 if (hdl->audio_encoding->val == V4L2_MPEG_AUDIO_ENCODING_AC3) { in cx2341x_s_ctrl()
1394 (hdl->audio_ac3_bitrate->val << 4) | in cx2341x_s_ctrl()
1399 ((3 - hdl->audio_encoding->val) << 2) | in cx2341x_s_ctrl()
1400 ((1 + hdl->audio_l2_bitrate->val) << 4); in cx2341x_s_ctrl()
1402 err = cx2341x_hdl_api(hdl, in cx2341x_s_ctrl()
1407 hdl->audio_properties = props; in cx2341x_s_ctrl()
1408 if (hdl->audio_ac3_bitrate) { in cx2341x_s_ctrl()
1409 int is_ac3 = hdl->audio_encoding->val == in cx2341x_s_ctrl()
1412 v4l2_ctrl_activate(hdl->audio_ac3_bitrate, is_ac3); in cx2341x_s_ctrl()
1413 v4l2_ctrl_activate(hdl->audio_l2_bitrate, !is_ac3); in cx2341x_s_ctrl()
1415 v4l2_ctrl_activate(hdl->audio_mode_extension, in cx2341x_s_ctrl()
1416 hdl->audio_mode->val == V4L2_MPEG_AUDIO_MODE_JOINT_STEREO); in cx2341x_s_ctrl()
1417 if (cx2341x_neq(hdl->audio_sampling_freq) && in cx2341x_s_ctrl()
1418 hdl->ops && hdl->ops->s_audio_sampling_freq) in cx2341x_s_ctrl()
1419 return hdl->ops->s_audio_sampling_freq(hdl, hdl->audio_sampling_freq->val); in cx2341x_s_ctrl()
1420 if (cx2341x_neq(hdl->audio_mode) && in cx2341x_s_ctrl()
1421 hdl->ops && hdl->ops->s_audio_mode) in cx2341x_s_ctrl()
1422 return hdl->ops->s_audio_mode(hdl, hdl->audio_mode->val); in cx2341x_s_ctrl()
1427 return cx2341x_hdl_api(hdl, CX2341X_ENC_SET_GOP_PROPERTIES, 2, in cx2341x_s_ctrl()
1428 hdl->video_gop_size->val, in cx2341x_s_ctrl()
1429 hdl->video_b_frames->val + 1); in cx2341x_s_ctrl()
1433 err = cx2341x_hdl_api(hdl, in cx2341x_s_ctrl()
1438 err = cx2341x_hdl_api(hdl, CX2341X_ENC_SET_BIT_RATE, 5, in cx2341x_s_ctrl()
1439 hdl->video_bitrate_mode->val, in cx2341x_s_ctrl()
1440 hdl->video_bitrate->val, in cx2341x_s_ctrl()
1441 hdl->video_bitrate_peak->val / 400, 0, 0); in cx2341x_s_ctrl()
1445 v4l2_ctrl_activate(hdl->video_bitrate_mode, in cx2341x_s_ctrl()
1446 hdl->video_encoding->val != V4L2_MPEG_VIDEO_ENCODING_MPEG_1); in cx2341x_s_ctrl()
1447 v4l2_ctrl_activate(hdl->video_bitrate_peak, in cx2341x_s_ctrl()
1448 hdl->video_bitrate_mode->val != V4L2_MPEG_VIDEO_BITRATE_MODE_CBR); in cx2341x_s_ctrl()
1449 if (cx2341x_neq(hdl->video_encoding) && in cx2341x_s_ctrl()
1450 hdl->ops && hdl->ops->s_video_encoding) in cx2341x_s_ctrl()
1451 return hdl->ops->s_video_encoding(hdl, hdl->video_encoding->val); in cx2341x_s_ctrl()
1456 return cx2341x_hdl_api(hdl, CX2341X_ENC_MUTE_VIDEO, 1, in cx2341x_s_ctrl()
1457 hdl->video_mute->val | in cx2341x_s_ctrl()
1458 (hdl->video_mute_yuv->val << 8)); in cx2341x_s_ctrl()
1464 err = cx2341x_hdl_api(hdl, CX2341X_ENC_SET_DNR_FILTER_MODE, 2, in cx2341x_s_ctrl()
1465 hdl->video_spatial_filter_mode->val | in cx2341x_s_ctrl()
1466 (hdl->video_temporal_filter_mode->val << 1), in cx2341x_s_ctrl()
1467 hdl->video_median_filter_type->val); in cx2341x_s_ctrl()
1471 active_filter = hdl->video_spatial_filter_mode->val != in cx2341x_s_ctrl()
1473 v4l2_ctrl_activate(hdl->video_spatial_filter, active_filter); in cx2341x_s_ctrl()
1474 v4l2_ctrl_activate(hdl->video_luma_spatial_filter_type, active_filter); in cx2341x_s_ctrl()
1475 v4l2_ctrl_activate(hdl->video_chroma_spatial_filter_type, active_filter); in cx2341x_s_ctrl()
1476 active_filter = hdl->video_temporal_filter_mode->val != in cx2341x_s_ctrl()
1478 v4l2_ctrl_activate(hdl->video_temporal_filter, active_filter); in cx2341x_s_ctrl()
1479 active_filter = hdl->video_median_filter_type->val != in cx2341x_s_ctrl()
1481 v4l2_ctrl_activate(hdl->video_luma_median_filter_bottom, active_filter); in cx2341x_s_ctrl()
1482 v4l2_ctrl_activate(hdl->video_luma_median_filter_top, active_filter); in cx2341x_s_ctrl()
1483 v4l2_ctrl_activate(hdl->video_chroma_median_filter_bottom, active_filter); in cx2341x_s_ctrl()
1484 v4l2_ctrl_activate(hdl->video_chroma_median_filter_top, active_filter); in cx2341x_s_ctrl()
1490 return cx2341x_hdl_api(hdl, in cx2341x_s_ctrl()
1492 hdl->video_luma_spatial_filter_type->val, in cx2341x_s_ctrl()
1493 hdl->video_chroma_spatial_filter_type->val); in cx2341x_s_ctrl()
1497 return cx2341x_hdl_api(hdl, CX2341X_ENC_SET_DNR_FILTER_PROPS, 2, in cx2341x_s_ctrl()
1498 hdl->video_spatial_filter->val, in cx2341x_s_ctrl()
1499 hdl->video_temporal_filter->val); in cx2341x_s_ctrl()
1503 return cx2341x_hdl_api(hdl, CX2341X_ENC_SET_CORING_LEVELS, 4, in cx2341x_s_ctrl()
1504 hdl->video_luma_median_filter_bottom->val, in cx2341x_s_ctrl()
1505 hdl->video_luma_median_filter_top->val, in cx2341x_s_ctrl()
1506 hdl->video_chroma_median_filter_bottom->val, in cx2341x_s_ctrl()
1507 hdl->video_chroma_median_filter_top->val); in cx2341x_s_ctrl()
1517 static struct v4l2_ctrl *cx2341x_ctrl_new_custom(struct v4l2_ctrl_handler *hdl, in cx2341x_ctrl_new_custom() argument
1537 return v4l2_ctrl_new_custom(hdl, &cfg, NULL); in cx2341x_ctrl_new_custom()
1540 static struct v4l2_ctrl *cx2341x_ctrl_new_std(struct v4l2_ctrl_handler *hdl, in cx2341x_ctrl_new_std() argument
1543 return v4l2_ctrl_new_std(hdl, &cx2341x_ops, id, min, max, step, def); in cx2341x_ctrl_new_std()
1546 static struct v4l2_ctrl *cx2341x_ctrl_new_menu(struct v4l2_ctrl_handler *hdl, in cx2341x_ctrl_new_menu() argument
1549 return v4l2_ctrl_new_std_menu(hdl, &cx2341x_ops, id, max, mask, def); in cx2341x_ctrl_new_menu()
1555 struct v4l2_ctrl_handler *hdl = &cxhdl->hdl; in cx2341x_handler_init() local
1564 v4l2_ctrl_handler_init(hdl, nr_of_controls_hint); in cx2341x_handler_init()
1568 cxhdl->stream_type = cx2341x_ctrl_new_menu(hdl, in cx2341x_handler_init()
1572 cxhdl->stream_vbi_fmt = cx2341x_ctrl_new_menu(hdl, in cx2341x_handler_init()
1576 cxhdl->audio_sampling_freq = cx2341x_ctrl_new_menu(hdl, in cx2341x_handler_init()
1580 cxhdl->audio_encoding = cx2341x_ctrl_new_menu(hdl, in cx2341x_handler_init()
1584 cxhdl->audio_l2_bitrate = cx2341x_ctrl_new_menu(hdl, in cx2341x_handler_init()
1588 cxhdl->audio_mode = cx2341x_ctrl_new_menu(hdl, in cx2341x_handler_init()
1592 cxhdl->audio_mode_extension = cx2341x_ctrl_new_menu(hdl, in cx2341x_handler_init()
1596 cxhdl->audio_emphasis = cx2341x_ctrl_new_menu(hdl, in cx2341x_handler_init()
1600 cxhdl->audio_crc = cx2341x_ctrl_new_menu(hdl, in cx2341x_handler_init()
1605 cx2341x_ctrl_new_std(hdl, V4L2_CID_MPEG_AUDIO_MUTE, 0, 1, 1, 0); in cx2341x_handler_init()
1607 cxhdl->audio_ac3_bitrate = cx2341x_ctrl_new_menu(hdl, in cx2341x_handler_init()
1611 cxhdl->video_encoding = cx2341x_ctrl_new_menu(hdl, in cx2341x_handler_init()
1615 cx2341x_ctrl_new_menu(hdl, in cx2341x_handler_init()
1619 cxhdl->video_b_frames = cx2341x_ctrl_new_std(hdl, in cx2341x_handler_init()
1621 cxhdl->video_gop_size = cx2341x_ctrl_new_std(hdl, in cx2341x_handler_init()
1624 cx2341x_ctrl_new_std(hdl, V4L2_CID_MPEG_VIDEO_GOP_CLOSURE, 0, 1, 1, 1); in cx2341x_handler_init()
1625 cxhdl->video_bitrate_mode = cx2341x_ctrl_new_menu(hdl, in cx2341x_handler_init()
1629 cxhdl->video_bitrate = cx2341x_ctrl_new_std(hdl, in cx2341x_handler_init()
1632 cxhdl->video_bitrate_peak = cx2341x_ctrl_new_std(hdl, in cx2341x_handler_init()
1635 cx2341x_ctrl_new_std(hdl, in cx2341x_handler_init()
1637 cxhdl->video_mute = cx2341x_ctrl_new_std(hdl, in cx2341x_handler_init()
1639 cxhdl->video_mute_yuv = cx2341x_ctrl_new_std(hdl, in cx2341x_handler_init()
1643 cxhdl->video_spatial_filter_mode = cx2341x_ctrl_new_custom(hdl, in cx2341x_handler_init()
1648 cxhdl->video_spatial_filter = cx2341x_ctrl_new_custom(hdl, in cx2341x_handler_init()
1651 cxhdl->video_luma_spatial_filter_type = cx2341x_ctrl_new_custom(hdl, in cx2341x_handler_init()
1657 cxhdl->video_chroma_spatial_filter_type = cx2341x_ctrl_new_custom(hdl, in cx2341x_handler_init()
1663 cxhdl->video_temporal_filter_mode = cx2341x_ctrl_new_custom(hdl, in cx2341x_handler_init()
1669 cxhdl->video_temporal_filter = cx2341x_ctrl_new_custom(hdl, in cx2341x_handler_init()
1672 cxhdl->video_median_filter_type = cx2341x_ctrl_new_custom(hdl, in cx2341x_handler_init()
1678 cxhdl->video_luma_median_filter_bottom = cx2341x_ctrl_new_custom(hdl, in cx2341x_handler_init()
1681 cxhdl->video_luma_median_filter_top = cx2341x_ctrl_new_custom(hdl, in cx2341x_handler_init()
1684 cxhdl->video_chroma_median_filter_bottom = cx2341x_ctrl_new_custom(hdl, in cx2341x_handler_init()
1687 cxhdl->video_chroma_median_filter_top = cx2341x_ctrl_new_custom(hdl, in cx2341x_handler_init()
1690 cx2341x_ctrl_new_custom(hdl, V4L2_CID_MPEG_CX2341X_STREAM_INSERT_NAV_PACKETS, in cx2341x_handler_init()
1693 if (hdl->error) { in cx2341x_handler_init()
1694 int err = hdl->error; in cx2341x_handler_init()
1696 v4l2_ctrl_handler_free(hdl); in cx2341x_handler_init()
1740 return v4l2_ctrl_handler_setup(&cxhdl->hdl); in cx2341x_handler_setup()