andoma/tvheadend — pull request #54 by ackalker (2012-02-12 18:29:38+00:00)
Title: Switch descrambling to libdvbcsa

I would like to propose using libdvbcsa for descrambling.
Advantages over FFdecsa:

- It better supports processors with big-endian byte ordering

I have tested the library (but not yet used it with Tvheadend) on an Atheros
AR7161 (big-endian MIPS) router, while I could never get FFdecsa to work on
the same hardware.

- It is claimed to be faster than FFdecsa

I haven't benchmarked FFdecsa personally, but libdvbcsa gives > 350Mbit/sec
streaming throughput on a Core(TM)2 Duo E7500 @ 2.93GHz. Speed is important
for using Tvheadend on embedded devices like routers, NAS etc.

- It is being actively developed

FFdecsa is no longer being updated, except by individual projects which
use it.

There is one drawback: the API for libdvbcsa differs from that of FFdecsa.
I have tried to keep the structure of my changes as close to the original as
possible.
Because libdvbcsa doesn't work with full TS packets, only payloads, and
also because it doesn't do any packet analysis or CW switch handling, I have
borrowed some code from FFdecsa for that.
I commented out and left some FIXMEs in the code in places where FFdecsa deals
with incomplete packets, but this doesn't appear to do any harm to the
descrambled stream. If you have any suggestions or comments about these,
please tell me.

My changes are currently just a proof-of-concept. I have tested the code word
client (but not Capmt) on my own setup (DVB-C, Irdeto2 CA, HDHomerun
-> dvbhdhomerun -> Tvheadend -> OScam with NewCamd emulation)
and it ran stable for hours on end, but it could use some more testing,
especially during CW switches.

Kind regards,

Alain