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; return;
} }
STREAM_LOG(LogLevel::Debug, ("Updating AudioOutputStreams for MediaStream %p", aStream));
nsAutoTArray<bool,2> audioOutputStreamsFound; nsAutoTArray<bool,2> audioOutputStreamsFound;
for (uint32_t i = 0; i < aStream->mAudioOutputStreams.Length(); ++i) { for (uint32_t i = 0; i < aStream->mAudioOutputStreams.Length(); ++i) {
audioOutputStreamsFound.AppendElement(false); audioOutputStreamsFound.AppendElement(false);
@ -1805,9 +1807,19 @@ MediaStream::SetAudioOutputVolume(void* aKey, float aVolume)
GraphImpl()->AppendMessage(new Message(this, aKey, 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 void
MediaStream::RemoveAudioOutputImpl(void* aKey) 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) { for (uint32_t i = 0; i < mAudioOutputs.Length(); ++i) {
if (mAudioOutputs[i].mKey == aKey) { if (mAudioOutputs[i].mKey == aKey) {
mAudioOutputs.RemoveElementAt(i); mAudioOutputs.RemoveElementAt(i);
@ -1833,6 +1845,26 @@ MediaStream::RemoveAudioOutput(void* aKey)
GraphImpl()->AppendMessage(new Message(this, 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 void
MediaStream::AddVideoOutput(VideoFrameContainer* aContainer) MediaStream::AddVideoOutput(VideoFrameContainer* aContainer)
{ {

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

@ -440,27 +440,15 @@ public:
void DumpTrackInfo() { return mBuffer.DumpTrackInfo(); } void DumpTrackInfo() { return mBuffer.DumpTrackInfo(); }
#endif #endif
void SetAudioOutputVolumeImpl(void* aKey, float aVolume); void SetAudioOutputVolumeImpl(void* aKey, float aVolume);
void AddAudioOutputImpl(void* aKey) void AddAudioOutputImpl(void* aKey);
{
mAudioOutputs.AppendElement(AudioOutput(aKey));
}
// Returns true if this stream has an audio output. // Returns true if this stream has an audio output.
bool HasAudioOutput() bool HasAudioOutput()
{ {
return !mAudioOutputs.IsEmpty(); return !mAudioOutputs.IsEmpty();
} }
void RemoveAudioOutputImpl(void* aKey); void RemoveAudioOutputImpl(void* aKey);
void AddVideoOutputImpl(already_AddRefed<VideoFrameContainer> aContainer) void AddVideoOutputImpl(already_AddRefed<VideoFrameContainer> aContainer);
{ void RemoveVideoOutputImpl(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 AddListenerImpl(already_AddRefed<MediaStreamListener> aListener); void AddListenerImpl(already_AddRefed<MediaStreamListener> aListener);
void RemoveListenerImpl(MediaStreamListener* aListener); void RemoveListenerImpl(MediaStreamListener* aListener);
void RemoveAllListenersImpl(); void RemoveAllListenersImpl();