зеркало из https://github.com/mozilla/gecko-dev.git
Backed out 4 changesets (bug 1806605) as requested by Jib. CLOSED TREE
Backed out changeset 56989b96892c (bug 1806605) Backed out changeset d5cc6cfba0ee (bug 1806605) Backed out changeset e85b278387fc (bug 1806605) Backed out changeset 0fa64a630cc7 (bug 1806605)
This commit is contained in:
Родитель
4de8903900
Коммит
b3c00ab7ae
|
@ -939,7 +939,7 @@ mozilla::ipc::IPCResult CamerasParent::RecvStartCapture(
|
|||
}
|
||||
|
||||
cap.VideoCapture()->SetTrackingId(
|
||||
(*cbh)->mTrackingId.mUniqueInProcId);
|
||||
(*cbh)->mTrackingId.ToString().get());
|
||||
error = cap.VideoCapture()->StartCapture(capability);
|
||||
|
||||
if (!error) {
|
||||
|
|
|
@ -42,7 +42,7 @@ class VideoCaptureAvFoundation : public VideoCaptureImpl {
|
|||
// Callback. This can be called on any thread.
|
||||
int32_t OnFrame(webrtc::VideoFrame& aFrame) MOZ_EXCLUDES(api_lock_);
|
||||
|
||||
void SetTrackingId(uint32_t aTrackingIdProcId) MOZ_EXCLUDES(api_lock_) override;
|
||||
void SetTrackingId(const char* _Nonnull aTrackingId) MOZ_EXCLUDES(api_lock_) override;
|
||||
|
||||
// Allows the capturer to start the recording before calling OnFrame, to cover more operations
|
||||
// under the same measurement.
|
||||
|
@ -60,10 +60,9 @@ class VideoCaptureAvFoundation : public VideoCaptureImpl {
|
|||
// thread only.
|
||||
mozilla::Maybe<VideoCaptureCapability> mCapability MOZ_GUARDED_BY(api_lock_);
|
||||
// Id string uniquely identifying this capture source. Written on the mChecker thread only.
|
||||
mozilla::Maybe<mozilla::TrackingId> mTrackingId MOZ_GUARDED_BY(api_lock_);
|
||||
mozilla::Maybe<nsCString> mTrackingId MOZ_GUARDED_BY(api_lock_);
|
||||
// Adds frame specific markers to the profiler while mTrackingId is set.
|
||||
mozilla::PerformanceRecorderMulti<mozilla::CaptureStage> mCaptureRecorder;
|
||||
mozilla::PerformanceRecorderMulti<mozilla::CopyVideoStage> mConversionRecorder;
|
||||
mozilla::PerformanceRecorderMulti<mozilla::CaptureStage> mPerformanceRecorder;
|
||||
std::atomic<ProfilerThreadId> mCallbackThreadId;
|
||||
};
|
||||
|
||||
|
|
|
@ -223,22 +223,21 @@ int32_t VideoCaptureAvFoundation::CaptureSettings(VideoCaptureCapability& aSetti
|
|||
|
||||
int32_t VideoCaptureAvFoundation::OnFrame(webrtc::VideoFrame& aFrame) {
|
||||
MutexLock lock(&api_lock_);
|
||||
mConversionRecorder.Record(0);
|
||||
int32_t rv = DeliverCapturedFrame(aFrame);
|
||||
mCaptureRecorder.Record(0);
|
||||
mPerformanceRecorder.Record(0);
|
||||
return rv;
|
||||
}
|
||||
|
||||
void VideoCaptureAvFoundation::SetTrackingId(uint32_t aTrackingIdProcId) {
|
||||
void VideoCaptureAvFoundation::SetTrackingId(const char* _Nonnull aTrackingId) {
|
||||
RTC_DCHECK_RUN_ON(&mChecker);
|
||||
MutexLock lock(&api_lock_);
|
||||
mTrackingId.emplace(TrackingId::Source::Camera, aTrackingIdProcId);
|
||||
mTrackingId = Some(nsCString(aTrackingId));
|
||||
}
|
||||
|
||||
void VideoCaptureAvFoundation::StartFrameRecording(int32_t aWidth, int32_t aHeight) {
|
||||
MaybeRegisterCallbackThread();
|
||||
MutexLock lock(&api_lock_);
|
||||
if (MOZ_UNLIKELY(!mTrackingId)) {
|
||||
if (MOZ_UNLIKELY(mTrackingId)) {
|
||||
return;
|
||||
}
|
||||
auto fromWebrtcVideoType = [](webrtc::VideoType aType) -> CaptureStage::ImageType {
|
||||
|
@ -261,13 +260,10 @@ void VideoCaptureAvFoundation::StartFrameRecording(int32_t aWidth, int32_t aHeig
|
|||
return CaptureStage::ImageType::Unknown;
|
||||
}
|
||||
};
|
||||
mCaptureRecorder.Start(
|
||||
mPerformanceRecorder.Start(
|
||||
0, "VideoCaptureAVFoundation"_ns, *mTrackingId, aWidth, aHeight,
|
||||
mCapability.map([&](const auto& aCap) { return fromWebrtcVideoType(aCap.videoType); })
|
||||
.valueOr(CaptureStage::ImageType::Unknown));
|
||||
if (mCapability && mCapability->videoType != webrtc::VideoType::kI420) {
|
||||
mConversionRecorder.Start(0, "VideoCaptureAVFoundation"_ns, *mTrackingId, aWidth, aHeight);
|
||||
}
|
||||
}
|
||||
|
||||
void VideoCaptureAvFoundation::MaybeRegisterCallbackThread() {
|
||||
|
|
|
@ -269,7 +269,7 @@ ProfilerString8View CaptureStage::Name() const {
|
|||
};
|
||||
mName = Some(nsPrintfCString(
|
||||
"CaptureVideoFrame %s %dx%d %s %s", mSource.Data(), mWidth, mHeight,
|
||||
imageTypeToStr(mImageType), mTrackingId.ToString().get()));
|
||||
imageTypeToStr(mImageType), mTrackingId.get()));
|
||||
}
|
||||
return *mName;
|
||||
}
|
||||
|
|
|
@ -151,7 +151,7 @@ class CaptureStage {
|
|||
MJPEG,
|
||||
};
|
||||
|
||||
CaptureStage(nsCString aSource, TrackingId aTrackingId, int32_t aWidth,
|
||||
CaptureStage(nsCString aSource, nsCString aTrackingId, int32_t aWidth,
|
||||
int32_t aHeight, ImageType aImageType)
|
||||
: mSource(std::move(aSource)),
|
||||
mTrackingId(std::move(aTrackingId)),
|
||||
|
@ -165,12 +165,10 @@ class CaptureStage {
|
|||
}
|
||||
|
||||
nsCString mSource;
|
||||
TrackingId mTrackingId;
|
||||
nsCString mTrackingId;
|
||||
int32_t mWidth;
|
||||
int32_t mHeight;
|
||||
ImageType mImageType;
|
||||
|
||||
private:
|
||||
mutable Maybe<nsCString> mName;
|
||||
};
|
||||
|
||||
|
|
|
@ -10389,7 +10389,7 @@
|
|||
# disabled, an older forked capture module is used.
|
||||
- name: media.getusermedia.camera.macavf.enabled
|
||||
type: bool
|
||||
value: @IS_EARLY_BETA_OR_EARLIER@
|
||||
value: false
|
||||
mirror: once
|
||||
|
||||
# WebRTC prefs follow
|
||||
|
|
|
@ -156,7 +156,7 @@ class VideoCaptureModule : public rtc::RefCountInterface {
|
|||
virtual bool GetApplyRotation() = 0;
|
||||
|
||||
// Mozilla: TrackingId setter for use in profiler markers.
|
||||
virtual void SetTrackingId(uint32_t aTrackingIdProcId) {}
|
||||
virtual void SetTrackingId(const char* aTrackingId) {}
|
||||
|
||||
protected:
|
||||
~VideoCaptureModule() override {}
|
||||
|
|
Загрузка…
Ссылка в новой задаче