OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef PPAPI_CPP_MEDIA_STREAM_VIDEO_TRACK_H_ | 5 #ifndef PPAPI_CPP_MEDIA_STREAM_VIDEO_TRACK_H_ |
6 #define PPAPI_CPP_MEDIA_STREAM_VIDEO_TRACK_H_ | 6 #define PPAPI_CPP_MEDIA_STREAM_VIDEO_TRACK_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "ppapi/c/ppb_media_stream_video_track.h" | 10 #include "ppapi/c/ppb_media_stream_video_track.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 MediaStreamVideoTrack(PassRef, PP_Resource resource); | 48 MediaStreamVideoTrack(PassRef, PP_Resource resource); |
49 | 49 |
50 ~MediaStreamVideoTrack(); | 50 ~MediaStreamVideoTrack(); |
51 | 51 |
52 /// Configures underlying frame buffers for incoming frames. | 52 /// Configures underlying frame buffers for incoming frames. |
53 /// If the application doesn't want to drop frames, then the | 53 /// If the application doesn't want to drop frames, then the |
54 /// <code>PP_MEDIASTREAMVIDEOTRACK_ATTRIB_BUFFERED_FRAMES</code> should be | 54 /// <code>PP_MEDIASTREAMVIDEOTRACK_ATTRIB_BUFFERED_FRAMES</code> should be |
55 /// chosen such that inter-frame processing time variability won't overrun the | 55 /// chosen such that inter-frame processing time variability won't overrun the |
56 /// input buffer. If the buffer is overfilled, then frames will be dropped. | 56 /// input buffer. If the buffer is overfilled, then frames will be dropped. |
57 /// The application can detect this by examining the timestamp on returned | 57 /// The application can detect this by examining the timestamp on returned |
58 /// frames. If <code>Configure()</code> is not called, default settings will | 58 /// frames. If some attributes are not specified, default values will be used |
59 /// be used. | 59 /// for those unspecified attributes. If <code>Configure()</code> is not |
| 60 /// called, default settings will be used. |
60 /// Example usage from plugin code: | 61 /// Example usage from plugin code: |
61 /// @code | 62 /// @code |
62 /// int32_t attribs[] = { | 63 /// int32_t attribs[] = { |
63 /// PP_MEDIASTREAMVIDEOTRACK_ATTRIB_BUFFERED_FRAMES, 4, | 64 /// PP_MEDIASTREAMVIDEOTRACK_ATTRIB_BUFFERED_FRAMES, 4, |
64 /// PP_MEDIASTREAMVIDEOTRACK_ATTRIB_NONE}; | 65 /// PP_MEDIASTREAMVIDEOTRACK_ATTRIB_NONE}; |
65 /// track.Configure(attribs, callback); | 66 /// track.Configure(attribs, callback); |
66 /// @endcode | 67 /// @endcode |
67 /// | 68 /// |
68 /// @param[in] attrib_list A list of attribute name-value pairs in which each | 69 /// @param[in] attrib_list A list of attribute name-value pairs in which each |
69 /// attribute is immediately followed by the corresponding desired value. | 70 /// attribute is immediately followed by the corresponding desired value. |
70 /// The list is terminated by | 71 /// The list is terminated by |
71 /// <code>PP_MEDIASTREAMVIDEOTRACK_ATTRIB_NONE</code>. | 72 /// <code>PP_MEDIASTREAMVIDEOTRACK_ATTRIB_NONE</code>. |
72 /// @param[in] callback A <code>CompletionCallback</code> to be called upon | 73 /// @param[in] callback A <code>CompletionCallback</code> to be called upon |
73 /// completion of <code>Configure()</code>. | 74 /// completion of <code>Configure()</code>. |
74 /// | 75 /// |
75 /// @return An int32_t containing a result code from <code>pp_errors.h</code>. | 76 /// @return An int32_t containing a result code from <code>pp_errors.h</code>. |
| 77 /// Returns <code>PP_ERROR_INPROGRESS</code> if there is a pending call of |
| 78 /// <code>Configure()</code> or <code>GetFrame()</code>, or the plugin |
| 79 /// holds some frames which are not recycled with <code>RecycleFrame()</code>. |
| 80 /// If an error is returned, all attributes and the underlying buffer will not |
| 81 /// be changed. |
76 int32_t Configure(const int32_t attributes[], | 82 int32_t Configure(const int32_t attributes[], |
77 const CompletionCallback& callback); | 83 const CompletionCallback& callback); |
78 | 84 |
79 /// Gets attribute value for a given attribute name. | 85 /// Gets attribute value for a given attribute name. |
80 /// | 86 /// |
81 /// @param[in] attrib A <code>PP_MediaStreamVideoTrack_Attrib</code> for | 87 /// @param[in] attrib A <code>PP_MediaStreamVideoTrack_Attrib</code> for |
82 /// querying. | 88 /// querying. |
83 /// @param[out] value A int32_t for storing the attribute value. | 89 /// @param[out] value A int32_t for storing the attribute value. |
84 /// | 90 /// |
85 /// @return An int32_t containing a result code from <code>pp_errors.h</code>. | 91 /// @return An int32_t containing a result code from <code>pp_errors.h</code>. |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 /// | 140 /// |
135 /// @param[in] resource A <code>Resource</code> to test. | 141 /// @param[in] resource A <code>Resource</code> to test. |
136 /// | 142 /// |
137 /// @return True if <code>resource</code> is a MediaStream video track. | 143 /// @return True if <code>resource</code> is a MediaStream video track. |
138 static bool IsMediaStreamVideoTrack(const Resource& resource); | 144 static bool IsMediaStreamVideoTrack(const Resource& resource); |
139 }; | 145 }; |
140 | 146 |
141 } // namespace pp | 147 } // namespace pp |
142 | 148 |
143 #endif // PPAPI_CPP_MEDIA_STREAM_VIDEO_TRACK_H_ | 149 #endif // PPAPI_CPP_MEDIA_STREAM_VIDEO_TRACK_H_ |
OLD | NEW |