// webrtc::CodecSpecificInfo has members that are not always memmovable, which // is required by nsTArray/AutoTArray by default. Use move constructors where // necessary. template <> struct nsTArray_RelocationStrategy<mozilla::detail::InputImageData> { using IID = mozilla::detail::InputImageData; // This logic follows MemMoveAnnotation.h. using Type =
std::conditional_t<(std::is_trivially_move_constructible_v<IID> ||
(!std::is_move_constructible_v<IID> &&
std::is_trivially_copy_constructible_v<IID>)) &&
std::is_trivially_destructible_v<IID>,
nsTArray_RelocateUsingMemutils,
nsTArray_RelocateUsingMoveConstructor<IID>>;
};
namespace mozilla {
class EncoderConfig; class MediaExtendedMIMEType; struct SupportDecoderParams;
// Whether the OpenH264 GMP can decode/encode the given H264 configuration. // aParams unused but kept to mirror PDM/PEM Supports calls.
[[nodiscard]] media::DecodeSupportSet WebrtcGmpDecoderSupports( const MediaExtendedMIMEType& aMime, const SupportDecoderParams& aParams);
[[nodiscard]] media::EncodeSupportSet WebrtcGmpEncoderSupports( const EncoderConfig& aConfig);
glean::webrtc::gmp_init_success
.EnumGet(static_cast<glean::webrtc::GmpInitSuccessLabel>(
aResult == WEBRTC_VIDEO_CODEC_OK))
.Add();
if (aResult == WEBRTC_VIDEO_CODEC_OK) { // Might be useful to notify the PeerConnection about successful init // someday. return;
}
PeerConnectionWrapper wrapper(aPCHandle);
if (wrapper.impl()) {
wrapper.impl()->OnMediaError(aError);
}
}
// Hold a frame for later decode class GMPDecodeData { public:
GMPDecodeData(const webrtc::EncodedImage& aInputImage, bool aMissingFrames,
int64_t aRenderTimeMs)
: mImage(aInputImage),
mMissingFrames(aMissingFrames),
mRenderTimeMs(aRenderTimeMs) { // We want to use this for queuing, and the calling code recycles the // buffer on return from Decode()
MOZ_RELEASE_ASSERT(aInputImage.size() <
(std::numeric_limits<size_t>::max() >> 1));
}
class RefCountedWebrtcVideoEncoder { public:
NS_INLINE_DECL_PURE_VIRTUAL_REFCOUNTING
// Implement sort of WebrtcVideoEncoder interface and support refcounting. // (We cannot use |Release|, since that's needed for nsRefPtr) virtual int32_t InitEncode( const webrtc::VideoCodec* aCodecSettings, const webrtc::VideoEncoder::Settings& aSettings) = 0;
class WebrtcGmpVideoEncoder final : public GMPVideoEncoderCallbackProxy, public RefCountedWebrtcVideoEncoder { public:
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(WebrtcGmpVideoEncoder, final);
// Basically a strong ref to a RefCountedWebrtcVideoEncoder, that also // translates from Release() to RefCountedWebrtcVideoEncoder::Shutdown(), // since we need RefCountedWebrtcVideoEncoder::Release() for managing the // refcount. The webrtc.org code gets one of these, so it doesn't unilaterally // delete the "real" encoder. class WebrtcVideoEncoderProxy final : public WebrtcVideoEncoder { public:
explicit WebrtcVideoEncoderProxy(
RefPtr<RefCountedWebrtcVideoEncoder> aEncoder)
: mEncoderImpl(std::move(aEncoder)) {}
class WebrtcGmpVideoDecoder final : public GMPVideoDecoderCallbackProxy { public:
WebrtcGmpVideoDecoder(std::string aPCHandle, TrackingId aTrackingId);
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(WebrtcGmpVideoDecoder, final);
class InitDoneCallback final : public GetGMPVideoDecoderCallback { public:
explicit InitDoneCallback(const RefPtr<WebrtcGmpVideoDecoder>& aDecoder)
: mDecoder(aDecoder) {}
nsCOMPtr<mozIGeckoMediaPluginService> mMPS;
nsCOMPtr<nsIThread> mGMPThread;
GMPVideoDecoderProxy* mGMP; // Addref is held for us // Used to handle a race where Release() is called while init is in progress bool mInitting; // Frames queued for decode while mInitting is true
nsTArray<UniquePtr<GMPDecodeData>> mQueuedFrames;
GMPVideoHost* mHost; // Protects mCallback
Mutex mCallbackMutex;
webrtc::DecodedImageCallback* mCallback MOZ_GUARDED_BY(mCallbackMutex);
Maybe<uint64_t> mCachedPluginId;
Atomic<GMPErr, ReleaseAcquire> mDecoderStatus; const std::string mPCHandle; const TrackingId mTrackingId;
PerformanceRecorderMulti<DecodeStage> mPerformanceRecorder;
// Basically a strong ref to a WebrtcGmpVideoDecoder, that also translates // from Release() to WebrtcGmpVideoDecoder::ReleaseGmp(), since we need // WebrtcGmpVideoDecoder::Release() for managing the refcount. // The webrtc.org code gets one of these, so it doesn't unilaterally delete // the "real" encoder. class WebrtcVideoDecoderProxy final : public WebrtcVideoDecoder { public:
explicit WebrtcVideoDecoderProxy(std::string aPCHandle,
TrackingId aTrackingId)
: mDecoderImpl(new WebrtcGmpVideoDecoder(std::move(aPCHandle),
std::move(aTrackingId))) {}
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.