OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 CGImageRelease(image_ref); | 109 CGImageRelease(image_ref); |
110 return true; | 110 return true; |
111 } | 111 } |
112 | 112 |
113 bool CarbonVideoRenderer::SetSize(int width, int height, int reserved) { | 113 bool CarbonVideoRenderer::SetSize(int width, int height, int reserved) { |
114 if (width != image_width_ || height != image_height_) { | 114 if (width != image_width_ || height != image_height_) { |
115 // Grab the image lock while changing its size. | 115 // Grab the image lock while changing its size. |
116 rtc::CritScope cs(&image_crit_); | 116 rtc::CritScope cs(&image_crit_); |
117 image_width_ = width; | 117 image_width_ = width; |
118 image_height_ = height; | 118 image_height_ = height; |
119 image_.reset(new uint8[width * height * 4]); | 119 image_.reset(new uint8_t[width * height * 4]); |
120 memset(image_.get(), 255, width * height * 4); | 120 memset(image_.get(), 255, width * height * 4); |
121 } | 121 } |
122 return true; | 122 return true; |
123 } | 123 } |
124 | 124 |
125 bool CarbonVideoRenderer::RenderFrame(const VideoFrame* video_frame) { | 125 bool CarbonVideoRenderer::RenderFrame(const VideoFrame* video_frame) { |
126 if (!video_frame) { | 126 if (!video_frame) { |
127 return false; | 127 return false; |
128 } | 128 } |
129 { | 129 { |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 if (err != noErr) { | 181 if (err != noErr) { |
182 LOG(LS_ERROR) << "Failed to install event handler, error code: " << err; | 182 LOG(LS_ERROR) << "Failed to install event handler, error code: " << err; |
183 return false; | 183 return false; |
184 } | 184 } |
185 SelectWindow(window_ref_); | 185 SelectWindow(window_ref_); |
186 ShowWindow(window_ref_); | 186 ShowWindow(window_ref_); |
187 return true; | 187 return true; |
188 } | 188 } |
189 | 189 |
190 } // namespace cricket | 190 } // namespace cricket |
OLD | NEW |