Wasabi ExpressPlay SDK for Embedded Systems  1.23.0
Ts2Marlin.h
Go to the documentation of this file.
1 /*****************************************************************
2 |
3 | MPEG2 Transport Stream - Marlin
4 |
5 | $Id: Ts2Marlin.h 354 2018-06-28 00:42:39Z pgirish $
6 | Original author: Julien Boeuf
7 |
8 | This software is provided to you pursuant to your agreement
9 | with Intertrust Technologies Corporation ("Intertrust").
10 | This software may be used only in accordance with the terms
11 | of the agreement.
12 |
13 | Copyright (c) 2010-2014 by Intertrust. All rights reserved.
14 |
15 ****************************************************************/
16 
17 #ifndef _TS2_MARLIN_H_
18 #define _TS2_MARLIN_H_
19 
20 /*----------------------------------------------------------------------
21 | includes
22 +---------------------------------------------------------------------*/
23 #include "Ts2Descriptors.h"
24 #include "Ts2Tables.h"
25 #include "Ts2Iec62455.h"
26 #include "Ts2Protection.h"
27 
28 /*----------------------------------------------------------------------
29 | constants
30 +---------------------------------------------------------------------*/
31 #define TS2_MARLIN_CA_SYSTEM_ID 0x4AF4
32 #define TS2_MARLIN_MAC_SEED "MRL-BBTS-AUTH-KEY-10"
33 #define TS2_MARLIN_RIGHTS_TABLE_ID 0x82
34 
35 #define TS2_MARLIN_SILENT_METHOD_ON_DEMAND 0x00
36 #define TS2_MARLIN_SILENT_METHOD_IN_ADVANCE 0x01
37 
38 /* The Key Derivation Function IDs from the Key Derivation Function descriptor */
39 #define TS2_KEY_DERIVATION_FUNCTION_NONE 0
40 #define TS2_KEY_DERIVATION_FUNCTION_TRUNCATED_SHA1 1
41 
42 /*----------------------------------------------------------------------
43 | types
44 +---------------------------------------------------------------------*/
45 typedef struct {
46  ATX_String rights_issuer_url;
47  ATX_String silent_rights_url;
48  ATX_String preview_rights_url;
50 
51 typedef struct {
55 
56 #ifdef __cplusplus
57 extern "C" {
58 #endif
59 
60 /*----------------------------------------------------------------------
61 | Marlin CADescriptor related methods
62 +---------------------------------------------------------------------*/
65 
68 
69 /*----------------------------------------------------------------------
70 | TS2_MarlinCADescriptor_Create
71 +---------------------------------------------------------------------*/
83 ATX_Result
84 TS2_MarlinCADescriptor_Create(ATX_UInt16 pid,
85  const char* base_cid, /* can be NULL */
86  ATX_Boolean single_key_layer,
87  TS2_TrafficProtectionSystem protection,
88  TS2_CADescriptor** desc);
89 
90 ATX_Result
92  ATX_String* base_cid,
93  TS2_TrafficProtectionSystem* protection,
94  ATX_UInt32* kdf_type);
95 
96 /*----------------------------------------------------------------------
97 | Marlin ContentId related methods
98 +---------------------------------------------------------------------*/
99 ATX_Result
100 TS2_GetMarlinContentIdFromKSM(const char* cid_base,
101  const TS2_KSM* ksm,
102  ATX_String* cid);
103 
104 ATX_Result
105 TS2_GetMarlinContentIdAndProtectionFromKSM(const char* cid_base,
106  const TS2_KSM* ksm,
107  ATX_String* cid,
108  TS2_TrafficProtectionSystem* protection);
109 
110 ATX_Result
111 TS2_ParseContentId(const char* content_id,
112  ATX_String* cid_base,
113  ATX_Byte* cid_extension, /* TS2_KSM_CID_EXTENSION_SIZE */
114  ATX_Boolean* is_service); /* ATX_FALSE means is_programme */
115 
116 /*----------------------------------------------------------------------
117 | MarlinRightsTable methods
118 +---------------------------------------------------------------------*/
119 TS2_EXPORT ATX_Result
121 
122 ATX_Boolean
124 
125 /*----------------------------------------------------------------------
126 | other methods
127 +---------------------------------------------------------------------*/
128 ATX_Result
129 TS2_VerifyMarlinKSM(const ATX_Byte* drm_key,
130  const TS2_KSM* ksm);
131 
132 #ifdef __cplusplus
133 }
134 #endif
135 
136 #endif /* _TS2_MARLIN_H_ */
Definition: Ts2Tables.h:99
Definition: Ts2Marlin.h:45
ATX_Result TS2_MarlinCADescriptor_GetBaseContentIdAndProtection(const TS2_CADescriptor *marlin_desc, ATX_String *base_cid, TS2_TrafficProtectionSystem *protection, ATX_UInt32 *kdf_type)
ATX_String silent_rights_url
Definition: Ts2Marlin.h:47
ATX_Result TS2_GetMarlinContentIdAndProtectionFromKSM(const char *cid_base, const TS2_KSM *ksm, ATX_String *cid, TS2_TrafficProtectionSystem *protection)
ATX_Result TS2_ParseContentId(const char *content_id, ATX_String *cid_base, ATX_Byte *cid_extension, ATX_Boolean *is_service)
ATX_Boolean TS2_MarlinRightsTable_IsEmpty(TS2_MarlinRightsTable *self)
TS2_EXPORT ATX_Result TS2_MarlinRightsTable_Construct(TS2_MarlinRightsTable *self)
ATX_String preview_rights_url
Definition: Ts2Marlin.h:48
TS2_CADescriptor * TS2_GetMarlinCADescriptorFromCAT(const TS2_CAT *cat)
#define TS2_EXPORT
Definition: Ts2Config.h:67
ATX_Result TS2_VerifyMarlinKSM(const ATX_Byte *drm_key, const TS2_KSM *ksm)
TS2_Table base
Definition: Ts2Marlin.h:52
ATX_Result TS2_MarlinCADescriptor_Create(ATX_UInt16 pid, const char *base_cid, ATX_Boolean single_key_layer, TS2_TrafficProtectionSystem protection, TS2_CADescriptor **desc)
Create a Marlin BBTS CA Descriptor object.
ATX_String rights_issuer_url
Definition: Ts2Marlin.h:46
Definition: Ts2Tables.h:68
TS2_MarlinRightsInfo info
Definition: Ts2Marlin.h:53
Definition: Ts2Marlin.h:51
TS2_TrafficProtectionSystem
Definition: Ts2Protection.h:334
ATX_Result TS2_GetMarlinContentIdFromKSM(const char *cid_base, const TS2_KSM *ksm, ATX_String *cid)
Definition: Ts2Tables.h:91
Definition: Ts2Iec62455.h:85
Definition: Ts2Descriptors.h:76
TS2_CADescriptor * TS2_GetMarlinCADescriptorFromPMT(const TS2_PMT *pmt)