| OLD | NEW |
| 1 /* | 1 /* |
| 2 * libjingle | 2 * libjingle |
| 3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 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 } | 109 } |
| 110 } | 110 } |
| 111 | 111 |
| 112 // The renderer_crit_ lock needs to be taken when calling this function. | 112 // The renderer_crit_ lock needs to be taken when calling this function. |
| 113 void CaptureRenderAdapter::MaybeSetRenderingSize(const VideoFrame* frame) { | 113 void CaptureRenderAdapter::MaybeSetRenderingSize(const VideoFrame* frame) { |
| 114 for (VideoRenderers::iterator iter = video_renderers_.begin(); | 114 for (VideoRenderers::iterator iter = video_renderers_.begin(); |
| 115 iter != video_renderers_.end(); ++iter) { | 115 iter != video_renderers_.end(); ++iter) { |
| 116 const bool new_resolution = iter->render_width != frame->GetWidth() || | 116 const bool new_resolution = iter->render_width != frame->GetWidth() || |
| 117 iter->render_height != frame->GetHeight(); | 117 iter->render_height != frame->GetHeight(); |
| 118 if (new_resolution) { | 118 if (new_resolution) { |
| 119 if (iter->renderer->SetSize(static_cast<int>(frame->GetWidth()), | 119 iter->render_width = frame->GetWidth(); |
| 120 static_cast<int>(frame->GetHeight()), 0)) { | 120 iter->render_height = frame->GetHeight(); |
| 121 iter->render_width = frame->GetWidth(); | |
| 122 iter->render_height = frame->GetHeight(); | |
| 123 } else { | |
| 124 LOG(LS_ERROR) << "Captured frame size not supported by renderer: " << | |
| 125 frame->GetWidth() << " x " << frame->GetHeight(); | |
| 126 } | |
| 127 } | 121 } |
| 128 } | 122 } |
| 129 } | 123 } |
| 130 | 124 |
| 131 // The renderer_crit_ lock needs to be taken when calling this function. | 125 // The renderer_crit_ lock needs to be taken when calling this function. |
| 132 bool CaptureRenderAdapter::IsRendererRegistered( | 126 bool CaptureRenderAdapter::IsRendererRegistered( |
| 133 const VideoRenderer& video_renderer) const { | 127 const VideoRenderer& video_renderer) const { |
| 134 for (VideoRenderers::const_iterator iter = video_renderers_.begin(); | 128 for (VideoRenderers::const_iterator iter = video_renderers_.begin(); |
| 135 iter != video_renderers_.end(); ++iter) { | 129 iter != video_renderers_.end(); ++iter) { |
| 136 if (&video_renderer == iter->renderer) { | 130 if (&video_renderer == iter->renderer) { |
| 137 return true; | 131 return true; |
| 138 } | 132 } |
| 139 } | 133 } |
| 140 return false; | 134 return false; |
| 141 } | 135 } |
| 142 | 136 |
| 143 } // namespace cricket | 137 } // namespace cricket |
| OLD | NEW |