| 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 /// int32_t attribs[] = { | 62 /// int32_t attribs[] = { |
| 63 /// PP_MEDIASTREAMVIDEOTRACK_ATTRIB_BUFFERED_FRAMES, 4, | 63 /// PP_MEDIASTREAMVIDEOTRACK_ATTRIB_BUFFERED_FRAMES, 4, |
| 64 /// PP_MEDIASTREAMVIDEOTRACK_ATTRIB_NONE}; | 64 /// PP_MEDIASTREAMVIDEOTRACK_ATTRIB_NONE}; |
| 65 /// track.Configure(attribs, callback); | 65 /// track.Configure(attribs, callback); |
| 66 /// @endcode | 66 /// @endcode |
| 67 /// | 67 /// |
| 68 /// @param[in] attrib_list A list of attribute name-value pairs in which each | 68 /// @param[in] attrib_list A list of attribute name-value pairs in which each |
| 69 /// attribute is immediately followed by the corresponding desired value. | 69 /// attribute is immediately followed by the corresponding desired value. |
| 70 /// The list is terminated by | 70 /// The list is terminated by |
| 71 /// <code>PP_MEDIASTREAMVIDEOTRACK_ATTRIB_NONE</code>. | 71 /// <code>PP_MEDIASTREAMVIDEOTRACK_ATTRIB_NONE</code>. |
| 72 /// @param[in] callback A <code>PP_CompletionCallback</code> to be called upon | 72 /// @param[in] callback A <code>CompletionCallback</code> to be called upon |
| 73 /// completion of <code>Configure()</code>. | 73 /// completion of <code>Configure()</code>. |
| 74 /// | 74 /// |
| 75 /// @return An int32_t containing a result code from <code>pp_errors.h</code>. | 75 /// @return An int32_t containing a result code from <code>pp_errors.h</code>. |
| 76 int32_t Configure(const int32_t attributes[], | 76 int32_t Configure(const int32_t attributes[], |
| 77 const CompletionCallback& callback); | 77 const CompletionCallback& callback); |
| 78 | 78 |
| 79 /// Gets attribute value for a given attribute name. | 79 /// Gets attribute value for a given attribute name. |
| 80 /// | 80 /// |
| 81 /// @param[in] attrib A <code>PP_MediaStreamVideoTrack_Attrib</code> for | 81 /// @param[in] attrib A <code>PP_MediaStreamVideoTrack_Attrib</code> for |
| 82 /// querying. | 82 /// querying. |
| (...skipping 14 matching lines...) Expand all Loading... |
| 97 /// Gets the next video frame from the MediaStream track. | 97 /// Gets the next video frame from the MediaStream track. |
| 98 /// If internal processing is slower than the incoming frame rate, new frames | 98 /// If internal processing is slower than the incoming frame rate, new frames |
| 99 /// will be dropped from the incoming stream. Once the input buffer is full, | 99 /// will be dropped from the incoming stream. Once the input buffer is full, |
| 100 /// frames will be dropped until <code>RecycleFrame()</code> is called to free | 100 /// frames will be dropped until <code>RecycleFrame()</code> is called to free |
| 101 /// a spot for another frame to be buffered. | 101 /// a spot for another frame to be buffered. |
| 102 /// If there are no frames in the input buffer, | 102 /// If there are no frames in the input buffer, |
| 103 /// <code>PP_OK_COMPLETIONPENDING</code> will be returned immediately and the | 103 /// <code>PP_OK_COMPLETIONPENDING</code> will be returned immediately and the |
| 104 /// <code>callback</code> will be called when a new frame is received or some | 104 /// <code>callback</code> will be called when a new frame is received or some |
| 105 /// error happens. | 105 /// error happens. |
| 106 /// | 106 /// |
| 107 /// @param[in] callback A <code>PP_CompletionCallback</code> to be called upon | 107 /// @param[in] callback A <code>CompletionCallbackWithOutput</code> to be |
| 108 /// completion of <code>GetFrame()</code>. If success, a VideoFrame will be | 108 /// called upon completion of <code>GetFrame()</code>. If success, |
| 109 /// passed into the completion callback function. | 109 /// a VideoFrame will be passed into the completion callback function. |
| 110 /// | 110 /// |
| 111 /// @return An int32_t containing a result code from <code>pp_errors.h</code>. | 111 /// @return An int32_t containing a result code from <code>pp_errors.h</code>. |
| 112 /// Returns PP_ERROR_NOMEMORY if <code>max_buffered_frames</code> frames | 112 /// Returns PP_ERROR_NOMEMORY if <code>max_buffered_frames</code> frames |
| 113 /// buffer was not allocated successfully. | 113 /// buffer was not allocated successfully. |
| 114 int32_t GetFrame( | 114 int32_t GetFrame( |
| 115 const CompletionCallbackWithOutput<VideoFrame>& callback); | 115 const CompletionCallbackWithOutput<VideoFrame>& callback); |
| 116 | 116 |
| 117 /// Recycles a frame returned by <code>GetFrame()</code>, so the track can | 117 /// Recycles a frame returned by <code>GetFrame()</code>, so the track can |
| 118 /// reuse the underlying buffer of this frame. And the frame will become | 118 /// reuse the underlying buffer of this frame. And the frame will become |
| 119 /// invalid. The caller should release all references it holds to | 119 /// invalid. The caller should release all references it holds to |
| (...skipping 14 matching lines...) Expand all Loading... |
| 134 /// | 134 /// |
| 135 /// @param[in] resource A <code>Resource</code> to test. | 135 /// @param[in] resource A <code>Resource</code> to test. |
| 136 /// | 136 /// |
| 137 /// @return True if <code>resource</code> is a MediaStream video track. | 137 /// @return True if <code>resource</code> is a MediaStream video track. |
| 138 static bool IsMediaStreamVideoTrack(const Resource& resource); | 138 static bool IsMediaStreamVideoTrack(const Resource& resource); |
| 139 }; | 139 }; |
| 140 | 140 |
| 141 } // namespace pp | 141 } // namespace pp |
| 142 | 142 |
| 143 #endif // PPAPI_CPP_MEDIA_STREAM_VIDEO_TRACK_H_ | 143 #endif // PPAPI_CPP_MEDIA_STREAM_VIDEO_TRACK_H_ |
| OLD | NEW |