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

Unified Diff: webrtc/sdk/objc/Framework/Classes/metal/RTCMTLVideoView.m

Issue 2651743007: Add metal view, shaders and renderer. (Closed)
Patch Set: Add metal renderer protocol and rename implementation classes Created 3 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
Index: webrtc/sdk/objc/Framework/Classes/metal/RTCMTLVideoView.m
diff --git a/webrtc/sdk/objc/Framework/Classes/metal/RTCMTLVideoView.m b/webrtc/sdk/objc/Framework/Classes/metal/RTCMTLVideoView.m
new file mode 100644
index 0000000000000000000000000000000000000000..7aec008edee848587ffd0c28c635b397966475fa
--- /dev/null
+++ b/webrtc/sdk/objc/Framework/Classes/metal/RTCMTLVideoView.m
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2016 The WebRTC project authors. All Rights Reserved.
kthelgason 2017/02/03 09:17:23 2017
daniela-webrtc 2017/02/07 10:51:08 Done.
daniela-webrtc 2017/02/07 10:51:08 Done.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#import "WebRTC/RTCMTLVideoView.h"
kthelgason 2017/02/03 09:17:23 blank line between this files' header and system h
daniela-webrtc 2017/02/07 10:51:08 Done.
daniela-webrtc 2017/02/07 10:51:09 Done.
+#import <Metal/Metal.h>
kthelgason 2017/02/03 09:17:23 Blank line between system headers and other projec
daniela-webrtc 2017/02/07 10:51:08 Done.
daniela-webrtc 2017/02/07 10:51:09 Done.
+#import "RTCNV12Renderer.h"
kthelgason 2017/02/03 09:17:23 This import should be prefixed with WebRTC/
kthelgason 2017/02/03 09:17:23 This import should be prefixed with WebRTC/
daniela-webrtc 2017/02/07 10:51:08 The WebRTC/ prefix works only for public framework
+
+@interface RTCMTLVideoView ()
+@property(nonatomic) id<RTCMTLRenderer> renderer;
+@end
+
+@implementation RTCMTLVideoView {
+ id<RTCMTLRenderer> _renderer;
+}
+
+@synthesize renderer = _renderer;
+
+- (instancetype)initWithFrame:(CGRect)frameRect device:(nullable id<MTLDevice>)device {
+ self = [super initWithFrame:frameRect device:device];
+ if (self) {
+ _renderer = [[RTCNV12Renderer alloc] initWithView:self];
+ }
+ return self;
+}
+
+- (BOOL)setupRenderer {
+ return [_renderer setup];
+}
+
+@end
kthelgason 2017/02/03 09:17:23 I think this file should have a .mm extension, but
daniela-webrtc 2017/02/07 10:51:09 Since this class is pure objective-c (doesn't have

Powered by Google App Engine
This is Rietveld 408576698