Pepper_37_C_interfaces
ppb_source_buffer_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/ppb_source_buffer_samsung.idl,
7  * modified Wed Jan 28 10:08:02 2015.
8  */
9 
10 #ifndef PPAPI_C_SAMSUNG_PPB_SOURCE_BUFFER_SAMSUNG_H_
11 #define PPAPI_C_SAMSUNG_PPB_SOURCE_BUFFER_SAMSUNG_H_
12 
13 #include "ppapi/c/pp_array_output.h"
14 #include "ppapi/c/pp_bool.h"
15 #include "ppapi/c/pp_completion_callback.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/samsung/pp_media_common_samsung.h"
20 
21 #define PPB_SOURCEBUFFER_SAMSUNG_INTERFACE_0_10 "PPB_SourceBuffer_Samsung;0.10"
22 #define PPB_SOURCEBUFFER_SAMSUNG_INTERFACE \
23  PPB_SOURCEBUFFER_SAMSUNG_INTERFACE_0_10
24 
25 /**
26  * @file
27  * This file defines the <code>PPB_SourceBuffer_Samsung</code> interface. */
28 
29 
30 /**
31  * @addtogroup Interfaces
32  * @{
33  */
34 /*
35  * This interface is used to manage sources of media streams and appending data
36  * to them. It's aim is to provide similar API as those defined in Media Source
37  * Extensions (MSE) for JavaScirpt.
38  * Simplified typical scenario:
39  * 1. Requesting MediaSource creates the Source Buffer
40  * 2. Getting the buffer's resource id/object in the callback.
41  * 3. Appending data to the buffer.
42  * 4. Waiting for the callback to append next chunk (or)
43  * 5. Waiting for the AppendEnd on the PPP interface to get back ranges.
44  */
46  /**
47  * Checks if given resource is Source Buffer.
48  */
50  /**
51  * Checks if the source is active i.e. it contains video, audio or
52  * text (subtitle) track being played
53  */
54  int32_t (*IsSourceActive)(PP_Resource buffer,
55  PP_Bool* active,
56  struct PP_CompletionCallback callback);
57  /**
58  * Appends data to this buffer.
59  * Execution is confirmed by calling |callback|.
60  * May return errors in callback:
61  * - PP_OK - when Append finished without errors
62  * - PP_ERROR_BADRESOURCE - when PP_Resource is invalid
63  * - PP_ERROR_FAILED when Append failed
64  */
65  int32_t (*Append)(PP_Resource buffer,
66  const void* data,
67  uint32_t bytes_to_append,
68  struct PP_CompletionCallback callback);
69  /**
70  * Aborts given data source
71  * Execution is confirmed by calling |callback|.
72  */
73  int32_t (*Abort)(PP_Resource buffer, struct PP_CompletionCallback callback);
74  /**
75  * Sets a time offset (in microseconds) to be applied to subsequent
76  * buffers appended to the given buffer.
77  */
78  int32_t (*SetTimestampOffset)(PP_Resource buffer,
79  PP_MicrosecondsDelta offset,
80  struct PP_CompletionCallback callback);
81  /** Gets offset in microseconds of selected stream */
82  int32_t (*GetTimestampOffset)(PP_Resource buffer,
83  PP_MicrosecondsDelta* output,
84  struct PP_CompletionCallback callback);
85  /**
86  * Read ranges of buffered media stream.
87  *
88  * |output| - An output array which will receive
89  * <code>PP_TimeRange</code> structures on success.
90  *
91  * The browser can not allocate memory on behalf of the plugin because
92  * the plugin and browser may have different allocators.
93  * A PP_ArrayOutput must be provided so that output will be stored in its
94  * allocated buffer.
95  */
96  int32_t (*ReadTimeRanges)(PP_Resource buffer,
97  struct PP_ArrayOutput output,
98  struct PP_CompletionCallback callback);
99 };
100 
102 /**
103  * @}
104  */
105 
106 #endif /* PPAPI_C_SAMSUNG_PPB_SOURCE_BUFFER_SAMSUNG_H_ */
107 
int32_t(* Abort)(PP_Resource buffer, struct PP_CompletionCallback callback)
int32_t(* GetTimestampOffset)(PP_Resource buffer, PP_MicrosecondsDelta *output, struct PP_CompletionCallback callback)
int64_t PP_MicrosecondsDelta
int32_t PP_Resource
Definition: pp_resource.h:40
int32_t(* Append)(PP_Resource buffer, const void *data, uint32_t bytes_to_append, struct PP_CompletionCallback callback)
int32_t(* SetTimestampOffset)(PP_Resource buffer, PP_MicrosecondsDelta offset, struct PP_CompletionCallback callback)
PP_Bool(* IsSourceBuffer)(PP_Resource resource)
int32_t(* ReadTimeRanges)(PP_Resource buffer, struct PP_ArrayOutput output, struct PP_CompletionCallback callback)
int32_t(* IsSourceActive)(PP_Resource buffer, PP_Bool *active, struct PP_CompletionCallback callback)
PP_Bool
Definition: pp_bool.h:30