<commit_before>#include <QDebug>

#include "gstpipeline.h"

#define GST_USE_UNSTABLE_API
#include <gst/gl/gstglconfig.h>

#include <QOpenGLContext>

#if GST_GL_HAVE_PLATFORM_EGL
	#include <QtPlatformHeaders/QEGLNativeContext>
	#include <gst/gl/egl/gstgldisplay_egl.h>
#endif

#if GST_GL_HAVE_PLATFORM_GLX
	#include <QtX11Extras/QX11Info>
	#include <QtPlatformHeaders/QGLXNativeContext>
	#include <gst/gl/x11/gstgldisplay_x11.h>
#endif

#if GST_GL_HAVE_PLATFORM_WGL
	#include <QtPlatformHeaders/QWGLNativeContext>
#endif

GstreamerPipeline::GstreamerPipeline() {
    moveToThread(&_thread);
    setObjectName("GstreamerPipeline");

    connect(this, &GstreamerPipeline::openFileRequested, this, &GstreamerPipeline::_open);
    _thread.start();
}

GstreamerPipeline::~GstreamerPipeline() {<commit_msg>add a glib main loop on windows<commit_after>#include <QDebug>

#include "gstpipeline.h"

#define GST_USE_UNSTABLE_API
#include <gst/gl/gstglconfig.h>

#include <QOpenGLContext>

#if GST_GL_HAVE_PLATFORM_EGL
	#include <QtPlatformHeaders/QEGLNativeContext>
	#include <gst/gl/egl/gstgldisplay_egl.h>
#endif

#if GST_GL_HAVE_PLATFORM_GLX
	#include <QtX11Extras/QX11Info>
	#include <QtPlatformHeaders/QGLXNativeContext>
	#include <gst/gl/x11/gstgldisplay_x11.h>
#endif

#if GST_GL_HAVE_PLATFORM_WGL
	#include <QtPlatformHeaders/QWGLNativeContext>
#endif

#ifdef Q_OS_WIN
GThread* _loop_thread;
GMainLoop *_loop;
void _g_main_loop_thread(void) {
    g_main_loop_run(_loop);
    g_thread_exit(0);
}
#endif

GstreamerPipeline::GstreamerPipeline() {
#ifdef Q_OS_WIN
    _loop = g_main_loop_new(g_main_context_default(), false);
    _loop_thread = g_thread_new("glib_main_loop", (GThreadFunc) _g_main_loop_thread, this);
#endif
    moveToThread(&_thread);
    setObjectName("GstreamerPipeline");

    connect(this, &GstreamerPipeline::openFileRequested, this, &GstreamerPipeline::_open);
    _thread.start();
}

GstreamerPipeline::~GstreamerPipeline() {
#ifdef Q_OS_WIN
    g_main_loop_quit(_loop);
    g_thread_join(_loop_thread);
#endif

{'fraction_non_alphanumeric': 0.11286347954657466, 'fraction_numerical': 0.008378511582060127, 'mean_word_length': 7.319672131147541, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4352871', 'n_tokens_mistral': 834, 'n_tokens_neox': 811, 'n_words': 113}