Mercurial > pt1
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 |
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 | 8 decoder *dec = calloc(1, sizeof(decoder)); |
9 int code; | |
2
8ac7c59fefc9
added b25 decode functionality
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
10 |
4 | 11 dec->b25 = create_arib_std_b25(); |
12 dec->b25->set_multi2_round(dec->b25, 4); //xxx round should be configurable | |
13 dec->b25->set_strip(dec->b25, 0); //ditto | |
14 dec->b25->set_emm_proc(dec->b25, 0); //ditto | |
15 dec->bcas = create_b_cas_card(); | |
16 code = dec->bcas->init(dec->bcas); | |
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 | 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 | 25 dec->b25->release(dec->b25); |
26 dec->bcas->release(dec->bcas); | |
27 free(dec); | |
2
8ac7c59fefc9
added b25 decode functionality
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
28 |
4 | 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 | 35 int code; |
2
8ac7c59fefc9
added b25 decode functionality
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
36 |
4 | 37 code = dec->b25->put(dec->b25, sbuf); |
38 if(code < 0) | |
39 return code; | |
40 | |
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 | 48 int code; |
2
8ac7c59fefc9
added b25 decode functionality
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
49 |
4 | 50 code = dec->b25->flush(dec->b25); |
51 if(code < 0) | |
52 return code; | |
53 | |
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 } |