2 * Copyright (C) 2020 Seungha Yang <seungha@centricular.com>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
24 #include <winapifamily.h>
26 #include "gstwasapi2sink.h"
27 #include "gstwasapi2src.h"
28 #include "gstwasapi2device.h"
29 #include "gstwasapi2util.h"
32 GST_DEBUG_CATEGORY (gst_wasapi2_debug);
33 GST_DEBUG_CATEGORY (gst_wasapi2_client_debug);
36 plugin_deinit (gpointer data)
42 plugin_init (GstPlugin * plugin)
44 GstRank rank = GST_RANK_PRIMARY + 1;
53 hr = MFStartup (MF_VERSION, MFSTARTUP_NOSOCKET);
54 if (!gst_wasapi2_result (hr)) {
55 GST_WARNING ("MFStartup failure, hr: 0x%x", hr);
59 GST_DEBUG_CATEGORY_INIT (gst_wasapi2_debug, "wasapi2", 0, "wasapi2");
60 GST_DEBUG_CATEGORY_INIT (gst_wasapi2_client_debug, "wasapi2client",
63 gst_element_register (plugin, "wasapi2sink", rank, GST_TYPE_WASAPI2_SINK);
64 gst_element_register (plugin, "wasapi2src", rank, GST_TYPE_WASAPI2_SRC);
66 gst_device_provider_register (plugin, "wasapi2deviceprovider",
67 rank, GST_TYPE_WASAPI2_DEVICE_PROVIDER);
69 g_object_set_data_full (G_OBJECT (plugin),
70 "plugin-wasapi2-shutdown", "shutdown-data",
71 (GDestroyNotify) plugin_deinit);
76 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
79 "Windows audio session API plugin",
80 plugin_init, VERSION, "LGPL", GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)