Handle a null local renderer for times when there's no local cam.
Review URL: http://webrtc-codereview.appspot.com/138015 git-svn-id: http://webrtc.googlecode.com/svn/trunk@545 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@@ -377,23 +377,25 @@ void GtkMainWnd::OnRedraw() {
|
|||||||
scaled += width * 2;
|
scaled += width * 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
image = reinterpret_cast<const uint32*>(local_renderer_->image());
|
if (local_renderer_.get() && local_renderer_->image()) {
|
||||||
scaled = reinterpret_cast<uint32*>(draw_buffer_.get());
|
image = reinterpret_cast<const uint32*>(local_renderer_->image());
|
||||||
// Position the local preview on the right side.
|
scaled = reinterpret_cast<uint32*>(draw_buffer_.get());
|
||||||
scaled += (width * 2) - (local_renderer_->width() / 2);
|
// Position the local preview on the right side.
|
||||||
// right margin...
|
scaled += (width * 2) - (local_renderer_->width() / 2);
|
||||||
scaled -= 10;
|
// right margin...
|
||||||
// ... towards the bottom.
|
scaled -= 10;
|
||||||
scaled += (height * width * 4) -
|
// ... towards the bottom.
|
||||||
((local_renderer_->height() / 2) *
|
scaled += (height * width * 4) -
|
||||||
(local_renderer_->width() / 2) * 4);
|
((local_renderer_->height() / 2) *
|
||||||
// bottom margin...
|
(local_renderer_->width() / 2) * 4);
|
||||||
scaled -= (width * 2) * 5;
|
// bottom margin...
|
||||||
for (int r = 0; r < local_renderer_->height(); r += 2) {
|
scaled -= (width * 2) * 5;
|
||||||
for (int c = 0; c < local_renderer_->width(); c += 2) {
|
for (int r = 0; r < local_renderer_->height(); r += 2) {
|
||||||
scaled[c / 2] = image[c + r * local_renderer_->width()];
|
for (int c = 0; c < local_renderer_->width(); c += 2) {
|
||||||
|
scaled[c / 2] = image[c + r * local_renderer_->width()];
|
||||||
|
}
|
||||||
|
scaled += width * 2;
|
||||||
}
|
}
|
||||||
scaled += width * 2;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gdk_draw_rgb_32_image(draw_area_->window,
|
gdk_draw_rgb_32_image(draw_area_->window,
|
||||||
|
|||||||
Reference in New Issue
Block a user