OLD | NEW |
(Empty) | |
| 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 #ifndef PPAPI_CPP_VIDEO_FRAME_H_ |
| 6 #define PPAPI_CPP_VIDEO_FRAME_H_ |
| 7 |
| 8 #include "ppapi/c/ppb_video_frame.h" |
| 9 #include "ppapi/cpp/resource.h" |
| 10 #include "ppapi/cpp/size.h" |
| 11 |
| 12 namespace pp { |
| 13 |
| 14 class VideoFrame : public Resource { |
| 15 public: |
| 16 /// Default constructor for creating an is_null() |
| 17 /// <code>VideoFrame</code> object. |
| 18 VideoFrame(); |
| 19 |
| 20 /// The copy constructor for <code>VideoFrame</code>. |
| 21 /// |
| 22 /// @param[in] other A reference to a <code>VideoFrame</code>. |
| 23 VideoFrame(const VideoFrame& other); |
| 24 |
| 25 VideoFrame(const Resource& resource); |
| 26 |
| 27 /// A constructor used when you have received a <code>PP_Resource</code> as a |
| 28 /// return value that has had 1 ref added for you. |
| 29 /// |
| 30 /// @para[in] resource A <code>PPB_VideoFrame</code> resource. |
| 31 VideoFrame(PassRef, PP_Resource resource); |
| 32 |
| 33 virtual ~VideoFrame(); |
| 34 |
| 35 /// Gets timestamp of the video frame. |
| 36 /// |
| 37 /// @return A <code>PP_TimeDelta</code> containing timestamp of the video |
| 38 /// frame. Given in seconds since the start of the containing video stream. |
| 39 PP_TimeDelta GetTimestamp() const; |
| 40 |
| 41 /// Sets the timestamp of the video frame. Given in seconds since the |
| 42 /// start of the containing video stream. |
| 43 /// |
| 44 /// @param[in] timestamp A <code>PP_TimeDelta</code> containing the timestamp |
| 45 /// of the video frame. Given in seconds since the start of the containing |
| 46 /// video stream. |
| 47 void SetTimestamp(PP_TimeDelta timestamp); |
| 48 |
| 49 /// Gets format of the video frame. |
| 50 /// |
| 51 /// @return A <code>PP_VideoFrame_Format</code> containing the format of the |
| 52 /// video frame. |
| 53 PP_VideoFrame_Format GetFormat() const; |
| 54 |
| 55 /// Gets size of the video frame. |
| 56 /// |
| 57 /// @param[out] size A <code>Size</code>. |
| 58 /// |
| 59 /// @return True on success or false on failure. |
| 60 bool GetSize(Size* size) const; |
| 61 |
| 62 /// Gets data buffer for video frame pixels. |
| 63 /// |
| 64 /// @return A pointer to the beginning of data buffer. |
| 65 void* GetDataBuffer(); |
| 66 |
| 67 /// Gets size of data buffer. |
| 68 /// |
| 69 /// @return The size of the data buffer. |
| 70 uint32_t GetDataBufferSize() const; |
| 71 }; |
| 72 |
| 73 } // namespace pp |
| 74 |
| 75 #endif // PPAPI_CPP_VIDEO_FRAME_H_ |
OLD | NEW |