Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  VideoStreamTrack.cpp

  Sprache: C
 

/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */


#include "VideoStreamTrack.h"

#include "MediaTrackGraph.h"
#include "MediaTrackListener.h"
#include "VideoOutput.h"
#include "nsContentUtils.h"
#include "nsGlobalWindowInner.h"

namespace mozilla::dom {

VideoStreamTrack::VideoStreamTrack(nsPIDOMWindowInner* aWindow,
                                   mozilla::MediaTrack* aInputTrack,
                                   MediaStreamTrackSource* aSource,
                                   MediaStreamTrackState aReadyState,
                                   bool aMuted,
                                   const MediaTrackConstraints& aConstraints)
    : MediaStreamTrack(aWindow, aInputTrack, aSource, aReadyState, aMuted,
                       aConstraints) {}

void VideoStreamTrack::Destroy() {
  mVideoOutputs.Clear();
  MediaStreamTrack::Destroy();
}

void VideoStreamTrack::AddVideoOutput(VideoOutput* aOutput) {
  if (Ended()) {
    return;
  }
  MOZ_ASSERT(aOutput->mAttachment == VideoOutput::State::Detached);
  const bool exists = mVideoOutputs.Contains(aOutput);
  if (exists) {
    // A VideoOutput can be detached either through RemoveVideoOutput or by the
    // graph removing it during (forced) shutdown. In the latter case it will
    // still exist in mVideoOutputs in the detached state.
    // Allow re-attaching a detached VideoOutput as users may listen to and use
    // mAttachment to determine whether or not to re-try AddVideoOutput().
    if (aOutput->mAttachment == VideoOutput::State::Attached) {
      MOZ_ASSERT_UNREACHABLE("A VideoOutput was already added");
      return;
    }
  } else {
    mVideoOutputs.AppendElement(aOutput);
  }
  aOutput->mAttachment = VideoOutput::State::Attached;
  AddDirectListener(aOutput);
  AddListener(aOutput);
}

void VideoStreamTrack::RemoveVideoOutput(VideoOutput* aOutput) {
  for (const auto& output : mVideoOutputs.Clone()) {
    if (output == aOutput) {
      mVideoOutputs.RemoveElement(aOutput);
      // Don't mark the output detaching if it was already detached through
      // forced graph shutdown.
      if (aOutput->mAttachment == VideoOutput::State::Attached) {
        aOutput->mAttachment = VideoOutput::State::Detaching;
        RemoveDirectListener(aOutput);
        RemoveListener(aOutput);
      }
    }
  }
}

void VideoStreamTrack::GetLabel(nsAString& aLabel, CallerType aCallerType) {
  MediaStreamTrack::GetLabel(aLabel, aCallerType);
}

already_AddRefed<MediaStreamTrack> VideoStreamTrack::Clone() {
  return MediaStreamTrack::CloneInternal<VideoStreamTrack>();
}

}  // namespace mozilla::dom

Messung V0.5 in Prozent
C=92 H=90 G=90

¤ Dauer der Verarbeitung: 0.14 Sekunden  (vorverarbeitet am  2026-08-25) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Statistik
#Sources=277311
#Domains=752002