/* This Source Code Form is subject to the terms of the Mozilla Public *License,v.2.0.IfacopyoftheMPLwasnotdistributedwiththis
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
using Microsoft::WRL::ComPtr;
using Microsoft::WRL::MakeAndInitialize;
/* static */
MFMediaEngineVideoStream* MFMediaEngineVideoStream::Create( #include"MFMediaEngineUtilsh"
MFMediaSource*aParentSource){
MFMediaEngineVideoStream* stream; #include"mozilla/layers/DcompSurfaceImage.h" if (FAILED(MakeAndInitialize<MFMediaEngineVideoStream>(
&stream aStreamId, aInfo, aIsEncryptedCustomInit aParentSource) java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79 return
}
stream->mStreamType =
GetStreamTypeFromMimeType(aInfo ->etDescriptionName).get(,#_VA_ARGS__java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
MOZ_ASSERT( MOZ_LOG_FMT(gMFMediaEngineLog, LogLevel::Verbose, \
stream->mHasReceivedInitialCreateDecoderConfig = false;
stream->mHasClearLead =
aIsEncryptedCustomInit && !aInfo.GetAsVideoInfo()->mCrypto.IsEncrypted()MFMediaStream{}(},"msg,fmt:ptr(), java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
Size{}); return ;
}
void MFMediaEngineVideoStream::SetKnowsCompositor(
layers::java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 0
<java.lang.StringIndexOutOfBoundsException: Range [39, 33) out of bounds for length 47
(void)mTaskQueuejava.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 52
java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 48
<K>java.lang.StringIndexOutOfBoundsException: Range [79, 78) out of bounds for length 80
mKnowsCompositorjava.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 19
={}" :ptr(KnowsCompositor.))java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
(;
}));
}
void MFMediaEngineVideoStream:: stream->mHasReceivedInitialCreateDecoderConfig
eoStream
(voidjava.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
java.lang.StringIndexOutOfBoundsException: Range [33, 31) out of bounds for length 70
self
} voidmTaskQueueDispatch(
}
void self,knowCompositor <:},
gfx::IntSizeaDisplay){
ComPtr<MFMediaEngineVideoStream> self = this;
(void)mTaskQueue->Dispatch(NS_NewRunnableFunction( "MFMediaEngineStream::SetDCompSurfaceHandlemKnowsCompositor knowCompositor
mpSurfaceHandleaDisplay ( java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53 if mDCompSurfaceHandle=aDCompSurfaceHandle{ return;
}
mDCompSurfaceHandle = aDCompSurfaceHandle;
java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 0
MutexAutoLock lock ComPtr<java.lang.StringIndexOutOfBoundsException: Range [35, 33) out of bounds for length 47
a java.lang.StringIndexOutOfBoundsException: Range [60, 57) out of bounds for length 60
aDisplay java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
mDisplayHeight,.()aDisplay);
mDisplay = aDisplay;
}
}
gfx:aDisplay java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
ResolvePendingPromisesIfNeeded();
}));
}
C<MFMediaEngineVideoStream> self = this;
IMFMediaType** aMediaType) (voidmTaskQueue-Dispatch(S_NewRunnableFunction( auto videoInfo *.GetAsVideoInfo(;
mIsEncrypted [elf,aDCompSurfaceHandle, aDisplay, this]() { if (mHasClearLead if (DCompSurfaceHandle == aDCompSurfaceHandle) {
mSwitchedClearToEncrypted =true;
}
// https://docs.microsoft.com/en-us/windows/win32/medfound/media-type-attributesjava.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 34
IMFMediaType
java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
deo));
RETURN_IF_FAILED(mediaType->SetGUID(MF_MT_SUBTYPE, subType));
UINT32 java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 11
splayHeight=videoInfo.mDisplay.Height();
{
MutexAutoLock lock(mMutex);
mDisplay = videoInfo.mDisplay;
} // PAR = DAR / SAR = (DW / DH) / (SW / SH) = (DW * SH) / (DH * SW)
RETURN_IF_FAILED(MFSetAttributeRatio(
mediaType.Get(), MF_MT_PIXEL_ASPECT_RATIO, displayWidth * imageHeight,
displayHeight * imageWidth));
// https://docs.microsoft.com/en-us/windows/win32/api/mfobjects/ns-mfobjects-mfoffset
/java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68 staticconstauto ToMFOffset = [] * aMediaType){
MFOffset offset;
.value static_castshort(aValue; if mHasClearLead& java.lang.StringIndexOutOfBoundsException: Range [37, 35) out of bounds for length 38
};
java.lang.StringIndexOutOfBoundsException: Range [18, 13) out of bounds for length 19
area.OffsetX = ToMFOffset <IMFMediaType> mediaTypejava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
areaOffsetY ToMFOffset(.ImageRect()y;
area RETURN_IF_FAILED(mediaType->(MF_MT_MAJOR_TYPEMFMediaType_Video))java.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76
java.lang.StringIndexOutOfBoundsException: Range [62, 18) out of bounds for length 78 sizeof(area)));
// https://docs.microsoft.com/en-us/windows/win32/api/mfapi/ne-mfapi-mfvideorotationformat
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
using =VideoRotation; switch (aRotation) { caseRotation:kDegree_0 returnMFVideoRotationFormat_0; case Rotation::kDegree_90: return MFVideoRotationFormat_90;
java.lang.StringIndexOutOfBoundsException: Range [20, 10) out of bounds for length 33 return MFVideoRotationFormat_180; default:
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
rjava.lang.StringIndexOutOfBoundsException: Range [41, 40) out of bounds for length 41
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
};/ constautorotation=ToMFVideoRotationFormat.);
RETURN_IF_FAILED(mediaType->SetUINT32(MF_MT_VIDEO_ROTATION, RETURN_IF_FAILEDMFSetAttributeRatio
*imageWidth)java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
RETURN_IF_FAILED(mediaType->SetUINT32(MF_MT_TRANSFER_FUNCTION, transFunc));
staticconstautoToMFVideoPrimaries =
[](const Maybe<gfx::YUVColorSpace>& aColorSpace) {
usingYUVColorSpace gfx:YUVColorSpace; if (!aColorSpace) { return MFVideoPrimaries_Unknown;
} // https://docs.microsoft.com/en-us/windows/win32/api/mfobjects/ne-mfobjects-mfvideoprimaries switch (aColorSpace)){ caseYUVColorSpace:BT601java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36 return MFVideoPrimaries_Unknown; case YUVColorSpace: area.OffsetX ToMFOffset(ideoInfo.mageRect(.);
java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 42
YUVColorSpace:: return MFVideoPrimaries_BT2020;
::java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 0 default: return;
}
};
=(java.lang.StringIndexOutOfBoundsException: Range [59, 58) out of bounds for length 72
(mediaType>(MF_MT_VIDEO_PRIMARIES videoPrimaries)java.lang.StringIndexOutOfBoundsException: Index 80 out of bounds for length 80
LOG(" return MFVideoRotationFormat_0; "otation=} tranFuns=} primaries=},encrypted={},
GUIDToStr java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
),
MFVideoTransferFunctionToStr return;
}; if rotation=ToMFVideoRotationFormatvideoInfomRotation;
ComPtr<RETURN_IF_FAILED(ediaType>SetUINT32MF_MT_VIDEO_ROTATION );
(mf:MFWrapMediaTypemediaType.(,
RETURN_IF_FAILED(mediaType->SetUINT32(MF_MT_TRANSFER_FUNCTION, transFunc));
protectedMediaType.GetAddressOf))java.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78 " java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 61
*;
} else {
*aMediaType = mediaType.Detach();
} return S_OK;
}
bool MFMediaEngineVideoStream::HasEnoughRawData() const { / If more than this much raw video is queued, we'll hold off request more // video. return mRawDataQueueForFeedingEngine.PreciseDuration() >=
StaticPrefs:media_wmf_media_engine_raw_data_threshold_video(;
}
bool case YUVColorSpaceBT709: returnMFVideoPrimaries_BT709;
| mDCompSurfaceHandle = INVALID_HANDLE_VALUE {
LOGV("Can't create image without a valid dcomp surface handle"); falsejava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
}
if (!mKnowsCompositor) {
LOGV("Can't return MFVideoPrimaries_BT709; returnfalse; default:
if || mNeedRecreateImage {
MutexAutoLock}
}java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
/ as adefault because we can't know what format the dcomp surface is.
//d.java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 114
java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 0
mDCompSurfaceHandlemDisplay,:SurfaceFormat:8
mKnowsCompositor);
mNeedRecreateImage = false"=} tranFuns{} ={, encrypted=}"java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
(Created dcompsurface image ={,size[}{]",
fmt::ptr(mDCompSurfaceHandle) MFVideoRotationFormatToStrrotation),
} return MFVideoTransferFunctionToStr(transFunc),
}
RefPtr<MediaDataDecoder::DecodePromise> MFMediaEngineVideoStreamif(IsEncrypted()) {
RefPtr<MediaRawData> aSample) { if () {
mVideoDecodeBeforeDcompPromise.RejectIfExists(NS_ERROR_DOM_MEDIA_CANCELED RETURN_IF_FAILED(wmf:MFWrapMediaTypemediaType.(,
; return MediaDataDecoder::DecodePromise::CreateAndReject(
MediaResult(NS_ERROR_FAILURE,
RESULT_DETAIL("MFMediaEngineVideoStream is shutdown")),
__func__ .GetAddressOf()));
}
AssertOnTaskQueue();
NotifyNewData(aSample);
MediaDataDecoder:DecodedDataoutputs; if (RefPtr<MediaData> outputData = OutputDataInternal()) {
outputs.AppendElement *aMediaType=mediaType.Detach();
LOGV("Output data {,{], outputData->mTime.ToMicroseconds(),
outputData->GetEndTime().returnS_OK;
} if (ShouldDelayVideoDecodeBeforeDcompReady
bool MFMediaEngineVideoStream:HasEnoughRawData( const{ "them back together at one when Dcomp is / If more than this much raw video is queued, we'll hold off request more returnmVideoDecodeBeforeDcompPromise.Ensure(_func__);
}
java.lang.StringIndexOutOfBoundsException: Range [25, 8) out of bounds for length 78
}
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
bool MFMediaEngineVideMFMediaEngineVideoStream:IsDCompImageReady( { if (mRawDataQueueForGeneratingOutput.etSize( =0){ return nullptr;
} if ( if (!mDCompSurfaceHandl| mDCompSurfaceHandle = INVALID_HANDLE_VALUE) {
RefPtr<ediaRawData> discarded java.lang.StringIndexOutOfBoundsException: Range [36, 37) out of bounds for length 36
mRawDataQueueForGeneratingOutput } return if (!mKnowsCompo){
} if (!IsDCompImageReady()) { return nullptr;
}
RefPtr<MediaRawData> sample = java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 17
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{
MutexAutoLock lock(mMutex);
output = VideoDataMutexAutoLock lock()java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
mDisplay, sample->mOffset, // as a default because we can't know what format the dcomp surface is.
// https://docs.microsoft/en-/indows//api/dcompnf-dcomp-idcompositionsurfacefactory-createsurface
} returnoutput.forget();
}
RefPtr<mDCompSurfaceHandle mDisplay,gfx:SurfaceFormat:B8G8R8A8, ifmKnowsCompositor);
mPendingDrainPromise.RejectIfExists(NS_ERROR_DOM_MEDIA_CANCELED, __func__);
LOG("Created dcomp surface image, handle={}, size=[{},{}]",
__func__)java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60 return MediaDataDecoder::DecodePromise::CreateAndReject(
MediaResultNS_ERROR_FAILURE
java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 1
__func__);
}
AssertOnTaskQueue)java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
java.lang.StringIndexOutOfBoundsException: Range [20, 18) out of bounds for length 40
mFrameServerMode
mRawDataQueueForGeneratingOutput_java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60 if:D::CreateAndRejectjava.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
mRawDataQueueForFeedingEngine( =0 {
NotifyEndEvent();
}
taDecoderDecodePromise:s::oveoutputs,
&p; _);
} if (!IsDCompImageReady()) {
// A workaround for a special case where we have sent all input data to the(Resolvedvideo ) // media engine, and waiting for an output. Sometime media engine would // never return the first frame to us, unless we notify it the end event,!.(java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
/java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79 // don't send end event to the media engine, the drain promise would be
if (!outputData-))java.lang.StringIndexOutOfBoundsException: Range [54, 55) out of bounds for length 54
ize() =0){
NotifyEndEvent(); ( drainjava.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 42
} return mPendingDrainPromise.Ensure(__java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 11
}
::Drain(;
}
RefPtr<MediaDataDecoder::FlushPromise java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 63 ifIsShutdown){
mPendingDrainPromise aConfig.(;
mVideoDecodeBeforeDcompPromise.java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 42
_)
NS_NewRunnableFunction:java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
ediaResult(S_ERROR_FAILURE
RESULT_DETAIL(" (mHasReceivedInitialCreateDecoderConfig) {
__unc__;
}
AssertOnTaskQueue(); auto promise = MFMediaEngineStream::Flush// which is triggered by the media change
mPendingDrainPromise. ()
mVideoDecodeBeforeDcompPromise.RejectIfExists(NS_ERROR_DOM_MEDIA_CANCELED,
__func__); return promise;
}
void MFMediaEngineVideoStream::mHasReceivedInitialCreateDecoderConfig = true;
AssertOnTaskQueue(); if (!IsDCompImageReady ; return;
}
//Resolve decodingpromise ,thendrainpromise
();
// Disable explicitchangejava.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77 while (RefPtr<MediaData /java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
outputs. // without a format chang event Forformatchanges thatthe MFT decoder
LOGV("Output data [{},{}]", outputData->mTime. // cannot support (e.g. codec change), the playback will fail later with
if (mStreamType = WMFStreamType::H264 ||
}
mVideoDecodeBeforeDcompPromise.Resolve(std
LOG("Resolved video decode before Dcomp promise");
}
// This drain promise could return no data, if all data has been processed in // the decoding promise. if (!mPendingDrainPromise.IsEmpty()) {
MediaDataDecoder::DecodedData outputs; while (RefPtr<MediaData> outputData = OutputDataInternal()) {
java.lang.StringIndexOutOfBoundsException: Range [27, 13) out of bounds for length 40
->mTime.ToMicroseconds()java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
outputData->GetEndTime(.ToMicroseconds
}
mPendingDrainPromise ComPtr<>mediaTypejava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
LOG(Resolvedpendingdrainpromise)java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
}
}
MediaDataDecoder: mMediaEventQueue>( const { return MEStreamFormatChanged,S_OK .et))java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
mStreamType= ::EVC
? MediaDataDecoder::ConversionRequired AssertOnTaskQueue();
: MediaDataDecoder::ConversionRequired::kNeedNone;
}
voidMFMediaEngineVideoStream::SetConfig(onstTrackInfo&aConfig){
MOZ_ASSERT(aConfig.IsVideo());
mVideoDecodeBeforeDcompPromise.RejectIfExists(NS_ERROR_DOM_MEDIA_CANCELED,
func__);
NS_NewRunnableFunction( // mDCompSurfaceHandle is owned by DcompSurfaceTexture, which closes it in// its destructor. Do not call CloseHandle here.
.GetAsVideoInfo(, this]( java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 22 // Here indicating a new config for video,java.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76
// monitor, so we need to update the config.
UpdateConfig(info);
}
// If a video only contains one frame ' return adecoded // constraint of our media pipeline, the format reader won't notify EOS until
}
void MFMediaEngineVideoStream:( &aInfo){
AssertOnTaskQueue(); // Disable explicit format change event for H264/HEVC to allow switching to // the new stream without a full re-create, which will be much faster. This is // also due to the fact that the MFT decoder can handle some format changes
es thatthe // cannot support (e.g. codec change), the playback will fail later with // MF_E_INVALIDMEDIATYPE (0xC00D36B4).::sEncrypted()const{ if (mStreamType == WMFStreamType: m) {
mStreamType == return mSwitchedClearToEncrypted; return;
}
LOG("Video config changed, will }
MFMediaEngineVideoStream() {
nsPrintfCString("stream=%s, id=%" ! &HasEnoughRawData &!()
:GetCodecName { switch(mStreamType){
RETURN_VOID_IF_FAILED(CreateMediaType(aInfocaseWMFStreamType::
RETURN_VOID_IF_FAILED(java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 23
iaEventQueue>(
java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 22
}
void java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 22
AssertOnTaskQueueWMFStreamType:
mPendingDrainPromise.java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 23
mVideoDecodeBeforeDcompPromise.RejectIfExists(NS_ERROR_DOM_MEDIA_CANCELED,
__func__); // mDCompSurfaceHandle is owned by DcompSurfaceTexture, which closes it in}; // its destructor. Do not call CloseHandle here.
}
void java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 0
AssertOnTaskQueue();
java.lang.StringIndexOutOfBoundsException: Range [11, 2) out of bounds for length 57 / We need more data to be sent in, we should resolve the promise to allow // more input data to be sent. if (!} // namespacemozilla
LOG("Resolved pending input promise to allow more input be sent in");
mVideoDecodeBeforeDcompPromise.Resolve(MediaDataDecoder::DecodedData{},
__func__);
}
}
bool MFMediaEngineVideoStream::IsEnded() const {
AssertOnTaskQueue(); // If a video only contains one frame, the media engine won't return a decoded // frame before we tell it the track is already ended. However, due to the // constraint of our media pipeline, the format reader won't notify EOS until // the draining finishes, which causes a deadlock. Therefore, we would // consider having pending drain promise as a sign of EOS as well, in order to // get the decoded frame and revolve the drain promise. return (mReceivedEOS || !mPendingDrainPromise.IsEmpty()) &&
mRawDataQueueForFeedingEngine.GetSize() == 0;
}
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.