Bug 187636 - [GStreamer][MSE] Add GstFlowCombiner to handle non-linked inactive branches
Summary: [GStreamer][MSE] Add GstFlowCombiner to handle non-linked inactive branches
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Xabier Rodríguez Calvar
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-07-13 01:16 PDT by Xabier Rodríguez Calvar
Modified: 2018-07-13 03:48 PDT (History)
4 users (show)

See Also:


Attachments
Patch (6.22 KB, patch)
2018-07-13 01:21 PDT, Xabier Rodríguez Calvar
no flags Details | Formatted Diff | Diff
Patch (5.46 KB, patch)
2018-07-13 03:05 PDT, Xabier Rodríguez Calvar
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Xabier Rodríguez Calvar 2018-07-13 01:16:54 PDT
[GStreamer][MSE] Add GstFlowCombiner to handle non-linked inactive branches
Comment 1 Xabier Rodríguez Calvar 2018-07-13 01:21:50 PDT
Created attachment 344930 [details]
Patch
Comment 2 Enrique Ocaña 2018-07-13 01:42:03 PDT
This patch looks good to me. It's going to be very helpful to support more than one audio streams.
Comment 3 Carlos Garcia Campos 2018-07-13 01:53:13 PDT
Comment on attachment 344930 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=344930&action=review

> Source/WebCore/platform/graphics/gstreamer/GUniquePtrGStreamer.h:36
> +// GstFlowCombiner becomes reference counted in 1.12.

What does this comment mean? It's confusing, if it's ref counted, why we define a GUniquePtr?

> Source/WebCore/platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:255
> +    return gst_flow_combiner_update_pad_flow(self.get()->priv->flowCombiner.get(), pad, gst_proxy_pad_chain_default(pad, GST_OBJECT(self.get()), buffer));

self.get()->priv -> self->priv

> Source/WebCore/platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:482
> -    GUniquePtr<gchar> padName(g_strdup_printf("src_%u", padId));
> -    GstPad* ghostpad = WebCore::webkitGstGhostPadFromStaticTemplate(&srcTemplate, padName.get(), sourcePad);
> +    auto padName = String::format("src_%u", padId);
> +    GstPad* ghostPad = WebCore::webkitGstGhostPadFromStaticTemplate(&srcTemplate, padName.utf8().data(), sourcePad);

Why did you change this? We are now doing encoding conversions.
Comment 4 Xabier Rodríguez Calvar 2018-07-13 02:12:34 PDT
(In reply to Carlos Garcia Campos from comment #3)
> > Source/WebCore/platform/graphics/gstreamer/GUniquePtrGStreamer.h:36
> > +// GstFlowCombiner becomes reference counted in 1.12.
> 
> What does this comment mean? It's confusing, if it's ref counted, why we
> define a GUniquePtr?

It became refcounted in 1.12 so from that moment on can can ref and unref but with previous versions of GStreamer, we have _new and _free. Since we don't need it to be refcounted for now, I thought the simplest way was implementing the non-refcounted use case.

> > Source/WebCore/platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:255
> > +    return gst_flow_combiner_update_pad_flow(self.get()->priv->flowCombiner.get(), pad, gst_proxy_pad_chain_default(pad, GST_OBJECT(self.get()), buffer));
> 
> self.get()->priv -> self->priv

Yes (monkey coding).

> > Source/WebCore/platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:482
> > -    GUniquePtr<gchar> padName(g_strdup_printf("src_%u", padId));
> > -    GstPad* ghostpad = WebCore::webkitGstGhostPadFromStaticTemplate(&srcTemplate, padName.get(), sourcePad);
> > +    auto padName = String::format("src_%u", padId);
> > +    GstPad* ghostPad = WebCore::webkitGstGhostPadFromStaticTemplate(&srcTemplate, padName.utf8().data(), sourcePad);
> 
> Why did you change this? We are now doing encoding conversions.

Cause I think it was better to use WebKit API rather than GLib's if possible. I think it is better. Do you object to this?
Comment 5 Carlos Garcia Campos 2018-07-13 02:20:30 PDT
(In reply to Xabier Rodríguez Calvar from comment #4)
> (In reply to Carlos Garcia Campos from comment #3)
> > > Source/WebCore/platform/graphics/gstreamer/GUniquePtrGStreamer.h:36
> > > +// GstFlowCombiner becomes reference counted in 1.12.
> > 
> > What does this comment mean? It's confusing, if it's ref counted, why we
> > define a GUniquePtr?
> 
> It became refcounted in 1.12 so from that moment on can can ref and unref
> but with previous versions of GStreamer, we have _new and _free. Since we
> don't need it to be refcounted for now, I thought the simplest way was
> implementing the non-refcounted use case.

Remove the comment then, it's confusing.

> > > Source/WebCore/platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:255
> > > +    return gst_flow_combiner_update_pad_flow(self.get()->priv->flowCombiner.get(), pad, gst_proxy_pad_chain_default(pad, GST_OBJECT(self.get()), buffer));
> > 
> > self.get()->priv -> self->priv
> 
> Yes (monkey coding).
> 
> > > Source/WebCore/platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:482
> > > -    GUniquePtr<gchar> padName(g_strdup_printf("src_%u", padId));
> > > -    GstPad* ghostpad = WebCore::webkitGstGhostPadFromStaticTemplate(&srcTemplate, padName.get(), sourcePad);
> > > +    auto padName = String::format("src_%u", padId);
> > > +    GstPad* ghostPad = WebCore::webkitGstGhostPadFromStaticTemplate(&srcTemplate, padName.utf8().data(), sourcePad);
> > 
> > Why did you change this? We are now doing encoding conversions.
> 
> Cause I think it was better to use WebKit API rather than GLib's if
> possible. I think it is better. Do you object to this?

Yes, WTF is preferred but only when it makes sense, and it doesn't in this case. The change is unrelated to this bug too.
Comment 6 Xabier Rodríguez Calvar 2018-07-13 03:05:39 PDT
Created attachment 344933 [details]
Patch
Comment 7 Xabier Rodríguez Calvar 2018-07-13 03:47:16 PDT
Comment on attachment 344933 [details]
Patch

Clearing flags on attachment: 344933

Committed r233797: <https://trac.webkit.org/changeset/233797>
Comment 8 Xabier Rodríguez Calvar 2018-07-13 03:47:20 PDT
All reviewed patches have been landed.  Closing bug.
Comment 9 Radar WebKit Bug Importer 2018-07-13 03:48:26 PDT
<rdar://problem/42160243>