Pepper_31_C_interfaces
ppb_media_source_samsung.h
Go to the documentation of this file.
1 /* Copyright (c) 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/ppb_media_source_samsung.idl,
7  * modified Mon Dec 9 17:27:10 2013.
8  */
9 
10 #ifndef PPAPI_C_SAMSUNG_PPB_MEDIA_SOURCE_SAMSUNG_H_
11 #define PPAPI_C_SAMSUNG_PPB_MEDIA_SOURCE_SAMSUNG_H_
12 
13 #include "ppapi/c/pp_array_output.h"
14 #include "ppapi/c/pp_bool.h"
15 #include "ppapi/c/pp_instance.h"
16 #include "ppapi/c/pp_macros.h"
17 #include "ppapi/c/pp_resource.h"
18 #include "ppapi/c/pp_stdint.h"
19 #include "ppapi/c/pp_var.h"
20 #include "ppapi/c/samsung/pp_media_common_samsung.h"
21 #include "ppapi/c/samsung/pp_media_control_samsung.h"
22 #include "ppapi/c/samsung/pp_media_source_samsung.h"
23 #include "ppapi/c/samsung/ppp_media_control_samsung.h"
24 #include "ppapi/c/samsung/ppp_media_source_samsung.h"
25 
26 #define PPB_MEDIASOURCE_SAMSUNG_INTERFACE_0_9 "PPB_MediaSource_Samsung;0.9"
27 #define PPB_MEDIASOURCE_SAMSUNG_INTERFACE PPB_MEDIASOURCE_SAMSUNG_INTERFACE_0_9
28 
29 /**
30  * @file
31  * This file defines the <code>PPB_MediaSource_Samsung</code> interface.
32  */
33 
34 
35 /**
36  * @addtogroup Interfaces
37  * @{
38  */
39 /**
40  * Interface used by PNaCl appliction to provide chunks of multimedia data
41  * to the platform. Those chunks will be decoded and played by the platform.
42  *
43  * This interface inherits from PPB_MediaControl_Samsung.
44  */
46  /**
47  * Creates new instance of Media Source associated with both PPP inerfaces
48  * |media_control_interface| and |media_source_interface|.
49  *
50  * |user_data| will be data passed to calls of methods from
51  * PPP_MediaControl_Samsung and PPP_MediaSource_Samsung interfaces.
52  */
54  PP_Instance instance,
55  const struct PPP_MediaControl_Samsung_0_9* media_control_interface,
56  const struct PPP_MediaSource_Samsung_0_9* media_source_interface,
57  void* user_data);
58  /**
59  * Checks if given resource is Media Source. If this method returns PP_TRUE,
60  * then also PPB_MediaControl_Samsung.IsMediaControl will also return PP_TRUE.
61  */
63  /**
64  * Binds given MediaSource to vide/audio object of given |id| present on
65  * HTML page on which given module is embedded.
66  */
68  /**
69  * Adds source for which data are appended using Append method. Added source
70  * is container of type |type| encoded using codecs on |codecs| list.
71  *
72  * Returns status - PP_SourceAddStatus and |id| if status is OK.
73  */
75  struct PP_Var type,
76  struct PP_Var codecs,
77  struct PP_Var* id);
78  /**
79  * Checks if given source is active i.e. it contains video, audio or
80  * text (subtitle) track being played
81  */
82  PP_Bool (*IsSourceActive)(PP_Resource media, struct PP_Var id);
83  /** Removes source of given |id| and frees associated resources with it. */
84  void (*RemoveSource)(PP_Resource media, struct PP_Var id);
85  /**
86  * Appends data to given buffer (identified by |id|).
87  * |data| argument must be a handle to PPB_Buffer_Dev_0_4 instance.
88  */
89  void (*Append)(PP_Resource media, struct PP_Var id, PP_Resource data);
90  /** Aborts given data source */
91  void (*Abort)(PP_Resource media, struct PP_Var id);
92  /** Sets duration in microseconds of currently played stream */
93  void (*SetDuration)(PP_Resource media, PP_MicrosecondsDelta duration);
94  /** Gets duration in microseconds of currently played stream */
96  /**
97  * Sets end of stream. |error| argument represents whether it is just end
98  * of the stream (PP_MEDIAERROR_NO_ERROR) or some kind of error occured.
99  */
100  void (*SetEndOfStream)(PP_Resource media, PP_MediaError error);
101  /**
102  * Sets a time offset (in microseconds) to be applied to subsequent
103  * buffers appended to the given buffer.
104  */
106  struct PP_Var id,
107  PP_MicrosecondsDelta offset);
108  /**
109  * |output| - An output array which will receive
110  * <code>PP_TimeRange</code> structures on success.
111  *
112  * The browser can not allocate memory on behalf of the plugin becaues
113  * the plugin and browser may have different allocators.
114  * A PP_ArrayOutput must be provided so that output will be stored in its
115  * allocated buffer.
116  */
118  struct PP_Var id,
119  struct PP_ArrayOutput output);
120  /**
121  * Gets a current time of media.
122  */
124  /**
125  * Gets a ReadyState of media.
126  */
128 };
129 
131 /**
132  * @}
133  */
134 
135 #endif /* PPAPI_C_SAMSUNG_PPB_MEDIA_SOURCE_SAMSUNG_H_ */
136 
PP_Bool(* ReadTimeRanges)(PP_Resource media, struct PP_Var id, struct PP_ArrayOutput output)
PP_SourceAddStatus(* AddSource)(PP_Resource media, struct PP_Var type, struct PP_Var codecs, struct PP_Var *id)
void(* SetDuration)(PP_Resource media, PP_MicrosecondsDelta duration)
int64_t PP_MicrosecondsDelta
PP_MicrosecondsDelta(* GetDuration)(PP_Resource media)
PP_VarType type
Definition: pp_var.h:156
PP_Bool(* BindToHTMLPlayer)(PP_Resource media, struct PP_Var id)
int32_t PP_Resource
Definition: pp_resource.h:40
PP_MicrosecondsDelta(* GetMediaTime)(PP_Resource media)
void(* Append)(PP_Resource media, struct PP_Var id, PP_Resource data)
void(* SetEndOfStream)(PP_Resource media, PP_MediaError error)
PP_Bool(* IsMediaSource)(PP_Resource resource)
Definition: pp_var.h:155
int32_t PP_Instance
Definition: pp_instance.h:34
PP_Bool(* SetTimestampOffset)(PP_Resource media, struct PP_Var id, PP_MicrosecondsDelta offset)
void(* Abort)(PP_Resource media, struct PP_Var id)
PP_Bool
Definition: pp_bool.h:30
PP_MediaReadyState(* GetReadyState)(PP_Resource media)
PP_Bool(* IsSourceActive)(PP_Resource media, struct PP_Var id)
void(* RemoveSource)(PP_Resource media, struct PP_Var id)
PP_Resource(* Create)(PP_Instance instance, const struct PPP_MediaControl_Samsung_0_9 *media_control_interface, const struct PPP_MediaSource_Samsung_0_9 *media_source_interface, void *user_data)