cc: Added inline to Tile::IsReadyToDraw
[chromium-blink-merge.git] / ppapi / c / private / ppb_video_source_private.h
bloba3ba0717e3dd5a21844dc57b7fae636ddeabc344
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 */
6 /* From private/ppb_video_source_private.idl,
7 * modified Thu Apr 25 11:51:30 2013.
8 */
10 #ifndef PPAPI_C_PRIVATE_PPB_VIDEO_SOURCE_PRIVATE_H_
11 #define PPAPI_C_PRIVATE_PPB_VIDEO_SOURCE_PRIVATE_H_
13 #include "ppapi/c/pp_bool.h"
14 #include "ppapi/c/pp_completion_callback.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_time.h"
20 #include "ppapi/c/pp_var.h"
21 #include "ppapi/c/private/pp_video_frame_private.h"
23 #define PPB_VIDEOSOURCE_PRIVATE_INTERFACE_0_1 "PPB_VideoSource_Private;0.1"
24 #define PPB_VIDEOSOURCE_PRIVATE_INTERFACE PPB_VIDEOSOURCE_PRIVATE_INTERFACE_0_1
26 /**
27 * @file
28 * This file defines the <code>PPB_VideoSource_Private</code> interface for a
29 * video source resource, which receives video frames from a MediaStream video
30 * track in the browser.
34 /**
35 * @addtogroup Interfaces
36 * @{
38 /**
39 * The <code>PPB_VideoSource_Private</code> interface contains pointers to
40 * several functions for creating video source resources and using them to
41 * receive video frames from a MediaStream video track in the browser.
43 struct PPB_VideoSource_Private_0_1 {
44 /**
45 * Creates a video source resource.
47 * @param[in] instance A <code>PP_Instance</code> identifying an instance of
48 * a module.
50 * @return A <code>PP_Resource</code> with a nonzero ID on success or zero on
51 * failure. Failure means the instance was invalid.
53 PP_Resource (*Create)(PP_Instance instance);
54 /**
55 * Determines if a resource is a video source resource.
57 * @param[in] resource The <code>PP_Resource</code> to test.
59 * @return A <code>PP_Bool</code> with <code>PP_TRUE</code> if the given
60 * resource is a video source resource or <code>PP_FALSE</code> otherwise.
62 PP_Bool (*IsVideoSource)(PP_Resource resource);
63 /**
64 * Opens a video source for getting frames.
66 * @param[in] source A <code>PP_Resource</code> corresponding to a video
67 * source resource.
68 * @param[in] stream_url A <code>PP_Var</code> string holding a URL
69 * identifying a MediaStream.
70 * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
71 * completion of Open().
73 * @return An int32_t containing a result code from <code>pp_errors.h</code>.
74 * Returns PP_ERROR_BADRESOURCE if source isn't a valid video source.
75 * Returns PP_ERROR_INPROGRESS if source is already open.
76 * Returns PP_ERROR_FAILED if the MediaStream doesn't exist or if there is
77 * some other browser error.
79 int32_t (*Open)(PP_Resource source,
80 struct PP_Var stream_url,
81 struct PP_CompletionCallback callback);
82 /**
83 * Gets a frame from the video source.
84 * The image data resource inside the returned frame will have its reference
85 * count incremented by one and must be managed by the plugin.
87 * @param[in] source A <code>PP_Resource</code> corresponding to a video
88 * source resource.
89 * @param[out] frame A <code>PP_VideoFrame_Private</code> to hold a video
90 * frame from the source.
91 * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
92 * completion of GetNextFrame().
94 * @return An int32_t containing a result code from <code>pp_errors.h</code>.
95 * Returns PP_ERROR_BADRESOURCE if source isn't a valid video source.
96 * Returns PP_ERROR_FAILED if the source is not open, or if some other
97 * browser error occurs.
99 int32_t (*GetFrame)(PP_Resource source,
100 struct PP_VideoFrame_Private* frame,
101 struct PP_CompletionCallback callback);
103 * Closes the video source.
105 * @param[in] source A <code>PP_Resource</code> corresponding to a video
106 * source resource.
108 void (*Close)(PP_Resource source);
111 typedef struct PPB_VideoSource_Private_0_1 PPB_VideoSource_Private;
113 * @}
116 #endif /* PPAPI_C_PRIVATE_PPB_VIDEO_SOURCE_PRIVATE_H_ */