Lines Matching full:hdl
1297 return container_of(ctrl->handler, struct cx2341x_handler, hdl); in to_cxhdl()
1300 static int cx2341x_hdl_api(struct cx2341x_handler *hdl, in cx2341x_hdl_api() argument
1312 return hdl->func(hdl->priv, cmd, args, 0, data); in cx2341x_hdl_api()
1323 struct cx2341x_handler *hdl = to_cxhdl(ctrl); in cx2341x_try_ctrl() local
1330 int gop = hdl->video_gop_size->val; in cx2341x_try_ctrl()
1337 hdl->video_gop_size->val = gop; in cx2341x_try_ctrl()
1343 hdl->video_encoding->val = in cx2341x_try_ctrl()
1344 (hdl->stream_type->val == V4L2_MPEG_STREAM_TYPE_MPEG1_SS || in cx2341x_try_ctrl()
1345 hdl->stream_type->val == V4L2_MPEG_STREAM_TYPE_MPEG1_VCD) ? in cx2341x_try_ctrl()
1348 if (hdl->video_encoding->val == V4L2_MPEG_VIDEO_ENCODING_MPEG_1) in cx2341x_try_ctrl()
1350 hdl->video_bitrate_mode->val = in cx2341x_try_ctrl()
1353 if (hdl->video_bitrate_mode->val == V4L2_MPEG_VIDEO_BITRATE_MODE_VBR && in cx2341x_try_ctrl()
1354 hdl->video_bitrate_peak->val < hdl->video_bitrate->val) in cx2341x_try_ctrl()
1355 hdl->video_bitrate_peak->val = hdl->video_bitrate->val; in cx2341x_try_ctrl()
1371 struct cx2341x_handler *hdl = to_cxhdl(ctrl); in cx2341x_s_ctrl() local
1378 if (hdl->ops && hdl->ops->s_stream_vbi_fmt) in cx2341x_s_ctrl()
1379 return hdl->ops->s_stream_vbi_fmt(hdl, val); in cx2341x_s_ctrl()
1383 return cx2341x_hdl_api(hdl, in cx2341x_s_ctrl()
1387 return cx2341x_hdl_api(hdl, CX2341X_ENC_SET_GOP_CLOSURE, 1, val); in cx2341x_s_ctrl()
1390 return cx2341x_hdl_api(hdl, CX2341X_ENC_MUTE_AUDIO, 1, val); in cx2341x_s_ctrl()
1393 return cx2341x_hdl_api(hdl, in cx2341x_s_ctrl()
1397 return cx2341x_hdl_api(hdl, CX2341X_ENC_MISC, 2, 7, val); in cx2341x_s_ctrl()
1401 props = (hdl->audio_sampling_freq->val << 0) | in cx2341x_s_ctrl()
1402 (hdl->audio_mode->val << 8) | in cx2341x_s_ctrl()
1403 (hdl->audio_mode_extension->val << 10) | in cx2341x_s_ctrl()
1404 (hdl->audio_crc->val << 14); in cx2341x_s_ctrl()
1405 if (hdl->audio_emphasis->val == V4L2_MPEG_AUDIO_EMPHASIS_CCITT_J17) in cx2341x_s_ctrl()
1408 props |= hdl->audio_emphasis->val << 12; in cx2341x_s_ctrl()
1410 if (hdl->audio_encoding->val == V4L2_MPEG_AUDIO_ENCODING_AC3) { in cx2341x_s_ctrl()
1416 (hdl->audio_ac3_bitrate->val << 4) | in cx2341x_s_ctrl()
1421 ((3 - hdl->audio_encoding->val) << 2) | in cx2341x_s_ctrl()
1422 ((1 + hdl->audio_l2_bitrate->val) << 4); in cx2341x_s_ctrl()
1424 err = cx2341x_hdl_api(hdl, in cx2341x_s_ctrl()
1429 hdl->audio_properties = props; in cx2341x_s_ctrl()
1430 if (hdl->audio_ac3_bitrate) { in cx2341x_s_ctrl()
1431 int is_ac3 = hdl->audio_encoding->val == in cx2341x_s_ctrl()
1434 v4l2_ctrl_activate(hdl->audio_ac3_bitrate, is_ac3); in cx2341x_s_ctrl()
1435 v4l2_ctrl_activate(hdl->audio_l2_bitrate, !is_ac3); in cx2341x_s_ctrl()
1437 v4l2_ctrl_activate(hdl->audio_mode_extension, in cx2341x_s_ctrl()
1438 hdl->audio_mode->val == V4L2_MPEG_AUDIO_MODE_JOINT_STEREO); in cx2341x_s_ctrl()
1439 if (cx2341x_neq(hdl->audio_sampling_freq) && in cx2341x_s_ctrl()
1440 hdl->ops && hdl->ops->s_audio_sampling_freq) in cx2341x_s_ctrl()
1441 return hdl->ops->s_audio_sampling_freq(hdl, hdl->audio_sampling_freq->val); in cx2341x_s_ctrl()
1442 if (cx2341x_neq(hdl->audio_mode) && in cx2341x_s_ctrl()
1443 hdl->ops && hdl->ops->s_audio_mode) in cx2341x_s_ctrl()
1444 return hdl->ops->s_audio_mode(hdl, hdl->audio_mode->val); in cx2341x_s_ctrl()
1449 return cx2341x_hdl_api(hdl, CX2341X_ENC_SET_GOP_PROPERTIES, 2, in cx2341x_s_ctrl()
1450 hdl->video_gop_size->val, in cx2341x_s_ctrl()
1451 hdl->video_b_frames->val + 1); in cx2341x_s_ctrl()
1455 err = cx2341x_hdl_api(hdl, in cx2341x_s_ctrl()
1460 err = cx2341x_hdl_api(hdl, CX2341X_ENC_SET_BIT_RATE, 5, in cx2341x_s_ctrl()
1461 hdl->video_bitrate_mode->val, in cx2341x_s_ctrl()
1462 hdl->video_bitrate->val, in cx2341x_s_ctrl()
1463 hdl->video_bitrate_peak->val / 400, 0, 0); in cx2341x_s_ctrl()
1467 v4l2_ctrl_activate(hdl->video_bitrate_mode, in cx2341x_s_ctrl()
1468 hdl->video_encoding->val != V4L2_MPEG_VIDEO_ENCODING_MPEG_1); in cx2341x_s_ctrl()
1469 v4l2_ctrl_activate(hdl->video_bitrate_peak, in cx2341x_s_ctrl()
1470 hdl->video_bitrate_mode->val != V4L2_MPEG_VIDEO_BITRATE_MODE_CBR); in cx2341x_s_ctrl()
1471 if (cx2341x_neq(hdl->video_encoding) && in cx2341x_s_ctrl()
1472 hdl->ops && hdl->ops->s_video_encoding) in cx2341x_s_ctrl()
1473 return hdl->ops->s_video_encoding(hdl, hdl->video_encoding->val); in cx2341x_s_ctrl()
1478 return cx2341x_hdl_api(hdl, CX2341X_ENC_MUTE_VIDEO, 1, in cx2341x_s_ctrl()
1479 hdl->video_mute->val | in cx2341x_s_ctrl()
1480 (hdl->video_mute_yuv->val << 8)); in cx2341x_s_ctrl()
1486 err = cx2341x_hdl_api(hdl, CX2341X_ENC_SET_DNR_FILTER_MODE, 2, in cx2341x_s_ctrl()
1487 hdl->video_spatial_filter_mode->val | in cx2341x_s_ctrl()
1488 (hdl->video_temporal_filter_mode->val << 1), in cx2341x_s_ctrl()
1489 hdl->video_median_filter_type->val); in cx2341x_s_ctrl()
1493 active_filter = hdl->video_spatial_filter_mode->val != in cx2341x_s_ctrl()
1495 v4l2_ctrl_activate(hdl->video_spatial_filter, active_filter); in cx2341x_s_ctrl()
1496 v4l2_ctrl_activate(hdl->video_luma_spatial_filter_type, active_filter); in cx2341x_s_ctrl()
1497 v4l2_ctrl_activate(hdl->video_chroma_spatial_filter_type, active_filter); in cx2341x_s_ctrl()
1498 active_filter = hdl->video_temporal_filter_mode->val != in cx2341x_s_ctrl()
1500 v4l2_ctrl_activate(hdl->video_temporal_filter, active_filter); in cx2341x_s_ctrl()
1501 active_filter = hdl->video_median_filter_type->val != in cx2341x_s_ctrl()
1503 v4l2_ctrl_activate(hdl->video_luma_median_filter_bottom, active_filter); in cx2341x_s_ctrl()
1504 v4l2_ctrl_activate(hdl->video_luma_median_filter_top, active_filter); in cx2341x_s_ctrl()
1505 v4l2_ctrl_activate(hdl->video_chroma_median_filter_bottom, active_filter); in cx2341x_s_ctrl()
1506 v4l2_ctrl_activate(hdl->video_chroma_median_filter_top, active_filter); in cx2341x_s_ctrl()
1512 return cx2341x_hdl_api(hdl, in cx2341x_s_ctrl()
1514 hdl->video_luma_spatial_filter_type->val, in cx2341x_s_ctrl()
1515 hdl->video_chroma_spatial_filter_type->val); in cx2341x_s_ctrl()
1519 return cx2341x_hdl_api(hdl, CX2341X_ENC_SET_DNR_FILTER_PROPS, 2, in cx2341x_s_ctrl()
1520 hdl->video_spatial_filter->val, in cx2341x_s_ctrl()
1521 hdl->video_temporal_filter->val); in cx2341x_s_ctrl()
1525 return cx2341x_hdl_api(hdl, CX2341X_ENC_SET_CORING_LEVELS, 4, in cx2341x_s_ctrl()
1526 hdl->video_luma_median_filter_bottom->val, in cx2341x_s_ctrl()
1527 hdl->video_luma_median_filter_top->val, in cx2341x_s_ctrl()
1528 hdl->video_chroma_median_filter_bottom->val, in cx2341x_s_ctrl()
1529 hdl->video_chroma_median_filter_top->val); in cx2341x_s_ctrl()
1539 static struct v4l2_ctrl *cx2341x_ctrl_new_custom(struct v4l2_ctrl_handler *hdl, in cx2341x_ctrl_new_custom() argument
1559 return v4l2_ctrl_new_custom(hdl, &cfg, NULL); in cx2341x_ctrl_new_custom()
1562 static struct v4l2_ctrl *cx2341x_ctrl_new_std(struct v4l2_ctrl_handler *hdl, in cx2341x_ctrl_new_std() argument
1565 return v4l2_ctrl_new_std(hdl, &cx2341x_ops, id, min, max, step, def); in cx2341x_ctrl_new_std()
1568 static struct v4l2_ctrl *cx2341x_ctrl_new_menu(struct v4l2_ctrl_handler *hdl, in cx2341x_ctrl_new_menu() argument
1571 return v4l2_ctrl_new_std_menu(hdl, &cx2341x_ops, id, max, mask, def); in cx2341x_ctrl_new_menu()
1577 struct v4l2_ctrl_handler *hdl = &cxhdl->hdl; in cx2341x_handler_init() local
1586 v4l2_ctrl_handler_init(hdl, nr_of_controls_hint); in cx2341x_handler_init()
1590 cxhdl->stream_type = cx2341x_ctrl_new_menu(hdl, in cx2341x_handler_init()
1594 cxhdl->stream_vbi_fmt = cx2341x_ctrl_new_menu(hdl, in cx2341x_handler_init()
1598 cxhdl->audio_sampling_freq = cx2341x_ctrl_new_menu(hdl, in cx2341x_handler_init()
1602 cxhdl->audio_encoding = cx2341x_ctrl_new_menu(hdl, in cx2341x_handler_init()
1606 cxhdl->audio_l2_bitrate = cx2341x_ctrl_new_menu(hdl, in cx2341x_handler_init()
1610 cxhdl->audio_mode = cx2341x_ctrl_new_menu(hdl, in cx2341x_handler_init()
1614 cxhdl->audio_mode_extension = cx2341x_ctrl_new_menu(hdl, in cx2341x_handler_init()
1618 cxhdl->audio_emphasis = cx2341x_ctrl_new_menu(hdl, in cx2341x_handler_init()
1622 cxhdl->audio_crc = cx2341x_ctrl_new_menu(hdl, in cx2341x_handler_init()
1627 cx2341x_ctrl_new_std(hdl, V4L2_CID_MPEG_AUDIO_MUTE, 0, 1, 1, 0); in cx2341x_handler_init()
1629 cxhdl->audio_ac3_bitrate = cx2341x_ctrl_new_menu(hdl, in cx2341x_handler_init()
1633 cxhdl->video_encoding = cx2341x_ctrl_new_menu(hdl, in cx2341x_handler_init()
1637 cx2341x_ctrl_new_menu(hdl, in cx2341x_handler_init()
1641 cxhdl->video_b_frames = cx2341x_ctrl_new_std(hdl, in cx2341x_handler_init()
1643 cxhdl->video_gop_size = cx2341x_ctrl_new_std(hdl, in cx2341x_handler_init()
1646 cx2341x_ctrl_new_std(hdl, V4L2_CID_MPEG_VIDEO_GOP_CLOSURE, 0, 1, 1, 1); in cx2341x_handler_init()
1647 cxhdl->video_bitrate_mode = cx2341x_ctrl_new_menu(hdl, in cx2341x_handler_init()
1651 cxhdl->video_bitrate = cx2341x_ctrl_new_std(hdl, in cx2341x_handler_init()
1654 cxhdl->video_bitrate_peak = cx2341x_ctrl_new_std(hdl, in cx2341x_handler_init()
1657 cx2341x_ctrl_new_std(hdl, in cx2341x_handler_init()
1659 cxhdl->video_mute = cx2341x_ctrl_new_std(hdl, in cx2341x_handler_init()
1661 cxhdl->video_mute_yuv = cx2341x_ctrl_new_std(hdl, in cx2341x_handler_init()
1665 cxhdl->video_spatial_filter_mode = cx2341x_ctrl_new_custom(hdl, in cx2341x_handler_init()
1670 cxhdl->video_spatial_filter = cx2341x_ctrl_new_custom(hdl, in cx2341x_handler_init()
1673 cxhdl->video_luma_spatial_filter_type = cx2341x_ctrl_new_custom(hdl, in cx2341x_handler_init()
1679 cxhdl->video_chroma_spatial_filter_type = cx2341x_ctrl_new_custom(hdl, in cx2341x_handler_init()
1685 cxhdl->video_temporal_filter_mode = cx2341x_ctrl_new_custom(hdl, in cx2341x_handler_init()
1691 cxhdl->video_temporal_filter = cx2341x_ctrl_new_custom(hdl, in cx2341x_handler_init()
1694 cxhdl->video_median_filter_type = cx2341x_ctrl_new_custom(hdl, in cx2341x_handler_init()
1700 cxhdl->video_luma_median_filter_bottom = cx2341x_ctrl_new_custom(hdl, in cx2341x_handler_init()
1703 cxhdl->video_luma_median_filter_top = cx2341x_ctrl_new_custom(hdl, in cx2341x_handler_init()
1706 cxhdl->video_chroma_median_filter_bottom = cx2341x_ctrl_new_custom(hdl, in cx2341x_handler_init()
1709 cxhdl->video_chroma_median_filter_top = cx2341x_ctrl_new_custom(hdl, in cx2341x_handler_init()
1712 cx2341x_ctrl_new_custom(hdl, V4L2_CID_MPEG_CX2341X_STREAM_INSERT_NAV_PACKETS, in cx2341x_handler_init()
1715 if (hdl->error) { in cx2341x_handler_init()
1716 int err = hdl->error; in cx2341x_handler_init()
1718 v4l2_ctrl_handler_free(hdl); in cx2341x_handler_init()
1762 return v4l2_ctrl_handler_setup(&cxhdl->hdl); in cx2341x_handler_setup()