summaryrefslogtreecommitdiffstats
path: root/ppapi/cpp/video_frame.h
diff options
context:
space:
mode:
authorpenghuang@chromium.org <penghuang@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-06 16:38:47 +0000
committerpenghuang@chromium.org <penghuang@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-06 16:38:47 +0000
commit9134a8c5bd338f555a61f9863b0a50ffe28e0d5a (patch)
tree3be721f5fc32679fc7378cbbde80893841e24f13 /ppapi/cpp/video_frame.h
parentc7c265f6fccf6a4672855af85d5cbd23689f4416 (diff)
downloadchromium_src-9134a8c5bd338f555a61f9863b0a50ffe28e0d5a.zip
chromium_src-9134a8c5bd338f555a61f9863b0a50ffe28e0d5a.tar.gz
chromium_src-9134a8c5bd338f555a61f9863b0a50ffe28e0d5a.tar.bz2
[PPAPI] API definition for video media stream artifacts
This API follows the design at https://docs.google.com/a/google.com/document/d/1rlwmFhf7VCX8mfrBok8wqXNgvr_ERhL2k6Fqha-pgIo/edit?disco=AAAAAHos8Y8# It defines new objects for the consumption of media video tracks based on the private VideoSource/VideoDestination classes. BUG=330851 Review URL: https://codereview.chromium.org/107083004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@243099 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/cpp/video_frame.h')
-rw-r--r--ppapi/cpp/video_frame.h75
1 files changed, 75 insertions, 0 deletions
diff --git a/ppapi/cpp/video_frame.h b/ppapi/cpp/video_frame.h
new file mode 100644
index 0000000..0c3b3ea
--- /dev/null
+++ b/ppapi/cpp/video_frame.h
@@ -0,0 +1,75 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef PPAPI_CPP_VIDEO_FRAME_H_
+#define PPAPI_CPP_VIDEO_FRAME_H_
+
+#include "ppapi/c/ppb_video_frame.h"
+#include "ppapi/cpp/resource.h"
+#include "ppapi/cpp/size.h"
+
+namespace pp {
+
+class VideoFrame : public Resource {
+ public:
+ /// Default constructor for creating an is_null()
+ /// <code>VideoFrame</code> object.
+ VideoFrame();
+
+ /// The copy constructor for <code>VideoFrame</code>.
+ ///
+ /// @param[in] other A reference to a <code>VideoFrame</code>.
+ VideoFrame(const VideoFrame& other);
+
+ VideoFrame(const Resource& resource);
+
+ /// A constructor used when you have received a <code>PP_Resource</code> as a
+ /// return value that has had 1 ref added for you.
+ ///
+ /// @para[in] resource A <code>PPB_VideoFrame</code> resource.
+ VideoFrame(PassRef, PP_Resource resource);
+
+ virtual ~VideoFrame();
+
+ /// Gets the timestamp of the video frame.
+ ///
+ /// @return A <code>PP_TimeDelta</code> containing the timestamp of the video
+ /// frame. Given in seconds since the start of the containing video stream.
+ PP_TimeDelta GetTimestamp() const;
+
+ /// Sets the timestamp of the video frame. Given in seconds since the
+ /// start of the containing video stream.
+ ///
+ /// @param[in] timestamp A <code>PP_TimeDelta</code> containing the timestamp
+ /// of the video frame. Given in seconds since the start of the containing
+ /// video stream.
+ void SetTimestamp(PP_TimeDelta timestamp);
+
+ /// Gets the format of the video frame.
+ ///
+ /// @return A <code>PP_VideoFrame_Format</code> containing the format of the
+ /// video frame.
+ PP_VideoFrame_Format GetFormat() const;
+
+ /// Gets the size of the video frame.
+ ///
+ /// @param[out] size A <code>Size</code>.
+ ///
+ /// @return True on success or false on failure.
+ bool GetSize(Size* size) const;
+
+ /// Gets the data buffer for video frame pixels.
+ ///
+ /// @return A pointer to the beginning of the data buffer.
+ void* GetDataBuffer();
+
+ /// Gets the size of data buffer.
+ ///
+ /// @return The size of the data buffer.
+ uint32_t GetDataBufferSize() const;
+};
+
+} // namespace pp
+
+#endif // PPAPI_CPP_VIDEO_FRAME_H_