Closed mbattista closed 1 year ago
Hi, happy to see you contributing again! Don't worry about that.
I am glad that we are going away from go-events, because they had some issue that affected neko as well and they did not merge my fix until this day.
I am concerned about the samples channel, since there can be multiple users that need to receive copy of the sample, it cannot be done from a single channel. We would need to to channel multiplexing for listeners. Have you tried it with multiple users? I'll build it and test it myself, when I get the chance.
I am concerned about the samples channel, since there can be multiple users that need to receive copy of the sample, it cannot be done from a single channel.
You are right. While it works with two viewers (thats what I tried), it should have a fan out for the samples. I will change that.
While looking at the code, I realized that pion will duplicate the track for each listener. So no changes needed, since the samples are written to the track.
max_fps=0
was actually meant to use the FPS from the screen size. Therefore I would say, it should do what your implemented adaptiveFramerate
is meant to do. Because having them both can lead to edge cases / confusion:
max_fps=0
and adaptiveFramerate=true
-> taken value from pipeline.max_fps=30
and adaptiveFramerate=true
-> taken value from pipeline up to 30?max_fps=0
and adaptiveFramerate=false
-> what FPS should be now used? default 25?max_fps=30
and adaptiveFramerate=false
-> should fps be set to 30 regardless on whats on input?With only max_fps
it would be:
max_fps=0
-> taken value from pipeline.max_fps=30
-> taken value from pipeline up to max specified value, now 30.I agree that current implementation of max_fps
is rather fps
where current value is used regardless of what is in the pipeline.
TODO:
go func() {
for {
val, ok := <-someChannel
if !ok {
// channel closed
break
}
// do something with val
}
}()
Do you have any idea why I cannot install the packages? Did you face similar issue?
Do you have any idea why I cannot install the packages? Did you face similar issue?
No. It just went through.
No. It just went through.
Interestingly it does not work on my ubuntu 20.04 but works on debian. Weird.
Should we remove the unused channels for now?
I'd say, some of them that are redundant should be removed. But some of them are actually already prepared for furute features.
Removed the wait timer in the webrtc function and create the channel in the manager.
Those latest changes fail with panic when changing screen size, because GST closes that channel.
I have been thinking about how it could be scoped.
So maybe if we had channel in streamsink that notifies capture about when pipeline starts, it could create goroutine that starts reading from it until the pipeline channel is closed. E.G. additional GetPipelineChannel() chan struct{}
that fires when pipeline is available.
Or something like channel that returns sample channel once it has been created. chan chan types.Sample
though it might seem ugly, but thats what I logically concluded.
Sorry, my testing were on the wrong commit.
It panics, because the channel is closed and it tries to write into a closed channel. The channel should never close after it is created, since it will always be needed. With this change the panic is gone.
The only thing that could be done, to be more futureproof, is to make it a map of channels on the manager, so e.g. different bandwidths can be done per different map entries.
I moved sample channel to AttachAppsink, because you can create pipelines (like broadcast) that do not need channel for samples. It is only added when we are attaching appsink.
It looks good from my side, this can be merged if you do not have any objections or pending changes.
No objections from my side either.
Hi,
I am very sorry about the style of this pull request, since it has a lot of changes and should probably be 3 separated requests.
Changes: