当前位置: 首页>>代码示例>>C++>>正文


C++ MediaSegment::GetType方法代码示例

本文整理汇总了C++中MediaSegment::GetType方法的典型用法代码示例。如果您正苦于以下问题:C++ MediaSegment::GetType方法的具体用法?C++ MediaSegment::GetType怎么用?C++ MediaSegment::GetType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MediaSegment的用法示例。


在下文中一共展示了MediaSegment::GetType方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: NotifyQueuedTrackChanges

 void NotifyQueuedTrackChanges(MediaStreamGraph* aGraph, TrackID aID,
                               StreamTime aTrackOffset, TrackEventCommand aTrackEvents,
                               const MediaSegment& aQueuedMedia,
                               MediaStream* aInputStream,
                               TrackID aInputTrackID) override
 {
   if (aTrackEvents & TrackEventCommand::TRACK_EVENT_CREATED) {
     aGraph->DispatchToMainThreadAfterStreamStateUpdate(
       NewRunnableMethod<MediaStreamGraph*, TrackID,
                         MediaSegment::Type,
                         RefPtr<MediaStream>,
                         TrackID>(
         "DOMMediaStream::OwnedStreamListener::DoNotifyTrackCreated",
         this,
         &OwnedStreamListener::DoNotifyTrackCreated,
         aGraph,
         aID,
         aQueuedMedia.GetType(),
         aInputStream,
         aInputTrackID));
   } else if (aTrackEvents & TrackEventCommand::TRACK_EVENT_ENDED) {
     aGraph->DispatchToMainThreadAfterStreamStateUpdate(
       NewRunnableMethod<MediaStreamGraph*, RefPtr<MediaStream>, TrackID, TrackID>(
         "DOMMediaStream::OwnedStreamListener::DoNotifyTrackEnded",
         this,
         &OwnedStreamListener::DoNotifyTrackEnded,
         aGraph,
         aInputStream,
         aInputTrackID,
         aID));
   }
 }
开发者ID:heiher,项目名称:gecko-dev,代码行数:32,代码来源:DOMMediaStream.cpp

示例2: size

void
MediaEncoder::NotifyQueuedTrackChanges(MediaStreamGraph* aGraph,
                                       TrackID aID,
                                       StreamTime aTrackOffset,
                                       TrackEventCommand aTrackEvents,
                                       const MediaSegment& aQueuedMedia,
                                       MediaStream* aInputStream,
                                       TrackID aInputTrackID)
{
  if (!mDirectConnected) {
    NotifyRealtimeData(aGraph, aID, aTrackOffset, aTrackEvents, aQueuedMedia);
  } else {
    if (aTrackEvents != TrackEventCommand::TRACK_EVENT_NONE) {
      // forward events (TRACK_EVENT_ENDED) but not the media
      if (aQueuedMedia.GetType() == MediaSegment::VIDEO) {
        VideoSegment segment;
        NotifyRealtimeData(aGraph, aID, aTrackOffset, aTrackEvents, segment);
      } else {
        AudioSegment segment;
        NotifyRealtimeData(aGraph, aID, aTrackOffset, aTrackEvents, segment);
      }
    }
    if (mSuspended == RECORD_RESUMED) {
      if (mVideoEncoder) {
        if (aQueuedMedia.GetType() == MediaSegment::VIDEO) {
          // insert a null frame of duration equal to the first segment passed
          // after Resume(), so it'll get added to one of the DirectListener frames
          VideoSegment segment;
          gfx::IntSize size(0,0);
          segment.AppendFrame(nullptr, aQueuedMedia.GetDuration(), size,
                              PRINCIPAL_HANDLE_NONE);
          mVideoEncoder->NotifyQueuedTrackChanges(aGraph, aID,
                                                  aTrackOffset, aTrackEvents,
                                                  segment);
          mSuspended = RECORD_NOT_SUSPENDED;
        }
      } else {
        mSuspended = RECORD_NOT_SUSPENDED; // no video
      }
    }
  }
}
开发者ID:brendandahl,项目名称:positron,代码行数:42,代码来源:MediaEncoder.cpp

示例3: if

void
MediaEncoder::NotifyQueuedTrackChanges(MediaStreamGraph* aGraph,
                                       TrackID aID,
                                       StreamTime aTrackOffset,
                                       uint32_t aTrackEvents,
                                       const MediaSegment& aQueuedMedia)
{
  // Process the incoming raw track data from MediaStreamGraph, called on the
  // thread of MediaStreamGraph.
  if (mAudioEncoder && aQueuedMedia.GetType() == MediaSegment::AUDIO) {
    mAudioEncoder->NotifyQueuedTrackChanges(aGraph, aID,
                                            aTrackOffset, aTrackEvents,
                                            aQueuedMedia);

  } else if (mVideoEncoder && aQueuedMedia.GetType() == MediaSegment::VIDEO) {
      mVideoEncoder->NotifyQueuedTrackChanges(aGraph, aID,
                                              aTrackOffset, aTrackEvents,
                                              aQueuedMedia);
  }
}
开发者ID:mtjvankuik,项目名称:gecko-dev,代码行数:20,代码来源:MediaEncoder.cpp

示例4: if

void
MediaEncoder::NotifyRealtimeData(MediaStreamGraph* aGraph,
                                 TrackID aID,
                                 StreamTime aTrackOffset,
                                 uint32_t aTrackEvents,
                                 const MediaSegment& aRealtimeMedia)
{
  if (mSuspended) {
    return;
  }
  // Process the incoming raw track data from MediaStreamGraph, called on the
  // thread of MediaStreamGraph.
  if (mAudioEncoder && aRealtimeMedia.GetType() == MediaSegment::AUDIO) {
    mAudioEncoder->NotifyQueuedTrackChanges(aGraph, aID,
                                            aTrackOffset, aTrackEvents,
                                            aRealtimeMedia);
  } else if (mVideoEncoder &&
              aRealtimeMedia.GetType() == MediaSegment::VIDEO &&
              aTrackEvents != TrackEventCommand::TRACK_EVENT_NONE) {
    mVideoEncoder->NotifyQueuedTrackChanges(aGraph, aID,
                                            aTrackOffset, aTrackEvents,
                                            aRealtimeMedia);
  }
}
开发者ID:ncalexan,项目名称:gecko-dev,代码行数:24,代码来源:MediaEncoder.cpp

示例5:

void
MediaEncoder::NotifyQueuedTrackChanges(MediaStreamGraph* aGraph,
                                       TrackID aID,
                                       TrackRate aTrackRate,
                                       TrackTicks aTrackOffset,
                                       uint32_t aTrackEvents,
                                       const MediaSegment& aQueuedMedia)
{
  // Process the incoming raw track data from MediaStreamGraph, called on the
  // thread of MediaStreamGraph.
  if (aQueuedMedia.GetType() == MediaSegment::AUDIO) {
    mAudioEncoder->NotifyQueuedTrackChanges(aGraph, aID, aTrackRate,
                                            aTrackOffset, aTrackEvents,
                                            aQueuedMedia);

  } else {
    // Type video is not supported for now.
  }
}
开发者ID:Nebelhom,项目名称:mozilla-central,代码行数:19,代码来源:MediaEncoder.cpp

示例6: NotifyQueuedTrackChanges

 void NotifyQueuedTrackChanges(MediaStreamGraph* aGraph, TrackID aID,
                               StreamTime aTrackOffset, uint32_t aTrackEvents,
                               const MediaSegment& aQueuedMedia,
                               MediaStream* aInputStream,
                               TrackID aInputTrackID) override
 {
   if (aTrackEvents & TRACK_EVENT_CREATED) {
     nsCOMPtr<nsIRunnable> runnable =
       NS_NewRunnableMethodWithArgs<TrackID, MediaSegment::Type>(
         this, &OwnedStreamListener::DoNotifyTrackCreated,
         aID, aQueuedMedia.GetType());
     aGraph->DispatchToMainThreadAfterStreamStateUpdate(runnable.forget());
   } else if (aTrackEvents & TRACK_EVENT_ENDED) {
     nsCOMPtr<nsIRunnable> runnable =
       NS_NewRunnableMethodWithArgs<TrackID>(
         this, &OwnedStreamListener::DoNotifyTrackEnded, aID);
     aGraph->DispatchToMainThreadAfterStreamStateUpdate(runnable.forget());
   }
 }
开发者ID:jasonmsoft,项目名称:system-addons,代码行数:19,代码来源:DOMMediaStream.cpp

示例7: NotifyRealtimeData

void
MediaEncoder::NotifyQueuedTrackChanges(MediaStreamGraph* aGraph,
                                       TrackID aID,
                                       StreamTime aTrackOffset,
                                       TrackEventCommand aTrackEvents,
                                       const MediaSegment& aQueuedMedia,
                                       MediaStream* aInputStream,
                                       TrackID aInputTrackID)
{
  if (!mDirectConnected) {
    NotifyRealtimeData(aGraph, aID, aTrackOffset, aTrackEvents, aQueuedMedia);
  } else {
    if (aTrackEvents != TrackEventCommand::TRACK_EVENT_NONE) {
      // forward events (TRACK_EVENT_ENDED) but not the media
      if (aQueuedMedia.GetType() == MediaSegment::VIDEO) {
        VideoSegment segment;
        NotifyRealtimeData(aGraph, aID, aTrackOffset, aTrackEvents, segment);
      } else {
        AudioSegment segment;
        NotifyRealtimeData(aGraph, aID, aTrackOffset, aTrackEvents, segment);
      }
    }
  }
}
开发者ID:ncalexan,项目名称:gecko-dev,代码行数:24,代码来源:MediaEncoder.cpp

示例8: CopyTrackData

  void TrackUnionStream::CopyTrackData(StreamTracks::Track* aInputTrack,
                     uint32_t aMapIndex, GraphTime aFrom, GraphTime aTo,
                     bool* aOutputTrackFinished)
  {
    TrackMapEntry* map = &mTrackMap[aMapIndex];
    StreamTracks::Track* outputTrack = mTracks.FindTrack(map->mOutputTrackID);
    MOZ_ASSERT(outputTrack && !outputTrack->IsEnded(), "Can't copy to ended track");

    MediaSegment* segment = map->mSegment;
    MediaStream* source = map->mInputPort->GetSource();

    GraphTime next;
    *aOutputTrackFinished = false;
    for (GraphTime t = aFrom; t < aTo; t = next) {
      MediaInputPort::InputInterval interval = map->mInputPort->GetNextInputInterval(t);
      interval.mEnd = std::min(interval.mEnd, aTo);
      StreamTime inputEnd = source->GraphTimeToStreamTimeWithBlocking(interval.mEnd);
      StreamTime inputTrackEndPoint = STREAM_TIME_MAX;

      if (aInputTrack->IsEnded() &&
          aInputTrack->GetEnd() <= inputEnd) {
        inputTrackEndPoint = aInputTrack->GetEnd();
        *aOutputTrackFinished = true;
      }

      if (interval.mStart >= interval.mEnd) {
        break;
      }
      StreamTime ticks = interval.mEnd - interval.mStart;
      next = interval.mEnd;

      StreamTime outputStart = outputTrack->GetEnd();

      if (interval.mInputIsBlocked) {
        // Maybe the input track ended?
        segment->AppendNullData(ticks);
        STREAM_LOG(LogLevel::Verbose, ("TrackUnionStream %p appending %lld ticks of null data to track %d",
                   this, (long long)ticks, outputTrack->GetID()));
      } else if (InMutedCycle()) {
        segment->AppendNullData(ticks);
      } else {
        if (source->IsSuspended()) {
          segment->AppendNullData(aTo - aFrom);
        } else {
          MOZ_ASSERT(outputTrack->GetEnd() == GraphTimeToStreamTimeWithBlocking(interval.mStart),
                     "Samples missing");
          StreamTime inputStart = source->GraphTimeToStreamTimeWithBlocking(interval.mStart);
          segment->AppendSlice(*aInputTrack->GetSegment(),
                               std::min(inputTrackEndPoint, inputStart),
                               std::min(inputTrackEndPoint, inputEnd));
        }
      }
      ApplyTrackDisabling(outputTrack->GetID(), segment);
      for (uint32_t j = 0; j < mListeners.Length(); ++j) {
        MediaStreamListener* l = mListeners[j];
        // Separate Audio and Video.
        if (segment->GetType() == MediaSegment::AUDIO) {
          l->NotifyQueuedAudioData(Graph(), outputTrack->GetID(),
                                   outputStart,
                                   *static_cast<AudioSegment*>(segment),
                                   map->mInputPort->GetSource(),
                                   map->mInputTrackID);
        }
      }
      for (TrackBound<MediaStreamTrackListener>& b : mTrackListeners) {
        if (b.mTrackID != outputTrack->GetID()) {
          continue;
        }
        b.mListener->NotifyQueuedChanges(Graph(), outputStart, *segment);
      }
      outputTrack->GetSegment()->AppendFrom(segment);
    }
  }
开发者ID:MichaelKohler,项目名称:gecko-dev,代码行数:73,代码来源:TrackUnionStream.cpp


注:本文中的MediaSegment::GetType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。