Lines Matching refs:cx
32 struct cx18 *cx = id->cx;
33 struct cx18_stream *s = &cx->streams[type];
73 s_assoc = &cx->streams[CX18_ENC_STREAM_TYPE_IDX];
74 if (cx->vbi.insert_mpeg && !cx18_raw_vbi(cx))
75 s_assoc = &cx->streams[CX18_ENC_STREAM_TYPE_VBI];
91 struct cx18 *cx = s->cx;
125 s_assoc = &cx->streams[CX18_ENC_STREAM_TYPE_IDX];
132 s_assoc = &cx->streams[CX18_ENC_STREAM_TYPE_VBI];
146 static void cx18_dualwatch(struct cx18 *cx)
152 new_stereo_mode = v4l2_ctrl_g_ctrl(cx->cxhdl.audio_mode);
154 cx18_call_all(cx, tuner, g_tuner, &vt);
159 if (new_stereo_mode == cx->dualwatch_stereo_mode)
163 cx->dualwatch_stereo_mode, new_stereo_mode);
164 if (v4l2_ctrl_s_ctrl(cx->cxhdl.audio_mode, new_stereo_mode))
172 struct cx18 *cx = s->cx;
173 struct cx18_stream *s_vbi = &cx->streams[CX18_ENC_STREAM_TYPE_VBI];
181 if (time_after(jiffies, cx->dualwatch_jiffies + msecs_to_jiffies(1000))) {
182 cx->dualwatch_jiffies = jiffies;
183 cx18_dualwatch(cx);
190 cx18_process_vbi_data(cx, mdl,
195 mdl = &cx->vbi.sliced_mpeg_mdl;
211 cx18_process_vbi_data(cx, mdl, s->type);
244 static void cx18_setup_sliced_vbi_mdl(struct cx18 *cx)
246 struct cx18_mdl *mdl = &cx->vbi.sliced_mpeg_mdl;
247 struct cx18_buffer *buf = &cx->vbi.sliced_mpeg_buf;
248 int idx = cx->vbi.inserted_frame % CX18_VBI_FRAMES;
250 buf->buf = cx->vbi.sliced_mpeg_data[idx];
251 buf->bytesused = cx->vbi.sliced_mpeg_size[idx];
255 mdl->bytesused = cx->vbi.sliced_mpeg_size[idx];
262 struct cx18 *cx = s->cx;
268 if (cx->vbi.insert_mpeg && s->type == CX18_ENC_STREAM_TYPE_MPG &&
269 !cx18_raw_vbi(cx) && buf != &cx->vbi.sliced_mpeg_buf) {
292 u8 ch = cx->search_pack_header ? 0xba : 0xe0;
311 if (!cx->search_pack_header) {
322 cx->search_pack_header = 1;
343 cx->search_pack_header = 0; /* expect vid PES */
345 cx18_setup_sliced_vbi_mdl(cx);
358 buf != &cx->vbi.sliced_mpeg_buf)
359 cx->mpg_data_received += len;
408 struct cx18 *cx = s->cx;
412 if (atomic_read(&cx->ana_capturing) == 0 && s->id == -1) {
422 if (s->type == CX18_ENC_STREAM_TYPE_VBI && !cx18_raw_vbi(cx))
448 if (mdl != &cx->vbi.sliced_mpeg_mdl) {
454 int idx = cx->vbi.inserted_frame % CX18_VBI_FRAMES;
456 cx->vbi.sliced_mpeg_size[idx] = 0;
457 cx->vbi.inserted_frame++;
458 cx->vbi_data_inserted += mdl->bytesused;
474 struct cx18 *cx = s->cx;
484 struct cx18 *cx = id->cx;
485 struct cx18_stream *s = &cx->streams[id->type];
507 s_vbi = &cx->streams[CX18_ENC_STREAM_TYPE_VBI];
508 s_idx = &cx->streams[CX18_ENC_STREAM_TYPE_IDX];
540 if (test_and_clear_bit(CX18_F_I_ENC_PAUSED, &cx->i_flags))
541 cx18_vapi(cx, CX18_CPU_CAPTURE_PAUSE, 1, s->handle);
575 struct cx18 *cx = id->cx;
576 struct cx18_stream *s = &cx->streams[id->type];
581 mutex_lock(&cx->serialize_lock);
583 mutex_unlock(&cx->serialize_lock);
594 struct cx18 *cx = id->cx;
595 struct cx18_stream *s = &cx->streams[id->type];
604 mutex_lock(&cx->serialize_lock);
606 mutex_unlock(&cx->serialize_lock);
642 struct cx18 *cx = s->cx;
643 struct cx18_stream *s_vbi = &cx->streams[CX18_ENC_STREAM_TYPE_VBI];
644 struct cx18_stream *s_idx = &cx->streams[CX18_ENC_STREAM_TYPE_IDX];
683 struct cx18 *cx = id->cx;
684 struct cx18_stream *s = &cx->streams[id->type];
689 mutex_lock(&cx->serialize_lock);
694 cx18_mute(cx);
696 clear_bit(CX18_F_I_RADIO_USER, &cx->i_flags);
698 cx18_call_all(cx, video, s_std, cx->std);
700 cx18_audio_set_io(cx);
701 if (atomic_read(&cx->ana_capturing) > 0) {
703 cx18_vapi(cx, CX18_CPU_SET_VIDEO_MUTE, 2, s->handle,
704 (v4l2_ctrl_g_ctrl(cx->cxhdl.video_mute) |
705 (v4l2_ctrl_g_ctrl(cx->cxhdl.video_mute_yuv) << 8)));
708 cx18_unmute(cx);
723 mutex_unlock(&cx->serialize_lock);
729 struct cx18 *cx = s->cx;
742 item->cx = cx;
745 item->open_id = cx->open_id++;
751 if (!test_bit(CX18_F_I_RADIO_USER, &cx->i_flags)) {
752 if (atomic_read(&cx->ana_capturing) > 0) {
763 set_bit(CX18_F_I_RADIO_USER, &cx->i_flags);
765 cx18_mute(cx);
767 cx18_call_all(cx, tuner, s_radio);
769 cx18_audio_set_io(cx);
771 cx18_unmute(cx);
781 struct cx18 *cx = s->cx;
783 mutex_lock(&cx->serialize_lock);
784 if (cx18_init_on_first_open(cx)) {
787 mutex_unlock(&cx->serialize_lock);
791 mutex_unlock(&cx->serialize_lock);
795 void cx18_mute(struct cx18 *cx)
798 if (atomic_read(&cx->ana_capturing)) {
799 h = cx18_find_handle(cx);
801 cx18_vapi(cx, CX18_CPU_SET_AUDIO_MUTE, 2, h, 1);
808 void cx18_unmute(struct cx18 *cx)
811 if (atomic_read(&cx->ana_capturing)) {
812 h = cx18_find_handle(cx);
815 cx18_vapi(cx, CX18_CPU_SET_MISC_PARAMETERS, 2, h, 12);
816 cx18_vapi(cx, CX18_CPU_SET_AUDIO_MUTE, 2, h, 0);