• Home
  • Raw
  • Download

Lines Matching refs:feed

94 	return (f->feed.sec.crc_val = crc32_be(f->feed.sec.crc_val, src, len));  in dvb_dmx_crc32()
107 static inline int dvb_dmx_swfilter_payload(struct dvb_demux_feed *feed, in dvb_dmx_swfilter_payload() argument
129 feed->peslen = 0xfffa; in dvb_dmx_swfilter_payload()
131 feed->peslen += count; in dvb_dmx_swfilter_payload()
133 return feed->cb.ts(&buf[p], count, NULL, 0, &feed->feed.ts, DMX_OK); in dvb_dmx_swfilter_payload()
136 static int dvb_dmx_swfilter_sectionfilter(struct dvb_demux_feed *feed, in dvb_dmx_swfilter_sectionfilter() argument
143 u8 xor = f->filter.filter_value[i] ^ feed->feed.sec.secbuf[i]; in dvb_dmx_swfilter_sectionfilter()
154 return feed->cb.sec(feed->feed.sec.secbuf, feed->feed.sec.seclen, in dvb_dmx_swfilter_sectionfilter()
158 static inline int dvb_dmx_swfilter_section_feed(struct dvb_demux_feed *feed) in dvb_dmx_swfilter_section_feed() argument
160 struct dvb_demux *demux = feed->demux; in dvb_dmx_swfilter_section_feed()
161 struct dvb_demux_filter *f = feed->filter; in dvb_dmx_swfilter_section_feed()
162 struct dmx_section_feed *sec = &feed->feed.sec; in dvb_dmx_swfilter_section_feed()
174 demux->check_crc32(feed, sec->secbuf, sec->seclen)) in dvb_dmx_swfilter_section_feed()
179 if (dvb_dmx_swfilter_sectionfilter(feed, f) < 0) in dvb_dmx_swfilter_section_feed()
188 static void dvb_dmx_swfilter_section_new(struct dvb_demux_feed *feed) in dvb_dmx_swfilter_section_new() argument
190 struct dmx_section_feed *sec = &feed->feed.sec; in dvb_dmx_swfilter_section_new()
234 static int dvb_dmx_swfilter_section_copy_dump(struct dvb_demux_feed *feed, in dvb_dmx_swfilter_section_copy_dump() argument
237 struct dvb_demux *demux = feed->demux; in dvb_dmx_swfilter_section_copy_dump()
238 struct dmx_section_feed *sec = &feed->feed.sec; in dvb_dmx_swfilter_section_copy_dump()
256 demux->memcopy(feed, sec->secbuf_base + sec->tsfeedp, buf, len); in dvb_dmx_swfilter_section_copy_dump()
277 if (feed->pusi_seen) in dvb_dmx_swfilter_section_copy_dump()
278 dvb_dmx_swfilter_section_feed(feed); in dvb_dmx_swfilter_section_copy_dump()
290 static int dvb_dmx_swfilter_section_packet(struct dvb_demux_feed *feed, in dvb_dmx_swfilter_section_packet() argument
305 ccok = ((feed->cc + 1) & 0x0f) == cc; in dvb_dmx_swfilter_section_packet()
306 feed->cc = cc; in dvb_dmx_swfilter_section_packet()
327 feed->pusi_seen = 0; in dvb_dmx_swfilter_section_packet()
328 dvb_dmx_swfilter_section_new(feed); in dvb_dmx_swfilter_section_packet()
339 dvb_dmx_swfilter_section_copy_dump(feed, before, in dvb_dmx_swfilter_section_packet()
342 feed->pusi_seen = 1; in dvb_dmx_swfilter_section_packet()
343 dvb_dmx_swfilter_section_new(feed); in dvb_dmx_swfilter_section_packet()
344 dvb_dmx_swfilter_section_copy_dump(feed, after, in dvb_dmx_swfilter_section_packet()
353 dvb_dmx_swfilter_section_copy_dump(feed, &buf[p], count); in dvb_dmx_swfilter_section_packet()
359 static inline void dvb_dmx_swfilter_packet_type(struct dvb_demux_feed *feed, in dvb_dmx_swfilter_packet_type() argument
362 switch (feed->type) { in dvb_dmx_swfilter_packet_type()
364 if (!feed->feed.ts.is_filtering) in dvb_dmx_swfilter_packet_type()
366 if (feed->ts_type & TS_PACKET) { in dvb_dmx_swfilter_packet_type()
367 if (feed->ts_type & TS_PAYLOAD_ONLY) in dvb_dmx_swfilter_packet_type()
368 dvb_dmx_swfilter_payload(feed, buf); in dvb_dmx_swfilter_packet_type()
370 feed->cb.ts(buf, 188, NULL, 0, &feed->feed.ts, in dvb_dmx_swfilter_packet_type()
373 if (feed->ts_type & TS_DECODER) in dvb_dmx_swfilter_packet_type()
374 if (feed->demux->write_to_decoder) in dvb_dmx_swfilter_packet_type()
375 feed->demux->write_to_decoder(feed, buf, 188); in dvb_dmx_swfilter_packet_type()
379 if (!feed->feed.sec.is_filtering) in dvb_dmx_swfilter_packet_type()
381 if (dvb_dmx_swfilter_section_packet(feed, buf) < 0) in dvb_dmx_swfilter_packet_type()
382 feed->feed.sec.seclen = feed->feed.sec.secbufp = 0; in dvb_dmx_swfilter_packet_type()
392 ((f)->feed.ts.is_filtering) && \
397 struct dvb_demux_feed *feed; in dvb_dmx_swfilter_packet() local
460 list_for_each_entry(feed, &demux->feed_list, list_head) { in dvb_dmx_swfilter_packet()
461 if ((feed->pid != pid) && (feed->pid != 0x2000)) in dvb_dmx_swfilter_packet()
466 if ((DVR_FEED(feed)) && (dvr_done++)) in dvb_dmx_swfilter_packet()
469 if (feed->pid == pid) in dvb_dmx_swfilter_packet()
470 dvb_dmx_swfilter_packet_type(feed, buf); in dvb_dmx_swfilter_packet()
471 else if (feed->pid == 0x2000) in dvb_dmx_swfilter_packet()
472 feed->cb.ts(buf, 188, NULL, 0, &feed->feed.ts, DMX_OK); in dvb_dmx_swfilter_packet()
591 demux->feed->cb.ts(buf, count, NULL, 0, &demux->feed->feed.ts, DMX_OK); in dvb_dmx_swfilter_raw()
618 if (demux->feed[i].state == DMX_STATE_FREE) in dvb_dmx_feed_alloc()
624 demux->feed[i].state = DMX_STATE_ALLOCATED; in dvb_dmx_feed_alloc()
626 return &demux->feed[i]; in dvb_dmx_feed_alloc()
629 static int dvb_demux_feed_find(struct dvb_demux_feed *feed) in dvb_demux_feed_find() argument
633 list_for_each_entry(entry, &feed->demux->feed_list, list_head) in dvb_demux_feed_find()
634 if (entry == feed) in dvb_demux_feed_find()
640 static void dvb_demux_feed_add(struct dvb_demux_feed *feed) in dvb_demux_feed_add() argument
642 spin_lock_irq(&feed->demux->lock); in dvb_demux_feed_add()
643 if (dvb_demux_feed_find(feed)) { in dvb_demux_feed_add()
645 __func__, feed->type, feed->state, feed->pid); in dvb_demux_feed_add()
649 list_add(&feed->list_head, &feed->demux->feed_list); in dvb_demux_feed_add()
651 spin_unlock_irq(&feed->demux->lock); in dvb_demux_feed_add()
654 static void dvb_demux_feed_del(struct dvb_demux_feed *feed) in dvb_demux_feed_del() argument
656 spin_lock_irq(&feed->demux->lock); in dvb_demux_feed_del()
657 if (!(dvb_demux_feed_find(feed))) { in dvb_demux_feed_del()
659 __func__, feed->type, feed->state, feed->pid); in dvb_demux_feed_del()
663 list_del(&feed->list_head); in dvb_demux_feed_del()
665 spin_unlock_irq(&feed->demux->lock); in dvb_demux_feed_del()
672 struct dvb_demux_feed *feed = (struct dvb_demux_feed *)ts_feed; in dmx_ts_feed_set() local
673 struct dvb_demux *demux = feed->demux; in dmx_ts_feed_set()
688 demux->pesfilter[pes_type] != feed) { in dmx_ts_feed_set()
693 demux->pesfilter[pes_type] = feed; in dmx_ts_feed_set()
697 dvb_demux_feed_add(feed); in dmx_ts_feed_set()
699 feed->pid = pid; in dmx_ts_feed_set()
700 feed->buffer_size = circular_buffer_size; in dmx_ts_feed_set()
701 feed->timeout = timeout; in dmx_ts_feed_set()
702 feed->ts_type = ts_type; in dmx_ts_feed_set()
703 feed->pes_type = pes_type; in dmx_ts_feed_set()
705 if (feed->buffer_size) { in dmx_ts_feed_set()
707 feed->buffer = NULL; in dmx_ts_feed_set()
709 feed->buffer = vmalloc(feed->buffer_size); in dmx_ts_feed_set()
710 if (!feed->buffer) { in dmx_ts_feed_set()
717 feed->state = DMX_STATE_READY; in dmx_ts_feed_set()
725 struct dvb_demux_feed *feed = (struct dvb_demux_feed *)ts_feed; in dmx_ts_feed_start_filtering() local
726 struct dvb_demux *demux = feed->demux; in dmx_ts_feed_start_filtering()
732 if (feed->state != DMX_STATE_READY || feed->type != DMX_TYPE_TS) { in dmx_ts_feed_start_filtering()
742 if ((ret = demux->start_feed(feed)) < 0) { in dmx_ts_feed_start_filtering()
749 feed->state = DMX_STATE_GO; in dmx_ts_feed_start_filtering()
758 struct dvb_demux_feed *feed = (struct dvb_demux_feed *)ts_feed; in dmx_ts_feed_stop_filtering() local
759 struct dvb_demux *demux = feed->demux; in dmx_ts_feed_stop_filtering()
764 if (feed->state < DMX_STATE_GO) { in dmx_ts_feed_stop_filtering()
774 ret = demux->stop_feed(feed); in dmx_ts_feed_stop_filtering()
778 feed->state = DMX_STATE_ALLOCATED; in dmx_ts_feed_stop_filtering()
790 struct dvb_demux_feed *feed; in dvbdmx_allocate_ts_feed() local
795 if (!(feed = dvb_dmx_feed_alloc(demux))) { in dvbdmx_allocate_ts_feed()
800 feed->type = DMX_TYPE_TS; in dvbdmx_allocate_ts_feed()
801 feed->cb.ts = callback; in dvbdmx_allocate_ts_feed()
802 feed->demux = demux; in dvbdmx_allocate_ts_feed()
803 feed->pid = 0xffff; in dvbdmx_allocate_ts_feed()
804 feed->peslen = 0xfffa; in dvbdmx_allocate_ts_feed()
805 feed->buffer = NULL; in dvbdmx_allocate_ts_feed()
807 (*ts_feed) = &feed->feed.ts; in dvbdmx_allocate_ts_feed()
815 if (!(feed->filter = dvb_dmx_filter_alloc(demux))) { in dvbdmx_allocate_ts_feed()
816 feed->state = DMX_STATE_FREE; in dvbdmx_allocate_ts_feed()
821 feed->filter->type = DMX_TYPE_TS; in dvbdmx_allocate_ts_feed()
822 feed->filter->feed = feed; in dvbdmx_allocate_ts_feed()
823 feed->filter->state = DMX_STATE_READY; in dvbdmx_allocate_ts_feed()
834 struct dvb_demux_feed *feed = (struct dvb_demux_feed *)ts_feed; in dvbdmx_release_ts_feed() local
838 if (feed->state == DMX_STATE_FREE) { in dvbdmx_release_ts_feed()
843 vfree(feed->buffer); in dvbdmx_release_ts_feed()
844 feed->buffer = NULL; in dvbdmx_release_ts_feed()
847 feed->state = DMX_STATE_FREE; in dvbdmx_release_ts_feed()
848 feed->filter->state = DMX_STATE_FREE; in dvbdmx_release_ts_feed()
850 dvb_demux_feed_del(feed); in dvbdmx_release_ts_feed()
852 feed->pid = 0xffff; in dvbdmx_release_ts_feed()
854 if (feed->ts_type & TS_DECODER && feed->pes_type < DMX_PES_OTHER) in dvbdmx_release_ts_feed()
855 demux->pesfilter[feed->pes_type] = NULL; in dvbdmx_release_ts_feed()
865 static int dmx_section_feed_allocate_filter(struct dmx_section_feed *feed, in dmx_section_feed_allocate_filter() argument
868 struct dvb_demux_feed *dvbdmxfeed = (struct dvb_demux_feed *)feed; in dmx_section_feed_allocate_filter()
883 (*filter)->parent = feed; in dmx_section_feed_allocate_filter()
885 dvbdmxfilter->feed = dvbdmxfeed; in dmx_section_feed_allocate_filter()
896 static int dmx_section_feed_set(struct dmx_section_feed *feed, in dmx_section_feed_set() argument
900 struct dvb_demux_feed *dvbdmxfeed = (struct dvb_demux_feed *)feed; in dmx_section_feed_set()
913 dvbdmxfeed->feed.sec.check_crc = check_crc; in dmx_section_feed_set()
952 static int dmx_section_feed_start_filtering(struct dmx_section_feed *feed) in dmx_section_feed_start_filtering() argument
954 struct dvb_demux_feed *dvbdmxfeed = (struct dvb_demux_feed *)feed; in dmx_section_feed_start_filtering()
961 if (feed->is_filtering) { in dmx_section_feed_start_filtering()
971 dvbdmxfeed->feed.sec.tsfeedp = 0; in dmx_section_feed_start_filtering()
972 dvbdmxfeed->feed.sec.secbuf = dvbdmxfeed->feed.sec.secbuf_base; in dmx_section_feed_start_filtering()
973 dvbdmxfeed->feed.sec.secbufp = 0; in dmx_section_feed_start_filtering()
974 dvbdmxfeed->feed.sec.seclen = 0; in dmx_section_feed_start_filtering()
989 feed->is_filtering = 1; in dmx_section_feed_start_filtering()
997 static int dmx_section_feed_stop_filtering(struct dmx_section_feed *feed) in dmx_section_feed_stop_filtering() argument
999 struct dvb_demux_feed *dvbdmxfeed = (struct dvb_demux_feed *)feed; in dmx_section_feed_stop_filtering()
1014 feed->is_filtering = 0; in dmx_section_feed_stop_filtering()
1021 static int dmx_section_feed_release_filter(struct dmx_section_feed *feed, in dmx_section_feed_release_filter() argument
1025 struct dvb_demux_feed *dvbdmxfeed = (struct dvb_demux_feed *)feed; in dmx_section_feed_release_filter()
1030 if (dvbdmxfilter->feed != dvbdmxfeed) { in dmx_section_feed_release_filter()
1035 if (feed->is_filtering) { in dmx_section_feed_release_filter()
1039 feed->stop_filtering(feed); in dmx_section_feed_release_filter()
1061 struct dmx_section_feed **feed, in dvbdmx_allocate_section_feed() argument
1079 dvbdmxfeed->feed.sec.secbuf = dvbdmxfeed->feed.sec.secbuf_base; in dvbdmx_allocate_section_feed()
1080 dvbdmxfeed->feed.sec.secbufp = dvbdmxfeed->feed.sec.seclen = 0; in dvbdmx_allocate_section_feed()
1081 dvbdmxfeed->feed.sec.tsfeedp = 0; in dvbdmx_allocate_section_feed()
1085 (*feed) = &dvbdmxfeed->feed.sec; in dvbdmx_allocate_section_feed()
1086 (*feed)->is_filtering = 0; in dvbdmx_allocate_section_feed()
1087 (*feed)->parent = demux; in dvbdmx_allocate_section_feed()
1088 (*feed)->priv = NULL; in dvbdmx_allocate_section_feed()
1090 (*feed)->set = dmx_section_feed_set; in dvbdmx_allocate_section_feed()
1091 (*feed)->allocate_filter = dmx_section_feed_allocate_filter; in dvbdmx_allocate_section_feed()
1092 (*feed)->start_filtering = dmx_section_feed_start_filtering; in dvbdmx_allocate_section_feed()
1093 (*feed)->stop_filtering = dmx_section_feed_stop_filtering; in dvbdmx_allocate_section_feed()
1094 (*feed)->release_filter = dmx_section_feed_release_filter; in dvbdmx_allocate_section_feed()
1101 struct dmx_section_feed *feed) in dvbdmx_release_section_feed() argument
1103 struct dvb_demux_feed *dvbdmxfeed = (struct dvb_demux_feed *)feed; in dvbdmx_release_section_feed()
1260 dvbdemux->feed = vmalloc(dvbdemux->feednum * sizeof(struct dvb_demux_feed)); in dvb_dmx_init()
1261 if (!dvbdemux->feed) { in dvb_dmx_init()
1271 dvbdemux->feed[i].state = DMX_STATE_FREE; in dvb_dmx_init()
1272 dvbdemux->feed[i].index = i; in dvb_dmx_init()
1327 vfree(dvbdemux->feed); in dvb_dmx_release()