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

Fix macOS and Linux build #92

Merged
merged 2 commits into from
Oct 31, 2024
Merged
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
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,14 @@ set(GSTCEF_SRCS
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one line above there's another gstcefloader.cc


set(GSTCEFSUBPROCESS_SRCS
gstcefloader.cc
gstcefsubprocess.cc
)

if (APPLE)
list(APPEND GSTCEF_SRCS gstcefloader.cc)
list(APPEND GSTCEFSUBPROCESS_SRCS gstcefloader.cc)
endif()

pkg_check_modules(GST REQUIRED gstreamer-1.0
gstreamer-video-1.0
gstreamer-audio-1.0)
Expand Down
4 changes: 2 additions & 2 deletions gstcefsrc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -845,10 +845,10 @@ gst_cef_src_change_state(GstElement *src, GstStateChange transition)
/* in the main thread as per Cocoa */
if (pthread_main_np()) {
g_mutex_unlock (&init_lock);
run_cef ((GstCefSrc*) src);
init_cef ((GstCefSrc*) src);
g_mutex_lock (&init_lock);
} else {
dispatch_async_f(dispatch_get_main_queue(), (GstCefSrc*)src, (dispatch_function_t)&run_cef);
dispatch_async_f(dispatch_get_main_queue(), (GstCefSrc*)src, (dispatch_function_t)&init_cef);
while (cef_status == CEF_STATUS_INITIALIZING)
g_cond_wait (&init_cond, &init_lock);
}
Expand Down
11 changes: 5 additions & 6 deletions gstcefsubprocess.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,12 @@
#include <include/cef_app.h>
#include <glib.h>

#ifdef GST_CEF_USE_SANDBOX
#if defined(__APPLE__)
#include "gstcefloader.h"
#endif

#if !defined(__APPLE__) && defined(GST_CEF_USE_SANDBOX)
#if defined(GST_CEF_USE_SANDBOX)
#include "include/cef_sandbox_mac.h"
#endif
#endif


enum ProcessType {
Expand Down Expand Up @@ -123,7 +122,7 @@ class RendererApp : public CefApp, public CefRenderProcessHandler {

int main(int argc, char * argv[])
{
#if !defined(__APPLE__) && defined(GST_CEF_USE_SANDBOX)
#if defined(__APPLE__) && defined(GST_CEF_USE_SANDBOX)
// Initialize the macOS sandbox for this helper process.
CefScopedSandboxContext sandbox_context;
if (!sandbox_context.Initialize(argc, argv)) {
Expand All @@ -141,7 +140,7 @@ int main(int argc, char * argv[])
CefMainArgs args(argc, argv);
#endif

#ifdef GST_CEF_USE_SANDBOX
#if defined(__APPLE__) && defined(GST_CEF_USE_SANDBOX)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same change has to be made also in gstcef.cc in two places

// Try loading like an app bundle (1) or as
// a sibling (2, at development time).
if (!gst_initialize_cef(TRUE) && !gst_initialize_cef(FALSE)) {
Expand Down
Loading