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

Side by Side Diff: talk/app/webrtc/objc/RTCI420Frame.mm

Issue 1838353004: cricket::VideoFrame cleanup. New width() and height(). Deleted GetChroma* methods. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: TODO comments. Formatting tweak. Created 4 years, 8 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
« no previous file with comments | « no previous file | talk/app/webrtc/objc/RTCVideoRendererAdapter.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 // TODO(nisse): chromaWidth and chromaHeight are used only in
47 // RTCOpenGLVideoRenderer.mm. Update, and then delete these
48 // properties.
46 - (NSUInteger)chromaWidth { 49 - (NSUInteger)chromaWidth {
47 return _videoFrame->GetChromaWidth(); 50 return (self.width + 1) / 2;
48 } 51 }
49 52
50 - (NSUInteger)chromaHeight { 53 - (NSUInteger)chromaHeight {
51 return _videoFrame->GetChromaHeight(); 54 return (self.height + 1) / 2;
52 }
53
54 - (NSUInteger)chromaSize {
55 return _videoFrame->GetChromaSize();
56 } 55 }
57 56
58 - (const uint8_t*)yPlane { 57 - (const uint8_t*)yPlane {
59 const cricket::VideoFrame* const_frame = _videoFrame.get(); 58 const cricket::VideoFrame* const_frame = _videoFrame.get();
60 return const_frame->GetYPlane(); 59 return const_frame->GetYPlane();
61 } 60 }
62 61
63 - (const uint8_t*)uPlane { 62 - (const uint8_t*)uPlane {
64 const cricket::VideoFrame* const_frame = _videoFrame.get(); 63 const cricket::VideoFrame* const_frame = _videoFrame.get();
65 return const_frame->GetUPlane(); 64 return const_frame->GetUPlane();
(...skipping 27 matching lines...) Expand all
93 - (instancetype)initWithVideoFrame:(cricket::VideoFrame*)videoFrame { 92 - (instancetype)initWithVideoFrame:(cricket::VideoFrame*)videoFrame {
94 if (self = [super init]) { 93 if (self = [super init]) {
95 // Keep a shallow copy of the video frame. The underlying frame buffer is 94 // Keep a shallow copy of the video frame. The underlying frame buffer is
96 // not copied. 95 // not copied.
97 _videoFrame.reset(videoFrame->Copy()); 96 _videoFrame.reset(videoFrame->Copy());
98 } 97 }
99 return self; 98 return self;
100 } 99 }
101 100
102 @end 101 @end
OLDNEW
« no previous file with comments | « no previous file | talk/app/webrtc/objc/RTCVideoRendererAdapter.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698