@@ -681,11 +681,13 @@ struct v4l2_subdev_ir_ops {
681
681
* @format: &struct v4l2_mbus_framefmt
682
682
* @crop: &struct v4l2_rect to be used for crop
683
683
* @compose: &struct v4l2_rect to be used for compose
684
+ * @interval: frame interval
684
685
*/
685
686
struct v4l2_subdev_pad_config {
686
687
struct v4l2_mbus_framefmt format ;
687
688
struct v4l2_rect crop ;
688
689
struct v4l2_rect compose ;
690
+ struct v4l2_fract interval ;
689
691
};
690
692
691
693
/**
@@ -697,6 +699,7 @@ struct v4l2_subdev_pad_config {
697
699
* @fmt: &struct v4l2_mbus_framefmt
698
700
* @crop: &struct v4l2_rect to be used for crop
699
701
* @compose: &struct v4l2_rect to be used for compose
702
+ * @interval: frame interval
700
703
*
701
704
* This structure stores configuration for a stream.
702
705
*/
@@ -708,6 +711,7 @@ struct v4l2_subdev_stream_config {
708
711
struct v4l2_mbus_framefmt fmt ;
709
712
struct v4l2_rect crop ;
710
713
struct v4l2_rect compose ;
714
+ struct v4l2_fract interval ;
711
715
};
712
716
713
717
/**
@@ -1392,6 +1396,27 @@ struct v4l2_rect *
1392
1396
__v4l2_subdev_state_get_compose (struct v4l2_subdev_state * state ,
1393
1397
unsigned int pad , u32 stream );
1394
1398
1399
+ /**
1400
+ * v4l2_subdev_state_get_interval() - Get pointer to a stream frame interval
1401
+ * @state: subdevice state
1402
+ * @pad: pad id
1403
+ * @...: stream id (optional argument)
1404
+ *
1405
+ * This returns a pointer to the frame interval for the given pad + stream in
1406
+ * the subdev state.
1407
+ *
1408
+ * For stream-unaware drivers the frame interval for the corresponding pad is
1409
+ * returned. If the pad does not exist, NULL is returned.
1410
+ */
1411
+ #define v4l2_subdev_state_get_interval (state , pad , ...) \
1412
+ __v4l2_subdev_state_gen_call(interval, ##__VA_ARGS__, , _pad) \
1413
+ (state, pad, ##__VA_ARGS__)
1414
+ #define __v4l2_subdev_state_get_interval_pad (state , pad ) \
1415
+ __v4l2_subdev_state_get_interval(state, pad, 0)
1416
+ struct v4l2_fract *
1417
+ __v4l2_subdev_state_get_interval (struct v4l2_subdev_state * state ,
1418
+ unsigned int pad , u32 stream );
1419
+
1395
1420
#if defined(CONFIG_VIDEO_V4L2_SUBDEV_API )
1396
1421
1397
1422
/**
@@ -1411,6 +1436,24 @@ __v4l2_subdev_state_get_compose(struct v4l2_subdev_state *state,
1411
1436
int v4l2_subdev_get_fmt (struct v4l2_subdev * sd , struct v4l2_subdev_state * state ,
1412
1437
struct v4l2_subdev_format * format );
1413
1438
1439
+ /**
1440
+ * v4l2_subdev_get_frame_interval() - Fill frame interval based on state
1441
+ * @sd: subdevice
1442
+ * @state: subdevice state
1443
+ * @fi: pointer to &struct v4l2_subdev_frame_interval
1444
+ *
1445
+ * Fill @fi->interval field based on the information in the @fi struct.
1446
+ *
1447
+ * This function can be used by the subdev drivers which support active state to
1448
+ * implement v4l2_subdev_pad_ops.get_frame_interval if the subdev driver does
1449
+ * not need to do anything special in their get_frame_interval op.
1450
+ *
1451
+ * Returns 0 on success, error value otherwise.
1452
+ */
1453
+ int v4l2_subdev_get_frame_interval (struct v4l2_subdev * sd ,
1454
+ struct v4l2_subdev_state * state ,
1455
+ struct v4l2_subdev_frame_interval * fi );
1456
+
1414
1457
/**
1415
1458
* v4l2_subdev_set_routing() - Set given routing to subdev state
1416
1459
* @sd: The subdevice
0 commit comments