Pepper_42_C_interfaces
pp_media_common_samsung.h
Go to the documentation of this file.
1 /* Copyright (c) 2016 Samsung Electronics. All rights reserved.
2  */
3 
4 /* From samsung/pp_media_common_samsung.idl,
5  * modified Mon Feb 15 15:41:05 2016.
6  */
7 
8 #ifndef PPAPI_C_SAMSUNG_PP_MEDIA_COMMON_SAMSUNG_H_
9 #define PPAPI_C_SAMSUNG_PP_MEDIA_COMMON_SAMSUNG_H_
10 
11 #include "ppapi/c/pp_macros.h"
12 #include "ppapi/c/pp_stdint.h"
13 
14 /**
15  * @file
16  * This file defines common structures used by Samsung media PPAPI interfaces.
17  */
18 
19 
20 /**
21  * @addtogroup Typedefs
22  * @{
23  */
24 /* Describes time delta in microseconds */
25 typedef int64_t PP_MicrosecondsDelta;
27 /**
28  * @}
29  */
30 
31 /**
32  * @addtogroup Enums
33  * @{
34  */
35 /**
36  * List of elementary stream types of which played media container
37  * can consists of.
38  *
39  * Values of valid elementary streams can be used to index array.
40  */
41 typedef enum {
42  /**
43  * Unknown Elementary Stream.
44  */
46  /**
47  * Video Elementary Stream.
48  */
50  /**
51  * Audio Elementary Stream.
52  */
54  /**
55  * Text/Subtitles Elementary Stream.
56  */
58  /**
59  * Number of valid Elementary Streams, which can be
60  * used as an array size.
61  */
65 /**
66  * @}
67  */
68 
69 /**
70  * @addtogroup Structs
71  * @{
72  */
73 /* The <code>PP_EncryptedSubsampleDescription</code> structure contains
74  * information to support subsample decryption.
75  *
76  * An input block can be split into several continuous subsamples.
77  * A <code>PP_DecryptSubsampleEntry</code> specifies the number of clear and
78  * cipher bytes in each subsample. For example, the following block has three
79  * subsamples:
80  *
81  * |<----- subsample1 ----->|<----- subsample2 ----->|<----- subsample3 ----->|
82  * | clear1 | cipher1 | clear2 | cipher2 | clear3 | cipher3 |
83  *
84  * For decryption, all of the cipher bytes in a block should be treated as a
85  * contiguous (in the subsample order) logical stream. The clear bytes should
86  * not be considered as part of decryption.
87  *
88  * Logical stream to decrypt: | cipher1 | cipher2 | cipher3 |
89  * Decrypted stream: | decrypted1| decrypted2 | decrypted3 |
90  *
91  * After decryption, the decrypted bytes should be copied over the position
92  * of the corresponding cipher bytes in the original block to form the output
93  * block. Following the above example, the decrypted block should be:
94  *
95  * |<----- subsample1 ----->|<----- subsample2 ----->|<----- subsample3 ----->|
96  * | clear1 | decrypted1| clear2 | decrypted2 | clear3 | decrypted3 |
97  */
99  /*
100  * Size in bytes of clear data in a subsample entry.
101  */
102  uint32_t clear_bytes;
103  /*
104  * Size in bytes of encrypted data in a subsample entry.
105  */
106  uint32_t cipher_bytes;
107 };
109 /**
110  * @}
111  */
112 
113 /**
114  * @addtogroup Functions
115  * @{
116  */
117 
118 /** Converts PP_MicrosecondsDelta to seconds */
120  return value / 1000000.0;
121 }
122 
123 /** Converts seconds to PP_MicrosecondsDelta */
125  return (int64_t)(value * 1000000.0 + 0.5);
126 }
127 
128 /**
129  * @}
130  */
131 
132 #endif /* PPAPI_C_SAMSUNG_PP_MEDIA_COMMON_SAMSUNG_H_ */
133 
#define PP_INLINE
Definition: pp_macros.h:46
int64_t PP_MicrosecondsDelta
PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_MicrosecondsDelta, 8)
PP_INLINE PP_MicrosecondsDelta PP_SecondsToMicrosecondsDelta(double value)
PP_INLINE double PP_MicrosecondsDeltaToSeconds(PP_MicrosecondsDelta value)
PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_EncryptedSubsampleDescription, 8)
PP_ElementaryStream_Type_Samsung