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

Unified Diff: ppapi/shared_impl/media_stream_frame.h

Issue 128683003: [PPAPI] Implement media stream video track API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@video_track_impl_cl
Patch Set: Update Created 6 years, 11 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 | « ppapi/proxy/video_frame_resource.cc ('k') | ppapi/shared_impl/media_stream_frame_buffer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/shared_impl/media_stream_frame.h
diff --git a/ppapi/shared_impl/media_stream_frame.h b/ppapi/shared_impl/media_stream_frame.h
new file mode 100644
index 0000000000000000000000000000000000000000..d2b60fb03cc3feb24e6c8364c3125f64b4cfc999
--- /dev/null
+++ b/ppapi/shared_impl/media_stream_frame.h
@@ -0,0 +1,54 @@
+// Copyright (c) 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_SHARED_IMPL_MEDIA_STREAM_FRAME_H_
+#define PPAPI_SHARED_IMPL_MEDIA_STREAM_FRAME_H_
+
+#include "ppapi/c/ppb_video_frame.h"
+
+namespace ppapi {
+
+union MediaStreamFrame {
+ enum Type {
+ TYPE_UNKNOWN = 0,
+ TYPE_AUDIO = 1,
+ TYPE_VIDEO = 2,
+ };
+
+ struct Header {
+ Type type;
+ uint32_t size;
+ };
+
+ struct Audio {
+ Header header;
+ // TODO(penghuang): implement the audio frame.
+ };
+
+ struct Video {
+ Header header;
+ PP_TimeDelta timestamp;
+ PP_VideoFrame_Format format;
+ PP_Size size;
+ uint32_t data_size;
+ // Uses 8 bytes to make sure the Video struct has consistent size between
+ // Nacl code and renderer code.
+ uint8_t data[8];
+ };
+
+ // Because these structs are written and read in shared memory, we need
+ // the size and alighment to be consistent between NaCl and its host trusted
+ // platform.
+ PP_COMPILE_ASSERT_SIZE_IN_BYTES(Header, 8);
+ PP_COMPILE_ASSERT_SIZE_IN_BYTES(Audio, 8);
+ PP_COMPILE_ASSERT_SIZE_IN_BYTES(Video, 40);
+
+ Header header;
+ Video video;
+ Audio audio;
+};
+
+} // namespace ppapi
+
+#endif // PPAPI_SHARED_IMPL_MEDIA_STREAM_FRAME_H_
« no previous file with comments | « ppapi/proxy/video_frame_resource.cc ('k') | ppapi/shared_impl/media_stream_frame_buffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698