void PeerConnectionMedia::GetReceivePipelinesMatching( MediaStreamTrack* aTrack, nsTArray<RefPtr<MediaPipeline>>* aPipelines) { for (RefPtr<TransceiverImpl>& transceiver : mTransceivers) { if (transceiver->HasReceiveTrack(aTrack)) { aPipelines->AppendElement(transceiver->GetReceivePipeline()); } } if (!aPipelines->Length()) { CSFLogWarn(LOGTAG, "%s: none found for %p", __FUNCTION__, aTrack); } }
bool PeerConnectionMedia::SetUsingBundle_m(int level, bool decision) { ASSERT_ON_THREAD(mMainThread); for (size_t i = 0; i < mRemoteSourceStreams.Length(); ++i) { if (mRemoteSourceStreams[i]->SetUsingBundle_m(level, decision)) { // Found the MediaPipeline for |level| return true; } } CSFLogWarn(logTag, "Could not locate level %d to set bundle flag to %s", static_cast<int>(level), decision ? "true" : "false"); return false; }
bool PeerConnectionMedia::UpdateFilterFromRemoteDescription_m( int level, nsAutoPtr<mozilla::MediaPipelineFilter> filter) { ASSERT_ON_THREAD(mMainThread); RefPtr<mozilla::MediaPipeline> receive; for (size_t i = 0; !receive && i < mRemoteSourceStreams.Length(); ++i) { receive = mRemoteSourceStreams[i]->GetPipelineByLevel_m(level); } RefPtr<mozilla::MediaPipeline> transmit; for (size_t i = 0; !transmit && i < mLocalSourceStreams.Length(); ++i) { transmit = mLocalSourceStreams[i]->GetPipelineByLevel_m(level); } if (receive && transmit) { // GetPipelineByLevel_m will return nullptr if shutdown is in progress; // since shutdown is initiated in main, and involves a dispatch to STS // before the pipelines are released, our dispatch to STS will complete // before any release can happen due to a shutdown that hasn't started yet. RUN_ON_THREAD(GetSTSThread(), WrapRunnableNM( &UpdateFilterFromRemoteDescription_s, receive, transmit, filter ), NS_DISPATCH_NORMAL); return true; } else { CSFLogWarn(logTag, "Could not locate level %d to update filter", static_cast<int>(level)); } return false; }