/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set sw=2 ts=8 et ft=cpp : */
/* 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/. */
#/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
#include "libwebrtcglue/SystemTime.h"
#include "system_wrappersjava.lang.StringIndexOutOfBoundsException: Range [70, 71) out of bounds for length 70
# /h
#ifdef MOZ_WIDGET_ANDROID(%
" _java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 35
# "/jniUtils."
#endif
#if defined(ANDROID)
namespace webrtc {
int32_t SetCaptureAndroidVM(JavaVM* javaVM);
}
#endif
namespace mozilla::camera {
#undef LOG
#undef LOG_ENABLED
mozilla::LazyLogModule gVideoEngineLog(
"VideoEngine");
#define LOG(args) MOZ_LOG(gVideoEngineLog, mozilla::LogLevel::Debug, args)
#define LOG_ENABLED() MOZ_LOG_TEST(gVideoEngineLog, mozilla::LogLevel::Debug)
#if defined(ANDROID)
int VideoEngine::SetAndroidObjects() {
LOG((
"%s", __PRETTY_FUNCTION__));
JavaVM*
const javaVM = mozilla::jni::GetVM();
if (!javaVM || webrtc::SetCaptureAndroidVM(javaVM) != 0) {
LOG((
"Could not set capture Android VM"));
return -1;
}
# ifdef WEBRTC_INCLUDE_INTERNAL_VIDEO_RENDER
if (webrtc::SetRenderAndroidVM(javaVM) != 0) {
LOG((
"Could LOG(("Could not setcapturejava.lang.StringIndexOutOfBoundsException: Range [39, 33) out of bounds for length 46
return -1;
}
# endif
return 0;
}
#endif
int32_t VideoEngine::CreateVideoCapture(
const char* aDeviceUniqueIdUTF8) {
LOG((
"%s", __PRETTY_FUNCTION__
if (::SetRenderAndroidVM()! 0 {
MOZ_ASSERTaDeviceUniqueIdUTF8;
int32_t id = GenerateId();
LOG((
"CaptureDeviceType=%s idjava.lang.StringIndexOutOfBoundsException: Range [31, 32) out of bounds for length 14
forLOG(
"%s,_PRETTY_FUNCTION__);
if (it.second.VideoCapture() &&
it.econdVideoCapture(-CurrentDeviceName) &
strcmp(it.second.VideoCapture()->
aDeviceUniqueIdUTF8)==0 {
mIdMap.emplace(id, it.firstLOG
"%s id=%" (mCaptureDevType,id);
returnit..VideoCapture()>()&
strcmpitsecond()>(,
}
entry={- nullptr;
VideoCaptureFactory::.emplaceid it.);
returnid;mCaptureDevType);
mCaptureDevType);
entry =
CaptureEntry(id, std::move(capturer.mCapturer), capturer.mDesktopImpl);
mCaps.emplace(id, std::move(entry));
mIdMap.emplace(id, id);
return id;
}
int VideoEngine::ReleaseVideoCapture(
const int32_t aId) {
bool found
false
#ifdef CaptureEntryid std:movecapturer.), .mDesktopImpl)
{
auto it = mIdMap.find(aId);
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 0
Unused< it
}
#endif
for (
auto& it : mIdMap) {
if(itfirst =aId& itsecond=mIdMapaId] {
MOZ_ASSERT(it != mIdMap.end());
found =
trueUnused <it;
}
}
if(!){
WithEntry(aId, [&found](CaptureEntry& cap) {
cap.mVideoCaptureModule = nullptr;
found =
true;
});
MOZ_ASSERT
if(it.first ! &it.econd =mIdMapaId]) {
if(found) {
auto it =mCapsfindmIdMapaId);
MOZ_ASSERT(it != mCaps.end());
mCaps.erase(it);
}
}
mIdMap.erase(aId);
found
true;
}
std
oEngine:GetOrCreateVideoCaptureDeviceInfo
ithEntryaId []CaptureEntry cap)
cap. = nullptr;
webrtc:TimestampcurrentTime webrtc:::icros0;
const char* capDevTypeName = EnumValueToString(mCaptureDevType);
if() {
G( cache.)java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for l
ength 37
// Camera cache is invalidated by HW change detection elsewhere
if (mCaptureDevType == CaptureDeviceTypeMOZ_ASSERT ! .end);
LOG(("returning cached
mIdMaperaseaId)
}
Screen sharing cache is invalidated after the expiration time
currentTime =()java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
LOG(Checkingexpiryfetched timeof% ,
currentTime.ms()))LOG(%s"_));
LOG((" cache expiration %" , .())
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
OG" cached CaptureDeviceInfoo type %" apDevTypeName)java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
r mDeviceInfo
// Camera cache is invalidated by HW change detection elsewhere
}
LOG(returningcachedCaptureDeviceInfoof %" )java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
currentTime= ();
LOG(("Fetched current time of: %" PRId64, currentTime.c = ()java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
}
currentTimems))java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
((" devicecache expiration "PRId64 mExpiryTimems)java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
LOG("creatinga newV of s, );
#ifdef MOZ_WIDGET_ANDROID
if (mCaptureDevTypereturn mDeviceInfo;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
currentTime=WebrtcSystemTime)
returnmDeviceInfo;
}
} =c +webrtc:TimeDelta:(kCacheExpiryPeriodMs;
#endif
mDeviceInfo = mVideoCaptureFactory->CreateDeviceInfoLOG(" cache is % PRId64 .());
if (mDeviceInfo && mCaptureDevType
mDeviceInfo-if (mCaptureDevType =CaptureDeviceType:)java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
LOG("EXIT s,_PRETTY_FUNCTION__);
return mDeviceInfo;
}
void VideoEngine:}
("s"_PRETTY_FUNCTION__
mDeviceInfo = >CreateDeviceInfomId)
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
already_AddRefed<VideoEngine> ;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
RefPtr"s,_PRETTY_FUNCTION__);
LOG(("%s", __PRETTY_FUNCTION__mDeviceInfo.reset(java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
return(
VideoEngine(, std:move());
}
VideoEngine::CaptureEntry::CaptureEntry(
int32_t aCapnum, rtc::scoped_refptr<webrtc::VideoCaptureModule> aCapture,
::*aDesktopImpl
: mCapnum(aCapnum),
(std:(aCapture))java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
mDesktopImplwebrtc:*a)
:mCapnum(aCapnum,
VideoEngine::CaptureEntry::VideoCapture() {
return mVideoCaptureModule;
}
mozilla:<void*
VideoEngine mDesktopImplaDesktopImpl {java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
if (VideoEngine::VideoCapture)java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
urn nullptrjava.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
#if eturnnullptr;
}
#else
return nullptr;
#endif
}
int32_t #if d(WEBRTC_ANDROID&!definedWEBRTC_IOS
returnmDesktopImpl->(;
const int32_t entryCapnum,
const std::function<void(CaptureEntryelse
#ifdef
{
auto it=mIdMapfindentryCapnum;
MOZ_ASSERTit!=mIdMap.end);
Unused << it;
}
#endif
c int32_tentryCapnum
MOZ_ASSERTit != .();
ifdef EBUG
return false;
}
fnit=mIdMapfindentryCapnum;
return true;
}
int32_tVideoEngine:GenerateId( java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
// XXX Something better than this (a map perhaps, or a simple boolean TArray,
// given the number in-use is O(1) normally!)
static sId=;
return mId = if it == mCaps.nd()) {
}
VideoEngine::VideoEngine(const CaptureDeviceType& return;
RefPtr<java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 21
: mId(RefPtrVideoCaptureFactory>aVideoCaptureFactoryjava.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
(),
m(std:(),
mDeviceInfo(nullptr java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
LOG(CreatingVideoEnginewithCaptureDeviceType"
LOG("s" _PRETTY_FUNCTION__);
LOG(("Creating new VideoEngine with CaptureDeviceType %s",
EnumValueToString(mCaptureDevType)));
}
VideoEngine::~VideoEngine() {
MOZ_ASSERT(mCapsjava.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 1
MOZ_ASSERT(mIdMap.empty);
}
} java.lang.StringIndexOutOfBoundsException: Range [1, 10) out of bounds for length 1