annotate recpt1/decoder.c @ 4:43d177fa65c9

fixed indentation
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Tue, 17 Feb 2009 01:46:54 +0900
parents 8ac7c59fefc9
children 97fd2315114e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2
8ac7c59fefc9 added b25 decode functionality
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
1 #include <stdlib.h>
8ac7c59fefc9 added b25 decode functionality
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
2
8ac7c59fefc9 added b25 decode functionality
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
3 #include "decoder.h"
8ac7c59fefc9 added b25 decode functionality
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
4
8ac7c59fefc9 added b25 decode functionality
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
5 decoder *
8ac7c59fefc9 added b25 decode functionality
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
6 b25_startup(void)
8ac7c59fefc9 added b25 decode functionality
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
7 {
4
43d177fa65c9 fixed indentation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 2
diff changeset
8 decoder *dec = calloc(1, sizeof(decoder));
43d177fa65c9 fixed indentation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 2
diff changeset
9 int code;
2
8ac7c59fefc9 added b25 decode functionality
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
10
4
43d177fa65c9 fixed indentation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 2
diff changeset
11 dec->b25 = create_arib_std_b25();
43d177fa65c9 fixed indentation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 2
diff changeset
12 dec->b25->set_multi2_round(dec->b25, 4); //xxx round should be configurable
43d177fa65c9 fixed indentation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 2
diff changeset
13 dec->b25->set_strip(dec->b25, 0); //ditto
43d177fa65c9 fixed indentation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 2
diff changeset
14 dec->b25->set_emm_proc(dec->b25, 0); //ditto
43d177fa65c9 fixed indentation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 2
diff changeset
15 dec->bcas = create_b_cas_card();
43d177fa65c9 fixed indentation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 2
diff changeset
16 code = dec->bcas->init(dec->bcas);
43d177fa65c9 fixed indentation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 2
diff changeset
17 code = dec->b25->set_b_cas_card(dec->b25, dec->bcas);
2
8ac7c59fefc9 added b25 decode functionality
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
18
4
43d177fa65c9 fixed indentation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 2
diff changeset
19 return dec;
2
8ac7c59fefc9 added b25 decode functionality
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
20 }
8ac7c59fefc9 added b25 decode functionality
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
21
8ac7c59fefc9 added b25 decode functionality
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
22 int
8ac7c59fefc9 added b25 decode functionality
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
23 b25_shutdown(decoder *dec)
8ac7c59fefc9 added b25 decode functionality
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
24 {
4
43d177fa65c9 fixed indentation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 2
diff changeset
25 dec->b25->release(dec->b25);
43d177fa65c9 fixed indentation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 2
diff changeset
26 dec->bcas->release(dec->bcas);
43d177fa65c9 fixed indentation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 2
diff changeset
27 free(dec);
2
8ac7c59fefc9 added b25 decode functionality
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
28
4
43d177fa65c9 fixed indentation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 2
diff changeset
29 return 0;
2
8ac7c59fefc9 added b25 decode functionality
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
30 }
8ac7c59fefc9 added b25 decode functionality
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
31
8ac7c59fefc9 added b25 decode functionality
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
32 int
8ac7c59fefc9 added b25 decode functionality
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
33 b25_decode(decoder *dec, ARIB_STD_B25_BUFFER *sbuf, ARIB_STD_B25_BUFFER *dbuf)
8ac7c59fefc9 added b25 decode functionality
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
34 {
4
43d177fa65c9 fixed indentation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 2
diff changeset
35 int code;
2
8ac7c59fefc9 added b25 decode functionality
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
36
4
43d177fa65c9 fixed indentation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 2
diff changeset
37 code = dec->b25->put(dec->b25, sbuf);
43d177fa65c9 fixed indentation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 2
diff changeset
38 if(code < 0)
43d177fa65c9 fixed indentation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 2
diff changeset
39 return code;
43d177fa65c9 fixed indentation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 2
diff changeset
40
43d177fa65c9 fixed indentation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 2
diff changeset
41 code = dec->b25->get(dec->b25, dbuf);
2
8ac7c59fefc9 added b25 decode functionality
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
42 return code;
8ac7c59fefc9 added b25 decode functionality
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
43 }
8ac7c59fefc9 added b25 decode functionality
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
44
8ac7c59fefc9 added b25 decode functionality
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
45 int
8ac7c59fefc9 added b25 decode functionality
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
46 b25_finish(decoder *dec, ARIB_STD_B25_BUFFER *sbuf, ARIB_STD_B25_BUFFER *dbuf)
8ac7c59fefc9 added b25 decode functionality
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
47 {
4
43d177fa65c9 fixed indentation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 2
diff changeset
48 int code;
2
8ac7c59fefc9 added b25 decode functionality
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
49
4
43d177fa65c9 fixed indentation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 2
diff changeset
50 code = dec->b25->flush(dec->b25);
43d177fa65c9 fixed indentation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 2
diff changeset
51 if(code < 0)
43d177fa65c9 fixed indentation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 2
diff changeset
52 return code;
43d177fa65c9 fixed indentation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 2
diff changeset
53
43d177fa65c9 fixed indentation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 2
diff changeset
54 code = dec->b25->get(dec->b25, dbuf);
2
8ac7c59fefc9 added b25 decode functionality
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
55 return code;
8ac7c59fefc9 added b25 decode functionality
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
56 }