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

Side by Side Diff: webrtc/api/objc/RTCI420Frame.mm

Issue 1533193003: Move RTCI420Frame with minor style changes. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Update parameter type Created 4 years, 12 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 unified diff | Download patch
OLDNEW
(Empty)
1 /*
2 * Copyright 2015 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11 #import "RTCI420Frame.h"
12
13 #include "webrtc/base/scoped_ptr.h"
14
15 #import "webrtc/api/objc/RTCI420Frame+Private.h"
16
17 @implementation RTCI420Frame {
18 rtc::scoped_ptr<cricket::VideoFrame> _videoFrame;
19 }
20
21 - (NSUInteger)width {
22 return _videoFrame->GetWidth();
23 }
24
25 - (NSUInteger)height {
26 return _videoFrame->GetHeight();
27 }
28
29 - (NSUInteger)chromaWidth {
30 return _videoFrame->GetChromaWidth();
31 }
32
33 - (NSUInteger)chromaHeight {
34 return _videoFrame->GetChromaHeight();
35 }
36
37 - (NSUInteger)chromaSize {
38 return _videoFrame->GetChromaSize();
39 }
40
41 - (const uint8_t *)yPlane {
42 const cricket::VideoFrame *const_frame = _videoFrame.get();
43 return const_frame->GetYPlane();
44 }
45
46 - (const uint8_t *)uPlane {
47 const cricket::VideoFrame *const_frame = _videoFrame.get();
48 return const_frame->GetUPlane();
49 }
50
51 - (const uint8_t *)vPlane {
52 const cricket::VideoFrame *const_frame = _videoFrame.get();
53 return const_frame->GetVPlane();
54 }
55
56 - (NSInteger)yPitch {
57 return _videoFrame->GetYPitch();
58 }
59
60 - (NSInteger)uPitch {
61 return _videoFrame->GetUPitch();
62 }
63
64 - (NSInteger)vPitch {
65 return _videoFrame->GetVPitch();
66 }
67
68 - (BOOL)makeExclusive {
69 return _videoFrame->MakeExclusive();
70 }
71
72 #pragma mark - Private
73
74 - (instancetype)initWithVideoFrame:(const cricket::VideoFrame *)videoFrame {
tkchin_webrtc 2016/01/05 17:09:28 to keep in line with the new stuff: initWIthNative
hjon 2016/01/05 23:55:35 Done.
75 if (self = [super init]) {
76 // Keep a shallow copy of the video frame. The underlying frame buffer is
77 // not copied.
78 _videoFrame.reset(videoFrame->Copy());
79 }
80 return self;
81 }
82
83 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698