OLD | NEW |
---|---|
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2013 Google Inc. | 3 * Copyright 2013 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 18 matching lines...) Expand all Loading... | |
29 | 29 |
30 #include <memory> | 30 #include <memory> |
31 | 31 |
32 #include "webrtc/media/base/videoframe.h" | 32 #include "webrtc/media/base/videoframe.h" |
33 | 33 |
34 @implementation RTCI420Frame { | 34 @implementation RTCI420Frame { |
35 std::unique_ptr<cricket::VideoFrame> _videoFrame; | 35 std::unique_ptr<cricket::VideoFrame> _videoFrame; |
36 } | 36 } |
37 | 37 |
38 - (NSUInteger)width { | 38 - (NSUInteger)width { |
39 return _videoFrame->GetWidth(); | 39 return _videoFrame->width(); |
40 } | 40 } |
41 | 41 |
42 - (NSUInteger)height { | 42 - (NSUInteger)height { |
43 return _videoFrame->GetHeight(); | 43 return _videoFrame->height(); |
44 } | 44 } |
45 | 45 |
46 - (NSUInteger)chromaWidth { | 46 - (NSUInteger)chromaWidth { |
47 return _videoFrame->GetChromaWidth(); | 47 return ([self width] + 1) / 2; |
tkchin_webrtc
2016/03/30 17:35:06
Is this always going to be true? This assumes that
tkchin_webrtc
2016/03/30 17:35:06
dot syntax for properties
self.width
self.height
s
perkj_webrtc
2016/03/31 04:58:23
Are these actually used for anything? Cant we just
nisse-webrtc
2016/03/31 08:22:17
Done.
nisse-webrtc
2016/03/31 08:22:18
This is no change in behavior. Probably with the m
| |
48 } | 48 } |
49 | 49 |
50 - (NSUInteger)chromaHeight { | 50 - (NSUInteger)chromaHeight { |
51 return _videoFrame->GetChromaHeight(); | 51 return ([self height] + 1) / 2; |
52 } | 52 } |
53 | 53 |
54 - (NSUInteger)chromaSize { | 54 - (NSUInteger)chromaSize { |
perkj_webrtc
2016/03/31 04:58:23
dito? Unused?
nisse-webrtc
2016/03/31 08:22:17
The chromaSize property appear to be completely un
pbos-webrtc
2016/03/31 14:49:09
Can you put a TODO here to do that?
| |
55 return _videoFrame->GetChromaSize(); | 55 return [self chromaWidth] * [self chromaHeight]; |
56 } | 56 } |
57 | 57 |
58 - (const uint8_t*)yPlane { | 58 - (const uint8_t*)yPlane { |
59 const cricket::VideoFrame* const_frame = _videoFrame.get(); | 59 const cricket::VideoFrame* const_frame = _videoFrame.get(); |
60 return const_frame->GetYPlane(); | 60 return const_frame->GetYPlane(); |
61 } | 61 } |
62 | 62 |
63 - (const uint8_t*)uPlane { | 63 - (const uint8_t*)uPlane { |
64 const cricket::VideoFrame* const_frame = _videoFrame.get(); | 64 const cricket::VideoFrame* const_frame = _videoFrame.get(); |
65 return const_frame->GetUPlane(); | 65 return const_frame->GetUPlane(); |
(...skipping 27 matching lines...) Expand all Loading... | |
93 - (instancetype)initWithVideoFrame:(cricket::VideoFrame*)videoFrame { | 93 - (instancetype)initWithVideoFrame:(cricket::VideoFrame*)videoFrame { |
94 if (self = [super init]) { | 94 if (self = [super init]) { |
95 // Keep a shallow copy of the video frame. The underlying frame buffer is | 95 // Keep a shallow copy of the video frame. The underlying frame buffer is |
96 // not copied. | 96 // not copied. |
97 _videoFrame.reset(videoFrame->Copy()); | 97 _videoFrame.reset(videoFrame->Copy()); |
98 } | 98 } |
99 return self; | 99 return self; |
100 } | 100 } |
101 | 101 |
102 @end | 102 @end |
OLD | NEW |