centricular / gstcefsrc

A simple gstreamer wrapper around Chromium Embedded Framework
83 stars 45 forks source link

cefbin: Change protocol handler to web+...:// #47

Closed philn closed 1 year ago

philn commented 1 year ago

The URIs this element receives are not compliant with RFC 3986 because they have 2 protocol schemes (web://http://...). So we can't use the GstURI parser in cefbin, we pass the unparsed URI stripped of the web:// or cef:// prefix to cefsrc.

V2:

These URIs are RFC 3986 compliant, so allowing for clean removal of the web+
prefix before passing the URI to cefsrc.
MathieuDuponchelle commented 1 year ago

Yes, I noticed this divergence with wpesrc too, however there is an alternative solution here, which is to not expect the "inner" protocol, and pick it / prepend it ourselves instead. I suppose we could have two variants of the web protocol then, web and webs. I honestly don't know what's the solution we should prefer, but that one is at least 3986-compliant :)

philn commented 1 year ago

But if we forge a new URI I still don't see much point in using the GstURI parser. Not sure either what's the best approach :)

MathieuDuponchelle commented 1 year ago

But if we forge a new URI I still don't see much point in using the GstURI parser. Not sure either what's the best approach :)

Consistency I suppose, but more importantly we do want to harmonize wpesrc and cefsrc :)

If you don't mind updating wpesrc I think I slightly prefer my solution (no double protocols in URI seems correct), if not I guess we'll have to ask someone else to flip a coin :D

philn commented 1 year ago

Yes, I noticed this divergence with wpesrc too, however there is an alternative solution here, which is to not expect the "inner" protocol, and pick it / prepend it ourselves instead. I suppose we could have two variants of the web protocol then, web and webs. I honestly don't know what's the solution we should prefer, but that one is at least 3986-compliant :)

What about the cef scheme? We drop iti?

philn commented 1 year ago

@thiblahute wdyt?

philn commented 1 year ago

I kinda liked web://proto:// because then we can use either http or file URIs...

MathieuDuponchelle commented 1 year ago

@philn the idea would be to have web and webs instead :)

philn commented 1 year ago

@philn the idea would be to have web and webs instead :)

yes, i understood that part :) but then what if we want to load local resources too? How do we know when to generate a file:// or a https:// ?

MathieuDuponchelle commented 1 year ago

Oh sorry I didn't read your comment right, yes true that's a problem

thiblahute commented 1 year ago

Isn't the common way to do it to have a web+http:// protocol ? (I have the impression that I have seen that notation in several places).

philn commented 1 year ago

Sounds like the way to go! Hopefully the GstURI parser will no choke on that.

MathieuDuponchelle commented 1 year ago

scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )

Perfect, thanks thib :)

MathieuDuponchelle commented 1 year ago

Thanks!

philn commented 1 year ago

I'll try to submit the corresponding change for wpesrc soon. Thanks for the reviews!

MathieuDuponchelle commented 1 year ago

please do yes :+1: