[Webkit-unassigned] [Bug 78883] [GStreamer] AudioSourceProvider support in the MediaPlayer
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Sat Jan 19 07:37:04 PST 2013
https://bugs.webkit.org/show_bug.cgi?id=78883
--- Comment #28 from Martin Robinson <mrobinson at webkit.org> 2013-01-19 07:38:51 PST ---
(In reply to comment #25)
> I wonder now why this is in the 0.10 code path indeed.
> We can't use a GRefPtr for the GstBin because gst_bin_new returns a floating reference :/ So a Debug build would ASSERT in the adoptGRef call.
This is the implementation of refGPtr for GstElement:
template <> GstElement* refGPtr<GstElement>(GstElement* ptr)
{
if (ptr)
webkitGstObjectRefSink(GST_OBJECT(ptr));
return ptr;
}
So all you need do to assign it to a GRefPtr is to not call adoptGRef because it returns a floating reference.
>
> > > Source/WebCore/platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp:193
> > > + GstAudioChannelPosition* positions = gst_audio_get_channel_positions(structure);
> >
> > You could use a GOwnPtr here.
> >
>
> Well that would mean adding a GOwnPtrGStreamer module again likely only for this gst 0.10 API. I'm not sure it's worth it.
Actually no, since positions is freed with g_free you can use the normal GOwnPtr.
> It should be needed only if result = GST_ITERATOR_OK but I guess it's acceptable to do it at every iteration.
In my code above it was a bit simpler/clearer and more effecient just under the block for GST_ITERATOR_OK. I think there's a risk that someone in the future who is refactoring this code could have the wrong idea about when the call is needed.
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list