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

Side by Side Diff: webrtc/modules/desktop_capture/x11/x_server_pixel_buffer.cc

Issue 2775793003: Update XServerPixelBuffer to handle shmget() errors properly. (Closed)
Patch Set: Created 3 years, 9 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 | no next file » | 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 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 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 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 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 } 147 }
148 } 148 }
149 } else { 149 } else {
150 LOG(LS_WARNING) << "Failed to get shared memory segment. " 150 LOG(LS_WARNING) << "Failed to get shared memory segment. "
151 "Performance may be degraded."; 151 "Performance may be degraded.";
152 } 152 }
153 } 153 }
154 154
155 if (!using_shm) { 155 if (!using_shm) {
156 LOG(LS_WARNING) << "Not using shared memory. Performance may be degraded."; 156 LOG(LS_WARNING) << "Not using shared memory. Performance may be degraded.";
157 Release(); 157 delete shm_segment_info_;
158 shm_segment_info_ = nullptr;
Hzj_jie 2017/03/25 00:30:30 It looks like in Release() function, there are bun
Sergey Ulanov 2017/03/27 19:23:06 Yes, good point. Fixed. Also update this code to s
158 return; 159 return;
159 } 160 }
160 161
161 if (have_pixmaps) 162 if (have_pixmaps)
162 have_pixmaps = InitPixmaps(default_depth); 163 have_pixmaps = InitPixmaps(default_depth);
163 164
164 shmctl(shm_segment_info_->shmid, IPC_RMID, 0); 165 shmctl(shm_segment_info_->shmid, IPC_RMID, 0);
165 shm_segment_info_->shmid = -1; 166 shm_segment_info_->shmid = -1;
166 167
167 LOG(LS_VERBOSE) << "Using X shared memory extension v" 168 LOG(LS_VERBOSE) << "Using X shared memory extension v"
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 // Write as 32-bit RGB. 332 // Write as 32-bit RGB.
332 dst_pos_32[x] = ((r >> 8) & 0xff0000) | ((g >> 16) & 0xff00) | 333 dst_pos_32[x] = ((r >> 8) & 0xff0000) | ((g >> 16) & 0xff00) |
333 ((b >> 24) & 0xff); 334 ((b >> 24) & 0xff);
334 } 335 }
335 dst_pos += frame->stride(); 336 dst_pos += frame->stride();
336 src_pos += src_stride; 337 src_pos += src_stride;
337 } 338 }
338 } 339 }
339 340
340 } // namespace webrtc 341 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698