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

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

Issue 1923903002: Reland of Delete cricket::VideoFrame methods GetYPlane and GetYPitch. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 7 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/public/RTCI420Frame.h » ('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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 // properties. 48 // properties.
49 - (NSUInteger)chromaWidth { 49 - (NSUInteger)chromaWidth {
50 return (self.width + 1) / 2; 50 return (self.width + 1) / 2;
51 } 51 }
52 52
53 - (NSUInteger)chromaHeight { 53 - (NSUInteger)chromaHeight {
54 return (self.height + 1) / 2; 54 return (self.height + 1) / 2;
55 } 55 }
56 56
57 - (const uint8_t*)yPlane { 57 - (const uint8_t*)yPlane {
58 const cricket::VideoFrame* const_frame = _videoFrame.get(); 58 const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& buffer =
59 return const_frame->GetYPlane(); 59 _videoFrame->video_frame_buffer();
60 return buffer ? buffer->DataY() : nullptr;
60 } 61 }
61 62
62 - (const uint8_t*)uPlane { 63 - (const uint8_t*)uPlane {
63 const cricket::VideoFrame* const_frame = _videoFrame.get(); 64 const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& buffer =
64 return const_frame->GetUPlane(); 65 _videoFrame->video_frame_buffer();
66 return buffer ? buffer->DataU() : nullptr;
65 } 67 }
66 68
67 - (const uint8_t*)vPlane { 69 - (const uint8_t*)vPlane {
68 const cricket::VideoFrame* const_frame = _videoFrame.get(); 70 const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& buffer =
69 return const_frame->GetVPlane(); 71 _videoFrame->video_frame_buffer();
72 return buffer ? buffer->DataV() : nullptr;
70 } 73 }
71 74
72 - (NSInteger)yPitch { 75 - (NSInteger)yPitch {
73 return _videoFrame->GetYPitch(); 76 const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& buffer =
77 _videoFrame->video_frame_buffer();
78 return buffer ? buffer->StrideY() : 0;
74 } 79 }
75 80
76 - (NSInteger)uPitch { 81 - (NSInteger)uPitch {
77 return _videoFrame->GetUPitch(); 82 const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& buffer =
83 _videoFrame->video_frame_buffer();
84 return buffer ? buffer->StrideU() : 0;
78 } 85 }
79 86
80 - (NSInteger)vPitch { 87 - (NSInteger)vPitch {
81 return _videoFrame->GetVPitch(); 88 const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& buffer =
89 _videoFrame->video_frame_buffer();
90 return buffer ? buffer->StrideV() : 0;
82 } 91 }
83 92
84 @end 93 @end
85 94
86 @implementation RTCI420Frame (Internal) 95 @implementation RTCI420Frame (Internal)
87 96
88 - (instancetype)initWithVideoFrame:(cricket::VideoFrame*)videoFrame { 97 - (instancetype)initWithVideoFrame:(cricket::VideoFrame*)videoFrame {
89 if (self = [super init]) { 98 if (self = [super init]) {
90 // Keep a shallow copy of the video frame. The underlying frame buffer is 99 // Keep a shallow copy of the video frame. The underlying frame buffer is
91 // not copied. 100 // not copied.
92 _videoFrame.reset(videoFrame->Copy()); 101 _videoFrame.reset(videoFrame->Copy());
93 } 102 }
94 return self; 103 return self;
95 } 104 }
96 105
97 @end 106 @end
OLDNEW
« no previous file with comments | « no previous file | talk/app/webrtc/objc/public/RTCI420Frame.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698