[M108 Aura Migration] Add media playback ewk api
[platform/framework/web/chromium-efl.git] / tizen_src / ewk / efl_integration / public / ewk_media_playback_info_product.h
1 /*
2  * Copyright (C) 2016 Samsung Electronics. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  *    notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  *    notice, this list of conditions and the following disclaimer in the
11  *    documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY SAMSUNG ELECTRONICS. AND ITS CONTRIBUTORS
14  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SAMSUNG ELECTRONICS. OR ITS
17  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
20  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
21  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
22  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
23  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24  */
25
26 /**
27  * @file    ewk_media_playback_info_product.h
28  * @brief   This file describes the ewk media playback info API.
29  */
30
31 #ifndef ewk_media_playback_info_product_h
32 #define ewk_media_playback_info_product_h
33
34 #include <Eina.h>
35 #include <Evas.h>
36 #include <tizen.h>
37
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41
42 /**
43  * Enum values used to inform webengine about decoder used by broadcast.
44  */
45 typedef enum Ewk_Hardware_Decoders {
46     EWK_HARDWARE_DECODERS_NONE,
47     EWK_HARDWARE_DECODERS_MAIN,
48     EWK_HARDWARE_DECODERS_SUB,
49 } Ewk_Hardware_Decoders;
50
51 typedef struct _Ewk_Media_Playback_Info Ewk_Media_Playback_Info;
52
53 /**
54  * Get video id of media.
55  *
56  * @param meia playback info's structure
57  *
58  * @return @c video id
59  */
60 EXPORT_API const int ewk_media_playback_info_video_id_get(
61     Ewk_Media_Playback_Info* data);
62
63 /**
64  * Get url of media.
65  *
66  * @param meia playback info's structure
67  *
68  * @return @c media url
69  */
70 EXPORT_API const char* ewk_media_playback_info_media_url_get(
71     Ewk_Media_Playback_Info* data);
72
73 /**
74  * Get mime type of media.
75  *
76  * @param meia playback info's structure
77  *
78  * @return @c mime type
79  */
80 EXPORT_API const char* ewk_media_playback_info_mime_type_get(
81     Ewk_Media_Playback_Info* data);
82
83 /**
84  * Get translated url of media.
85  *
86  * @param media playback info's structure
87  *
88  * @return @c translated url
89  */
90 EXPORT_API const char* ewk_media_playback_info_translated_url_get(
91     Ewk_Media_Playback_Info* data);
92
93 /**
94  * Get drm info of media.
95  *
96  * @param media playback info's structure
97  *
98  * @return @c drm info
99  */
100 EXPORT_API const char* ewk_media_playback_info_drm_info_get(
101     Ewk_Media_Playback_Info* data);
102
103 /**
104  * Get decoder info of media.
105  *
106  * @param data playback info's structure
107  *
108  * @return @c decoder name
109  */
110 EXPORT_API Ewk_Hardware_Decoders ewk_media_playback_info_decoder_get(
111     Ewk_Media_Playback_Info* data);
112
113 /**
114  * Set media resource acquired of media.
115  *
116  * @param media playback info's structure
117  */
118 EXPORT_API void ewk_media_playback_info_media_resource_acquired_set(
119     Ewk_Media_Playback_Info* data,
120     Eina_Bool media_resource_acquired);
121
122 /**
123  * Set translated url of media.
124  *
125  * @param media playback info's structure
126  */
127 EXPORT_API void ewk_media_playback_info_translated_url_set(
128     Ewk_Media_Playback_Info* data,
129     const char* translated_url);
130
131 /**
132  * Set drm info of media.
133  *
134  * @param media playback info's structure
135  */
136 EXPORT_API void ewk_media_playback_info_drm_info_set(
137     Ewk_Media_Playback_Info* data,
138     const char* drm_info);
139
140 /**
141  * Set decoder info of media.
142  *
143  * @param media playback info's structure
144  */
145 EXPORT_API void ewk_media_playback_info_decoder_set(
146     Ewk_Media_Playback_Info* data,
147     Ewk_Hardware_Decoders decoder);
148
149 Ewk_Media_Playback_Info* ewkMediaPlaybackInfoCreate(const int player_id,
150                                                     const char* url,
151                                                     const char* mime_type);
152 Eina_Bool ewk_media_playback_info_media_resource_acquired_get(
153     Ewk_Media_Playback_Info* data);
154 void ewkMediaPlaybackInfoDelete(Ewk_Media_Playback_Info* data);
155
156 #ifdef __cplusplus
157 }
158 #endif
159 #endif  // ewk_media_playback_info_product_h