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

Unified Diff: media/base/video_frame.h

Issue 1704273002: Add MojoVideoFrame (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months 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
« no previous file with comments | « no previous file | media/base/video_frame.cc » ('j') | media/mojo/services/BUILD.gn » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/video_frame.h
diff --git a/media/base/video_frame.h b/media/base/video_frame.h
index ad7f4c01a4268651728ce71acba87c3ec0ac388e..b413b624716f7ce836de19e203fbb1272eb7c459 100644
--- a/media/base/video_frame.h
+++ b/media/base/video_frame.h
@@ -73,7 +73,8 @@ class MEDIA_EXPORT VideoFrame : public base::RefCountedThreadSafe<VideoFrame> {
STORAGE_HOLE = 6,
#endif
STORAGE_GPU_MEMORY_BUFFERS = 7,
- STORAGE_LAST = STORAGE_GPU_MEMORY_BUFFERS,
+ STORAGE_MOJO_SHARED_MEMORY = 8,
+ STORAGE_LAST = STORAGE_MOJO_SHARED_MEMORY,
mcasas 2016/02/18 04:32:50 I do something similar in media/capture/service/m
jrummell 2016/02/23 02:01:21 I've added most of the code from the other CL into
};
// CB to be called on the mailbox backing this frame when the frame is
@@ -413,7 +414,7 @@ class MEDIA_EXPORT VideoFrame : public base::RefCountedThreadSafe<VideoFrame> {
// Returns a human-readable string describing |*this|.
std::string AsHumanReadableString();
- private:
+ protected:
friend class base::RefCountedThreadSafe<VideoFrame>;
static scoped_refptr<VideoFrame> WrapExternalStorage(
@@ -463,6 +464,26 @@ class MEDIA_EXPORT VideoFrame : public base::RefCountedThreadSafe<VideoFrame> {
void AllocateYUV(bool zero_initialize_memory);
+ static std::string ConfigToString(const VideoPixelFormat format,
+ const VideoFrame::StorageType storage_type,
+ const gfx::Size& coded_size,
+ const gfx::Rect& visible_rect,
+ const gfx::Size& natural_size);
+
+ // Returns true if |plane| is a valid plane index for the given |format|.
+ static bool IsValidPlane(size_t plane, VideoPixelFormat format);
+
+ // Returns the pixel size per element for given |plane| and |format|. E.g. 2x2
+ // for the U-plane in PIXEL_FORMAT_I420.
+ static gfx::Size SampleSize(VideoPixelFormat format, size_t plane);
+
+ // Returns the number of bytes per element for given |plane| and |format|.
+ static int BytesPerElement(VideoPixelFormat format, size_t plane);
+
+ // Return the alignment for the whole frame, calculated as the max of the
+ // alignment for each individual plane.
+ static gfx::Size CommonAlignment(VideoPixelFormat format);
+
// Frame format.
const VideoPixelFormat format_;
« no previous file with comments | « no previous file | media/base/video_frame.cc » ('j') | media/mojo/services/BUILD.gn » ('J')

Powered by Google App Engine
This is Rietveld 408576698