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