• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500v2-V1.0.0.60_1.0.38/src/linux/linux-2.6/drivers/media/video/ivtv/

Lines Matching refs:itv

45 	struct ivtv *itv = id->itv;
46 struct ivtv_stream *s = &itv->streams[type];
72 ivtv_clear_irq_mask(itv, IVTV_IRQ_DEC_VBI_RE_INSERT);
82 itv->vbi.insert_mpeg && itv->vbi.sliced_in->service_set) {
87 s_vbi = &itv->streams[vbi_type];
92 ivtv_clear_irq_mask(itv, IVTV_IRQ_DEC_VBI_RE_INSERT);
103 struct ivtv *itv = s->itv;
121 ivtv_set_irq_mask(itv, IVTV_IRQ_DEC_VBI_RE_INSERT);
127 s_vbi = &itv->streams[IVTV_DEC_STREAM_TYPE_VBI];
129 s_vbi = &itv->streams[IVTV_ENC_STREAM_TYPE_VBI];
144 ivtv_set_irq_mask(itv, IVTV_IRQ_DEC_VBI_RE_INSERT);
149 static void ivtv_dualwatch(struct ivtv *itv)
157 new_stereo_mode = itv->params.audio_properties & stereo_mask;
159 ivtv_call_i2c_clients(itv, VIDIOC_G_TUNER, &vt);
163 if (new_stereo_mode == itv->dualwatch_stereo_mode)
166 new_bitmap = new_stereo_mode | (itv->params.audio_properties & ~stereo_mask);
169 itv->dualwatch_stereo_mode, new_stereo_mode, new_bitmap);
171 if (ivtv_vapi(itv, CX2341X_ENC_SET_AUDIO_PROPERTIES, 1, new_bitmap) == 0) {
172 itv->dualwatch_stereo_mode = new_stereo_mode;
178 static void ivtv_update_pgm_info(struct ivtv *itv)
180 u32 wr_idx = (read_enc(itv->pgm_info_offset) - itv->pgm_info_offset - 4) / 24;
184 if (wr_idx >= itv->pgm_info_num) {
185 IVTV_DEBUG_WARN("Invalid PGM index %d (>= %d)\n", wr_idx, itv->pgm_info_num);
188 cnt = (wr_idx + itv->pgm_info_num - itv->pgm_info_write_idx) % itv->pgm_info_num;
190 int idx = (itv->pgm_info_write_idx + i) % itv->pgm_info_num;
191 struct v4l2_enc_idx_entry *e = itv->pgm_info + idx;
192 u32 addr = itv->pgm_info_offset + 4 + idx * 24;
196 if (e->offset > itv->mpg_data_received) {
199 e->offset += itv->vbi_data_inserted;
205 itv->pgm_info_write_idx = (itv->pgm_info_write_idx + i) % itv->pgm_info_num;
210 struct ivtv *itv = s->itv;
211 struct ivtv_stream *s_vbi = &itv->streams[IVTV_ENC_STREAM_TYPE_VBI];
219 ivtv_update_pgm_info(itv);
221 if (jiffies - itv->dualwatch_jiffies > HZ) {
222 itv->dualwatch_jiffies = jiffies;
223 ivtv_dualwatch(itv);
230 ivtv_process_vbi_data(itv, buf, s_vbi->dma_pts, s_vbi->type);
234 buf = &itv->vbi.sliced_mpeg_buf;
255 ivtv_process_vbi_data(itv, buf, s->dma_pts, s->type);
287 static void ivtv_setup_sliced_vbi_buf(struct ivtv *itv)
289 int idx = itv->vbi.inserted_frame % IVTV_VBI_FRAMES;
291 itv->vbi.sliced_mpeg_buf.buf = itv->vbi.sliced_mpeg_data[idx];
292 itv->vbi.sliced_mpeg_buf.bytesused = itv->vbi.sliced_mpeg_size[idx];
293 itv->vbi.sliced_mpeg_buf.readpos = 0;
299 struct ivtv *itv = s->itv;
303 if (itv->vbi.insert_mpeg && s->type == IVTV_ENC_STREAM_TYPE_MPG &&
304 itv->vbi.sliced_in->service_set && buf != &itv->vbi.sliced_mpeg_buf) {
308 u8 ch = itv->search_pack_header ? 0xba : 0xe0;
317 if (!itv->search_pack_header) {
323 itv->search_pack_header = 1;
336 itv->search_pack_header = 0;
338 ivtv_setup_sliced_vbi_buf(itv);
347 /*IVTV_INFO("copied %lld %d %d %d %d %d vbi %d\n", itv->mpg_data_received, len, ucount,
349 buf == &itv->vbi.sliced_mpeg_buf); */
351 if (s->type == IVTV_ENC_STREAM_TYPE_MPG && buf != &itv->vbi.sliced_mpeg_buf)
352 itv->mpg_data_received += len;
358 struct ivtv *itv = s->itv;
362 if (atomic_read(&itv->capturing) == 0 && s->id == -1) {
371 (s->type == IVTV_ENC_STREAM_TYPE_VBI && itv->vbi.sliced_in->service_set))
384 if (buf != &itv->vbi.sliced_mpeg_buf) {
388 int idx = itv->vbi.inserted_frame % IVTV_VBI_FRAMES;
389 itv->vbi.sliced_mpeg_size[idx] = 0;
390 itv->vbi.inserted_frame++;
391 itv->vbi_data_inserted += buf->bytesused;
407 struct ivtv *itv = s->itv;
417 struct ivtv *itv = id->itv;
418 struct ivtv_stream *s = &itv->streams[id->type];
447 s_vbi = &itv->streams[IVTV_ENC_STREAM_TYPE_VBI];
472 if (test_and_clear_bit(IVTV_F_I_ENC_PAUSED, &itv->i_flags))
473 ivtv_vapi(itv, CX2341X_ENC_PAUSE_ENCODER, 1, 1);
496 struct ivtv *itv = id->itv;
497 struct ivtv_stream *s = &itv->streams[id->type];
510 struct ivtv *itv = id->itv;
511 struct ivtv_stream *s = &itv->streams[id->type];
513 if (atomic_read(&itv->decoding) == 0) {
522 return ivtv_set_speed(itv, speed);
529 struct ivtv *itv = id->itv;
530 struct ivtv_stream *s = &itv->streams[id->type];
553 return ivtv_write_vbi(itv, user_buf, count);
558 if (ivtv_set_output_mode(itv, mode) != mode) {
613 rc = ivtv_start_decoding(id, itv->speed);
623 if (s->q_full.length >= itv->dma_data_req_size) {
626 prepare_to_wait(&itv->dma_waitq, &wait, TASK_INTERRUPTIBLE);
631 finish_wait(&itv->dma_waitq, &wait);
638 ivtv_queue_move(s, &s->q_full, NULL, &s->q_predma, itv->dma_data_req_size);
639 ivtv_dma_stream_dec_prepare(s, itv->dma_data_req_offset + IVTV_DECODER_OFFSET, 1);
653 struct ivtv *itv = id->itv;
654 struct ivtv_stream *s = &itv->streams[id->type];
660 set_bit(IVTV_F_I_EV_VSYNC_ENABLED, &itv->i_flags);
661 if (test_bit(IVTV_F_I_EV_VSYNC, &itv->i_flags) ||
662 test_bit(IVTV_F_I_EV_DEC_STOPPED, &itv->i_flags))
674 struct ivtv *itv = id->itv;
675 struct ivtv_stream *s = &itv->streams[id->type];
699 struct ivtv *itv = id->itv;
700 struct ivtv_stream *s = &itv->streams[id->type];
708 struct ivtv_stream *s_vbi = &itv->streams[IVTV_ENC_STREAM_TYPE_VBI];
737 struct ivtv *itv = id->itv;
738 struct ivtv_stream *s = &itv->streams[id->type];
750 if (id->type == IVTV_DEC_STREAM_TYPE_YUV && test_bit(IVTV_F_I_DECODING_YUV, &itv->i_flags)) {
752 ivtv_yuv_close(itv);
754 if (s->type == IVTV_DEC_STREAM_TYPE_YUV && itv->output_mode == OUT_YUV)
755 itv->output_mode = OUT_NONE;
756 else if (s->type == IVTV_DEC_STREAM_TYPE_MPG && itv->output_mode == OUT_MPG)
757 itv->output_mode = OUT_NONE;
759 itv->speed = 0;
766 struct ivtv *itv = id->itv;
767 struct ivtv_stream *s = &itv->streams[id->type];
771 v4l2_prio_close(&itv->prio, &id->prio);
784 ivtv_mute(itv);
786 clear_bit(IVTV_F_I_RADIO_USER, &itv->i_flags);
788 ivtv_call_i2c_clients(itv, VIDIOC_S_STD, &itv->std);
790 ivtv_audio_set_io(itv);
791 if (itv->hw_flags & IVTV_HW_SAA711X)
796 ivtv_saa7115(itv, VIDIOC_INT_S_CRYSTAL_FREQ, &crystal_freq);
799 ivtv_unmute(itv);
814 struct ivtv *itv = NULL;
820 for (x = 0; itv == NULL && x < ivtv_cards_active; x++) {
825 itv = ivtv_cards[x];
832 if (itv == NULL) {
840 test_bit(IVTV_F_S_CLAIMED, &itv->streams[IVTV_DEC_STREAM_TYPE_YUV].s_flags))
844 test_bit(IVTV_F_S_CLAIMED, &itv->streams[IVTV_DEC_STREAM_TYPE_MPG].s_flags))
852 ivtv_udma_alloc(itv);
861 item->itv = itv;
863 v4l2_prio_open(&itv->prio, &item->prio);
865 item->open_id = itv->open_id++;
877 ivtv_mute(itv);
879 ivtv_call_i2c_clients(itv, AUDC_SET_RADIO, NULL);
881 set_bit(IVTV_F_I_RADIO_USER, &itv->i_flags);
883 ivtv_audio_set_io(itv);
884 if (itv->hw_flags & IVTV_HW_SAA711X)
889 ivtv_saa7115(itv, VIDIOC_INT_S_CRYSTAL_FREQ, &crystal_freq);
892 ivtv_unmute(itv);
897 clear_bit(IVTV_F_I_DEC_YUV, &itv->i_flags);
900 set_bit(IVTV_F_I_DEC_YUV, &itv->i_flags);
906 void ivtv_mute(struct ivtv *itv)
911 ivtv_control_ioctls(itv, VIDIOC_S_CTRL, &ctrl);
913 if (atomic_read(&itv->capturing))
914 ivtv_vapi(itv, CX2341X_ENC_MUTE_AUDIO, 1, 1);
919 void ivtv_unmute(struct ivtv *itv)
924 if (atomic_read(&itv->capturing) == 0)
925 ivtv_vapi(itv, CX2341X_ENC_INITIALIZE_INPUT, 0);
929 if (atomic_read(&itv->capturing)) {
930 ivtv_vapi(itv, CX2341X_ENC_MISC, 1, 12);
931 ivtv_vapi(itv, CX2341X_ENC_MUTE_AUDIO, 1, 0);
935 ivtv_control_ioctls(itv, VIDIOC_S_CTRL, &ctrl);