Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(201)

Unified Diff: ppapi/cpp/video_frame.h

Issue 107083004: [PPAPI] API definition for video media stream artifacts (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Update Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ppapi/cpp/video_frame.h
diff --git a/ppapi/cpp/video_frame.h b/ppapi/cpp/video_frame.h
new file mode 100644
index 0000000000000000000000000000000000000000..cdab097056ad66524aa55bc89ff52b12e9c290c6
--- /dev/null
+++ b/ppapi/cpp/video_frame.h
@@ -0,0 +1,75 @@
+// Copyright (c) 2013 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 timestamp of the video frame.
+ ///
+ /// @return A <code>PP_TimeDelta</code> containing 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 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 size of the video frame.
+ ///
+ /// @param[out] size A <code>Size</code>
yzshen1 2013/12/26 18:52:38 trailing '.', please.
Peng 2013/12/27 01:37:52 Done.
+ ///
+ /// @return True on success or false on failure.
+ bool GetSize(Size* size) const;
+
+ /// Gets data buffer for video frame pixels.
+ ///
+ /// @return A pointer to the beginning of data buffer.
+ void* GetDataBuffer();
+
+ /// Gets size of data buffer.
+ ///
+ /// @return The size of the data buffer.
+ uint32_t GetDataBufferSize() const;
+};
+
+} // namespace pp
+
+#endif // PPAPI_CPP_VIDEO_FRAME_H_

Powered by Google App Engine
This is Rietveld 408576698