int ret, k, n;
struct private_fecdec_data *pfd = fn->private_data;
- PARA_CRIT_LOG("sb: %d, len: %d\n", h->slice_bytes, len);
if (h->slice_bytes > len) { /* can not use the thing, try to read more */
fn->min_iqs = h->slice_bytes + FEC_HEADER_SIZE;
return 0;
return 1;
}
-static ssize_t fecdec(char *buf, size_t len, struct filter_node *fn)
-{
- int ret;
- struct fec_header h;
-
- ret = read_fec_header(buf, len, &h);
- if (ret <= 0)
- return ret;
- if (!h.slice_bytes)
- return -E_BAD_SLICE_SIZE;
- if (h.slice_num > h.slices_per_group)
- return -E_BAD_SLICE_NUM;
- ret = dispatch_slice(buf + FEC_HEADER_SIZE, len - FEC_HEADER_SIZE,
- &h, fn);
- //PARA_INFO_LOG("ret: %d, len: %d, slice_bytes: %d\n", ret, len, h.slice_bytes);
- if (ret <= 0)
- return ret;
- return FEC_HEADER_SIZE + h.slice_bytes;
-}
-
static void fecdec_close(struct filter_node *fn)
{
struct private_fecdec_data *pfd = fn->private_data;
*/
void fecdec_filter_init(struct filter *f)
{
- f->convert = fecdec;
f->close = fecdec_close;
f->open = fecdec_open;
f->pre_select = generic_filter_pre_select;