[PATCH] dvb: core: dvb_demux formatting fixes
Formatting fixes (Lindent + some handwork). Signed-off-by: Andreas Oberritter <obi@linuxtv.org> Signed-off-by: Johannes Stezenbach <js@linuxtv.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
db574d7d6e
commit
dad4a73071
|
@ -38,55 +38,52 @@
|
|||
*/
|
||||
// #define DVB_DEMUX_SECTION_LOSS_LOG
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* static inlined helper functions
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
static inline u16 section_length(const u8 *buf)
|
||||
{
|
||||
return 3 + ((buf[1] & 0x0f) << 8) + buf[2];
|
||||
}
|
||||
|
||||
|
||||
static inline u16 ts_pid(const u8 *buf)
|
||||
{
|
||||
return ((buf[1] & 0x1f) << 8) + buf[2];
|
||||
}
|
||||
|
||||
|
||||
static inline u8 payload(const u8 *tsp)
|
||||
{
|
||||
if (!(tsp[3] & 0x10)) // no payload?
|
||||
return 0;
|
||||
|
||||
if (tsp[3] & 0x20) { // adaptation field?
|
||||
if (tsp[4] > 183) // corrupted data?
|
||||
return 0;
|
||||
else
|
||||
return 184 - 1 - tsp[4];
|
||||
}
|
||||
|
||||
return 184;
|
||||
}
|
||||
|
||||
|
||||
static u32 dvb_dmx_crc32(struct dvb_demux_feed *f, const u8 *src, size_t len)
|
||||
{
|
||||
return (f->feed.sec.crc_val = crc32_be(f->feed.sec.crc_val, src, len));
|
||||
}
|
||||
|
||||
|
||||
static void dvb_dmx_memcopy (struct dvb_demux_feed *f, u8 *d, const u8 *s, size_t len)
|
||||
static void dvb_dmx_memcopy(struct dvb_demux_feed *f, u8 *d, const u8 *s,
|
||||
size_t len)
|
||||
{
|
||||
memcpy(d, s, len);
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* Software filter functions
|
||||
******************************************************************************/
|
||||
|
||||
static inline int dvb_dmx_swfilter_payload (struct dvb_demux_feed *feed, const u8 *buf)
|
||||
static inline int dvb_dmx_swfilter_payload(struct dvb_demux_feed *feed,
|
||||
const u8 *buf)
|
||||
{
|
||||
int count = payload(buf);
|
||||
int p;
|
||||
|
@ -100,8 +97,8 @@ static inline int dvb_dmx_swfilter_payload (struct dvb_demux_feed *feed, const u
|
|||
|
||||
/*
|
||||
cc = buf[3] & 0x0f;
|
||||
ccok=((dvbdmxfeed->cc+1)&0x0f)==cc ? 1 : 0;
|
||||
dvbdmxfeed->cc=cc;
|
||||
ccok = ((feed->cc + 1) & 0x0f) == cc;
|
||||
feed->cc = cc;
|
||||
if (!ccok)
|
||||
printk("missed packet!\n");
|
||||
*/
|
||||
|
@ -114,7 +111,6 @@ static inline int dvb_dmx_swfilter_payload (struct dvb_demux_feed *feed, const u
|
|||
return feed->cb.ts(&buf[p], count, NULL, 0, &feed->feed.ts, DMX_OK);
|
||||
}
|
||||
|
||||
|
||||
static int dvb_dmx_swfilter_sectionfilter(struct dvb_demux_feed *feed,
|
||||
struct dvb_demux_filter *f)
|
||||
{
|
||||
|
@ -137,7 +133,6 @@ static int dvb_dmx_swfilter_sectionfilter (struct dvb_demux_feed *feed,
|
|||
NULL, 0, &f->filter, DMX_OK);
|
||||
}
|
||||
|
||||
|
||||
static inline int dvb_dmx_swfilter_section_feed(struct dvb_demux_feed *feed)
|
||||
{
|
||||
struct dvb_demux *demux = feed->demux;
|
||||
|
@ -168,22 +163,20 @@ static inline int dvb_dmx_swfilter_section_feed (struct dvb_demux_feed *feed)
|
|||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static void dvb_dmx_swfilter_section_new(struct dvb_demux_feed *feed)
|
||||
{
|
||||
struct dmx_section_feed *sec = &feed->feed.sec;
|
||||
|
||||
#ifdef DVB_DEMUX_SECTION_LOSS_LOG
|
||||
if(sec->secbufp < sec->tsfeedp)
|
||||
{
|
||||
if (sec->secbufp < sec->tsfeedp) {
|
||||
int i, n = sec->tsfeedp - sec->secbufp;
|
||||
|
||||
/* section padding is done with 0xff bytes entirely.
|
||||
** due to speed reasons, we won't check all of them
|
||||
** but just first and last
|
||||
/*
|
||||
* Section padding is done with 0xff bytes entirely.
|
||||
* Due to speed reasons, we won't check all of them
|
||||
* but just first and last.
|
||||
*/
|
||||
if(sec->secbuf[0] != 0xff || sec->secbuf[n-1] != 0xff)
|
||||
{
|
||||
if (sec->secbuf[0] != 0xff || sec->secbuf[n - 1] != 0xff) {
|
||||
printk("dvb_demux.c section ts padding loss: %d/%d\n",
|
||||
n, sec->tsfeedp);
|
||||
printk("dvb_demux.c pad data:");
|
||||
|
@ -199,24 +192,25 @@ static void dvb_dmx_swfilter_section_new(struct dvb_demux_feed *feed)
|
|||
}
|
||||
|
||||
/*
|
||||
** Losless Section Demux 1.4.1 by Emard
|
||||
** Valsecchi Patrick:
|
||||
** - middle of section A (no PUSI)
|
||||
** - end of section A and start of section B
|
||||
** (with PUSI pointing to the start of the second section)
|
||||
**
|
||||
** In this case, without feed->pusi_seen you'll receive a garbage section
|
||||
** consisting of the end of section A. Basically because tsfeedp
|
||||
** is incemented and the use=0 condition is not raised
|
||||
** when the second packet arrives.
|
||||
**
|
||||
** Fix:
|
||||
** when demux is started, let feed->pusi_seen = 0 to
|
||||
** prevent initial feeding of garbage from the end of
|
||||
** previous section. When you for the first time see PUSI=1
|
||||
** then set feed->pusi_seen = 1
|
||||
* Losless Section Demux 1.4.1 by Emard
|
||||
* Valsecchi Patrick:
|
||||
* - middle of section A (no PUSI)
|
||||
* - end of section A and start of section B
|
||||
* (with PUSI pointing to the start of the second section)
|
||||
*
|
||||
* In this case, without feed->pusi_seen you'll receive a garbage section
|
||||
* consisting of the end of section A. Basically because tsfeedp
|
||||
* is incemented and the use=0 condition is not raised
|
||||
* when the second packet arrives.
|
||||
*
|
||||
* Fix:
|
||||
* when demux is started, let feed->pusi_seen = 0 to
|
||||
* prevent initial feeding of garbage from the end of
|
||||
* previous section. When you for the first time see PUSI=1
|
||||
* then set feed->pusi_seen = 1
|
||||
*/
|
||||
static int dvb_dmx_swfilter_section_copy_dump(struct dvb_demux_feed *feed, const u8 *buf, u8 len)
|
||||
static int dvb_dmx_swfilter_section_copy_dump(struct dvb_demux_feed *feed,
|
||||
const u8 *buf, u8 len)
|
||||
{
|
||||
struct dvb_demux *demux = feed->demux;
|
||||
struct dmx_section_feed *sec = &feed->feed.sec;
|
||||
|
@ -225,11 +219,11 @@ static int dvb_dmx_swfilter_section_copy_dump(struct dvb_demux_feed *feed, const
|
|||
if (sec->tsfeedp >= DMX_MAX_SECFEED_SIZE)
|
||||
return 0;
|
||||
|
||||
if(sec->tsfeedp + len > DMX_MAX_SECFEED_SIZE)
|
||||
{
|
||||
if (sec->tsfeedp + len > DMX_MAX_SECFEED_SIZE) {
|
||||
#ifdef DVB_DEMUX_SECTION_LOSS_LOG
|
||||
printk("dvb_demux.c section buffer full loss: %d/%d\n",
|
||||
sec->tsfeedp + len - DMX_MAX_SECFEED_SIZE, DMX_MAX_SECFEED_SIZE);
|
||||
sec->tsfeedp + len - DMX_MAX_SECFEED_SIZE,
|
||||
DMX_MAX_SECFEED_SIZE);
|
||||
#endif
|
||||
len = DMX_MAX_SECFEED_SIZE - sec->tsfeedp;
|
||||
}
|
||||
|
@ -240,10 +234,9 @@ static int dvb_dmx_swfilter_section_copy_dump(struct dvb_demux_feed *feed, const
|
|||
demux->memcopy(feed, sec->secbuf_base + sec->tsfeedp, buf, len);
|
||||
sec->tsfeedp += len;
|
||||
|
||||
/* -----------------------------------------------------
|
||||
** Dump all the sections we can find in the data (Emard)
|
||||
/*
|
||||
* Dump all the sections we can find in the data (Emard)
|
||||
*/
|
||||
|
||||
limit = sec->tsfeedp;
|
||||
if (limit > DMX_MAX_SECFEED_SIZE)
|
||||
return -1; /* internal error should never happen */
|
||||
|
@ -251,8 +244,7 @@ static int dvb_dmx_swfilter_section_copy_dump(struct dvb_demux_feed *feed, const
|
|||
/* to be sure always set secbuf */
|
||||
sec->secbuf = sec->secbuf_base + sec->secbufp;
|
||||
|
||||
for(n = 0; sec->secbufp + 2 < limit; n++)
|
||||
{
|
||||
for (n = 0; sec->secbufp + 2 < limit; n++) {
|
||||
seclen = section_length(sec->secbuf);
|
||||
if (seclen <= 0 || seclen > DMX_MAX_SECFEED_SIZE
|
||||
|| seclen + sec->secbufp > limit)
|
||||
|
@ -267,14 +259,14 @@ static int dvb_dmx_swfilter_section_copy_dump(struct dvb_demux_feed *feed, const
|
|||
printk("dvb_demux.c pusi not seen, discarding section data\n");
|
||||
#endif
|
||||
sec->secbufp += seclen; /* secbufp and secbuf moving together is */
|
||||
sec->secbuf += seclen; /* redundand but saves pointer arithmetic */
|
||||
sec->secbuf += seclen; /* redundant but saves pointer arithmetic */
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int dvb_dmx_swfilter_section_packet(struct dvb_demux_feed *feed, const u8 *buf)
|
||||
static int dvb_dmx_swfilter_section_packet(struct dvb_demux_feed *feed,
|
||||
const u8 *buf)
|
||||
{
|
||||
u8 p, count;
|
||||
int ccok, dc_i = 0;
|
||||
|
@ -299,49 +291,51 @@ static int dvb_dmx_swfilter_section_packet(struct dvb_demux_feed *feed, const u8
|
|||
|
||||
if (!ccok || dc_i) {
|
||||
#ifdef DVB_DEMUX_SECTION_LOSS_LOG
|
||||
printk("dvb_demux.c discontinuity detected %d bytes lost\n", count);
|
||||
/* those bytes under sume circumstances will again be reported
|
||||
** in the following dvb_dmx_swfilter_section_new
|
||||
printk("dvb_demux.c discontinuity detected %d bytes lost\n",
|
||||
count);
|
||||
/*
|
||||
* those bytes under sume circumstances will again be reported
|
||||
* in the following dvb_dmx_swfilter_section_new
|
||||
*/
|
||||
#endif
|
||||
/* Discontinuity detected. Reset pusi_seen = 0 to
|
||||
** stop feeding of suspicious data until next PUSI=1 arrives
|
||||
/*
|
||||
* Discontinuity detected. Reset pusi_seen = 0 to
|
||||
* stop feeding of suspicious data until next PUSI=1 arrives
|
||||
*/
|
||||
feed->pusi_seen = 0;
|
||||
dvb_dmx_swfilter_section_new(feed);
|
||||
}
|
||||
|
||||
if (buf[1] & 0x40) {
|
||||
// PUSI=1 (is set), section boundary is here
|
||||
/* PUSI=1 (is set), section boundary is here */
|
||||
if (count > 1 && buf[p] < count) {
|
||||
const u8 *before = buf+p+1;
|
||||
const u8 *before = &buf[p + 1];
|
||||
u8 before_len = buf[p];
|
||||
const u8 *after = before+before_len;
|
||||
const u8 *after = &before[before_len];
|
||||
u8 after_len = count - 1 - before_len;
|
||||
|
||||
dvb_dmx_swfilter_section_copy_dump(feed, before, before_len);
|
||||
dvb_dmx_swfilter_section_copy_dump(feed, before,
|
||||
before_len);
|
||||
/* before start of new section, set pusi_seen = 1 */
|
||||
feed->pusi_seen = 1;
|
||||
dvb_dmx_swfilter_section_new(feed);
|
||||
dvb_dmx_swfilter_section_copy_dump(feed, after, after_len);
|
||||
dvb_dmx_swfilter_section_copy_dump(feed, after,
|
||||
after_len);
|
||||
}
|
||||
#ifdef DVB_DEMUX_SECTION_LOSS_LOG
|
||||
else
|
||||
if (count > 0)
|
||||
else if (count > 0)
|
||||
printk("dvb_demux.c PUSI=1 but %d bytes lost\n", count);
|
||||
#endif
|
||||
} else {
|
||||
// PUSI=0 (is not set), no section boundary
|
||||
const u8 *entire = buf+p;
|
||||
u8 entire_len = count;
|
||||
|
||||
dvb_dmx_swfilter_section_copy_dump(feed, entire, entire_len);
|
||||
/* PUSI=0 (is not set), no section boundary */
|
||||
dvb_dmx_swfilter_section_copy_dump(feed, &buf[p], count);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static inline void dvb_dmx_swfilter_packet_type(struct dvb_demux_feed *feed, const u8 *buf)
|
||||
static inline void dvb_dmx_swfilter_packet_type(struct dvb_demux_feed *feed,
|
||||
const u8 *buf)
|
||||
{
|
||||
switch (feed->type) {
|
||||
case DMX_TYPE_TS:
|
||||
|
@ -351,7 +345,8 @@ static inline void dvb_dmx_swfilter_packet_type(struct dvb_demux_feed *feed, con
|
|||
if (feed->ts_type & TS_PAYLOAD_ONLY)
|
||||
dvb_dmx_swfilter_payload(feed, buf);
|
||||
else
|
||||
feed->cb.ts(buf, 188, NULL, 0, &feed->feed.ts, DMX_OK);
|
||||
feed->cb.ts(buf, 188, NULL, 0, &feed->feed.ts,
|
||||
DMX_OK);
|
||||
}
|
||||
if (feed->ts_type & TS_DECODER)
|
||||
if (feed->demux->write_to_decoder)
|
||||
|
@ -404,21 +399,21 @@ static void dvb_dmx_swfilter_packet(struct dvb_demux *demux, const u8 *buf)
|
|||
}
|
||||
}
|
||||
|
||||
void dvb_dmx_swfilter_packets(struct dvb_demux *demux, const u8 *buf, size_t count)
|
||||
void dvb_dmx_swfilter_packets(struct dvb_demux *demux, const u8 *buf,
|
||||
size_t count)
|
||||
{
|
||||
spin_lock(&demux->lock);
|
||||
|
||||
while (count--) {
|
||||
if(buf[0] == 0x47) {
|
||||
if (buf[0] == 0x47)
|
||||
dvb_dmx_swfilter_packet(demux, buf);
|
||||
}
|
||||
buf += 188;
|
||||
}
|
||||
|
||||
spin_unlock(&demux->lock);
|
||||
}
|
||||
EXPORT_SYMBOL(dvb_dmx_swfilter_packets);
|
||||
|
||||
EXPORT_SYMBOL(dvb_dmx_swfilter_packets);
|
||||
|
||||
void dvb_dmx_swfilter(struct dvb_demux *demux, const u8 *buf, size_t count)
|
||||
{
|
||||
|
@ -426,8 +421,10 @@ void dvb_dmx_swfilter(struct dvb_demux *demux, const u8 *buf, size_t count)
|
|||
|
||||
spin_lock(&demux->lock);
|
||||
|
||||
if ((i = demux->tsbufp)) {
|
||||
if (count < (j=188-i)) {
|
||||
if (demux->tsbufp) {
|
||||
i = demux->tsbufp;
|
||||
j = 188 - i;
|
||||
if (count < j) {
|
||||
memcpy(&demux->tsbuf[i], buf, count);
|
||||
demux->tsbufp += count;
|
||||
goto bailout;
|
||||
|
@ -442,11 +439,11 @@ void dvb_dmx_swfilter(struct dvb_demux *demux, const u8 *buf, size_t count)
|
|||
while (p < count) {
|
||||
if (buf[p] == 0x47) {
|
||||
if (count - p >= 188) {
|
||||
dvb_dmx_swfilter_packet(demux, buf+p);
|
||||
dvb_dmx_swfilter_packet(demux, &buf[p]);
|
||||
p += 188;
|
||||
} else {
|
||||
i = count - p;
|
||||
memcpy(demux->tsbuf, buf+p, i);
|
||||
memcpy(demux->tsbuf, &buf[p], i);
|
||||
demux->tsbufp = i;
|
||||
goto bailout;
|
||||
}
|
||||
|
@ -457,16 +454,20 @@ void dvb_dmx_swfilter(struct dvb_demux *demux, const u8 *buf, size_t count)
|
|||
bailout:
|
||||
spin_unlock(&demux->lock);
|
||||
}
|
||||
|
||||
EXPORT_SYMBOL(dvb_dmx_swfilter);
|
||||
|
||||
void dvb_dmx_swfilter_204(struct dvb_demux *demux, const u8 *buf, size_t count)
|
||||
{
|
||||
int p = 0, i, j;
|
||||
u8 tmppack[188];
|
||||
|
||||
spin_lock(&demux->lock);
|
||||
|
||||
if ((i = demux->tsbufp)) {
|
||||
if (count < (j=204-i)) {
|
||||
if (demux->tsbufp) {
|
||||
i = demux->tsbufp;
|
||||
j = 204 - i;
|
||||
if (count < j) {
|
||||
memcpy(&demux->tsbuf[i], buf, count);
|
||||
demux->tsbufp += count;
|
||||
goto bailout;
|
||||
|
@ -474,7 +475,8 @@ void dvb_dmx_swfilter_204(struct dvb_demux *demux, const u8 *buf, size_t count)
|
|||
memcpy(&demux->tsbuf[i], buf, j);
|
||||
if ((demux->tsbuf[0] == 0x47) | (demux->tsbuf[0] == 0xB8)) {
|
||||
memcpy(tmppack, demux->tsbuf, 188);
|
||||
if (tmppack[0] == 0xB8) tmppack[0] = 0x47;
|
||||
if (tmppack[0] == 0xB8)
|
||||
tmppack[0] = 0x47;
|
||||
dvb_dmx_swfilter_packet(demux, tmppack);
|
||||
}
|
||||
demux->tsbufp = 0;
|
||||
|
@ -484,13 +486,14 @@ void dvb_dmx_swfilter_204(struct dvb_demux *demux, const u8 *buf, size_t count)
|
|||
while (p < count) {
|
||||
if ((buf[p] == 0x47) | (buf[p] == 0xB8)) {
|
||||
if (count - p >= 204) {
|
||||
memcpy(tmppack, buf+p, 188);
|
||||
if (tmppack[0] == 0xB8) tmppack[0] = 0x47;
|
||||
memcpy(tmppack, &buf[p], 188);
|
||||
if (tmppack[0] == 0xB8)
|
||||
tmppack[0] = 0x47;
|
||||
dvb_dmx_swfilter_packet(demux, tmppack);
|
||||
p += 204;
|
||||
} else {
|
||||
i = count - p;
|
||||
memcpy(demux->tsbuf, buf+p, i);
|
||||
memcpy(demux->tsbuf, &buf[p], i);
|
||||
demux->tsbufp = i;
|
||||
goto bailout;
|
||||
}
|
||||
|
@ -502,8 +505,8 @@ void dvb_dmx_swfilter_204(struct dvb_demux *demux, const u8 *buf, size_t count)
|
|||
bailout:
|
||||
spin_unlock(&demux->lock);
|
||||
}
|
||||
EXPORT_SYMBOL(dvb_dmx_swfilter_204);
|
||||
|
||||
EXPORT_SYMBOL(dvb_dmx_swfilter_204);
|
||||
|
||||
static struct dvb_demux_filter *dvb_dmx_filter_alloc(struct dvb_demux *demux)
|
||||
{
|
||||
|
@ -577,8 +580,8 @@ out:
|
|||
}
|
||||
|
||||
static int dmx_ts_feed_set(struct dmx_ts_feed *ts_feed, u16 pid, int ts_type,
|
||||
enum dmx_ts_pes pes_type, size_t circular_buffer_size,
|
||||
struct timespec timeout)
|
||||
enum dmx_ts_pes pes_type,
|
||||
size_t circular_buffer_size, struct timespec timeout)
|
||||
{
|
||||
struct dvb_demux_feed *feed = (struct dvb_demux_feed *)ts_feed;
|
||||
struct dvb_demux *demux = feed->demux;
|
||||
|
@ -631,7 +634,6 @@ static int dmx_ts_feed_set (struct dmx_ts_feed* ts_feed, u16 pid, int ts_type,
|
|||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int dmx_ts_feed_start_filtering(struct dmx_ts_feed *ts_feed)
|
||||
{
|
||||
struct dvb_demux_feed *feed = (struct dvb_demux_feed *)ts_feed;
|
||||
|
@ -695,7 +697,8 @@ static int dmx_ts_feed_stop_filtering(struct dmx_ts_feed* ts_feed)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static int dvbdmx_allocate_ts_feed (struct dmx_demux *dmx, struct dmx_ts_feed **ts_feed,
|
||||
static int dvbdmx_allocate_ts_feed(struct dmx_demux *dmx,
|
||||
struct dmx_ts_feed **ts_feed,
|
||||
dmx_ts_cb callback)
|
||||
{
|
||||
struct dvb_demux *demux = (struct dvb_demux *)dmx;
|
||||
|
@ -724,7 +727,6 @@ static int dvbdmx_allocate_ts_feed (struct dmx_demux *dmx, struct dmx_ts_feed **
|
|||
(*ts_feed)->stop_filtering = dmx_ts_feed_stop_filtering;
|
||||
(*ts_feed)->set = dmx_ts_feed_set;
|
||||
|
||||
|
||||
if (!(feed->filter = dvb_dmx_filter_alloc(demux))) {
|
||||
feed->state = DMX_STATE_FREE;
|
||||
up(&demux->mutex);
|
||||
|
@ -740,7 +742,8 @@ static int dvbdmx_allocate_ts_feed (struct dmx_demux *dmx, struct dmx_ts_feed **
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int dvbdmx_release_ts_feed(struct dmx_demux *dmx, struct dmx_ts_feed *ts_feed)
|
||||
static int dvbdmx_release_ts_feed(struct dmx_demux *dmx,
|
||||
struct dmx_ts_feed *ts_feed)
|
||||
{
|
||||
struct dvb_demux *demux = (struct dvb_demux *)dmx;
|
||||
struct dvb_demux_feed *feed = (struct dvb_demux_feed *)ts_feed;
|
||||
|
@ -752,10 +755,9 @@ static int dvbdmx_release_ts_feed(struct dmx_demux *dmx, struct dmx_ts_feed *ts_
|
|||
up(&demux->mutex);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
#ifndef NOBUFS
|
||||
vfree(feed->buffer);
|
||||
feed->buffer=0;
|
||||
feed->buffer = NULL;
|
||||
#endif
|
||||
|
||||
feed->state = DMX_STATE_FREE;
|
||||
|
@ -772,7 +774,6 @@ static int dvbdmx_release_ts_feed(struct dmx_demux *dmx, struct dmx_ts_feed *ts_
|
|||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* dmx_section_feed API calls
|
||||
******************************************************************************/
|
||||
|
@ -808,7 +809,6 @@ static int dmx_section_feed_allocate_filter(struct dmx_section_feed* feed,
|
|||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int dmx_section_feed_set(struct dmx_section_feed *feed,
|
||||
u16 pid, size_t circular_buffer_size,
|
||||
int check_crc)
|
||||
|
@ -843,7 +843,6 @@ static int dmx_section_feed_set(struct dmx_section_feed* feed,
|
|||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static void prepare_secfilters(struct dvb_demux_feed *dvbdmxfeed)
|
||||
{
|
||||
int i;
|
||||
|
@ -866,7 +865,6 @@ static void prepare_secfilters(struct dvb_demux_feed *dvbdmxfeed)
|
|||
} while ((f = f->next));
|
||||
}
|
||||
|
||||
|
||||
static int dmx_section_feed_start_filtering(struct dmx_section_feed *feed)
|
||||
{
|
||||
struct dvb_demux_feed *dvbdmxfeed = (struct dvb_demux_feed *)feed;
|
||||
|
@ -912,7 +910,6 @@ static int dmx_section_feed_start_filtering(struct dmx_section_feed *feed)
|
|||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int dmx_section_feed_stop_filtering(struct dmx_section_feed *feed)
|
||||
{
|
||||
struct dvb_demux_feed *dvbdmxfeed = (struct dvb_demux_feed *)feed;
|
||||
|
@ -938,7 +935,6 @@ static int dmx_section_feed_stop_filtering(struct dmx_section_feed* feed)
|
|||
return ret;
|
||||
}
|
||||
|
||||
|
||||
static int dmx_section_feed_release_filter(struct dmx_section_feed *feed,
|
||||
struct dmx_section_filter *filter)
|
||||
{
|
||||
|
@ -1029,7 +1025,7 @@ static int dvbdmx_release_section_feed(struct dmx_demux *demux,
|
|||
}
|
||||
#ifndef NOBUFS
|
||||
vfree(dvbdmxfeed->buffer);
|
||||
dvbdmxfeed->buffer=0;
|
||||
dvbdmxfeed->buffer = NULL;
|
||||
#endif
|
||||
dvbdmxfeed->state = DMX_STATE_FREE;
|
||||
|
||||
|
@ -1041,7 +1037,6 @@ static int dvbdmx_release_section_feed(struct dmx_demux *demux,
|
|||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* dvb_demux kernel data API calls
|
||||
******************************************************************************/
|
||||
|
@ -1057,7 +1052,6 @@ static int dvbdmx_open(struct dmx_demux *demux)
|
|||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int dvbdmx_close(struct dmx_demux *demux)
|
||||
{
|
||||
struct dvb_demux *dvbdemux = (struct dvb_demux *)demux;
|
||||
|
@ -1070,7 +1064,6 @@ static int dvbdmx_close(struct dmx_demux *demux)
|
|||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int dvbdmx_write(struct dmx_demux *demux, const char *buf, size_t count)
|
||||
{
|
||||
struct dvb_demux *dvbdemux = (struct dvb_demux *)demux;
|
||||
|
@ -1088,8 +1081,8 @@ static int dvbdmx_write(struct dmx_demux *demux, const char *buf, size_t count)
|
|||
return count;
|
||||
}
|
||||
|
||||
|
||||
static int dvbdmx_add_frontend(struct dmx_demux *demux, struct dmx_frontend *frontend)
|
||||
static int dvbdmx_add_frontend(struct dmx_demux *demux,
|
||||
struct dmx_frontend *frontend)
|
||||
{
|
||||
struct dvb_demux *dvbdemux = (struct dvb_demux *)demux;
|
||||
struct list_head *head = &dvbdemux->frontend_list;
|
||||
|
@ -1099,8 +1092,8 @@ static int dvbdmx_add_frontend(struct dmx_demux *demux, struct dmx_frontend *fro
|
|||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int dvbdmx_remove_frontend(struct dmx_demux *demux, struct dmx_frontend *frontend)
|
||||
static int dvbdmx_remove_frontend(struct dmx_demux *demux,
|
||||
struct dmx_frontend *frontend)
|
||||
{
|
||||
struct dvb_demux *dvbdemux = (struct dvb_demux *)demux;
|
||||
struct list_head *pos, *n, *head = &dvbdemux->frontend_list;
|
||||
|
@ -1115,18 +1108,18 @@ static int dvbdmx_remove_frontend(struct dmx_demux *demux, struct dmx_frontend *
|
|||
return -ENODEV;
|
||||
}
|
||||
|
||||
|
||||
static struct list_head *dvbdmx_get_frontends(struct dmx_demux *demux)
|
||||
{
|
||||
struct dvb_demux *dvbdemux = (struct dvb_demux *)demux;
|
||||
|
||||
if (list_empty(&dvbdemux->frontend_list))
|
||||
return NULL;
|
||||
|
||||
return &dvbdemux->frontend_list;
|
||||
}
|
||||
|
||||
|
||||
static int dvbdmx_connect_frontend(struct dmx_demux *demux, struct dmx_frontend *frontend)
|
||||
static int dvbdmx_connect_frontend(struct dmx_demux *demux,
|
||||
struct dmx_frontend *frontend)
|
||||
{
|
||||
struct dvb_demux *dvbdemux = (struct dvb_demux *)demux;
|
||||
|
||||
|
@ -1141,7 +1134,6 @@ static int dvbdmx_connect_frontend(struct dmx_demux *demux, struct dmx_frontend
|
|||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int dvbdmx_disconnect_frontend(struct dmx_demux *demux)
|
||||
{
|
||||
struct dvb_demux *dvbdemux = (struct dvb_demux *)demux;
|
||||
|
@ -1154,7 +1146,6 @@ static int dvbdmx_disconnect_frontend(struct dmx_demux *demux)
|
|||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int dvbdmx_get_pes_pids(struct dmx_demux *demux, u16 * pids)
|
||||
{
|
||||
struct dvb_demux *dvbdemux = (struct dvb_demux *)demux;
|
||||
|
@ -1163,7 +1154,6 @@ static int dvbdmx_get_pes_pids(struct dmx_demux *demux, u16 *pids)
|
|||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int dvb_dmx_init(struct dvb_demux *dvbdemux)
|
||||
{
|
||||
int i;
|
||||
|
@ -1209,7 +1199,7 @@ int dvb_dmx_init(struct dvb_demux *dvbdemux)
|
|||
dvbdemux->memcopy = dvb_dmx_memcopy;
|
||||
|
||||
dmx->frontend = NULL;
|
||||
dmx->priv = (void *) dvbdemux;
|
||||
dmx->priv = dvbdemux;
|
||||
dmx->open = dvbdmx_open;
|
||||
dmx->close = dvbdmx_close;
|
||||
dmx->write = dvbdmx_write;
|
||||
|
@ -1230,12 +1220,13 @@ int dvb_dmx_init(struct dvb_demux *dvbdemux)
|
|||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(dvb_dmx_init);
|
||||
|
||||
EXPORT_SYMBOL(dvb_dmx_init);
|
||||
|
||||
void dvb_dmx_release(struct dvb_demux *dvbdemux)
|
||||
{
|
||||
vfree(dvbdemux->filter);
|
||||
vfree(dvbdemux->feed);
|
||||
}
|
||||
|
||||
EXPORT_SYMBOL(dvb_dmx_release);
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _DVB_DEMUX_H_
|
||||
#define _DVB_DEMUX_H_
|
||||
|
||||
|
@ -59,7 +58,6 @@ struct dvb_demux_filter {
|
|||
struct timer_list timer;
|
||||
};
|
||||
|
||||
|
||||
#define DMX_FEED_ENTRY(pos) list_entry(pos, struct dvb_demux_feed, list_head)
|
||||
|
||||
struct dvb_demux_feed {
|
||||
|
@ -131,11 +129,12 @@ struct dvb_demux {
|
|||
spinlock_t lock;
|
||||
};
|
||||
|
||||
|
||||
int dvb_dmx_init(struct dvb_demux *dvbdemux);
|
||||
void dvb_dmx_release(struct dvb_demux *dvbdemux);
|
||||
void dvb_dmx_swfilter_packets(struct dvb_demux *dvbdmx, const u8 *buf, size_t count);
|
||||
void dvb_dmx_swfilter_packets(struct dvb_demux *dvbdmx, const u8 *buf,
|
||||
size_t count);
|
||||
void dvb_dmx_swfilter(struct dvb_demux *demux, const u8 *buf, size_t count);
|
||||
void dvb_dmx_swfilter_204(struct dvb_demux *demux, const u8 *buf, size_t count);
|
||||
void dvb_dmx_swfilter_204(struct dvb_demux *demux, const u8 *buf,
|
||||
size_t count);
|
||||
|
||||
#endif /* _DVB_DEMUX_H_ */
|
||||
|
|
Loading…
Reference in New Issue