aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/ivtv/ivtv-streams.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2007-08-23 09:13:15 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-10-09 21:06:48 -0400
commitfd8b281a2809d2bd9119df1fbd717ab2371297cd (patch)
treec5ebdbc3ba9febddded3d4cddd4deb0e75b9c027 /drivers/media/video/ivtv/ivtv-streams.c
parent33c0fcad2160bc211272295e862c6f708118d006 (diff)
V4L/DVB (6093): ivtv: reorganized and cleanup ivtv struct
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/ivtv/ivtv-streams.c')
-rw-r--r--drivers/media/video/ivtv/ivtv-streams.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/drivers/media/video/ivtv/ivtv-streams.c b/drivers/media/video/ivtv/ivtv-streams.c
index 3939a804f043..e05af62a8cd5 100644
--- a/drivers/media/video/ivtv/ivtv-streams.c
+++ b/drivers/media/video/ivtv/ivtv-streams.c
@@ -404,8 +404,8 @@ static void ivtv_vbi_setup(struct ivtv *itv)
404 if (!itv->vbi.fpi) 404 if (!itv->vbi.fpi)
405 itv->vbi.fpi = 1; 405 itv->vbi.fpi = 1;
406 406
407 IVTV_DEBUG_INFO("Setup VBI start 0x%08x frames %d fpi %d lines 0x%08x\n", 407 IVTV_DEBUG_INFO("Setup VBI start 0x%08x frames %d fpi %d\n",
408 itv->vbi.enc_start, data[1], itv->vbi.fpi, itv->digitizer); 408 itv->vbi.enc_start, data[1], itv->vbi.fpi);
409 409
410 /* select VBI lines. 410 /* select VBI lines.
411 Note that the sliced argument seems to have no effect. */ 411 Note that the sliced argument seems to have no effect. */
@@ -494,6 +494,8 @@ int ivtv_start_v4l2_encode_stream(struct ivtv_stream *s)
494 clear_bit(IVTV_F_S_STREAMOFF, &s->s_flags); 494 clear_bit(IVTV_F_S_STREAMOFF, &s->s_flags);
495 495
496 if (atomic_read(&itv->capturing) == 0) { 496 if (atomic_read(&itv->capturing) == 0) {
497 int digitizer;
498
497 /* Always use frame based mode. Experiments have demonstrated that byte 499 /* Always use frame based mode. Experiments have demonstrated that byte
498 stream based mode results in dropped frames and corruption. Not often, 500 stream based mode results in dropped frames and corruption. Not often,
499 but occasionally. Many thanks go to Leonard Orb who spent a lot of 501 but occasionally. Many thanks go to Leonard Orb who spent a lot of
@@ -519,7 +521,14 @@ int ivtv_start_v4l2_encode_stream(struct ivtv_stream *s)
519 ivtv_vapi(itv, CX2341X_ENC_SET_PLACEHOLDER, 12, 521 ivtv_vapi(itv, CX2341X_ENC_SET_PLACEHOLDER, 12,
520 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); 522 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
521 523
522 ivtv_vapi(itv, CX2341X_ENC_SET_NUM_VSYNC_LINES, 2, itv->digitizer, itv->digitizer); 524 if (itv->card->hw_all & (IVTV_HW_SAA7115 | IVTV_HW_SAA717X))
525 digitizer = 0xF1;
526 else if (itv->card->hw_all & IVTV_HW_SAA7114)
527 digitizer = 0xEF;
528 else /* cx25840 */
529 digitizer = 0x140;
530
531 ivtv_vapi(itv, CX2341X_ENC_SET_NUM_VSYNC_LINES, 2, digitizer, digitizer);
523 532
524 /* Setup VBI */ 533 /* Setup VBI */
525 if (itv->v4l2_cap & V4L2_CAP_VBI_CAPTURE) { 534 if (itv->v4l2_cap & V4L2_CAP_VBI_CAPTURE) {
@@ -761,7 +770,7 @@ int ivtv_stop_v4l2_encode_stream(struct ivtv_stream *s, int gop_end)
761 unsigned long duration; 770 unsigned long duration;
762 771
763 then = jiffies; 772 then = jiffies;
764 add_wait_queue(&itv->cap_w, &wait); 773 add_wait_queue(&itv->eos_waitq, &wait);
765 774
766 set_current_state(TASK_INTERRUPTIBLE); 775 set_current_state(TASK_INTERRUPTIBLE);
767 776
@@ -787,7 +796,7 @@ int ivtv_stop_v4l2_encode_stream(struct ivtv_stream *s, int gop_end)
787 IVTV_DEBUG_INFO("%s: EOS took %lu ms to occur.\n", s->name, duration); 796 IVTV_DEBUG_INFO("%s: EOS took %lu ms to occur.\n", s->name, duration);
788 } 797 }
789 set_current_state(TASK_RUNNING); 798 set_current_state(TASK_RUNNING);
790 remove_wait_queue(&itv->cap_w, &wait); 799 remove_wait_queue(&itv->eos_waitq, &wait);
791 } 800 }
792 801
793 then = jiffies; 802 then = jiffies;