aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Walls <awalls@radix.net>2009-12-31 00:14:51 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-02-26 13:10:29 -0500
commite46c54a87e4a6364b0e86b03cb3d00d09ef2f627 (patch)
treef8b98c7aa54c80bd56c1dd54387f8153648aec0e
parent7b1dde03314912cfa9a5fa34ea9423df0db13860 (diff)
V4L/DVB (13905): cx18: Allow MPEG index streams to be started and stopped internally
This change allows the IDX stream to be started and stopped as any other stream even though it has no associated device node. This is needed for cx18 driver internal use. Also always tell the CX23418 to generate index entries when an analog capture starts and the IDX stream has had buffers allocated (i.e. is enabled). Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/video/cx18/cx18-streams.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/drivers/media/video/cx18/cx18-streams.c b/drivers/media/video/cx18/cx18-streams.c
index 1764971f3da..304b6bc5121 100644
--- a/drivers/media/video/cx18/cx18-streams.c
+++ b/drivers/media/video/cx18/cx18-streams.c
@@ -358,7 +358,9 @@ void cx18_streams_cleanup(struct cx18 *cx, int unregister)
358 358
359static inline bool cx18_stream_enabled(struct cx18_stream *s) 359static inline bool cx18_stream_enabled(struct cx18_stream *s)
360{ 360{
361 return s->video_dev || s->dvb.enabled; 361 return s->video_dev || s->dvb.enabled ||
362 (s->type == CX18_ENC_STREAM_TYPE_IDX &&
363 s->cx->stream_buffers[CX18_ENC_STREAM_TYPE_IDX] != 0);
362} 364}
363 365
364static void cx18_vbi_setup(struct cx18_stream *s) 366static void cx18_vbi_setup(struct cx18_stream *s)
@@ -567,6 +569,7 @@ int cx18_start_v4l2_encode_stream(struct cx18_stream *s)
567 struct cx18 *cx = s->cx; 569 struct cx18 *cx = s->cx;
568 int captype = 0; 570 int captype = 0;
569 struct cx18_api_func_private priv; 571 struct cx18_api_func_private priv;
572 struct cx18_stream *s_idx;
570 573
571 if (!cx18_stream_enabled(s)) 574 if (!cx18_stream_enabled(s))
572 return -EINVAL; 575 return -EINVAL;
@@ -582,6 +585,9 @@ int cx18_start_v4l2_encode_stream(struct cx18_stream *s)
582 cx->search_pack_header = 0; 585 cx->search_pack_header = 0;
583 break; 586 break;
584 587
588 case CX18_ENC_STREAM_TYPE_IDX:
589 captype = CAPTURE_CHANNEL_TYPE_INDEX;
590 break;
585 case CX18_ENC_STREAM_TYPE_TS: 591 case CX18_ENC_STREAM_TYPE_TS:
586 captype = CAPTURE_CHANNEL_TYPE_TS; 592 captype = CAPTURE_CHANNEL_TYPE_TS;
587 break; 593 break;
@@ -656,11 +662,13 @@ int cx18_start_v4l2_encode_stream(struct cx18_stream *s)
656 cx18_vbi_setup(s); 662 cx18_vbi_setup(s);
657 663
658 /* 664 /*
659 * assign program index info. 665 * Select to receive I, P, and B frame index entries, if the
660 * Mask 7: select I/P/B, Num_req: 400 max 666 * index stream is enabled. Otherwise disable index entry
661 * FIXME - currently we have this hardcoded as disabled 667 * generation.
662 */ 668 */
663 cx18_vapi_result(cx, data, CX18_CPU_SET_INDEXTABLE, 1, 0); 669 s_idx = &cx->streams[CX18_ENC_STREAM_TYPE_IDX];
670 cx18_vapi_result(cx, data, CX18_CPU_SET_INDEXTABLE, 1,
671 cx18_stream_enabled(s_idx) ? 7 : 0);
664 672
665 /* Call out to the common CX2341x API setup for user controls */ 673 /* Call out to the common CX2341x API setup for user controls */
666 priv.cx = cx; 674 priv.cx = cx;