当前位置: 首页>>代码示例>>C++>>正文


C++ dvb_dmx_init函数代码示例

本文整理汇总了C++中dvb_dmx_init函数的典型用法代码示例。如果您正苦于以下问题:C++ dvb_dmx_init函数的具体用法?C++ dvb_dmx_init怎么用?C++ dvb_dmx_init使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了dvb_dmx_init函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: pvr2_dvb_adapter_init

static int pvr2_dvb_adapter_init(struct pvr2_dvb_adapter *adap)
{
	int ret;

	ret = dvb_register_adapter(&adap->dvb_adap, "pvrusb2-dvb",
				   THIS_MODULE/*&hdw->usb_dev->owner*/,
				   &adap->channel.hdw->usb_dev->dev,
				   adapter_nr);
	if (ret < 0) {
		pvr2_trace(PVR2_TRACE_ERROR_LEGS,
			   "dvb_register_adapter failed: error %d", ret);
		goto err;
	}
	adap->dvb_adap.priv = adap;

	adap->demux.dmx.capabilities = DMX_TS_FILTERING |
				       DMX_SECTION_FILTERING |
				       DMX_MEMORY_BASED_FILTERING;
	adap->demux.priv             = adap;
	adap->demux.filternum        = 256;
	adap->demux.feednum          = 256;
	adap->demux.start_feed       = pvr2_dvb_start_feed;
	adap->demux.stop_feed        = pvr2_dvb_stop_feed;
	adap->demux.write_to_decoder = NULL;

	ret = dvb_dmx_init(&adap->demux);
	if (ret < 0) {
		pvr2_trace(PVR2_TRACE_ERROR_LEGS,
			   "dvb_dmx_init failed: error %d", ret);
		goto err_dmx;
	}

	adap->dmxdev.filternum       = adap->demux.filternum;
	adap->dmxdev.demux           = &adap->demux.dmx;
	adap->dmxdev.capabilities    = 0;

	ret = dvb_dmxdev_init(&adap->dmxdev, &adap->dvb_adap);
	if (ret < 0) {
		pvr2_trace(PVR2_TRACE_ERROR_LEGS,
			   "dvb_dmxdev_init failed: error %d", ret);
		goto err_dmx_dev;
	}

	dvb_net_init(&adap->dvb_adap, &adap->dvb_net, &adap->demux.dmx);

	return 0;

err_dmx_dev:
	dvb_dmx_release(&adap->demux);
err_dmx:
	dvb_unregister_adapter(&adap->dvb_adap);
err:
	return ret;
}
开发者ID:020gzh,项目名称:linux,代码行数:54,代码来源:pvrusb2-dvb.c

示例2: budget_register

static int budget_register(struct budget *budget)
{
        struct dvb_demux *dvbdemux=&budget->demux;
        int ret;

	DEB_EE(("budget: %p\n",budget));

        dvbdemux->priv = (void *) budget;

	dvbdemux->filternum = 256;
        dvbdemux->feednum = 256;
        dvbdemux->start_feed = budget_start_feed;
        dvbdemux->stop_feed = budget_stop_feed;
        dvbdemux->write_to_decoder = NULL;

        dvbdemux->dmx.capabilities = (DMX_TS_FILTERING | DMX_SECTION_FILTERING |
                                      DMX_MEMORY_BASED_FILTERING);

        dvb_dmx_init(&budget->demux);

        budget->dmxdev.filternum = 256;
        budget->dmxdev.demux = &dvbdemux->dmx;
        budget->dmxdev.capabilities = 0;

        dvb_dmxdev_init(&budget->dmxdev, budget->dvb_adapter);

        budget->hw_frontend.source = DMX_FRONTEND_0;

        ret = dvbdemux->dmx.add_frontend(&dvbdemux->dmx, &budget->hw_frontend);

        if (ret < 0)
                return ret;
        
        budget->mem_frontend.source = DMX_MEMORY_FE;
        ret=dvbdemux->dmx.add_frontend (&dvbdemux->dmx, 
                                        &budget->mem_frontend);
        if (ret<0)
                return ret;
        
        ret=dvbdemux->dmx.connect_frontend (&dvbdemux->dmx, 
                                            &budget->hw_frontend);
        if (ret < 0)
                return ret;

        dvb_net_init(budget->dvb_adapter, &budget->dvb_net, &dvbdemux->dmx);

	return 0;
}
开发者ID:FelipeFernandes1988,项目名称:Alice-1121-Modem,代码行数:48,代码来源:budget-core.c

示例3: my_dvb_dmx_ts_card_init

int my_dvb_dmx_ts_card_init(struct dvb_demux *dvbdemux, char *id,
			    int (*start_feed)(struct dvb_demux_feed *),
			    int (*stop_feed)(struct dvb_demux_feed *),
			    void *priv)
{
	dvbdemux->priv = priv;

	dvbdemux->filternum = 256;
	dvbdemux->feednum = 256;
	dvbdemux->start_feed = start_feed;
	dvbdemux->stop_feed = stop_feed;
	dvbdemux->write_to_decoder = NULL;
	dvbdemux->dmx.capabilities = (DMX_TS_FILTERING |
				      DMX_SECTION_FILTERING |
				      DMX_MEMORY_BASED_FILTERING);
	return dvb_dmx_init(dvbdemux);
}
开发者ID:AshishNamdev,项目名称:linux,代码行数:17,代码来源:ngene-dvb.c

示例4: mpq_sw_dmx_init

static int mpq_sw_dmx_init(struct dvb_adapter *mpq_adapter,
		struct mpq_demux *mpq_demux)
{
	int ret;
	struct dvb_demux *dvb_demux = &mpq_demux->demux;

	/* Set the kernel-demux object capabilities */
	mpq_demux->demux.dmx.capabilities =
		DMX_TS_FILTERING			|
		DMX_PES_FILTERING			|
		DMX_SECTION_FILTERING			|
		DMX_MEMORY_BASED_FILTERING		|
		DMX_CRC_CHECKING			|
		DMX_TS_DESCRAMBLING;

	mpq_demux->decoder_alloc_flags = ION_FLAG_CACHED;

	/* Set dvb-demux "virtual" function pointers */
	dvb_demux->priv = (void *)mpq_demux;
	dvb_demux->filternum = MPQ_MAX_DMX_FILES;
	dvb_demux->feednum = MPQ_MAX_DMX_FILES;
	dvb_demux->start_feed = mpq_sw_dmx_start_filtering;
	dvb_demux->stop_feed = mpq_sw_dmx_stop_filtering;
	dvb_demux->write_to_decoder = mpq_sw_dmx_write_to_decoder;
	dvb_demux->decoder_fullness_init = mpq_dmx_decoder_fullness_init;
	dvb_demux->decoder_fullness_wait = mpq_dmx_decoder_fullness_wait;
	dvb_demux->decoder_fullness_abort = mpq_dmx_decoder_fullness_abort;
	dvb_demux->decoder_buffer_status = mpq_dmx_decoder_buffer_status;
	dvb_demux->reuse_decoder_buffer = mpq_dmx_reuse_decoder_buffer;
	dvb_demux->set_cipher_op = mpq_dmx_set_cipher_ops;
	dvb_demux->oob_command = mpq_dmx_oob_command;
	dvb_demux->convert_ts = mpq_dmx_convert_tts;
	dvb_demux->flush_decoder_buffer = NULL;

	/* Initialize dvb_demux object */
	ret = dvb_dmx_init(dvb_demux);
	if (ret) {
		MPQ_DVB_ERR_PRINT("%s: dvb_dmx_init failed, ret=%d\n",
			__func__, ret);
		goto init_failed;
	}

	/* Now initialize the dmx-dev object */
	mpq_demux->dmxdev.filternum = MPQ_MAX_DMX_FILES;
	mpq_demux->dmxdev.demux = &mpq_demux->demux.dmx;
	mpq_demux->dmxdev.capabilities = DMXDEV_CAP_DUPLEX;

	mpq_demux->dmxdev.demux->set_source = mpq_sw_dmx_set_source;
	mpq_demux->dmxdev.demux->get_stc = NULL;
	mpq_demux->dmxdev.demux->get_caps = mpq_sw_dmx_get_caps;
	mpq_demux->dmxdev.demux->map_buffer = mpq_dmx_map_buffer;
	mpq_demux->dmxdev.demux->unmap_buffer = mpq_dmx_unmap_buffer;
	mpq_demux->dmxdev.demux->write = mpq_dmx_write;
	ret = dvb_dmxdev_init(&mpq_demux->dmxdev, mpq_adapter);
	if (ret) {
		MPQ_DVB_ERR_PRINT("%s: dvb_dmxdev_init failed, ret=%d\n",
			__func__, ret);
		goto init_failed_dmx_release;
	}

	/* Extend dvb-demux debugfs with mpq demux statistics. */
	mpq_dmx_init_debugfs_entries(mpq_demux);

	return 0;

init_failed_dmx_release:
	dvb_dmx_release(dvb_demux);
init_failed:
	return ret;
}
开发者ID:moonlightly,项目名称:NX523J_kernel,代码行数:70,代码来源:mpq_dmx_plugin_sw.c

示例5: dvb_register

static int dvb_register(struct au0828_dev *dev)
{
	struct au0828_dvb *dvb = &dev->dvb;
	int result;

	dprintk(1, "%s()\n", __func__);

	INIT_WORK(&dev->restart_streaming, au0828_restart_dvb_streaming);

	/* register adapter */
	result = dvb_register_adapter(&dvb->adapter, DRIVER_NAME, THIS_MODULE,
				      &dev->usbdev->dev, adapter_nr);
	if (result < 0) {
		printk(KERN_ERR "%s: dvb_register_adapter failed "
		       "(errno = %d)\n", DRIVER_NAME, result);
		goto fail_adapter;
	}
	dvb->adapter.priv = dev;

	/* register frontend */
	result = dvb_register_frontend(&dvb->adapter, dvb->frontend);
	if (result < 0) {
		printk(KERN_ERR "%s: dvb_register_frontend failed "
		       "(errno = %d)\n", DRIVER_NAME, result);
		goto fail_frontend;
	}

	/* register demux stuff */
	dvb->demux.dmx.capabilities =
		DMX_TS_FILTERING | DMX_SECTION_FILTERING |
		DMX_MEMORY_BASED_FILTERING;
	dvb->demux.priv       = dev;
	dvb->demux.filternum  = 256;
	dvb->demux.feednum    = 256;
	dvb->demux.start_feed = au0828_dvb_start_feed;
	dvb->demux.stop_feed  = au0828_dvb_stop_feed;
	result = dvb_dmx_init(&dvb->demux);
	if (result < 0) {
		printk(KERN_ERR "%s: dvb_dmx_init failed (errno = %d)\n",
		       DRIVER_NAME, result);
		goto fail_dmx;
	}

	dvb->dmxdev.filternum    = 256;
	dvb->dmxdev.demux        = &dvb->demux.dmx;
	dvb->dmxdev.capabilities = 0;
	result = dvb_dmxdev_init(&dvb->dmxdev, &dvb->adapter);
	if (result < 0) {
		printk(KERN_ERR "%s: dvb_dmxdev_init failed (errno = %d)\n",
		       DRIVER_NAME, result);
		goto fail_dmxdev;
	}

	dvb->fe_hw.source = DMX_FRONTEND_0;
	result = dvb->demux.dmx.add_frontend(&dvb->demux.dmx, &dvb->fe_hw);
	if (result < 0) {
		printk(KERN_ERR "%s: add_frontend failed "
		       "(DMX_FRONTEND_0, errno = %d)\n", DRIVER_NAME, result);
		goto fail_fe_hw;
	}

	dvb->fe_mem.source = DMX_MEMORY_FE;
	result = dvb->demux.dmx.add_frontend(&dvb->demux.dmx, &dvb->fe_mem);
	if (result < 0) {
		printk(KERN_ERR "%s: add_frontend failed "
		       "(DMX_MEMORY_FE, errno = %d)\n", DRIVER_NAME, result);
		goto fail_fe_mem;
	}

	result = dvb->demux.dmx.connect_frontend(&dvb->demux.dmx, &dvb->fe_hw);
	if (result < 0) {
		printk(KERN_ERR "%s: connect_frontend failed (errno = %d)\n",
		       DRIVER_NAME, result);
		goto fail_fe_conn;
	}

	/* register network adapter */
	dvb_net_init(&dvb->adapter, &dvb->net, &dvb->demux.dmx);
	return 0;

fail_fe_conn:
	dvb->demux.dmx.remove_frontend(&dvb->demux.dmx, &dvb->fe_mem);
fail_fe_mem:
	dvb->demux.dmx.remove_frontend(&dvb->demux.dmx, &dvb->fe_hw);
fail_fe_hw:
	dvb_dmxdev_release(&dvb->dmxdev);
fail_dmxdev:
	dvb_dmx_release(&dvb->demux);
fail_dmx:
	dvb_unregister_frontend(dvb->frontend);
fail_frontend:
	dvb_frontend_detach(dvb->frontend);
	dvb_unregister_adapter(&dvb->adapter);
fail_adapter:
	return result;
}
开发者ID:AllenDou,项目名称:linux,代码行数:96,代码来源:au0828-dvb.c

示例6: register_dvb

static int register_dvb(struct tm6000_core *dev)
{
	int ret = -1;
	struct tm6000_dvb *dvb = dev->dvb;

	mutex_init(&dvb->mutex);

	dvb->streams = 0;

	/* attach the frontend */
	ret = tm6000_dvb_attach_frontend(dev);
	if (ret < 0) {
		printk(KERN_ERR "tm6000: couldn't attach the frontend!\n");
		goto err;
	}

	ret = dvb_register_adapter(&dvb->adapter, "Trident TVMaster 6000 DVB-T",
					THIS_MODULE, &dev->udev->dev, adapter_nr);
	dvb->adapter.priv = dev;

	if (dvb->frontend) {
		switch (dev->tuner_type) {
		case TUNER_XC2028: {
			struct xc2028_config cfg = {
				.i2c_adap = &dev->i2c_adap,
				.i2c_addr = dev->tuner_addr,
			};

			dvb->frontend->callback = tm6000_tuner_callback;
			ret = dvb_register_frontend(&dvb->adapter, dvb->frontend);
			if (ret < 0) {
				printk(KERN_ERR
					"tm6000: couldn't register frontend\n");
				goto adapter_err;
			}

			if (!dvb_attach(xc2028_attach, dvb->frontend, &cfg)) {
				printk(KERN_ERR "tm6000: couldn't register "
						"frontend (xc3028)\n");
				ret = -EINVAL;
				goto frontend_err;
			}
			printk(KERN_INFO "tm6000: XC2028/3028 asked to be "
					 "attached to frontend!\n");
			break;
			}
		case TUNER_XC5000: {
			struct xc5000_config cfg = {
				.i2c_address = dev->tuner_addr,
			};

			dvb->frontend->callback = tm6000_xc5000_callback;
			ret = dvb_register_frontend(&dvb->adapter, dvb->frontend);
			if (ret < 0) {
				printk(KERN_ERR
					"tm6000: couldn't register frontend\n");
				goto adapter_err;
			}

			if (!dvb_attach(xc5000_attach, dvb->frontend, &dev->i2c_adap, &cfg)) {
				printk(KERN_ERR "tm6000: couldn't register "
						"frontend (xc5000)\n");
				ret = -EINVAL;
				goto frontend_err;
			}
			printk(KERN_INFO "tm6000: XC5000 asked to be "
					 "attached to frontend!\n");
			break;
			}
		}
	} else
		printk(KERN_ERR "tm6000: no frontend found\n");

	dvb->demux.dmx.capabilities = DMX_TS_FILTERING | DMX_SECTION_FILTERING
							    | DMX_MEMORY_BASED_FILTERING;
	dvb->demux.priv = dev;
	dvb->demux.filternum = 8;
	dvb->demux.feednum = 8;
	dvb->demux.start_feed = tm6000_start_feed;
	dvb->demux.stop_feed = tm6000_stop_feed;
	dvb->demux.write_to_decoder = NULL;
	ret = dvb_dmx_init(&dvb->demux);
	if (ret < 0) {
		printk(KERN_ERR "tm6000: dvb_dmx_init failed (errno = %d)\n", ret);
		goto frontend_err;
	}

	dvb->dmxdev.filternum = dev->dvb->demux.filternum;
	dvb->dmxdev.demux = &dev->dvb->demux.dmx;
	dvb->dmxdev.capabilities = 0;

	ret =  dvb_dmxdev_init(&dvb->dmxdev, &dvb->adapter);
	if (ret < 0) {
		printk(KERN_ERR "tm6000: dvb_dmxdev_init failed (errno = %d)\n", ret);
		goto dvb_dmx_err;
	}

	return 0;

dvb_dmx_err:
//.........这里部分代码省略.........
开发者ID:020gzh,项目名称:linux,代码行数:101,代码来源:tm6000-dvb.c

示例7: videobuf_dvb_register

int videobuf_dvb_register(struct videobuf_dvb *dvb,
			  struct module *module,
			  void *adapter_priv)
{
	int result;

	mutex_init(&dvb->lock);

	/* register adapter */
	result = dvb_register_adapter(&dvb->adapter, dvb->name, module);
	if (result < 0) {
		printk(KERN_WARNING "%s: dvb_register_adapter failed (errno = %d)\n",
		       dvb->name, result);
		goto fail_adapter;
	}
	dvb->adapter.priv = adapter_priv;

	/* register frontend */
	result = dvb_register_frontend(&dvb->adapter, dvb->frontend);
	if (result < 0) {
		printk(KERN_WARNING "%s: dvb_register_frontend failed (errno = %d)\n",
		       dvb->name, result);
		goto fail_frontend;
	}

	/* register demux stuff */
	dvb->demux.dmx.capabilities =
		DMX_TS_FILTERING | DMX_SECTION_FILTERING |
		DMX_MEMORY_BASED_FILTERING;
	dvb->demux.priv       = dvb;
	dvb->demux.filternum  = 256;
	dvb->demux.feednum    = 256;
	dvb->demux.start_feed = videobuf_dvb_start_feed;
	dvb->demux.stop_feed  = videobuf_dvb_stop_feed;
	result = dvb_dmx_init(&dvb->demux);
	if (result < 0) {
		printk(KERN_WARNING "%s: dvb_dmx_init failed (errno = %d)\n",
		       dvb->name, result);
		goto fail_dmx;
	}

	dvb->dmxdev.filternum    = 256;
	dvb->dmxdev.demux        = &dvb->demux.dmx;
	dvb->dmxdev.capabilities = 0;
	result = dvb_dmxdev_init(&dvb->dmxdev, &dvb->adapter);
	if (result < 0) {
		printk(KERN_WARNING "%s: dvb_dmxdev_init failed (errno = %d)\n",
		       dvb->name, result);
		goto fail_dmxdev;
	}

	dvb->fe_hw.source = DMX_FRONTEND_0;
	result = dvb->demux.dmx.add_frontend(&dvb->demux.dmx, &dvb->fe_hw);
	if (result < 0) {
		printk(KERN_WARNING "%s: add_frontend failed (DMX_FRONTEND_0, errno = %d)\n",
		       dvb->name, result);
		goto fail_fe_hw;
	}

	dvb->fe_mem.source = DMX_MEMORY_FE;
	result = dvb->demux.dmx.add_frontend(&dvb->demux.dmx, &dvb->fe_mem);
	if (result < 0) {
		printk(KERN_WARNING "%s: add_frontend failed (DMX_MEMORY_FE, errno = %d)\n",
		       dvb->name, result);
		goto fail_fe_mem;
	}

	result = dvb->demux.dmx.connect_frontend(&dvb->demux.dmx, &dvb->fe_hw);
	if (result < 0) {
		printk(KERN_WARNING "%s: connect_frontend failed (errno = %d)\n",
		       dvb->name, result);
		goto fail_fe_conn;
	}

	/* register network adapter */
	dvb_net_init(&dvb->adapter, &dvb->net, &dvb->demux.dmx);
	return 0;

fail_fe_conn:
	dvb->demux.dmx.remove_frontend(&dvb->demux.dmx, &dvb->fe_mem);
fail_fe_mem:
	dvb->demux.dmx.remove_frontend(&dvb->demux.dmx, &dvb->fe_hw);
fail_fe_hw:
	dvb_dmxdev_release(&dvb->dmxdev);
fail_dmxdev:
	dvb_dmx_release(&dvb->demux);
fail_dmx:
	dvb_unregister_frontend(dvb->frontend);
fail_frontend:
	dvb_unregister_adapter(&dvb->adapter);
fail_adapter:
	return result;
}
开发者ID:BackupTheBerlios,项目名称:arp2-svn,代码行数:93,代码来源:video-buf-dvb.c

示例8: as102_dvb_register

int as102_dvb_register(struct as102_dev_t *as102_dev)
{
	int ret = 0;
	ENTER();

	dprintk(debug,"1 dvb_register_adapter\n");
	
	ret = dvb_register_adapter(&as102_dev->dvb_adap,
				   as102_dev->name,
				   THIS_MODULE,
				   &as102_dev->bus_adap.usb_dev->dev,
				   adapter_nr
				   );
	if (ret < 0) {
		err("%s: dvb_register_adapter() failed (errno = %d)",
		    __func__, ret);
		goto failed;
	}

/*j00zek comment: We don't initiate demux here as we use one from player2*/
#if 0

	as102_dev->dvb_dmx.priv = as102_dev;
	as102_dev->dvb_dmx.filternum = pid_filtering ? 16 : 256;
	as102_dev->dvb_dmx.feednum = 256;
	as102_dev->dvb_dmx.start_feed = as102_dvb_dmx_start_feed;
	as102_dev->dvb_dmx.stop_feed = as102_dvb_dmx_stop_feed;

	as102_dev->dvb_dmx.write_to_decoder = NULL;
	as102_dev->dvb_dmx.dmx.set_source = NULL; //as102_dvb_dmx_SetSource;
	
	as102_dev->dvb_dmx.dmx.capabilities = DMX_TS_FILTERING |
					      DMX_SECTION_FILTERING | DMX_MEMORY_BASED_FILTERING;


	as102_dev->dvb_dmxdev.filternum = as102_dev->dvb_dmx.filternum;
	as102_dev->dvb_dmxdev.demux = &as102_dev->dvb_dmx.dmx;
	as102_dev->dvb_dmxdev.capabilities = 0;


	dprintk(debug,"3 dvb_dmx_init\n");
	ret = dvb_dmx_init(&as102_dev->dvb_dmx);
	if (ret < 0) {
		err("%s: dvb_dmx_init() failed (errno = %d)", __func__, ret);
		goto failed;
	}

	dprintk(debug,"4 dvb_dmxdev_init\n");
	ret = dvb_dmxdev_init(&as102_dev->dvb_dmxdev, &as102_dev->dvb_adap);
	if (ret < 0) {
		err("%s: dvb_dmxdev_init() failed (errno = %d)", __func__,
		    ret);
		goto failed;
	}
#endif

	dprintk(debug,"2 dvb_register_frontend\n");
	ret = as102_dvb_register_fe(as102_dev, &as102_dev->dvb_fe);
	if (ret < 0) {
		err("%s: as102_dvb_register_frontend() failed (errno = %d)",
		    __func__, ret);
		goto failed;
	}

	/* init bus mutex for token locking */
	mutex_init(&as102_dev->bus_adap.lock);

	/* init start / stop stream mutex */
	mutex_init(&as102_dev->sem);

#if defined(CONFIG_FW_LOADER) || defined(CONFIG_FW_LOADER_MODULE)
	/*
	 * try to load as102 firmware. If firmware upload failed, we'll be
	 * able to upload it later.
	 */
	if (fw_upload)
		try_then_request_module(as102_fw_upload(&as102_dev->bus_adap),
				"firmware_class");
#endif

	/* start/stop pid from dvb_demux.c */
	as102_dev_ = as102_dev;//store dvb_adapter to use later when feeding from demux_player2
	extern_startfeed_init(as102_dvb_dmx_start_feed,as102_dvb_dmx_stop_feed);

failed:
	LEAVE();
	/* FIXME: free dvb_XXX */
	return ret;
}
开发者ID:Raxone,项目名称:STB8000_TDT_SH4,代码行数:89,代码来源:as102_drv.c

示例9: SysDVBRegisterAdapter


//.........这里部分代码省略.........
	if(!p->i2c_bus) {
		dvb_unregister_adapter(p->adapter);
#if 0 
		printk(KERN_WARNING "%s: failed to register dvb-i2c\n",
			p->name);
#else
		SysPrintk(KERN_WARNING "%s: failed to register dvb-i2c\n",
			p->name);
#endif 
		return -ENOMEM;
	}
	DBG_fCDVB("registered dvb-i2c %p\n", p->i2c_bus);
	#endif

	
	DBG_fCDVB("init software demux, demux_sw=%p\n", &p->demux_sw);
#if 0 
	memset(&p->demux_sw, 0, sizeof(struct dvb_demux)); 
#else
	SysMemSet(&p->demux_sw, 0, sizeof(struct dvb_demux)); 
#endif 
	p->demux_sw.priv = (void *)p;
	p->demux_sw.filternum = max_filters;
	p->demux_sw.feednum = max_filters;
	p->demux_sw.start_feed = demux_sw_start_feed;
	p->demux_sw.stop_feed = demux_sw_stop_feed;
	p->demux_sw.write_to_decoder = NULL;
	p->demux_sw.dmx.capabilities = 
			(DMX_TS_FILTERING |
			 DMX_SECTION_FILTERING |
			 DMX_MEMORY_BASED_FILTERING
			);

	ret = dvb_dmx_init(&p->demux_sw);
	if(ret) {
		printk(KERN_WARNING "%s: failed to init demux(%d)\n",
			p->name, ret);
		goto fail2;
	}

	
	DBG_fCDVB("init demux devices, dmxdev_sw=%p\n", &p->dmxdev_sw);
	p->dmxdev_sw.filternum = max_filters;
	p->dmxdev_sw.demux = &p->demux_sw.dmx;
	p->dmxdev_sw.capabilities = 0;

	ret = dvb_dmxdev_init(&p->dmxdev_sw, p->adapter);
	if(ret) {
#if 0 
		printk(KERN_WARNING "%s: failed to init dmxdev\n",
			p->name);
#else
		SysPrintk(KERN_WARNING "%s: failed to init dmxdev\n",
			p->name);
#endif 
		goto fail3;
	}

	
	DBG_fCDVB("add h/w frontend\n");
	p->hw_frontend.source = DMX_FRONTEND_0;
	ret = p->demux_sw.dmx.add_frontend(&p->demux_sw.dmx,
						   &p->hw_frontend);
	if(ret < 0) {
#if 0 
		printk(KERN_WARNING "%s: cannot add hw frontend\n",
开发者ID:blackwarthog,项目名称:avermedia-a828,代码行数:67,代码来源:osdep_dvb.c

示例10: vtunerc_init

static int __init vtunerc_init(void)
{
	struct vtunerc_ctx *ctx = NULL;
	struct dvb_demux *dvbdemux;
	struct dmx_demux *dmx;
	int ret = -EINVAL, i, idx;

	printk(KERN_INFO "virtual DVB adapter driver, version "
			VTUNERC_MODULE_VERSION
			", (c) 2010-11 Honza Petrous, SmartImp.cz\n");

	request_module("dvb-core"); /* FIXME: dunno which way it should work :-/ */

	for (idx = 0; idx < config.devices; idx++) {
		ctx = kzalloc(sizeof(struct vtunerc_ctx), GFP_KERNEL);
		if (!ctx)
			return -ENOMEM;

		vtunerc_tbl[idx] = ctx;

		ctx->idx = idx;
		ctx->config = &config;
		ctx->ctrldev_request.type = -1;
		ctx->ctrldev_response.type = -1;
		init_waitqueue_head(&ctx->ctrldev_wait_request_wq);
		init_waitqueue_head(&ctx->ctrldev_wait_response_wq);

		/* dvb */

		/* create new adapter */
		ret = dvb_register_adapter(&ctx->dvb_adapter, DRIVER_NAME,
					   THIS_MODULE, NULL, adapter_nr);
		if (ret < 0)
			goto err_kfree;

		ctx->dvb_adapter.priv = ctx;

		memset(&ctx->demux, 0, sizeof(ctx->demux));
		dvbdemux = &ctx->demux;
		dvbdemux->priv = ctx;
		dvbdemux->filternum = MAX_PIDTAB_LEN;
		dvbdemux->feednum = MAX_PIDTAB_LEN;
		dvbdemux->start_feed = vtunerc_start_feed;
		dvbdemux->stop_feed = vtunerc_stop_feed;
		dvbdemux->dmx.capabilities = 0;
		ret = dvb_dmx_init(dvbdemux);
		if (ret < 0)
			goto err_dvb_unregister_adapter;

		dmx = &dvbdemux->dmx;

		ctx->hw_frontend.source = DMX_FRONTEND_0;
		ctx->mem_frontend.source = DMX_MEMORY_FE;
		ctx->dmxdev.filternum = MAX_PIDTAB_LEN;
		ctx->dmxdev.demux = dmx;

		ret = dvb_dmxdev_init(&ctx->dmxdev, &ctx->dvb_adapter);
		if (ret < 0)
			goto err_dvb_dmx_release;

		ret = dmx->add_frontend(dmx, &ctx->hw_frontend);
		if (ret < 0)
			goto err_dvb_dmxdev_release;

		ret = dmx->add_frontend(dmx, &ctx->mem_frontend);
		if (ret < 0)
			goto err_remove_hw_frontend;

		ret = dmx->connect_frontend(dmx, &ctx->hw_frontend);
		if (ret < 0)
			goto err_remove_mem_frontend;

		sema_init(&ctx->xchange_sem, 1);
		sema_init(&ctx->ioctl_sem, 1);
		sema_init(&ctx->tswrite_sem, 1);

		/* init pid table */
		for (i = 0; i < MAX_PIDTAB_LEN; i++)
			ctx->pidtab[i] = PID_UNKNOWN;

#ifdef CONFIG_PROC_FS
		{
			char procfilename[64];

			sprintf(procfilename, VTUNERC_PROC_FILENAME,
					ctx->idx);
			ctx->procname = my_strdup(procfilename);
			if (create_proc_read_entry(ctx->procname, 0, NULL,
							vtunerc_read_proc,
							ctx) == 0)
				printk(KERN_WARNING
					"vtunerc%d: Unable to register '%s' proc file\n",
					ctx->idx, ctx->procname);
		}
#endif
	}

	vtunerc_register_ctrldev(ctx);

out:
//.........这里部分代码省略.........
开发者ID:gdachs,项目名称:vtuner,代码行数:101,代码来源:vtunerc_main.c

示例11: printk

struct stfe *stfe_create(void *private_data, void *start_feed, void *stop_feed)
{
	struct stfe *stfe;
	int channel;
	int result;
	if (!(stfe = kmalloc(sizeof(struct stfe), GFP_KERNEL)))
		return NULL;
	printk("%s: Allocated stfe @ 0x%p\n", __FUNCTION__, stfe);
	memset(stfe, 0, sizeof(struct stfe));
	sema_init(&stfe->sem, 0);
	up(&stfe->sem);
	for (channel = 0; channel < STFE_MAXCHANNEL; ++channel)
	{
		stfe->channel[channel].id = channel;
		stfe->channel[channel].stfe = stfe;
		stfe->channel[channel].havana_id = private_data;
	}
	dvb_register_adapter(&stfe->adapter, "ST Generic Front End Driver", THIS_MODULE, NULL, adapter_nr);
	stfe->adapter.priv = stfe;
	memset(&stfe->dvb_demux, 0, sizeof(stfe->dvb_demux));
	stfe->dvb_demux.dmx.capabilities =
		DMX_TS_FILTERING | DMX_SECTION_FILTERING | DMX_MEMORY_BASED_FILTERING;
	stfe->dvb_demux.priv = private_data;
	stfe->dvb_demux.filternum = 48;
	stfe->dvb_demux.feednum = STFE_MAXCHANNEL;
	stfe->dvb_demux.start_feed = start_feed;
	stfe->dvb_demux.stop_feed = stop_feed;
	stfe->dvb_demux.write_to_decoder = NULL; /* write_to_decoder;*/
	if ((result = dvb_dmx_init(&stfe->dvb_demux)) < 0)
	{
		printk("stfe_init: dvb_dmx_init failed (errno = %d)\n",
		       result);
		goto err;
	}
	stfe->dmxdev.filternum = stfe->dvb_demux.filternum;
	stfe->dmxdev.demux = &stfe->dvb_demux.dmx;
	stfe->dmxdev.capabilities = 0;
	if ((result = dvb_dmxdev_init(&stfe->dmxdev, &stfe->adapter)) < 0)
	{
		printk("stfe_init: dvb_dmxdev_init failed (errno = %d)\n",
		       result);
		dvb_dmx_release(&stfe->dvb_demux);
		goto err;
	}
	stfe->hw_frontend.source = DMX_FRONTEND_0;
	result = stfe->dvb_demux.dmx.add_frontend(&stfe->dvb_demux.dmx, &stfe->hw_frontend);
	if (result < 0)
		return NULL;
	stfe->mem_frontend.source = DMX_MEMORY_FE;
	result = stfe->dvb_demux.dmx.add_frontend(&stfe->dvb_demux.dmx, &stfe->mem_frontend);
	if (result < 0)
		return NULL;
	result = stfe->dvb_demux.dmx.connect_frontend(&stfe->dvb_demux.dmx, &stfe->hw_frontend);
	if (result < 0)
		return NULL;
	stfe->driver_data = private_data;
//i2c_add_driver(&st_tuner_i2c_driver);
	return stfe;
err:
	return NULL;
}
开发者ID:Audioniek,项目名称:driver,代码行数:61,代码来源:st-common.c

示例12: cx18_dvb_register

int cx18_dvb_register(struct cx18_stream *stream)
{
	struct cx18 *cx = stream->cx;
	struct cx18_dvb *dvb = stream->dvb;
	struct dvb_adapter *dvb_adapter;
	struct dvb_demux *dvbdemux;
	struct dmx_demux *dmx;
	int ret;

	if (!dvb)
		return -EINVAL;

	dvb->enabled = 0;
	dvb->stream = stream;

	ret = dvb_register_adapter(&dvb->dvb_adapter,
			CX18_DRIVER_NAME,
			THIS_MODULE, &cx->pci_dev->dev, adapter_nr);
	if (ret < 0)
		goto err_out;

	dvb_adapter = &dvb->dvb_adapter;

	dvbdemux = &dvb->demux;

	dvbdemux->priv = (void *)stream;

	dvbdemux->filternum = 256;
	dvbdemux->feednum = 256;
	dvbdemux->start_feed = cx18_dvb_start_feed;
	dvbdemux->stop_feed = cx18_dvb_stop_feed;
	dvbdemux->dmx.capabilities = (DMX_TS_FILTERING |
		DMX_SECTION_FILTERING | DMX_MEMORY_BASED_FILTERING);
	ret = dvb_dmx_init(dvbdemux);
	if (ret < 0)
		goto err_dvb_unregister_adapter;

	dmx = &dvbdemux->dmx;

	dvb->hw_frontend.source = DMX_FRONTEND_0;
	dvb->mem_frontend.source = DMX_MEMORY_FE;
	dvb->dmxdev.filternum = 256;
	dvb->dmxdev.demux = dmx;

	ret = dvb_dmxdev_init(&dvb->dmxdev, dvb_adapter);
	if (ret < 0)
		goto err_dvb_dmx_release;

	ret = dmx->add_frontend(dmx, &dvb->hw_frontend);
	if (ret < 0)
		goto err_dvb_dmxdev_release;

	ret = dmx->add_frontend(dmx, &dvb->mem_frontend);
	if (ret < 0)
		goto err_remove_hw_frontend;

	ret = dmx->connect_frontend(dmx, &dvb->hw_frontend);
	if (ret < 0)
		goto err_remove_mem_frontend;

	ret = dvb_register(stream);
	if (ret < 0)
		goto err_disconnect_frontend;

	dvb_net_init(dvb_adapter, &dvb->dvbnet, dmx);

	CX18_INFO("DVB Frontend registered\n");
	CX18_INFO("Registered DVB adapter%d for %s (%d x %d.%02d kB)\n",
		  stream->dvb->dvb_adapter.num, stream->name,
		  stream->buffers, stream->buf_size/1024,
		  (stream->buf_size * 100 / 1024) % 100);

	mutex_init(&dvb->feedlock);
	dvb->enabled = 1;
	return ret;

err_disconnect_frontend:
	dmx->disconnect_frontend(dmx);
err_remove_mem_frontend:
	dmx->remove_frontend(dmx, &dvb->mem_frontend);
err_remove_hw_frontend:
	dmx->remove_frontend(dmx, &dvb->hw_frontend);
err_dvb_dmxdev_release:
	dvb_dmxdev_release(&dvb->dmxdev);
err_dvb_dmx_release:
	dvb_dmx_release(dvbdemux);
err_dvb_unregister_adapter:
	dvb_unregister_adapter(dvb_adapter);
err_out:
	return ret;
}
开发者ID:AshishNamdev,项目名称:linux,代码行数:91,代码来源:cx18-dvb.c

示例13: kzalloc

/*static*/ int __init StmLoadModule(void)
{
	int Result;
	int i;
	short int AdapterNumbers[] = { -1 };
	DvbContext = kzalloc(sizeof(struct DvbContext_s), GFP_KERNEL);
	if (DvbContext == NULL)
	{
		DVB_ERROR("Unable to allocate device memory\n");
		return -ENOMEM;
	}
#ifdef __TDT__
	memset(DvbContext, 0, sizeof * DvbContext);
#endif
#ifdef __TDT__
	if (swts)
		printk("swts ->routing streams from dvr0 to tsm to pti to player\n");
	else
		printk("no swts ->routing streams from dvr0 direct to the player\n");
#endif
#if DVB_API_VERSION < 5
	Result = dvb_register_adapter(&DvbContext->DvbAdapter, MODULE_NAME, THIS_MODULE, NULL);
#else
	Result = dvb_register_adapter(&DvbContext->DvbAdapter, MODULE_NAME, THIS_MODULE, NULL, AdapterNumbers);
#endif
	if (Result < 0)
	{
		DVB_ERROR("Failed to register adapter (%d)\n", Result);
		kfree(DvbContext);
		DvbContext = NULL;
		return -ENOMEM;
	}
	mutex_init(&(DvbContext->Lock));
	mutex_lock(&(DvbContext->Lock));
	/*{{{  Register devices*/
	for (i = 0; i < DVB_MAX_DEVICES_PER_ADAPTER; i++)
	{
		struct DeviceContext_s* DeviceContext   = &DvbContext->DeviceContext[i];
		struct dvb_demux*       DvbDemux        = &DeviceContext->DvbDemux;
		struct dmxdev*          DmxDevice       = &DeviceContext->DmxDevice;
		struct dvb_device*      DvrDevice;
#ifdef __TDT__
		//sylvester: wenn der stream vom user kommt soll WriteToDecoder nix
		//tun, da das ja hier schon passiert. keine ahnung wie man das ansonsten
		//verhindern soll;-)
		DeviceContext->dvr_write = 0;
#endif
		DeviceContext->DvbContext = DvbContext;
#if defined (USE_KERNEL_DEMUX)
		memset(DvbDemux, 0, sizeof(struct dvb_demux));
#ifdef __TDT__
		DvbDemux->dmx.capabilities = DMX_TS_FILTERING | DMX_SECTION_FILTERING | DMX_MEMORY_BASED_FILTERING | DMX_TS_DESCRAMBLING;
		/* currently only dummy to avoid EINVAL error. Later we need it for second frontend ?! */
		DvbDemux->dmx.set_source = SetSource;
#else
		DvbDemux->dmx.capabilities = DMX_TS_FILTERING | DMX_SECTION_FILTERING | DMX_MEMORY_BASED_FILTERING;
#endif
		DvbDemux->priv = DeviceContext;
		DvbDemux->filternum = 32;
		DvbDemux->feednum = 32;
		DvbDemux->start_feed = StartFeed;
		DvbDemux->stop_feed = StopFeed;
#ifdef __TDT__
		DvbDemux->write_to_decoder = WriteToDecoder;
#else
		DvbDemux->write_to_decoder = NULL;
#endif
		Result = dvb_dmx_init(DvbDemux);
		if (Result < 0)
		{
			DVB_ERROR("dvb_dmx_init failed (errno = %d)\n", Result);
			return Result;
		}
		memset(DmxDevice, 0, sizeof(struct dmxdev));
		DmxDevice->filternum = DvbDemux->filternum;
		DmxDevice->demux = &DvbDemux->dmx;
		DmxDevice->capabilities = 0;
		Result = dvb_dmxdev_init(DmxDevice, &DvbContext->DvbAdapter);
		if (Result < 0)
		{
			DVB_ERROR("dvb_dmxdev_init failed (errno = %d)\n", Result);
			dvb_dmx_release(DvbDemux);
			return Result;
		}
		DvrDevice = DvrInit(DmxDevice->dvr_dvbdev->fops);
#ifdef __TDT__
		printk("%d: DeviceContext %p, DvbDemux %p, DmxDevice %p\n", i, DeviceContext, DvbDemux, DmxDevice);
#endif
		/* Unregister the built-in dvr device and replace it with our own version */
		dvb_unregister_device(DmxDevice->dvr_dvbdev);
		dvb_register_device(&DvbContext->DvbAdapter,
							&DmxDevice->dvr_dvbdev,
							DvrDevice, DmxDevice, DVB_DEVICE_DVR);
		DeviceContext->MemoryFrontend.source = DMX_MEMORY_FE;
		Result = DvbDemux->dmx.add_frontend(&DvbDemux->dmx, &DeviceContext->MemoryFrontend);
		if (Result < 0)
		{
			DVB_ERROR("add_frontend failed (errno = %d)\n", Result);
			dvb_dmxdev_release(DmxDevice);
			dvb_dmx_release(DvbDemux);
//.........这里部分代码省略.........
开发者ID:miciomaxx,项目名称:driver,代码行数:101,代码来源:dvb_module.c

示例14: smsdvb_hotplug

static int smsdvb_hotplug(struct smscore_device_t *coredev,
			  struct device *device, int arrival)
{
	struct smsclient_params_t params;
	struct smsdvb_client_t *client;
	int rc;

	/* device removal handled by onremove callback */
	if (!arrival)
		return 0;
	client = kzalloc(sizeof(struct smsdvb_client_t), GFP_KERNEL);
	if (!client)
		return -ENOMEM;

	/* register dvb adapter */
	rc = dvb_register_adapter(&client->adapter,
				  sms_get_board(
					smscore_get_board_id(coredev))->name,
				  THIS_MODULE, device, adapter_nr);
	if (rc < 0) {
		pr_err("dvb_register_adapter() failed %d\n", rc);
		goto adapter_error;
	}
	dvb_register_media_controller(&client->adapter, coredev->media_dev);

	/* init dvb demux */
	client->demux.dmx.capabilities = DMX_TS_FILTERING;
	client->demux.filternum = 32; /* todo: nova ??? */
	client->demux.feednum = 32;
	client->demux.start_feed = smsdvb_start_feed;
	client->demux.stop_feed = smsdvb_stop_feed;

	rc = dvb_dmx_init(&client->demux);
	if (rc < 0) {
		pr_err("dvb_dmx_init failed %d\n", rc);
		goto dvbdmx_error;
	}

	/* init dmxdev */
	client->dmxdev.filternum = 32;
	client->dmxdev.demux = &client->demux.dmx;
	client->dmxdev.capabilities = 0;

	rc = dvb_dmxdev_init(&client->dmxdev, &client->adapter);
	if (rc < 0) {
		pr_err("dvb_dmxdev_init failed %d\n", rc);
		goto dmxdev_error;
	}

	/* init and register frontend */
	memcpy(&client->frontend.ops, &smsdvb_fe_ops,
	       sizeof(struct dvb_frontend_ops));

	switch (smscore_get_device_mode(coredev)) {
	case DEVICE_MODE_DVBT:
	case DEVICE_MODE_DVBT_BDA:
		client->frontend.ops.delsys[0] = SYS_DVBT;
		break;
	case DEVICE_MODE_ISDBT:
	case DEVICE_MODE_ISDBT_BDA:
		client->frontend.ops.delsys[0] = SYS_ISDBT;
		break;
	}

	rc = dvb_register_frontend(&client->adapter, &client->frontend);
	if (rc < 0) {
		pr_err("frontend registration failed %d\n", rc);
		goto frontend_error;
	}

	params.initial_id = 1;
	params.data_type = MSG_SMS_DVBT_BDA_DATA;
	params.onresponse_handler = smsdvb_onresponse;
	params.onremove_handler = smsdvb_onremove;
	params.context = client;

	rc = smscore_register_client(coredev, &params, &client->smsclient);
	if (rc < 0) {
		pr_err("smscore_register_client() failed %d\n", rc);
		goto client_error;
	}

	client->coredev = coredev;

	init_completion(&client->tune_done);
	init_completion(&client->stats_done);

	kmutex_lock(&g_smsdvb_clientslock);

	list_add(&client->entry, &g_smsdvb_clients);

	kmutex_unlock(&g_smsdvb_clientslock);

	client->event_fe_state = -1;
	client->event_unc_state = -1;
	sms_board_dvb3_event(client, DVB3_EVENT_HOTPLUG);

	sms_board_setup(coredev);

	if (smsdvb_debugfs_create(client) < 0)
//.........这里部分代码省略.........
开发者ID:ReneNyffenegger,项目名称:linux,代码行数:101,代码来源:smsdvb-main.c

示例15: as102_dvb_register

int as102_dvb_register(struct as102_dev_t *as102_dev)
{
	struct device *dev = &as102_dev->bus_adap.usb_dev->dev;
	int ret;

	ret = dvb_register_adapter(&as102_dev->dvb_adap,
			   as102_dev->name, THIS_MODULE,
			   dev, adapter_nr);
	if (ret < 0) {
		dev_err(dev, "%s: dvb_register_adapter() failed: %d\n",
			__func__, ret);
		return ret;
	}

	as102_dev->dvb_dmx.priv = as102_dev;
	as102_dev->dvb_dmx.filternum = pid_filtering ? 16 : 256;
	as102_dev->dvb_dmx.feednum = 256;
	as102_dev->dvb_dmx.start_feed = as102_dvb_dmx_start_feed;
	as102_dev->dvb_dmx.stop_feed = as102_dvb_dmx_stop_feed;

	as102_dev->dvb_dmx.dmx.capabilities = DMX_TS_FILTERING |
					      DMX_SECTION_FILTERING;

	as102_dev->dvb_dmxdev.filternum = as102_dev->dvb_dmx.filternum;
	as102_dev->dvb_dmxdev.demux = &as102_dev->dvb_dmx.dmx;
	as102_dev->dvb_dmxdev.capabilities = 0;

	ret = dvb_dmx_init(&as102_dev->dvb_dmx);
	if (ret < 0) {
		dev_err(dev, "%s: dvb_dmx_init() failed: %d\n", __func__, ret);
		goto edmxinit;
	}

	ret = dvb_dmxdev_init(&as102_dev->dvb_dmxdev, &as102_dev->dvb_adap);
	if (ret < 0) {
		dev_err(dev, "%s: dvb_dmxdev_init() failed: %d\n",
			__func__, ret);
		goto edmxdinit;
	}

	ret = as102_dvb_register_fe(as102_dev, &as102_dev->dvb_fe);
	if (ret < 0) {
		dev_err(dev, "%s: as102_dvb_register_frontend() failed: %d",
		    __func__, ret);
		goto efereg;
	}

	/* init bus mutex for token locking */
	mutex_init(&as102_dev->bus_adap.lock);

	/* init start / stop stream mutex */
	mutex_init(&as102_dev->sem);

	/*
	 * try to load as102 firmware. If firmware upload failed, we'll be
	 * able to upload it later.
	 */
	if (fw_upload)
		try_then_request_module(as102_fw_upload(&as102_dev->bus_adap),
				"firmware_class");

	pr_info("Registered device %s", as102_dev->name);
	return 0;

efereg:
	dvb_dmxdev_release(&as102_dev->dvb_dmxdev);
edmxdinit:
	dvb_dmx_release(&as102_dev->dvb_dmx);
edmxinit:
	dvb_unregister_adapter(&as102_dev->dvb_adap);
	return ret;
}
开发者ID:openube,项目名称:android_kernel_sony_c2305,代码行数:72,代码来源:as102_drv.c


注:本文中的dvb_dmx_init函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。