/* This Source Code Form is subject to the terms of the Mozilla Public *License, STDMETHODIMjava.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 65
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75 #static sNextId;
#return +java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
#include <deque>
#include"EncoderConfig #include"WMF.hconst nsCOMPtr<nsISerialEventTarget> mEncoderThread; #include"mozilla/DataMutex.h" #includeconst<FTEncoder mEncoder
java.lang.StringIndexOutOfBoundsException: Index 80 out of bounds for length 28 #include"mozilla/MozPromise / always accessed from a single thread, making locking effectively #include"mozilla/ //java.lang.StringIndexOutOfBoundsException: Index 80 out of bounds for length 80 #include// mEventGenerator will be accessed from multiple threads: event requests are #include// made on the MFTEncoder's working thread (via BeginEventListening()), while #include /event deliveryoccurson OSthread (ia (). Sincethese
java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
namespacemozilla {
class MFTEventSource;
class MFTEncoder final {
public:
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(MFTEncoder)
/ deliveries are performed on separate threads. Furthermore, because
RefPtr<IMFSample> mSample{}; bool mKeyFrameRequested = java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
};
using MPEGHeader/java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
// events
RefPtrIMFSample>mSample}java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
MPEGHeader ;
};
using DataMutex<<MFMediaEventGenerator> mEventGenerator;
using}java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
java.lang.StringIndexOutOfBoundsException: Range [0, 16) out of bounds for length 0
static nsCString GetFriendlyName(const GUIDjava.lang.StringIndexOutOfBoundsException: Range [46, 47) out of bounds for length 46
{
GUID java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 0
nsCString;
}; struct
:
nsISerialEventTargetaEncoderThread *,
Provider java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 20
Microsoft::ComPtrIMFActivate>mActivate;
nsCString mName;
static sNextId
Microsoft:WRL:ComPtrIMFActivate>& aActivate;
Factory(Factory& }
Factory(const Factory& aOther) =
~Factoryjava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
explicitoperatorbool() const { /
)
};
private/ friendclass MFTEventSource
~MFTEncoder() { // mEventGenerator will
static static nsTArray static /java.lang.StringIndexOutOfBoundsException: Index 80 out of bounds for length 80
// APIs for synchronous processing model.
>java.lang.StringIndexOutOfBoundsException: Range [46, 45) out of bounds for length 79
java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
Result (java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
// APIs for asynchronous processing model for regular usage.
Result RefPtr> java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
Result<endif
private:
RefPtr<IMFSample> mSample;
MPEGHeader mHeader;
};
Result<OutputResult, HRESULT> GetOutputOrNewHeader(); // Set the output type to the first available type found for the output // stream.
HRESULT UpdateOutputType();
HRESULT ProcessOutput(RefPtr<IMFSample>& aSample, DWORD& aOutputStatus,
DWORD& aBufferStatus);
HRESULT ProcessInput(InputSample&& aInput);
State mState = State::Uninited; bool mIsRealtime = false;
// The following members are used only for asynchronous processing model
size_t mNumNeedInput;
std::deque<InputSample> mPendingInputs;
nsTArray<OutputSample> mOutputs; // Holds a temporary MPEGSequenceHeader to be attached to the first output // packet after format renegotiation.
MPEGHeader mOutputHeader;
RefPtr<MFTEventSource> mAsyncEventSource;
// The following members are used only for realtime asynchronous processing // model.
MediaResult mPendingError;
MozPromiseHolder<EncodePromise> mEncodePromise;
MozPromiseHolder<EncodePromise> mDrainPromise;
MozPromiseHolder<EncodePromise> mPreDrainPromise; // Use to resolve the encode promise if mAsyncEventSource doesn't response in // time.
nsCOMPtr<nsITimer> mTimer;
};
class MFTEventSource final : public IMFAsyncCallback {
public:
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(MFTEventSource)
// A basic IMFMediaEventGenerator wrapper that does not support retrieving // events from asynchronous callbacks when constructed this way. Events should // instead be obtained by calling GetEvent(). explicit MFTEventSource(
already_AddRefed<IMFMediaEventGenerator> aEventGenerator)
: MFTEventSource(GetCurrentSerialEventTarget(), nullptr,
std::move(aEventGenerator)) {} // This constructor creates an MFTEventSource that forwards events from // asynchronous callbacks directly to the MFTEncoder's event handler. In this // usage, GetEvent() should not be called, as events are handled // automatically.
MFTEventSource(MFTEncoder* aEncoder,
already_AddRefed<IMFMediaEventGenerator> aEventGenerator)
: MFTEventSource(GetCurrentSerialEventTarget(), aEncoder,
std::move(aEventGenerator)) {}
// IMFAsyncCallback implementations:
STDMETHODIMP GetParameters(DWORD* aFlags, DWORD* aQueue) override; // Invoke() can be called on any thread by the OS, but it will forward the // event to the MFTEncoder's working thread.
STDMETHODIMP Invoke(IMFAsyncResult* aAsyncResult) override;
STDMETHODIMP QueryInterface(REFIID aIID, void** aPPV) override; // AddRef() and Release() are implemented by // NS_INLINE_DECL_THREADSAFE_REFCOUNTING.
static Id GenerateId() { static Id sNextId = 0; return sNextId++;
}
// The following members are used to forwards events from any OS thread to the // MFTEncoder's working thread. const nsCOMPtr<nsISerialEventTarget> mEncoderThread; const RefPtr<MFTEncoder> mEncoder; // When acting as a simple wrapper for IMFMediaEventGenerator, mEventGenerator // is always accessed from a single thread, making locking effectively // cost-free. In scenarios where MFTEventSource forwards events to MFTEncoder, // mEventGenerator will be accessed from multiple threads: event requests are // made on the MFTEncoder's working thread (via BeginEventListening()), while // event delivery occurs on the OS thread (via Invoke()). Since these // operations do not happen concurrently, the overhead of DataMutex locking is // negligible. DataMutex is used here to clarify that event requests and // deliveries are performed on separate threads. Furthermore, because // MFTEncoder might release MFTEventSource while waiting for an event—and the // Windows Media Foundation documentation does not specify whether releasing // IMFMediaEventGenerator cancels pending event waits—we release // mEventGenerator in the MFTEventSource destructor to ensure all pending // events are properly handled, rather than resetting it when MFTEncoder // releases MFTEventSource.
DataMutex<RefPtr<IMFMediaEventGenerator>> mEventGenerator;
};
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.