RESOLVED FIXED 125588
[GStreamer] Use GMutexLocker instead of g_mutex_lock
https://bugs.webkit.org/show_bug.cgi?id=125588
Summary [GStreamer] Use GMutexLocker instead of g_mutex_lock
Brendan Long
Reported 2013-12-11 11:08:17 PST
This bit of code would be much simpler with GMutexLocker: void MediaPlayerPrivateGStreamerBase::paint(GraphicsContext* context, const IntRect& rect) { #if USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER_GL) && !USE(COORDINATED_GRAPHICS) if (client()) return; #endif if (context->paintingDisabled() || m_skipPainting) return; if (!m_player->visible()) return; g_mutex_lock(m_bufferMutex); if (!m_buffer) { g_mutex_unlock(m_bufferMutex); return; } GRefPtr<GstCaps> caps = currentVideoSinkCaps(); if (!caps) { g_mutex_unlock(m_bufferMutex); return; } RefPtr<ImageGStreamer> gstImage = ImageGStreamer::createImage(m_buffer, caps.get()); if (!gstImage) { g_mutex_unlock(m_bufferMutex); return; } context->drawImage(reinterpret_cast<Image*>(gstImage->image().get()), ColorSpaceSRGB, rect, gstImage->rect(), CompositeCopy, ImageOrientationDescription(), false); g_mutex_unlock(m_bufferMutex); }
Attachments
Patch (9.85 KB, patch)
2013-12-13 12:35 PST, Brendan Long
no flags
Brendan Long
Comment 1 2013-12-13 12:35:38 PST
Brendan Long
Comment 2 2013-12-13 12:37:19 PST
This just simplifies some code. There are two cases where it's not that much simpler, converting this: g_mutex_lock(...); something(); g_mutex_unlock(...); To this: { GMutexLocker lock(...); something(); } I decided to make that change anyway though, for consistency.
WebKit Commit Bot
Comment 3 2013-12-14 01:00:49 PST
Comment on attachment 219180 [details] Patch Clearing flags on attachment: 219180 Committed r160593: <http://trac.webkit.org/changeset/160593>
WebKit Commit Bot
Comment 4 2013-12-14 01:00:52 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.