Files
palemoon27/dom/media/webaudio/BufferDecoder.cpp
T
roytam1 2f3df18559 import changes from `dev' branch of rmottola/Arctic-Fox:
- Bug 1172264 - Mirror duration from the MDSM to the MediaDecoderReader and remove MDSM::GetDuration. r=jww (369a3d1b4)
- Bug 1172264 - Route mExplicitDuration directly from the mediasource code to MediaDecoder, and stop passing an argument to DurationChanged. r=pending=jww (b429dfe41)
- Bug 1172264 - Watch mStateMachineDuration, and stop manually firing DurationChanged. r=jww (54091368c)
- bug 1126065 - Make JS callers of ios.newChannel call ios.newChannel2 in dom/browser-element. r=sicking (8c38534ed)
- Bug 1144015 - (Browser API) mozbrowseropentab support. r=kchen (8b1eecb4e)
- Bug 1143650: Update webref failure links r=karlt (b3c94f173)
- Bug 1172264 - Mark WPT as succeeding. r=jya (664350c56)
- Bug 1141029 - Disabling mochitests on Mulet with parity to B2G Desktop for taskcluster. r=ahal (73bb186cb)
- Bug 1144080 - Disable mochitests on Mulet for TaskCluster. r=ahal (0b71b6a05)
- Bug 1145407: Add mochitests that cause multiple tracks of the same type to be placed in the same remote stream. r=mt (263770e16)
- Bug 1148649: Reenable video multistream mochitests on debug e10s. r=drno (f7674fe4a)
- part of Bug 1094764 - Implement AudioContext.suspend and friends. @ (baa450713)
- Bug 1166803 - Add an `msg` tag to mochitest.ini in dom/media/*. r=jesup (5284df8b2)
- Bug 1166659 - Add mochitest tags for webaudio and webrtc. r=jesup, r=padenot (f5424f26f)
- Bug 1087551: updated tests around addIceCandidate(). r=jib (f28cde40b)
- Bug 1169338 - Part 1: Re-enable a subset of the webrtc mochitests on B2G emulator and Mulet. r=mt (9c0f8c2da)
- Bug 1143827 - remove default stun server. r=abr,bsmedberg (f1e306a95)
- Bug 1169338 - Part 2: Extend ICE timeouts since mochitests are frequently run on systems that are performance constrained. r=mt (da6147576)
- Bug 1155493 - Part 1: Add CaretStateChangedEvent and corresponding utility function. r=roc, sr=smaug (9d710ad21)
- Bug 995394: Removed parts of BrowserElementPanning.js that are only used when APZ is disabled and added that to a separte file BrowserElementPanningAPZDisabled.js r=botond, a=RyanVM (8b76bca9f)
- Bug 1138252 - Load BrowserElementPanning.js only if touch events are enabled. r=botond (30f5f3197)
- Bug 1155493 - Part 2: Event hook for mozbrowser element. r=kanru (6f6db8248)
- Bug 1162844 - Add meta name="viewmode" to have configurable VR experiences. r=fabrice (07d6d0736)
- Bug 1163961 - Browser API: Page search. r=kchen, r=ehsan (df0c37dfa)
- Bug 1179718 - Convert BrowserElement.webidl to use CheckAllPermissions. r=bz (4a92b2c7d)
- Bug 1147819 - Any media element should be stopped by the AudioChannelService when the window is destroyed, r=ehsan (e949db77f)
- Bug 1153915 - Null check the window in AudioChannelService::WindowDestroyedEnumerator(); r=baku (b38261d9d)
- Bug 1089526 - Change speaker state. r=baku (8dbf54b04)
- Bug 1157121 - Add speaker status checking. r=baku (ec5416680)
- Bug 1037389 - add support for deviceId in gUM constraints (merged 11 patches). r=smaug, r=jesup (bc6f9640d)
- Bug 1180748 - Unbreak building with --disable-webrtc. r=jesup (b5d53b666)
2021-04-08 11:18:21 +08:00

176 lines
3.1 KiB
C++

/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* 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 "BufferDecoder.h"
#include "nsISupports.h"
#include "MediaResource.h"
namespace mozilla {
extern PRLogModuleInfo* gMediaDecoderLog;
NS_IMPL_ISUPPORTS0(BufferDecoder)
BufferDecoder::BufferDecoder(MediaResource* aResource)
: mReentrantMonitor("BufferDecoder")
, mResource(aResource)
{
MOZ_ASSERT(NS_IsMainThread());
MOZ_COUNT_CTOR(BufferDecoder);
if (!gMediaDecoderLog) {
gMediaDecoderLog = PR_NewLogModule("MediaDecoder");
}
}
BufferDecoder::~BufferDecoder()
{
// The dtor may run on any thread, we cannot be sure.
MOZ_COUNT_DTOR(BufferDecoder);
}
void
BufferDecoder::BeginDecoding(MediaTaskQueue* aTaskQueueIdentity)
{
MOZ_ASSERT(!mTaskQueueIdentity && aTaskQueueIdentity);
mTaskQueueIdentity = aTaskQueueIdentity;
}
ReentrantMonitor&
BufferDecoder::GetReentrantMonitor()
{
return mReentrantMonitor;
}
bool
BufferDecoder::IsShutdown() const
{
// BufferDecoder cannot be shut down.
return false;
}
bool
BufferDecoder::OnStateMachineTaskQueue() const
{
// BufferDecoder doesn't have the concept of a state machine.
return true;
}
bool
BufferDecoder::OnDecodeTaskQueue() const
{
MOZ_ASSERT(mTaskQueueIdentity, "Forgot to call BeginDecoding?");
return mTaskQueueIdentity->IsCurrentThreadIn();
}
MediaResource*
BufferDecoder::GetResource() const
{
return mResource;
}
void
BufferDecoder::NotifyBytesConsumed(int64_t aBytes, int64_t aOffset)
{
// ignore
}
void
BufferDecoder::NotifyDecodedFrames(uint32_t aParsed, uint32_t aDecoded,
uint32_t aDropped)
{
// ignore
}
void
BufferDecoder::UpdateEstimatedMediaDuration(int64_t aDuration)
{
// ignore
}
void
BufferDecoder::SetMediaSeekable(bool aMediaSeekable)
{
// ignore
}
VideoFrameContainer*
BufferDecoder::GetVideoFrameContainer()
{
// no video frame
return nullptr;
}
layers::ImageContainer*
BufferDecoder::GetImageContainer()
{
// no image container
return nullptr;
}
bool
BufferDecoder::IsTransportSeekable()
{
return false;
}
bool
BufferDecoder::IsMediaSeekable()
{
return false;
}
void
BufferDecoder::MetadataLoaded(nsAutoPtr<MediaInfo> aInfo, nsAutoPtr<MetadataTags> aTags, MediaDecoderEventVisibility aEventVisibility)
{
// ignore
}
void
BufferDecoder::FirstFrameLoaded(nsAutoPtr<MediaInfo> aInfo, MediaDecoderEventVisibility aEventVisibility)
{
// ignore
}
void
BufferDecoder::QueueMetadata(int64_t aTime, nsAutoPtr<MediaInfo> aInfo, nsAutoPtr<MetadataTags> aTags)
{
// ignore
}
void
BufferDecoder::RemoveMediaTracks()
{
// ignore
}
void
BufferDecoder::OnReadMetadataCompleted()
{
// ignore
}
void
BufferDecoder::NotifyWaitingForResourcesStatusChanged()
{
// ignore
}
void
BufferDecoder::NotifyDataArrived(const char* aBuffer, uint32_t aLength, int64_t aOffset)
{
// ignore
}
MediaDecoderOwner*
BufferDecoder::GetOwner()
{
// unknown
return nullptr;
}
} // namespace mozilla