Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nw14 mas #4813

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion nw.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,17 @@
'<(DEPTH)/components/nacl.gyp:nacl',
]
}],
[ 'OS=="mac"', {
[ 'OS=="mac" and nwjs_mas==1', {
'copies': [
{
'destination': '<(PRODUCT_DIR)/<(mac_product_name).app/Contents/Versions/<(version_full)/<(mac_product_name) Framework.framework/Versions/Current/',
'files': [
'<(PRODUCT_DIR)/libnode.dylib',
],
},
],
}],
[ 'OS=="mac" and nwjs_mas!=1', {
'copies': [
{
'destination': '<(PRODUCT_DIR)/<(mac_product_name).app/Contents/Versions/<(version_full)/<(mac_product_name) Framework.framework/',
Expand All @@ -435,6 +445,9 @@
['disable_nacl==0 and nwjs_sdk==0', {
'package_mode': 'nacl',
}],
['nwjs_mas==1 and OS=="mac"', {
'package_mode': 'mas',
}],
], # conditions
}, # variables
'actions': [
Expand Down
4 changes: 4 additions & 0 deletions patch/patch.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,8 @@ patches = [
'name': 'webrtc_window_capturer',
'path': 'src/third_party/webrtc/',
},
{
'name': 'webrtc_mas',
'path': 'src/third_party/webrtc/',
},
]
134 changes: 134 additions & 0 deletions patch/patches/webrtc_mas.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
diff --git a/media/media.gyp b/media/media.gyp
index e4960e1..1c32bfa 100644
--- media/media.gyp
+++ media/media.gyp
@@ -226,6 +226,15 @@
},
},
}],
+ ['nwjs_mas==1', {
+ 'link_settings': {
+ 'xcode_settings': {
+ 'OTHER_LDFLAGS!': [
+ '-framework QTKit',
+ ],
+ },
+ },
+ }],
],
'xcode_settings': {
'WARNING_CFLAGS': [
diff --git a/modules/video_capture/mac/video_capture_mac.mm b/modules/video_capture/mac/video_capture_mac.mm
index a9dab96..819928b 100644
--- modules/video_capture/mac/video_capture_mac.mm
+++ modules/video_capture/mac/video_capture_mac.mm
@@ -21,6 +21,7 @@
#include "webrtc/system_wrappers/include/ref_count.h"
#include "webrtc/system_wrappers/include/trace.h"

+#if !defined(NWJS_MAS)
// 10.4 support must be decided runtime. We will just decide which framework to
// use at compile time "work" classes. One for QTKit, one for QuickTime
#if __MAC_OS_X_VERSION_MIN_REQUIRED == __MAC_10_4 // QuickTime version
@@ -30,6 +31,7 @@
#include "webrtc/modules/video_capture/mac/qtkit/video_capture_qtkit.h"
#include "webrtc/modules/video_capture/mac/qtkit/video_capture_qtkit_info.h"
#endif
+#endif // !defined(NWJS_MAS)

namespace webrtc
{
@@ -113,6 +115,12 @@ VideoCaptureModule* VideoCaptureImpl::Create(
const int32_t id, const char* deviceUniqueIdUTF8)
{

+#if defined(NWJS_MAS)
+ WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideoCapture, id,
+ "QTKit is disabled in MAS. Could not create video capture "
+ "module. Returning NULL");
+ return NULL;
+#else
if (webrtc::videocapturemodule::CheckOSVersion() == false)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideoCapture, id,
@@ -194,6 +202,7 @@ VideoCaptureModule* VideoCaptureImpl::Create(
"framework",deviceUniqueIdUTF8);
return newCaptureModule;
#endif
+#endif // defined(NWJS_MAS)
}

/**************************************************************************
@@ -205,8 +214,12 @@ VideoCaptureModule* VideoCaptureImpl::Create(
VideoCaptureModule::DeviceInfo*
VideoCaptureImpl::CreateDeviceInfo(const int32_t id)
{
-
-
+#if defined(NWJS_MAS)
+ WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideoCapture, id,
+ "QTKit is disabled in MAS. Could not create video capture "
+ "module. Returning NULL");
+ return NULL;
+#else
if (webrtc::videocapturemodule::CheckOSVersion() == false)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideoCapture, id,
@@ -259,7 +272,7 @@ VideoCaptureImpl::CreateDeviceInfo(const int32_t id)
return newCaptureInfoModule;

#endif
-
+#endif // defined(NWJS_MAS)
}

/**************************************************************************
diff --git a/modules/video_capture/video_capture.gypi b/modules/video_capture/video_capture.gypi
index c80f2bf..f9b251d 100644
--- modules/video_capture/video_capture.gypi
+++ modules/video_capture/video_capture.gypi
@@ -70,6 +70,7 @@
}], # linux
['OS=="mac"', {
'sources': [
+ 'mac/video_capture_mac.mm',
'mac/qtkit/video_capture_qtkit.h',
'mac/qtkit/video_capture_qtkit.mm',
'mac/qtkit/video_capture_qtkit_info.h',
@@ -79,7 +80,6 @@
'mac/qtkit/video_capture_qtkit_objc.h',
'mac/qtkit/video_capture_qtkit_objc.mm',
'mac/qtkit/video_capture_qtkit_utility.h',
- 'mac/video_capture_mac.mm',
],
'link_settings': {
'xcode_settings': {
@@ -90,6 +90,28 @@
],
},
},
+ 'conditions': [
+ ['nwjs_mas==1', {
+ 'sources!': [
+ 'mac/qtkit/video_capture_qtkit.h',
+ 'mac/qtkit/video_capture_qtkit.mm',
+ 'mac/qtkit/video_capture_qtkit_info.h',
+ 'mac/qtkit/video_capture_qtkit_info.mm',
+ 'mac/qtkit/video_capture_qtkit_info_objc.h',
+ 'mac/qtkit/video_capture_qtkit_info_objc.mm',
+ 'mac/qtkit/video_capture_qtkit_objc.h',
+ 'mac/qtkit/video_capture_qtkit_objc.mm',
+ 'mac/qtkit/video_capture_qtkit_utility.h',
+ ],
+ 'link_settings': {
+ 'xcode_settings': {
+ 'OTHER_LDFLAGS!': [
+ '-framework QTKit',
+ ],
+ },
+ },
+ }]
+ ]
}], # mac
['OS=="win"', {
'dependencies': [
34 changes: 34 additions & 0 deletions tools/mas/build.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[Sign]
## [REQUIRED] Your Application Certificate Identity
ApplicationIdentity = 3rd Party Mac Developer Application: Foo (XXXXXXXXXX)
## [REQUIRED] (for --pkg) Your Installer Certificate Identity
InstallerIdentity = 3rd Party Mac Developer Installer: Foo (XXXXXXXXXX)
## [Optional] (for --pkg) Installation path
InstallPath = /Applications
## [REQUIRED] Entitlements
ParentEntitlements = entitlements-parent.plist
ChildEntitlements = entitlements-child.plist

[Info.plist]
## [REQUIRED] Your app bundle identifier
CFBundleIdentifier = your.app.bundle.id
## [REQUIRED] Team ID obtained from Apple Developer -> Membership -> Team ID
NWTeamID = XXXXXXXXXX
## Properties of Info.plist will be overwritten in this section.

[Resources]
## [OPTIONAL] Your custom icon file
Icon = path/to/custom/icon.icns
## [OPTIONAL] Locales
## If Locales is not set, all current locales are preserved.
## If comma separated locale list (e.g. en,fr,zh_CN) is given, you should have
## additional [Locale locale_name] section for each locale containing localized strings.
## Locales not in the list will be removed.
Locales = en

## [OPTIONAL] custom locales
[Locale en]
CFBundleDisplayName = My App
CFBundleGetInfoString = My App 1.0.0, Copyright 2016 My Company. All rights reserved.
CFBundleName = My App
NSHumanReadableCopyright = Copyright 2016 My Company. All rights reserved.
Loading