clib/dvb_ts_lib/descriptors/parse_desc_ancillary_data.c

filter: Statementstmt 0.0% 0 / 16 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 0.0% 0 / 16 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« clib/dvb_ts_lib/descriptors/parse_desc_adaptation_field_data.c ↑ Summary clib/dvb_ts_lib/descriptors/parse_desc_announcement_support.c »
1 /*
2 * parse_desc_ancillary_data.c
3 *
4 * Created by: si_desc.pl
5 * Created on: 20-May-2011
6 * Author: sdprice1
7 */
8
9
10 // VERSION = 1.00
11
12 /*=============================================================================================*/
13 // USES
14 /*=============================================================================================*/
15
16 #include <stdio.h>
17 #include <stdlib.h>
18 #include <unistd.h>
19 #include <string.h>
20 #include <errno.h>
21 #include <ctype.h>
22 #include <fcntl.h>
23 #include <inttypes.h>
24
25 #include "parse_desc_ancillary_data.h"
26 #include "descriptors/parse_desc.h"
27
28 /*=============================================================================================*/
29 // CONSTANTS
30 /*=============================================================================================*/
31
32 /*=============================================================================================*/
33 // MACROS
34 /*=============================================================================================*/
35
36 /*=============================================================================================*/
37 // FUNCTIONS
38 /*=============================================================================================*/
39
40 /* ----------------------------------------------------------------------- */
41 //
42 // ancillary_data_descriptor(){
43 // descriptor_tag 8 uimsbf
44 // descriptor_length 8 uimsbf
45 // ancillary_data_identifier 8 bslbf
46 // }
47
48
49 /* ----------------------------------------------------------------------- */
50 0 void print_ancillary_data(struct Descriptor_ancillary_data *add, int level)
51 {
52 struct list_head *item, *safe;
53
54 0 printf(" Descriptor: ancillary_data [0x%02x]\n", add->descriptor_tag) ;
55 0 printf(" Length: %d\n", add->descriptor_length) ;
56
57 0 printf(" ancillary_data_identifier = %d\n", add->ancillary_data_identifier) ;
58 0 }
59
60 /* ----------------------------------------------------------------------- */
61 0 struct Descriptor *parse_ancillary_data(struct TS_bits *bits, unsigned tag, unsigned len)
62 {
63 struct Descriptor_ancillary_data *add ;
64 unsigned byte ;
65 int end_buff_len ;
66
67 0 add = (struct Descriptor_ancillary_data *)malloc( sizeof(*add) ) ;
68 0 memset(add,0,sizeof(*add));
69
70 //== Parse data ==
71 0 INIT_LIST_HEAD(&add->next);
72 0 add->descriptor_tag = tag ; // already extracted by parse_desc()
73 0 add->descriptor_length = len ; // already extracted by parse_desc()
74 0 add->ancillary_data_identifier = bits_get(bits, 8) ;
75
76 0 return (struct Descriptor *)add ;
77 }
78
79 /* ----------------------------------------------------------------------- */
80 0 void free_ancillary_data(struct Descriptor_ancillary_data *add)
81 {
82 struct list_head *item, *safe;
83
84 0 free(add) ;
85 0 }
« clib/dvb_ts_lib/descriptors/parse_desc_adaptation_field_data.c ↑ Summary clib/dvb_ts_lib/descriptors/parse_desc_announcement_support.c »