Bug 1216417 - Add logging for audio and video output changes in MSG. r=roc

--HG--
extra : commitid : 22iTDWGdkKT
extra : rebase_source : fe30f433900b8e685f6c1d525c1b279babbb8079
This commit is contained in:
Andreas Pehrson 2015-10-29 13:19:51 +08:00
Родитель 72945ba2fb
Коммит cd79c1257d
2 изменённых файлов: 35 добавлений и 15 удалений

Просмотреть файл

@ -585,6 +585,8 @@ MediaStreamGraphImpl::CreateOrDestroyAudioStreams(MediaStream* aStream)
return;
}
STREAM_LOG(LogLevel::Debug, ("Updating AudioOutputStreams for MediaStream %p", aStream));
nsAutoTArray<bool,2> audioOutputStreamsFound;
for (uint32_t i = 0; i < aStream->mAudioOutputStreams.Length(); ++i) {
audioOutputStreamsFound.AppendElement(false);
@ -1805,9 +1807,19 @@ MediaStream::SetAudioOutputVolume(void* aKey, float aVolume)
GraphImpl()->AppendMessage(new Message(this, aKey, aVolume));
}
void
MediaStream::AddAudioOutputImpl(void* aKey)
{
STREAM_LOG(LogLevel::Info, ("MediaStream %p Adding AudioOutput for key %p",
this, aKey));
mAudioOutputs.AppendElement(AudioOutput(aKey));
}
void
MediaStream::RemoveAudioOutputImpl(void* aKey)
{
STREAM_LOG(LogLevel::Info, ("MediaStream %p Removing AudioOutput for key %p",
this, aKey));
for (uint32_t i = 0; i < mAudioOutputs.Length(); ++i) {
if (mAudioOutputs[i].mKey == aKey) {
mAudioOutputs.RemoveElementAt(i);
@ -1833,6 +1845,26 @@ MediaStream::RemoveAudioOutput(void* aKey)
GraphImpl()->AppendMessage(new Message(this, aKey));
}
void
MediaStream::AddVideoOutputImpl(already_AddRefed<VideoFrameContainer> aContainer)
{
RefPtr<VideoFrameContainer> container = aContainer;
STREAM_LOG(LogLevel::Info, ("MediaStream %p Adding VideoFrameContainer %p as output",
this, container.get()));
*mVideoOutputs.AppendElement() = container.forget();
}
void
MediaStream::RemoveVideoOutputImpl(VideoFrameContainer* aContainer)
{
STREAM_LOG(LogLevel::Info, ("MediaStream %p Removing VideoFrameContainer %p as output",
this, aContainer));
// Ensure that any frames currently queued for playback by the compositor
// are removed.
aContainer->ClearFutureFrames();
mVideoOutputs.RemoveElement(aContainer);
}
void
MediaStream::AddVideoOutput(VideoFrameContainer* aContainer)
{

Просмотреть файл

@ -440,27 +440,15 @@ public:
void DumpTrackInfo() { return mBuffer.DumpTrackInfo(); }
#endif
void SetAudioOutputVolumeImpl(void* aKey, float aVolume);
void AddAudioOutputImpl(void* aKey)
{
mAudioOutputs.AppendElement(AudioOutput(aKey));
}
void AddAudioOutputImpl(void* aKey);
// Returns true if this stream has an audio output.
bool HasAudioOutput()
{
return !mAudioOutputs.IsEmpty();
}
void RemoveAudioOutputImpl(void* aKey);
void AddVideoOutputImpl(already_AddRefed<VideoFrameContainer> aContainer)
{
*mVideoOutputs.AppendElement() = aContainer;
}
void RemoveVideoOutputImpl(VideoFrameContainer* aContainer)
{
// Ensure that any frames currently queued for playback by the compositor
// are removed.
aContainer->ClearFutureFrames();
mVideoOutputs.RemoveElement(aContainer);
}
void AddVideoOutputImpl(already_AddRefed<VideoFrameContainer> aContainer);
void RemoveVideoOutputImpl(VideoFrameContainer* aContainer);
void AddListenerImpl(already_AddRefed<MediaStreamListener> aListener);
void RemoveListenerImpl(MediaStreamListener* aListener);
void RemoveAllListenersImpl();