Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 330577
b: refs/heads/master
c: 3256cde
h: refs/heads/master
i:
  330575: edda215
v: v3
  • Loading branch information
Antti Palosaari authored and Mauro Carvalho Chehab committed Aug 4, 2012
1 parent 50e090c commit b6a2846
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 35 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 39831f094fb703412c23a1178d28e1d8d1aa4d18
refs/heads/master: 3256cdef6ea09776e587b23240b74ead733fb11c
3 changes: 1 addition & 2 deletions trunk/drivers/media/dvb/dvb-usb/dvb_usb.h
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,6 @@ struct dvb_usb_fe_adapter {
int (*fe_init) (struct dvb_frontend *);
int (*fe_sleep) (struct dvb_frontend *);

struct usb_data_stream stream;

int pid_filtering;
int max_feed_count;

Expand All @@ -325,6 +323,7 @@ struct dvb_usb_fe_adapter {
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
Expand Down
5 changes: 2 additions & 3 deletions trunk/drivers/media/dvb/dvb-usb/dvb_usb_dvb.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ static int dvb_usb_ctrl_feed(struct dvb_demux_feed *dvbdmxfeed, int onoff)
/* 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(
Expand Down Expand Up @@ -70,8 +70,7 @@ static int dvb_usb_ctrl_feed(struct dvb_demux_feed *dvbdmxfeed, int onoff)
}

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 &&
Expand Down
54 changes: 25 additions & 29 deletions trunk/drivers/media/dvb/dvb-usb/dvb_usb_urb.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,43 +93,39 @@ static void dvb_usb_data_complete_raw(struct usb_data_stream *stream,

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;
}

0 comments on commit b6a2846

Please sign in to comment.