clib/dvb_ts_lib/descriptors/parse_desc_time_shifted_service.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_time_shifted_event.c ↑ Summary clib/dvb_ts_lib/descriptors/parse_desc_transport_stream.c »
1 /*
2 * parse_desc_time_shifted_service.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_time_shifted_service.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 // time_shifted_service_descriptor(){
43 // descriptor_tag 8 uimsbf
44 // descriptor_length 8 uimsbf
45 // reference_service_id 16 uimsbf
46 // }
47
48
49 /* ----------------------------------------------------------------------- */
50 0 void print_time_shifted_service(struct Descriptor_time_shifted_service *tssd, int level)
51 {
52 struct list_head *item, *safe;
53
54 0 printf(" Descriptor: time_shifted_service [0x%02x]\n", tssd->descriptor_tag) ;
55 0 printf(" Length: %d\n", tssd->descriptor_length) ;
56
57 0 printf(" reference_service_id = %d\n", tssd->reference_service_id) ;
58 0 }
59
60 /* ----------------------------------------------------------------------- */
61 0 struct Descriptor *parse_time_shifted_service(struct TS_bits *bits, unsigned tag, unsigned len)
62 {
63 struct Descriptor_time_shifted_service *tssd ;
64 unsigned byte ;
65 int end_buff_len ;
66
67 0 tssd = (struct Descriptor_time_shifted_service *)malloc( sizeof(*tssd) ) ;
68 0 memset(tssd,0,sizeof(*tssd));
69
70 //== Parse data ==
71 0 INIT_LIST_HEAD(&tssd->next);
72 0 tssd->descriptor_tag = tag ; // already extracted by parse_desc()
73 0 tssd->descriptor_length = len ; // already extracted by parse_desc()
74 0 tssd->reference_service_id = bits_get(bits, 16) ;
75
76 0 return (struct Descriptor *)tssd ;
77 }
78
79 /* ----------------------------------------------------------------------- */
80 0 void free_time_shifted_service(struct Descriptor_time_shifted_service *tssd)
81 {
82 struct list_head *item, *safe;
83
84 0 free(tssd) ;
85 0 }
« clib/dvb_ts_lib/descriptors/parse_desc_time_shifted_event.c ↑ Summary clib/dvb_ts_lib/descriptors/parse_desc_transport_stream.c »