int (*fe_init) (struct dvb_frontend *);
int (*fe_sleep) (struct dvb_frontend *);
- struct usb_data_stream stream;
-
int pid_filtering;
int max_feed_count;
struct dvb_usb_adapter {
struct dvb_usb_device *dev;
struct dvb_usb_adapter_properties props;
+ struct usb_data_stream stream;
#define DVB_USB_ADAP_STATE_INIT 0x000
#define DVB_USB_ADAP_STATE_DVB 0x001
/* stop feed before setting a new pid if there will be no pid anymore */
if (newfeedcount == 0) {
deb_ts("stop feeding\n");
- usb_urb_kill(&adap->fe_adap[adap->active_fe].stream);
+ usb_urb_kill(&adap->stream);
if (adap->props.fe[adap->active_fe].streaming_ctrl != NULL) {
ret = adap->props.fe[adap->active_fe].streaming_ctrl(
}
deb_ts("submitting all URBs\n");
- usb_urb_submit(&adap->fe_adap[adap->active_fe].stream,
- &stream_props);
+ usb_urb_submit(&adap->stream, &stream_props);
deb_ts("controlling pid parser\n");
if (adap->props.fe[adap->active_fe].caps & DVB_USB_ADAP_HAS_PID_FILTER &&
int dvb_usb_adapter_stream_init(struct dvb_usb_adapter *adap)
{
- int i, ret = 0;
+ int ret;
struct usb_data_stream_properties stream_props;
- for (i = 0; i < adap->props.num_frontends; i++) {
- adap->fe_adap[i].stream.udev = adap->dev->udev;
- if (adap->props.fe[i].caps & DVB_USB_ADAP_RECEIVES_204_BYTE_TS)
- adap->fe_adap[i].stream.complete =
- dvb_usb_data_complete_204;
- else
- if (adap->props.fe[i].caps & DVB_USB_ADAP_RECEIVES_RAW_PAYLOAD)
- adap->fe_adap[i].stream.complete =
- dvb_usb_data_complete_raw;
- else
- adap->fe_adap[i].stream.complete = dvb_usb_data_complete;
- adap->fe_adap[i].stream.user_priv = adap;
-
- /* resolve USB stream configuration */
- if (adap->dev->props.get_usb_stream_config) {
- ret = adap->dev->props.get_usb_stream_config(NULL,
- &stream_props);
- if (ret < 0)
- break;
- } else {
- stream_props = adap->props.fe[i].stream;
- }
+ /*
+ * FIXME: We should config demux callback for each time streaming is
+ * started. Same for the USB data stream config.
+ */
+
+ adap->stream.udev = adap->dev->udev;
+ if (adap->props.fe[0].caps & DVB_USB_ADAP_RECEIVES_204_BYTE_TS)
+ adap->stream.complete = dvb_usb_data_complete_204;
+ else if (adap->props.fe[0].caps & DVB_USB_ADAP_RECEIVES_RAW_PAYLOAD)
+ adap->stream.complete = dvb_usb_data_complete_raw;
+ else
+ adap->stream.complete = dvb_usb_data_complete;
- ret = usb_urb_init(&adap->fe_adap[i].stream, &stream_props);
+ adap->stream.user_priv = adap;
+
+ /* resolve USB stream configuration */
+ if (adap->dev->props.get_usb_stream_config) {
+ ret = adap->dev->props.get_usb_stream_config(NULL,
+ &stream_props);
if (ret < 0)
- break;
+ return ret;
+ } else {
+ stream_props = adap->props.fe[0].stream;
}
- return ret;
+
+ return usb_urb_init(&adap->stream, &stream_props);
}
int dvb_usb_adapter_stream_exit(struct dvb_usb_adapter *adap)
{
- int i;
- for (i = 0; i < adap->props.num_frontends; i++)
- usb_urb_exit(&adap->fe_adap[i].stream);
+ usb_urb_exit(&adap->stream);
return 0;
}