static int ts_init_encoder(struct saa7134_dev* dev) { struct v4l2_ext_controls ctrls = { V4L2_CTRL_CLASS_MPEG, 0 }; ts_reset_encoder(dev); saa7134_i2c_call_clients(dev, VIDIOC_S_EXT_CTRLS, &ctrls); dev->empress_started = 1; return 0; }
static void empress_signal_update(struct work_struct *work) { struct saa7134_dev* dev = container_of(work, struct saa7134_dev, empress_workqueue); if (dev->nosignal) { dprintk("no video signal\n"); ts_reset_encoder(dev); } else { dprintk("video signal acquired\n"); if (dev->empress_users) ts_init_encoder(dev); } }
static int ts_release(struct inode *inode, struct file *file) { struct saa7134_dev *dev = file->private_data; videobuf_stop(&dev->empress_tsq); videobuf_mmap_free(&dev->empress_tsq); dev->empress_users--; /* stop the encoder */ ts_reset_encoder(dev); /* Mute audio */ saa_writeb(SAA7134_AUDIO_MUTE_CTRL, saa_readb(SAA7134_AUDIO_MUTE_CTRL) | (1 << 6)); return 0; }
static int ts_init_encoder(struct saa7134_dev* dev) { u32 leading_null_bytes = 0; /* If more cards start to need this, then this should probably be added to the card definitions. */ switch (dev->board) { case SAA7134_BOARD_BEHOLD_M6: case SAA7134_BOARD_BEHOLD_M63: case SAA7134_BOARD_BEHOLD_M6_EXTRA: leading_null_bytes = 1; break; } ts_reset_encoder(dev); saa_call_all(dev, core, init, leading_null_bytes); dev->empress_started = 1; return 0; }