Projects
Essentials
gstreamer-plugins-bad-codecs
Sign Up
Log In
Username
Password
We truncated the diff of some files because they were too big. If you want to see the full diff for every file,
click here
.
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 38
View file
gstreamer-plugins-bad-codecs.changes
Changed
@@ -1,4 +1,9 @@ ------------------------------------------------------------------- +Thu Aug 14 16:20:34 UTC 2025 - Bjørn Lie <zaitor@opensuse.org> + +- Update to version 1.26.5 + +------------------------------------------------------------------- Mon Jul 28 18:30:23 UTC 2025 - Bjørn Lie <zaitor@opensuse.org> - Update to version 1.26.4
View file
gstreamer-plugins-bad-codecs.spec
Changed
@@ -7,7 +7,7 @@ %define _version 1.26.0 Name: gstreamer-plugins-bad-codecs -Version: 1.26.4 +Version: 1.26.5 Release: 0 Summary: Codecs/plugins for gstreamer-plugins-bad License: LGPL-2.1-or-later
View file
_service
Changed
@@ -2,7 +2,7 @@ <service name="download_url"> <param name="host">gstreamer.freedesktop.org</param> <param name="protocol">https</param> - <param name="path">/src/gst-plugins-bad/gst-plugins-bad-1.26.4.tar.xz</param> + <param name="path">/src/gst-plugins-bad/gst-plugins-bad-1.26.5.tar.xz</param> </service> <service name="set_version" mode="buildtime"/> </services>
View file
_service:download_url:gst-plugins-bad-1.26.4.tar.xz/sys/wasapi2/AsyncOperations.h
Deleted
@@ -1,168 +0,0 @@ -// MIT License -// -// Copyright (c) 2016 Microsoft Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -// Source taken from https://github.com/microsoft/MixedRealityCompanionKit - -#pragma once - -#include <wrl.h> -#include <wrl\async.h> -#include <Windows.System.Threading.h> -#include <functional> - -template <typename TDelegate, typename TOperation, typename TLambda> -HRESULT StartAsyncThen(_In_ TOperation* pOperation, _In_ TLambda&& tFunc) -{ - if (nullptr == pOperation) - { - return E_INVALIDARG; - } - - auto spCallback = Microsoft::WRL::Callback<TDelegate>( - tFunc(_In_ TOperation* pOperation, _In_ AsyncStatus status) -> HRESULT - { - HRESULT hr = S_OK; - - // wrap the operation - if (status != AsyncStatus::Completed) - { - Microsoft::WRL::ComPtr<TOperation> spOperation(pOperation); - Microsoft::WRL::ComPtr<IAsyncInfo> spAsyncInfo; - hr = spOperation.As(&spAsyncInfo); - if (SUCCEEDED(hr)) - { - spAsyncInfo->get_ErrorCode(&hr); - } - } - - return tFunc(hr, pOperation, status); - }); - - // start - return (nullptr != spCallback) ? pOperation->put_Completed(spCallback.Get()) : E_OUTOFMEMORY; -} -template <typename TLambda> -HRESULT StartAsyncThen(_In_ ABI::Windows::Foundation::IAsyncAction* pOperation, _In_ TLambda&& tFunc) -{ - return StartAsyncThen<ABI::Windows::Foundation::IAsyncActionCompletedHandler, ABI::Windows::Foundation::IAsyncAction>(pOperation, static_cast<TLambda&&>(tFunc)); -} -template <typename TProgress, typename TLambda> -HRESULT StartAsyncThen(_In_ ABI::Windows::Foundation::IAsyncActionWithProgress<TProgress>* pOperation, _In_ TLambda&& tFunc) -{ - return StartAsyncThen<ABI::Windows::Foundation::IAsyncActionWithProgressCompletedHandler<TProgress>, Windows::Foundation::IAsyncActionWithProgress<TProgress>>(pOperation, static_cast<TLambda&&>(tFunc)); -} -template <typename TResult, typename TLambda> -HRESULT StartAsyncThen(_In_ ABI::Windows::Foundation::IAsyncOperation<TResult>* pOperation, _In_ TLambda&& tFunc) -{ - return StartAsyncThen<ABI::Windows::Foundation::IAsyncOperationCompletedHandler<TResult>, ABI::Windows::Foundation::IAsyncOperation<TResult>>(pOperation, static_cast<TLambda&&>(tFunc)); -} -template <typename TResult, typename TProgress, typename TLambda> -HRESULT StartAsyncThen(_In_ ABI::Windows::Foundation::IAsyncOperationWithProgress<TResult, TProgress>* pOperation, _In_ TLambda&& tFunc) -{ - return StartAsyncThen<ABI::Windows::Foundation::IAsyncOperationWithProgressCompletedHandler<TResult, TProgress>, ABI::Windows::Foundation::IAsyncOperationWithProgress<TResult, TProgress>>(pOperation, static_cast<TLambda&&>(tFunc)); -} - - -// eg. TOperation = IAsyncOperationWithProgress<UINT32, UINT32> -// eg. THandler = IAsyncOperationWithProgressCompletedHandler<UINT, UINT> -template<typename TOperation, typename THandler> -class AsyncEventDelegate - : public Microsoft::WRL::RuntimeClass - < Microsoft::WRL::RuntimeClassFlags<Microsoft::WRL::RuntimeClassType::Delegate> - , THandler - , Microsoft::WRL::FtmBase > -{ -public: - AsyncEventDelegate() - : _completedEvent(CreateEventEx(nullptr, nullptr, 0, EVENT_ALL_ACCESS)) - { - ComPtr<AsyncEventDelegate> spThis(this); - auto lambda = (this, spThis(_In_ HRESULT hr, _In_ TOperation* pOperation) - { - SetEvent(_completedEvent.Get()); - }); - _func = std::move(lambda); - } - - STDMETHOD(Invoke)( - _In_ TOperation* pOperation, - _In_ AsyncStatus status) - { - HRESULT hr = S_OK; - - // if we completed successfully, then there is no need for getting hresult - if (status != AsyncStatus::Completed) - { - Microsoft::WRL::ComPtr<TOperation> spOperation(pOperation); - Microsoft::WRL::ComPtr<IAsyncInfo> spAsyncInfo; - if (SUCCEEDED(spOperation.As(&spAsyncInfo))) - { - spAsyncInfo->get_ErrorCode(&hr); - } - } - - _func(hr, pOperation); - - return S_OK; - } - - STDMETHOD(SyncWait)(_In_ TOperation* pOperation, _In_ DWORD dwMilliseconds) - { - HRESULT hr = pOperation->put_Completed(this); - if (FAILED(hr)) - { - return hr; - } - - DWORD dwWait = WaitForSingleObjectEx(_completedEvent.Get(), dwMilliseconds, TRUE); - if (WAIT_IO_COMPLETION == dwWait || WAIT_OBJECT_0 == dwWait) - return S_OK; - - return HRESULT_FROM_WIN32(GetLastError()); - } - -private: - std::function<void(HRESULT, TOperation*)> _func; - Microsoft::WRL::Wrappers::Event _completedEvent; -}; -template <typename TOperation, typename THandler> -HRESULT SyncWait(_In_ TOperation* pOperation, _In_ DWORD dwMilliseconds) -{ - auto spCallback = Microsoft::WRL::Make<AsyncEventDelegate<TOperation, THandler>>(); - - return spCallback->SyncWait(pOperation, dwMilliseconds); -} -template <typename TResult> -HRESULT SyncWait(_In_ ABI::Windows::Foundation::IAsyncAction* pOperation, _In_ DWORD dwMilliseconds = INFINITE) -{ - return SyncWait<ABI::Windows::Foundation::IAsyncAction, ABI::Windows::Foundation::IAsyncActionCompletedHandler>(pOperation, dwMilliseconds); -} -template <typename TResult> -HRESULT SyncWait(_In_ ABI::Windows::Foundation::IAsyncOperation<TResult>* pOperation, _In_ DWORD dwMilliseconds = INFINITE) -{ - return SyncWait<ABI::Windows::Foundation::IAsyncOperation<TResult>, ABI::Windows::Foundation::IAsyncOperationCompletedHandler<TResult>>(pOperation, dwMilliseconds); -} -template <typename TResult, typename TProgress> -HRESULT SyncWait(_In_ ABI::Windows::Foundation::IAsyncOperationWithProgress<TResult, TProgress>* pOperation, _In_ DWORD dwMilliseconds = INFINITE) -{ - return SyncWait<ABI::Windows::Foundation::IAsyncOperationWithProgress<TResult, TProgress>, ABI::Windows::Foundation::IAsyncOperationWithProgressCompletedHandler<TResult, TProgress>>(pOperation, dwMilliseconds); -}
View file
_service:download_url:gst-plugins-bad-1.26.4.tar.xz/sys/wasapi2/gstwasapi2client.cpp
Deleted
@@ -1,1342 +0,0 @@ -/* - * Copyright (C) 2008 Ole André Vadla Ravnås <ole.andre.ravnas@tandberg.com> - * Copyright (C) 2013 Collabora Ltd. - * Author: Sebastian Dröge <sebastian.droege@collabora.co.uk> - * Copyright (C) 2018 Centricular Ltd. - * Author: Nirbheek Chauhan <nirbheek@centricular.com> - * Copyright (C) 2020 Seungha Yang <seungha@centricular.com> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "AsyncOperations.h" -#include "gstwasapi2client.h" -#include "gstwasapi2util.h" -#include <initguid.h> -#include <windows.foundation.h> -#include <windows.ui.core.h> -#include <wrl.h> -#include <wrl/wrappers/corewrappers.h> -#include <audioclient.h> -#include <mmdeviceapi.h> -#include <string.h> -#include <string> -#include <locale> -#include <codecvt> -#include <atomic> - -/* *INDENT-OFF* */ -using namespace ABI::Windows::ApplicationModel::Core; -using namespace ABI::Windows::Foundation; -using namespace ABI::Windows::Foundation::Collections; -using namespace ABI::Windows::UI::Core; -using namespace ABI::Windows::Media::Devices; -using namespace ABI::Windows::Devices::Enumeration; - -using namespace Microsoft::WRL; -using namespace Microsoft::WRL::Wrappers; - -/* Copy of audioclientactivationparams.h since those types are defined only for - * NTDDI_VERSION >= NTDDI_WIN10_FE */ -#define GST_VIRTUAL_AUDIO_DEVICE_PROCESS_LOOPBACK L"VAD\\Process_Loopback" -typedef enum -{ - GST_PROCESS_LOOPBACK_MODE_INCLUDE_TARGET_PROCESS_TREE = 0, - GST_PROCESS_LOOPBACK_MODE_EXCLUDE_TARGET_PROCESS_TREE = 1 -} GST_PROCESS_LOOPBACK_MODE; - -typedef struct -{ - DWORD TargetProcessId; - GST_PROCESS_LOOPBACK_MODE ProcessLoopbackMode; -} GST_AUDIOCLIENT_PROCESS_LOOPBACK_PARAMS; - -typedef enum -{ - GST_AUDIOCLIENT_ACTIVATION_TYPE_DEFAULT = 0, - GST_AUDIOCLIENT_ACTIVATION_TYPE_PROCESS_LOOPBACK = 1 -} GST_AUDIOCLIENT_ACTIVATION_TYPE; - -typedef struct -{ - GST_AUDIOCLIENT_ACTIVATION_TYPE ActivationType; - union - { - GST_AUDIOCLIENT_PROCESS_LOOPBACK_PARAMS ProcessLoopbackParams; - } DUMMYUNIONNAME; -} GST_AUDIOCLIENT_ACTIVATION_PARAMS; -/* End of audioclientactivationparams.h */ - -G_BEGIN_DECLS - -GST_DEBUG_CATEGORY_EXTERN (gst_wasapi2_client_debug); -#define GST_CAT_DEFAULT gst_wasapi2_client_debug - -G_END_DECLS -/* *INDENT-ON* */ - -static void -gst_wasapi2_client_on_device_activated (GstWasapi2Client * client, - IAudioClient * audio_client); - -static void -gst_wasapi2_client_on_endpoint_volume_activated (GstWasapi2Client * client, - IAudioEndpointVolume * audio_endpoint_volume); - -static void -gst_wasapi2_client_set_endpoint_muted (GstWasapi2Client * client, - gboolean muted); - -/* *INDENT-OFF* */ -class GstWasapiDeviceActivator - : public RuntimeClass<RuntimeClassFlags<ClassicCom>, FtmBase, - IActivateAudioInterfaceCompletionHandler> -{ -public: - typedef enum { - WASAPI_IFACE_AUDIO_CLIENT, - WASAPI_IFACE_AUDIO_ENDPOINT_VOLUME, - } WasapiInterface; - - GstWasapiDeviceActivator () - { - g_weak_ref_init (&listener_, nullptr); - interface_to_activate_ = WASAPI_IFACE_AUDIO_CLIENT; - } - - ~GstWasapiDeviceActivator () - { - g_weak_ref_set (&listener_, nullptr); - } - - HRESULT - RuntimeClassInitialize (GstWasapi2Client * listener, - gpointer dispatcher, - WasapiInterface interface_to_activate) - { - if (!listener) - return E_INVALIDARG; - - g_weak_ref_set (&listener_, listener); - - if (dispatcher) { - ComPtr<IInspectable> inspectable = - reinterpret_cast<IInspectable*> (dispatcher); - HRESULT hr; - - hr = inspectable.As (&dispatcher_); - if (gst_wasapi2_result (hr)) - GST_INFO("Main UI dispatcher is available"); - } - - interface_to_activate_ = interface_to_activate; - - return S_OK; - } - - STDMETHOD(ActivateCompleted) - (IActivateAudioInterfaceAsyncOperation *async_op) - { - ComPtr<IAudioClient> audio_client; - ComPtr<IAudioEndpointVolume> audio_endpoint_volume; - HRESULT hr = S_OK; - HRESULT hr_async_op = S_OK; - ComPtr<IUnknown> audio_interface; - GstWasapi2Client *client; - - client = (GstWasapi2Client *) g_weak_ref_get (&listener_); - - if (!client) { - GST_WARNING ("No listener was configured"); - return S_OK; - } - - GST_INFO_OBJECT (client, "AsyncOperation done"); - - hr = async_op->GetActivateResult(&hr_async_op, &audio_interface); - - if (!gst_wasapi2_result (hr)) { - GST_WARNING_OBJECT (client, "Failed to get activate result, hr: 0x%x", hr); - goto done; - } - - if (!gst_wasapi2_result (hr_async_op)) { - GST_WARNING_OBJECT (client, "Failed to activate device"); - goto done; - } - - switch (interface_to_activate_) { - case WASAPI_IFACE_AUDIO_CLIENT: - hr = audio_interface.As (&audio_client); - if (!gst_wasapi2_result (hr)) { - GST_ERROR_OBJECT (client, "Failed to get IAudioClient3 interface"); - goto done; - } - break; - case WASAPI_IFACE_AUDIO_ENDPOINT_VOLUME: - hr = audio_interface.As (&audio_endpoint_volume); - if (!gst_wasapi2_result (hr)) { - GST_ERROR_OBJECT (client, "Failed to get IAudioEndpointVolume interface"); - goto done; - } - break;
View file
_service:download_url:gst-plugins-bad-1.26.4.tar.xz/sys/wasapi2/gstwasapi2client.h
Deleted
@@ -1,99 +0,0 @@ -/* - * Copyright (C) 2020 Seungha Yang <seungha@centricular.com> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#ifndef __GST_WASAPI2_CLIENT_H__ -#define __GST_WASAPI2_CLIENT_H__ - -#include <gst/gst.h> -#include <gst/audio/audio.h> -#include "gstwasapi2util.h" - -G_BEGIN_DECLS - -typedef enum -{ - GST_WASAPI2_CLIENT_DEVICE_CLASS_CAPTURE = 0, - GST_WASAPI2_CLIENT_DEVICE_CLASS_RENDER, - GST_WASAPI2_CLIENT_DEVICE_CLASS_LOOPBACK_CAPTURE, - GST_WASAPI2_CLIENT_DEVICE_CLASS_INCLUDE_PROCESS_LOOPBACK_CAPTURE, - GST_WASAPI2_CLIENT_DEVICE_CLASS_EXCLUDE_PROCESS_LOOPBACK_CAPTURE, -} GstWasapi2ClientDeviceClass; - -typedef enum -{ - GST_WASAPI2_OK, - GST_WASAPI2_DEVICE_NOT_FOUND, - GST_WASAPI2_ACTIVATION_FAILED, -} GstWasapi2Result; - -static inline gboolean -gst_wasapi2_device_class_is_loopback (GstWasapi2ClientDeviceClass device_class) -{ - switch (device_class) { - case GST_WASAPI2_CLIENT_DEVICE_CLASS_LOOPBACK_CAPTURE: - return TRUE; - default: - break; - } - - return FALSE; -} - -static inline gboolean -gst_wasapi2_device_class_is_process_loopback (GstWasapi2ClientDeviceClass device_class) -{ - switch (device_class) { - case GST_WASAPI2_CLIENT_DEVICE_CLASS_INCLUDE_PROCESS_LOOPBACK_CAPTURE: - case GST_WASAPI2_CLIENT_DEVICE_CLASS_EXCLUDE_PROCESS_LOOPBACK_CAPTURE: - return TRUE; - default: - break; - } - - return FALSE; -} - -#define GST_TYPE_WASAPI2_CLIENT_DEVICE_CLASS (gst_wasapi2_client_device_class_get_type()) -GType gst_wasapi2_client_device_class_get_type (void); - -#define GST_TYPE_WASAPI2_CLIENT (gst_wasapi2_client_get_type()) -G_DECLARE_FINAL_TYPE (GstWasapi2Client, - gst_wasapi2_client, GST, WASAPI2_CLIENT, GstObject); - -GstWasapi2Client * gst_wasapi2_client_new (GstWasapi2ClientDeviceClass device_class, - gint device_index, - const gchar * device_id, - guint target_pid, - gpointer dispatcher); - -gboolean gst_wasapi2_client_ensure_activation (GstWasapi2Client * client); - -IAudioClient * gst_wasapi2_client_get_handle (GstWasapi2Client * client); - -gboolean gst_wasapi2_client_is_endpoint_muted (GstWasapi2Client * client); - -GstCaps * gst_wasapi2_client_get_caps (GstWasapi2Client * client); - -GstWasapi2Result gst_wasapi2_client_enumerate (GstWasapi2ClientDeviceClass device_class, - gint device_index, - GstWasapi2Client ** client); - -G_END_DECLS - -#endif /* __GST_WASAPI2_CLIENT_H__ */
View file
_service:download_url:gst-plugins-bad-1.26.4.tar.xz/sys/wasapi2/gstwasapi2device.c
Deleted
@@ -1,601 +0,0 @@ -/* GStreamer - * Copyright (C) 2018 Nirbheek Chauhan <nirbheek@centricular.com> - * Copyright (C) 2020 Seungha Yang <seungha@centricular.com> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "gstwasapi2device.h" -#include "gstwasapi2client.h" -#include "gstwasapi2util.h" -#include <gst/winrt/gstwinrt.h> - -GST_DEBUG_CATEGORY_EXTERN (gst_wasapi2_debug); -#define GST_CAT_DEFAULT gst_wasapi2_debug - -enum -{ - PROP_0, - PROP_DEVICE, -}; - -struct _GstWasapi2Device -{ - GstDevice parent; - - gchar *device_id; - const gchar *factory_name; - GstWasapi2ClientDeviceClass device_class; -}; - -G_DEFINE_TYPE (GstWasapi2Device, gst_wasapi2_device, GST_TYPE_DEVICE); - -static void gst_wasapi2_device_get_property (GObject * object, - guint prop_id, GValue * value, GParamSpec * pspec); -static void gst_wasapi2_device_set_property (GObject * object, - guint prop_id, const GValue * value, GParamSpec * pspec); -static void gst_wasapi2_device_finalize (GObject * object); -static GstElement *gst_wasapi2_device_create_element (GstDevice * device, - const gchar * name); - -static void -gst_wasapi2_device_class_init (GstWasapi2DeviceClass * klass) -{ - GObjectClass *gobject_class = G_OBJECT_CLASS (klass); - GstDeviceClass *dev_class = GST_DEVICE_CLASS (klass); - - dev_class->create_element = gst_wasapi2_device_create_element; - - gobject_class->get_property = gst_wasapi2_device_get_property; - gobject_class->set_property = gst_wasapi2_device_set_property; - gobject_class->finalize = gst_wasapi2_device_finalize; - - g_object_class_install_property (gobject_class, PROP_DEVICE, - g_param_spec_string ("device", "Device", - "Audio device ID as provided by " - "Windows.Devices.Enumeration.DeviceInformation.Id", NULL, - G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)); -} - -static void -gst_wasapi2_device_init (GstWasapi2Device * self) -{ -} - -static void -gst_wasapi2_device_finalize (GObject * object) -{ - GstWasapi2Device *self = GST_WASAPI2_DEVICE (object); - - g_free (self->device_id); - - G_OBJECT_CLASS (gst_wasapi2_device_parent_class)->finalize (object); -} - -static GstElement * -gst_wasapi2_device_create_element (GstDevice * device, const gchar * name) -{ - GstWasapi2Device *self = GST_WASAPI2_DEVICE (device); - GstElement *elem; - - elem = gst_element_factory_make (self->factory_name, name); - - g_object_set (elem, "device", self->device_id, NULL); - - if (self->device_class == GST_WASAPI2_CLIENT_DEVICE_CLASS_LOOPBACK_CAPTURE) - g_object_set (elem, "loopback", TRUE, NULL); - - return elem; -} - -static void -gst_wasapi2_device_get_property (GObject * object, guint prop_id, - GValue * value, GParamSpec * pspec) -{ - GstWasapi2Device *self = GST_WASAPI2_DEVICE (object); - - switch (prop_id) { - case PROP_DEVICE: - g_value_set_string (value, self->device_id); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - -static void -gst_wasapi2_device_set_property (GObject * object, guint prop_id, - const GValue * value, GParamSpec * pspec) -{ - GstWasapi2Device *self = GST_WASAPI2_DEVICE (object); - - switch (prop_id) { - case PROP_DEVICE: - /* G_PARAM_CONSTRUCT_ONLY */ - self->device_id = g_value_dup_string (value); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - -typedef struct _GstWasapi2DeviceProvider -{ - GstDeviceProvider parent; - - GstWinRTDeviceWatcher *watcher; - - GMutex lock; - GCond cond; - - gboolean enum_completed; -} GstWasapi2DeviceProvider; - -typedef struct _GstWasapi2DeviceProviderClass -{ - GstDeviceProviderClass parent_class; - - GstWinRTDeviceClass winrt_device_class; -} GstWasapi2DeviceProviderClass; - -static GstDeviceProviderClass *parent_class = NULL; - -#define GST_WASAPI2_DEVICE_PROVIDER(object) \ - ((GstWasapi2DeviceProvider *) (object)) -#define GST_WASAPI2_DEVICE_PROVIDER_GET_CLASS(object) \ - (G_TYPE_INSTANCE_GET_CLASS ((object),G_TYPE_FROM_INSTANCE (object),GstWasapi2DeviceProviderClass)) - -static void gst_wasapi2_device_provider_dispose (GObject * object); -static void gst_wasapi2_device_provider_finalize (GObject * object); - -static GList *gst_wasapi2_device_provider_probe (GstDeviceProvider * provider); -static gboolean -gst_wasapi2_device_provider_start (GstDeviceProvider * provider); -static void gst_wasapi2_device_provider_stop (GstDeviceProvider * provider); - -static void -gst_wasapi2_device_provider_device_added (GstWinRTDeviceWatcher * watcher, - __x_ABI_CWindows_CDevices_CEnumeration_CIDeviceInformation * info, - gpointer user_data); -static void -gst_wasapi2_device_provider_device_updated (GstWinRTDeviceWatcher * watcher, - __x_ABI_CWindows_CDevices_CEnumeration_CIDeviceInformationUpdate * - info_update, gpointer user_data); -static void gst_wasapi2_device_provider_device_removed (GstWinRTDeviceWatcher * - watcher, - __x_ABI_CWindows_CDevices_CEnumeration_CIDeviceInformationUpdate * - info_update, gpointer user_data); -static void -gst_wasapi2_device_provider_device_enum_completed (GstWinRTDeviceWatcher * - watcher, gpointer user_data); - -static void -gst_wasapi2_device_provider_class_init (GstWasapi2DeviceProviderClass * klass, - gpointer data) -{ - GObjectClass *gobject_class = G_OBJECT_CLASS (klass); - GstDeviceProviderClass *provider_class = GST_DEVICE_PROVIDER_CLASS (klass); - - gobject_class->dispose = gst_wasapi2_device_provider_dispose; - gobject_class->finalize = gst_wasapi2_device_provider_finalize;
View file
_service:download_url:gst-plugins-bad-1.26.4.tar.xz/sys/wasapi2/gstwasapi2util.c
Deleted
@@ -1,564 +0,0 @@ -/* - * Copyright (C) 2008 Ole André Vadla Ravnås <ole.andre.ravnas@tandberg.com> - * Copyright (C) 2018 Centricular Ltd. - * Author: Nirbheek Chauhan <nirbheek@centricular.com> - * Copyright (C) 2020 Seungha Yang <seungha@centricular.com> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include "gstwasapi2util.h" -#include <audioclient.h> -#include <mmdeviceapi.h> -#include <winternl.h> - -GST_DEBUG_CATEGORY_EXTERN (gst_wasapi2_debug); -#define GST_CAT_DEFAULT gst_wasapi2_debug - -/* Desktop only defines */ -#ifndef KSAUDIO_SPEAKER_MONO -#define KSAUDIO_SPEAKER_MONO (SPEAKER_FRONT_CENTER) -#endif -#ifndef KSAUDIO_SPEAKER_1POINT1 -#define KSAUDIO_SPEAKER_1POINT1 (SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY) -#endif -#ifndef KSAUDIO_SPEAKER_STEREO -#define KSAUDIO_SPEAKER_STEREO (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT) -#endif -#ifndef KSAUDIO_SPEAKER_2POINT1 -#define KSAUDIO_SPEAKER_2POINT1 (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_LOW_FREQUENCY) -#endif -#ifndef KSAUDIO_SPEAKER_3POINT0 -#define KSAUDIO_SPEAKER_3POINT0 (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER) -#endif -#ifndef KSAUDIO_SPEAKER_3POINT1 -#define KSAUDIO_SPEAKER_3POINT1 (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | \ - SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY) -#endif -#ifndef KSAUDIO_SPEAKER_QUAD -#define KSAUDIO_SPEAKER_QUAD (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | \ - SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT) -#endif -#define KSAUDIO_SPEAKER_SURROUND (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | \ - SPEAKER_FRONT_CENTER | SPEAKER_BACK_CENTER) -#ifndef KSAUDIO_SPEAKER_5POINT0 -#define KSAUDIO_SPEAKER_5POINT0 (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | \ - SPEAKER_SIDE_LEFT | SPEAKER_SIDE_RIGHT) -#endif -#define KSAUDIO_SPEAKER_5POINT1 (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | \ - SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | \ - SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT) -#ifndef KSAUDIO_SPEAKER_7POINT0 -#define KSAUDIO_SPEAKER_7POINT0 (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | \ - SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT | \ - SPEAKER_SIDE_LEFT | SPEAKER_SIDE_RIGHT) -#endif -#ifndef KSAUDIO_SPEAKER_7POINT1 -#define KSAUDIO_SPEAKER_7POINT1 (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | \ - SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | \ - SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT | \ - SPEAKER_FRONT_LEFT_OF_CENTER | SPEAKER_FRONT_RIGHT_OF_CENTER) -#endif - -/* *INDENT-OFF* */ -static struct -{ - guint64 wasapi_pos; - GstAudioChannelPosition gst_pos; -} wasapi_to_gst_pos = { - {SPEAKER_FRONT_LEFT, GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT}, - {SPEAKER_FRONT_RIGHT, GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT}, - {SPEAKER_FRONT_CENTER, GST_AUDIO_CHANNEL_POSITION_FRONT_CENTER}, - {SPEAKER_LOW_FREQUENCY, GST_AUDIO_CHANNEL_POSITION_LFE1}, - {SPEAKER_BACK_LEFT, GST_AUDIO_CHANNEL_POSITION_REAR_LEFT}, - {SPEAKER_BACK_RIGHT, GST_AUDIO_CHANNEL_POSITION_REAR_RIGHT}, - {SPEAKER_FRONT_LEFT_OF_CENTER, - GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT_OF_CENTER}, - {SPEAKER_FRONT_RIGHT_OF_CENTER, - GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT_OF_CENTER}, - {SPEAKER_BACK_CENTER, GST_AUDIO_CHANNEL_POSITION_REAR_CENTER}, - /* Enum values diverge from this point onwards */ - {SPEAKER_SIDE_LEFT, GST_AUDIO_CHANNEL_POSITION_SIDE_LEFT}, - {SPEAKER_SIDE_RIGHT, GST_AUDIO_CHANNEL_POSITION_SIDE_RIGHT}, - {SPEAKER_TOP_CENTER, GST_AUDIO_CHANNEL_POSITION_TOP_CENTER}, - {SPEAKER_TOP_FRONT_LEFT, GST_AUDIO_CHANNEL_POSITION_TOP_FRONT_LEFT}, - {SPEAKER_TOP_FRONT_CENTER, GST_AUDIO_CHANNEL_POSITION_TOP_FRONT_CENTER}, - {SPEAKER_TOP_FRONT_RIGHT, GST_AUDIO_CHANNEL_POSITION_TOP_FRONT_RIGHT}, - {SPEAKER_TOP_BACK_LEFT, GST_AUDIO_CHANNEL_POSITION_TOP_REAR_LEFT}, - {SPEAKER_TOP_BACK_CENTER, GST_AUDIO_CHANNEL_POSITION_TOP_REAR_CENTER}, - {SPEAKER_TOP_BACK_RIGHT, GST_AUDIO_CHANNEL_POSITION_TOP_REAR_RIGHT} -}; - -static DWORD default_ch_masks = { - 0, - KSAUDIO_SPEAKER_MONO, - /* 2ch */ - KSAUDIO_SPEAKER_STEREO, - /* 2.1ch */ - /* KSAUDIO_SPEAKER_3POINT0 ? */ - KSAUDIO_SPEAKER_2POINT1, - /* 4ch */ - /* KSAUDIO_SPEAKER_3POINT1 or KSAUDIO_SPEAKER_SURROUND ? */ - KSAUDIO_SPEAKER_QUAD, - /* 5ch */ - KSAUDIO_SPEAKER_5POINT0, - /* 5.1ch */ - KSAUDIO_SPEAKER_5POINT1, - /* 7ch */ - KSAUDIO_SPEAKER_7POINT0, - /* 7.1ch */ - KSAUDIO_SPEAKER_7POINT1, -}; -/* *INDENT-ON* */ - -static const gchar * -hresult_to_string_fallback (HRESULT hr) -{ - const gchar *s = "unknown error"; - - switch (hr) { - case AUDCLNT_E_NOT_INITIALIZED: - s = "AUDCLNT_E_NOT_INITIALIZED"; - break; - case AUDCLNT_E_ALREADY_INITIALIZED: - s = "AUDCLNT_E_ALREADY_INITIALIZED"; - break; - case AUDCLNT_E_WRONG_ENDPOINT_TYPE: - s = "AUDCLNT_E_WRONG_ENDPOINT_TYPE"; - break; - case AUDCLNT_E_DEVICE_INVALIDATED: - s = "AUDCLNT_E_DEVICE_INVALIDATED"; - break; - case AUDCLNT_E_NOT_STOPPED: - s = "AUDCLNT_E_NOT_STOPPED"; - break; - case AUDCLNT_E_BUFFER_TOO_LARGE: - s = "AUDCLNT_E_BUFFER_TOO_LARGE"; - break; - case AUDCLNT_E_OUT_OF_ORDER: - s = "AUDCLNT_E_OUT_OF_ORDER"; - break; - case AUDCLNT_E_UNSUPPORTED_FORMAT: - s = "AUDCLNT_E_UNSUPPORTED_FORMAT"; - break; - case AUDCLNT_E_INVALID_DEVICE_PERIOD: - s = "AUDCLNT_E_INVALID_DEVICE_PERIOD"; - break; - case AUDCLNT_E_INVALID_SIZE: - s = "AUDCLNT_E_INVALID_SIZE"; - break; - case AUDCLNT_E_DEVICE_IN_USE: - s = "AUDCLNT_E_DEVICE_IN_USE"; - break; - case AUDCLNT_E_BUFFER_OPERATION_PENDING: - s = "AUDCLNT_E_BUFFER_OPERATION_PENDING"; - break; - case AUDCLNT_E_BUFFER_SIZE_ERROR: - s = "AUDCLNT_E_BUFFER_SIZE_ERROR"; - break; - case AUDCLNT_E_BUFFER_SIZE_NOT_ALIGNED: - s = "AUDCLNT_E_BUFFER_SIZE_NOT_ALIGNED"; - break; - case AUDCLNT_E_THREAD_NOT_REGISTERED: - s = "AUDCLNT_E_THREAD_NOT_REGISTERED"; - break; - case AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED: - s = "AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED"; - break; - case AUDCLNT_E_ENDPOINT_CREATE_FAILED: - s = "AUDCLNT_E_ENDPOINT_CREATE_FAILED"; - break; - case AUDCLNT_E_SERVICE_NOT_RUNNING: - s = "AUDCLNT_E_SERVICE_NOT_RUNNING"; - break; - case AUDCLNT_E_EVENTHANDLE_NOT_EXPECTED: - s = "AUDCLNT_E_EVENTHANDLE_NOT_EXPECTED"; - break; - case AUDCLNT_E_EXCLUSIVE_MODE_ONLY: - s = "AUDCLNT_E_EXCLUSIVE_MODE_ONLY"; - break; - case AUDCLNT_E_BUFDURATION_PERIOD_NOT_EQUAL: - s = "AUDCLNT_E_BUFDURATION_PERIOD_NOT_EQUAL"; - break; - case AUDCLNT_E_EVENTHANDLE_NOT_SET:
View file
_service:download_url:gst-plugins-bad-1.26.4.tar.xz/sys/wasapi2/plugin.c
Deleted
@@ -1,79 +0,0 @@ -/* GStreamer - * Copyright (C) 2020 Seungha Yang <seungha@centricular.com> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <winapifamily.h> - -#include "gstwasapi2sink.h" -#include "gstwasapi2src.h" -#include "gstwasapi2device.h" -#include "gstwasapi2util.h" -#include <mfapi.h> - -GST_DEBUG_CATEGORY (gst_wasapi2_debug); -GST_DEBUG_CATEGORY (gst_wasapi2_client_debug); - -static void -plugin_deinit (gpointer data) -{ - MFShutdown (); -} - -static gboolean -plugin_init (GstPlugin * plugin) -{ - GstRank rank = GST_RANK_PRIMARY + 1; - HRESULT hr; - - /** - * plugin-wasapi2: - * - * Since: 1.18 - */ - - hr = MFStartup (MF_VERSION, MFSTARTUP_NOSOCKET); - if (!gst_wasapi2_result (hr)) { - GST_WARNING ("MFStartup failure, hr: 0x%x", hr); - return TRUE; - } - - GST_DEBUG_CATEGORY_INIT (gst_wasapi2_debug, "wasapi2", 0, "wasapi2"); - GST_DEBUG_CATEGORY_INIT (gst_wasapi2_client_debug, "wasapi2client", - 0, "wasapi2client"); - - gst_element_register (plugin, "wasapi2sink", rank, GST_TYPE_WASAPI2_SINK); - gst_element_register (plugin, "wasapi2src", rank, GST_TYPE_WASAPI2_SRC); - - gst_wasapi2_device_provider_register (plugin, rank); - - g_object_set_data_full (G_OBJECT (plugin), - "plugin-wasapi2-shutdown", "shutdown-data", - (GDestroyNotify) plugin_deinit); - - return TRUE; -} - -GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, - GST_VERSION_MINOR, - wasapi2, - "Windows audio session API plugin", - plugin_init, VERSION, "LGPL", GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)
View file
_service:download_url:gst-plugins-bad-1.26.4.tar.xz/ChangeLog -> _service:download_url:gst-plugins-bad-1.26.5.tar.xz/ChangeLog
Changed
@@ -1,3 +1,238 @@ +=== release 1.26.5 === + +2025-08-07 19:06:46 +0100 Tim-Philipp Müller <tim@centricular.com> + + * NEWS: + * RELEASE: + * gst-plugins-bad.doap: + * meson.build: + Release 1.26.5 + +2025-08-07 13:58:27 +0300 Sebastian Dröge <sebastian@centricular.com> + + * gst-libs/gst/codecparsers/gstav1parser.c: + av1parser: Don't error out on "currently" undefined seq-level indices + They might very well be defined in the future and that shouldn't affect the + parsing in any way. Specifically, ffmpeg with `av1_nvenc` seems to create + `GST_AV1_SEQ_LEVEL_7_3` currently and parsing such streams would fail otherwise. + Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/4589 + Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9504> + +2025-08-01 14:55:12 +0200 Víctor Manuel Jáquez Leal <vjaquez@igalia.com> + + * gst-libs/gst/vulkan/gstvkphysicaldevice-private.h: + * gst-libs/gst/vulkan/gstvkphysicaldevice.c: + vkphysicaldevice: enable sampler ycbcr, sync2 and timeline semaphore features + For the features VkPhysicalDeviceSamplerYcbcrConversionFeaturesKHR, + VkPhysicalDeviceSynchronization2Features and + VkPhisicalDeviceTimelineSemaphoreFeatures + The Vulkan specification states: + If the `VkPhysicalDeviceXXXFeatures` structure is included in the `pNext` + chain of the `VkPhysicalDeviceFeatures2` structure passed to + `vkGetPhysicalDeviceFeatures2`, it is filled in to indicate whether each + corresponding feature is supported. If the application wishes to use a + `VkDevice` with any features described by `VkPhysicalDeviceXXXFeatures`, + it **must** add an instance of the structure, with the desired feature members + set to `VK_TRUE`, to the `pNext` chain of `VkDeviceCreateInfo` when creating + the `VkDevice`. + And that was missing in the code. + Strangely, that functionality doesn't have a Valid-Usage ID assigned, so it + isn't caught by the validation layer. + This patch adds the structures in the physical devices to get them and later set + them in the device creation. + In order to link these features, videomaintenance1, and others to come, without + knowing if Vulkan 1.3 features are chained in the device properties structure, a + static and inlined function was added in gstvkphysicaldevice-private.h. It was + added in a header file to avoid compiler warnings if it's not used because of + old Vulkan headers. + Also the value dump videomaintenance1 was moved to another function to pack + there all these queried features. + Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9489> + +2025-08-01 11:52:17 +0200 Víctor Manuel Jáquez Leal <vjaquez@igalia.com> + + * sys/va/gstvaav1enc.c: + * sys/va/gstvah264enc.c: + * sys/va/gstvah265enc.c: + * sys/va/gstvavp8enc.c: + * sys/va/gstvavp9enc.c: + vaXXXenc: fix potential race condition + VA encoders, at reconfiguration, have to check if the rate-control was changed + by the user, but since user parameters setting are in another thread, the + comparison was racy. + This patch locks the object to compare the current rate-control with the one set + by the user. + Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9484> + +2025-05-29 13:20:59 +0200 Víctor Manuel Jáquez Leal <vjaquez@igalia.com> + + * gst-libs/gst/vulkan/gstvkdevice.c: + vulkan: ycbcr conversion extension got promoted in 1.1.0 + Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9482> + +2025-08-01 01:03:10 +0900 Seungha Yang <seungha@centricular.com> + + * sys/d3d12/gstd3d12screencapturedevice.cpp: + d3d12screencapturedevice: Avoid false device removal on monitor reconfiguration + Post device-changed instead of device-removed/device-added when + only HMONITOR or display position changed without actual device change. + Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9481> + +2025-07-30 15:50:56 +0400 Marc-André Lureau <marcandre.lureau@redhat.com> + + * gst-libs/gst/d3d12/meson.build: + * sys/d3d12/meson.build: + meson: d3d12: Add support for MinGW DirectXMath package + This is a similar issue that was found for d3d11: + https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6495 + Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9473> + +2025-07-29 11:42:54 +0100 Philippe Normand <philn@igalia.com> + + * sys/va/gstvavp9dec.c: + vavp9dec: Always chain to parent class negotiate vmethod + When the base videodecoder class re-attempts a negotiation after flush, the + vabasedec `need_negotiation` flag isn't necessarily set to TRUE, because in that + situation the input state hasn't changed. + By always chaining up we are sure that buffer pool negotiation will always be + attempted. + Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9461> + +2025-07-29 11:42:44 +0100 Philippe Normand <philn@igalia.com> + + * sys/va/gstvajpegdec.c: + vajpegdec: Always chain to parent class negotiate vmethod + When the base videodecoder class re-attempts a negotiation after flush, the + vabasedec `need_negotiation` flag isn't necessarily set to TRUE, because in that + situation the input state hasn't changed. + By always chaining up we are sure that buffer pool negotiation will always be + attempted. + Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9461> + +2025-07-29 11:42:33 +0100 Philippe Normand <philn@igalia.com> + + * sys/va/gstvaav1dec.c: + vaav1dec: Always chain to parent class negotiate vmethod + When the base videodecoder class re-attempts a negotiation after flush, the + vabasedec `need_negotiation` flag isn't necessarily set to TRUE, because in that + situation the input state hasn't changed. + By always chaining up we are sure that buffer pool negotiation will always be + attempted. + Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9461> + +2025-07-28 12:52:22 +0100 Philippe Normand <philn@igalia.com> + + * sys/va/gstvabasedec.c: + vabasedec: Instrument negotiate function with debug statements + Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9461> + +2025-07-28 12:49:36 +0100 Philippe Normand <philn@igalia.com> + + * sys/va/gstvabasedec.c: + vabasedec: Always chain to parent class negotiate vmethod + When the base videodecoder class re-attempts a negotiation after flush, the + vabasedec `need_negotiation` flag isn't necessarily set to TRUE, because in that + situation the input state hasn't changed. + By always chaining up we are sure that buffer pool negotiation will always be + attempted. + Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9461> + +2025-07-28 12:45:25 +0100 Philippe Normand <philn@igalia.com> + + * sys/va/gstvah264dec.c: + vah264dec: Spelling fix in warning debug statement + Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9461> + +2025-07-28 12:44:48 +0100 Philippe Normand <philn@igalia.com> + + * gst-libs/gst/codecs/gsth264decoder.c: + h264decoder: Spelling fix in warning debug statement + Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9461> + +2025-07-24 18:16:51 +0200 Víctor Manuel Jáquez Leal <vjaquez@igalia.com> + + * sys/va/gstvaav1enc.c: + * sys/va/gstvah264enc.c: + * sys/va/gstvah265enc.c: + * sys/va/gstvajpegenc.c: + * sys/va/gstvavp8enc.c: + * sys/va/gstvavp9enc.c: + vaXXXenc: calculate latency with corrected framerate + Fixes: #4558 + Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9447> + +2025-06-29 22:52:37 +0900 Seungha Yang <seungha@centricular.com> + + * sys/wasapi2/gstwasapi2ringbuffer.cpp: + wasapi2: Fix various MinGW build warnings + Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9428> + +2025-06-29 20:45:51 +0900 Seungha Yang <seungha@centricular.com> + + * sys/wasapi2/AsyncOperations.h: + * sys/wasapi2/gstwasapi2client.cpp: + * sys/wasapi2/gstwasapi2client.h: + * sys/wasapi2/gstwasapi2util.cpp: + * sys/wasapi2/meson.build: + waapi2: Remove unused WinRT deps and implementations + Removing unused WinRT API based implementations + Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9428> + +2025-06-29 01:46:44 +0900 Seungha Yang <seungha@centricular.com> + + * sys/wasapi2/gstwasapi2object.cpp: + * sys/wasapi2/gstwasapi2object.h: + * sys/wasapi2/gstwasapi2ringbuffer.cpp: + * sys/wasapi2/gstwasapi2ringbuffer.h: + * sys/wasapi2/gstwasapi2sink.c: + * sys/wasapi2/gstwasapi2src.c: + * sys/wasapi2/meson.build: + wasapi2: Port to IMMDevice based device selection + Because of a couple of issues reported related to WinRT device + enumeration, porting to IMMDevice device id based device selection. + Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/4311 + Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3936 + Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9428> + +2025-06-27 21:36:53 +0900 Seungha Yang <seungha@centricular.com> + + * sys/wasapi2/gstwasapi2activator.cpp:
View file
_service:download_url:gst-plugins-bad-1.26.4.tar.xz/NEWS -> _service:download_url:gst-plugins-bad-1.26.5.tar.xz/NEWS
Changed
@@ -2,11 +2,11 @@ GStreamer 1.26.0 was originally released on 11 March 2025. -The latest bug-fix release in the stable 1.26 series is 1.26.4 and was released on 16 July 2025. +The latest bug-fix release in the stable 1.26 series is 1.26.5 and was released on 07 August 2025. See https://gstreamer.freedesktop.org/releases/1.26/ for the latest version of this document. -Last updated: Wednesday 16 July 2025, 15:00 UTC (log) +Last updated: Thursday 07 August 2025, 18:00 UTC (log) ## Introduction @@ -2189,6 +2189,169 @@ - List of Merge Requests applied in 1.26.4 - List of Issues fixed in 1.26.4 +1.26.5 + +The fifth 1.26 bug-fix release (1.26.5) was released on 7 August 2025. + +This release only contains bugfixes including some important playback fixes, and it should be safe to update from 1.26.x. + +Highlighted bugfixes in 1.26.5 + +- audioconvert: Fix caps negotiation regression when using a mix matrix +- aws: Add support for brevity in awstranslate and add option to partition speakers in the transcription output of + awstranscriber2 +- speechmatics speech-to-text: Expose mask-profanities property +- cea708mux: Add support for discarding select services on each input +- cea608overlay, cea708overlay: Accept GPU memory buffers if downstream supports the overlay composition meta +- d3d12screencapture source element and device provider fixes +- decodebin3: Don’t error on an incoming ONVIF metadata stream +- uridecodebin3: Fix potential crash when adding URIs to messages, e.g. if no decoder is available +- v4l2: Fix memory leak for dynamic resolution change +- VA encoder fixes +- videorate, imagefreeze: Add support for JPEG XS +- Vulkan integration fixes +- wasapi2 audio device monitor improvements +- webrtc: Add WHEP client signaller and add whepclientsrc element on top of webrtcsrc using that +- threadshare: Many improvements and fixes to the generic threadshare and RTP threadshare elements +- rtpbin2 improvements and fixes +- gst-device-monitor-1.0 command line tool improvements +- Various bug fixes, build fixes, memory leak fixes, and other stability and reliability improvements + +gstreamer + +- aggregator: add sub_latency_min to pad queue size +- build: Disable C5287 warning on MSVC + +gst-plugins-base + +- audioconvert: Fix regression when using a mix matrix +- audioconvert: mix-matrix causes caps negotiation failure +- decodebin3: Don’t error on an incoming ONVIF metadata stream +- gloverlay: Recompute geometry when caps change, and load texture after stopping and starting again +- uridecodebin3: Add missing locking and NULL checks when adding URIs to messages +- uridecodebin3: segfault in update_message_with_uri() if no decoder available +- videorate, imagefreeze: add support for JPEG XS +- gst-device-monitor-1.0: Add shell quoting for launch lines +- gst-device-monitor-1.0: Fix criticals, and also accept utf8 in launch lines +- gst-device-monitor-1.0: Use gst_print instead of g_print + +gst-plugins-good + +- v4l2: fix memory leak for dynamic resolution change +- videorate, imagefreeze: add support for JPEG XS + +gst-plugins-bad + +- av1parse: Don’t error out on “currently” undefined seq-level indices +- av1parse: fails to parse AV1 bitstreams generated by FFmpeg using the av1_nvenc hardware encoder +- d3d12screencapturedevice: Avoid false device removal on monitor reconfiguration +- d3d12screencapturesrc: Fix OS handle leaks/random crash in WGC mode +- meson: d3d12: Add support for MinGW DirectXMath package +- va: Re-negotiate after FLUSH +- vaXXXenc: calculate latency with corrected framerate +- vaXXXenc: fix potential race condition +- vkphysicaldevice: enable sampler ycbcr conversion, synchronization2 and timeline semaphore features +- vulkan: ycbcr conversion extension got promoted in 1.1.0 +- wasapi2: Port to IMMDevice based device selection + +gst-plugins-ugly + +- No changes + +GStreamer Rust plugins + +- awstranscriber2,awstranslate: Handle multiple stream-start event +- awstranslate: expose property for turning brevity on +- awstranscriber2: add property for setting show_speaker_labels +- cea708mux: expose “discarded-services” property on sink pads +- ceaX08overlay: support ANY caps features, allowing e.g. memory:GLMemory if downstream supports the overlay composition meta +- hlsmultivariantsink: Fix master playlist version +- rtprecv: Drop state lock before chaining RTCP packets from the RTP chain function +- rtpbin2: Add examples +- rtpmp4apay2: fix payload size prefix +- rtp: threadshare: fix some property ranges +- mpegtslivesrc: Remove leftover debug message +- speechmatics: expose mask-profanities property +- ts-audiotestsrc fixes +- threadshare: fix flush for ts-queue ts-proxy & ts-intersrc +- threadshare: fix regression in ts-proxysrc +- threadshare: improvements to some elements +- threadshare: udp: avoid getifaddrs in android +- threadshare: Enable windows Win32_Networking feature +- threadshare: queue & proxy: fix race condition stopping +- threadshare: Also enable windows Win32_Networking_WinSock feature +- tracers: pipeline-snapshot: reduce WebSocket connection log level +- tracers: queue-levels: add support for threadshare DataQueue related elements +- tracers: Update to etherparse 0.19 +- transcriberbin: Fix handling of upstream latency query +- webrtc: android example: fix media handling initialization sequence +- webrtcsink: Move videorate before videoconvert and videoscale to avoid processing frames that would be dropped +- whep: add WHEP client signaller +- Fix various new clippy 1.89 warnings + +gst-libav + +- No changes + +gst-rtsp-server + +- No changes + +gstreamer-vaapi + +- No changes + +gstreamer-sharp + +- No changes + +gst-python + +- No changes + +gst-editing-services + +- No changes + +gst-devtools, gst-validate + gst-integration-testsuites + +- No changes + +gst-examples + +- No changes + +gstreamer-docs + +- No changes + +Development build environment + +- gst-env: only-environment: only dump added and updated vars +- gst-full: Fix detection of duplicate plugin entries +- ci: Fix gst-full breakage due to a typo +- build: Disable C5287 warning on MSVC + +Cerbero build tool and packaging changes in 1.26.5 + +- a52dec: update to 0.8.0 and port to Meson +- build: Fix passing multiple steps +- expat: update to 2.7.1 +- tar: Refactor in preparation for xcframework support + +Contributors to 1.26.5 + +François Laignel, Jan Schmidt, Jaslo Ziska, L. E. Segovia, Marc-André Lureau, Mathieu Duponchelle, Matthew Waters, Nirbheek +Chauhan, Philippe Normand, Qian Hu (胡骞), Sanchayan Maity, Sebastian Dröge, Seungha Yang, Thibault Saunier, Tim-Philipp Müller, +Víctor Manuel Jáquez Leal, Xavier Claessens, + +… and many others who have contributed bug reports, translations, sent suggestions or helped testing. Thank you all! + +List of merge requests and issues fixed in 1.26.5 + +- List of Merge Requests applied in 1.26.5 +- List of Issues fixed in 1.26.5 + Schedule for 1.28 Our next major feature release will be 1.28, and 1.27 will be the unstable development version leading up to the stable 1.28
View file
_service:download_url:gst-plugins-bad-1.26.4.tar.xz/RELEASE -> _service:download_url:gst-plugins-bad-1.26.5.tar.xz/RELEASE
Changed
@@ -1,4 +1,4 @@ -This is GStreamer gst-plugins-bad 1.26.4. +This is GStreamer gst-plugins-bad 1.26.5. The GStreamer team is thrilled to announce a new major feature release of your favourite cross-platform multimedia framework!
View file
_service:download_url:gst-plugins-bad-1.26.4.tar.xz/gst-libs/gst/codecparsers/gstav1parser.c -> _service:download_url:gst-plugins-bad-1.26.5.tar.xz/gst-libs/gst/codecparsers/gstav1parser.c
Changed
@@ -486,18 +486,7 @@ av1_seq_level_idx_is_valid (GstAV1SeqLevels seq_level_idx) { return seq_level_idx == GST_AV1_SEQ_LEVEL_MAX - || (seq_level_idx < GST_AV1_SEQ_LEVELS - /* The following levels are currently undefined. */ - && seq_level_idx != GST_AV1_SEQ_LEVEL_2_2 - && seq_level_idx != GST_AV1_SEQ_LEVEL_2_3 - && seq_level_idx != GST_AV1_SEQ_LEVEL_3_2 - && seq_level_idx != GST_AV1_SEQ_LEVEL_3_3 - && seq_level_idx != GST_AV1_SEQ_LEVEL_4_2 - && seq_level_idx != GST_AV1_SEQ_LEVEL_4_3 - && seq_level_idx != GST_AV1_SEQ_LEVEL_7_0 - && seq_level_idx != GST_AV1_SEQ_LEVEL_7_1 - && seq_level_idx != GST_AV1_SEQ_LEVEL_7_2 - && seq_level_idx != GST_AV1_SEQ_LEVEL_7_3); + || seq_level_idx < GST_AV1_SEQ_LEVELS; } static void
View file
_service:download_url:gst-plugins-bad-1.26.4.tar.xz/gst-libs/gst/codecs/gsth264decoder.c -> _service:download_url:gst-plugins-bad-1.26.5.tar.xz/gst-libs/gst/codecs/gsth264decoder.c
Changed
@@ -1323,7 +1323,8 @@ ret = klass->new_picture (self, priv->current_frame, picture); if (ret != GST_FLOW_OK) { - GST_WARNING_OBJECT (self, "subclass does not want accept new picture"); + GST_WARNING_OBJECT (self, + "subclass does not want to accept new picture"); priv->current_picture = NULL; gst_h264_picture_unref (picture); return ret;
View file
_service:download_url:gst-plugins-bad-1.26.4.tar.xz/gst-libs/gst/d3d12/meson.build -> _service:download_url:gst-plugins-bad-1.26.5.tar.xz/gst-libs/gst/d3d12/meson.build
Changed
@@ -122,7 +122,7 @@ name: 'DirectXMath support in Windows SDK') if not have_dx_math - directxmath_dep = dependency('directxmath', + directxmath_dep = dependency('DirectXMath', 'directxmath', allow_fallback: true, required: d3d12_option) if not directxmath_dep.found()
View file
_service:download_url:gst-plugins-bad-1.26.4.tar.xz/gst-libs/gst/vulkan/gstvkdevice.c -> _service:download_url:gst-plugins-bad-1.26.5.tar.xz/gst-libs/gst/vulkan/gstvkdevice.c
Changed
@@ -241,7 +241,7 @@ OPTIONAL_EXTENSION_VERSION (VK_KHR_SWAPCHAIN_EXTENSION_NAME, VK_MAKE_VERSION (1, 0, 0), NEVER_VK_VERSION), OPTIONAL_EXTENSION_VERSION (VK_KHR_SAMPLER_YCBCR_CONVERSION_EXTENSION_NAME, - VK_MAKE_VERSION (1, 0, 0), NEVER_VK_VERSION), + VK_MAKE_VERSION (1, 0, 0), VK_MAKE_VERSION (1, 1, 0)), #if defined(VK_KHR_timeline_semaphore) OPTIONAL_EXTENSION_VERSION (VK_KHR_TIMELINE_SEMAPHORE_EXTENSION_NAME, VK_MAKE_VERSION (1, 1, 0), VK_MAKE_VERSION (1, 2, 0)),
View file
_service:download_url:gst-plugins-bad-1.26.4.tar.xz/gst-libs/gst/vulkan/gstvkphysicaldevice-private.h -> _service:download_url:gst-plugins-bad-1.26.5.tar.xz/gst-libs/gst/vulkan/gstvkphysicaldevice-private.h
Changed
@@ -28,6 +28,17 @@ const VkPhysicalDeviceFeatures2 * gst_vulkan_physical_device_get_features (GstVulkanPhysicalDevice * device); +static inline void +vk_link_struct (gpointer chain, gconstpointer in) +{ + VkBaseOutStructure *out = chain; + + while (out->pNext) + out = out->pNext; + + out->pNext = (void *) in; +} + G_END_DECLS #endif /* __GST_VULKAN_PHYSICAL_DEVICE_PRIVATE_H__ */
View file
_service:download_url:gst-plugins-bad-1.26.4.tar.xz/gst-libs/gst/vulkan/gstvkphysicaldevice.c -> _service:download_url:gst-plugins-bad-1.26.5.tar.xz/gst-libs/gst/vulkan/gstvkphysicaldevice.c
Changed
@@ -70,10 +70,19 @@ #if defined (VK_API_VERSION_1_3) VkPhysicalDeviceVulkan13Features features13; VkPhysicalDeviceVulkan13Properties properties13; +#endif +#if defined (VK_KHR_sampler_ycbcr_conversion) + VkPhysicalDeviceSamplerYcbcrConversionFeaturesKHR sampler_ycbcr_conversion; +#endif +#if defined (VK_KHR_synchronization2) + VkPhysicalDeviceSynchronization2FeaturesKHR synchronization2; +#endif +#if defined (VK_KHR_timeline_semaphore) + VkPhysicalDeviceTimelineSemaphoreFeaturesKHR timeline_semaphore; +#endif #if defined (VK_KHR_video_maintenance1) VkPhysicalDeviceVideoMaintenance1FeaturesKHR videomaintenance1; #endif -#endif }; static void @@ -204,11 +213,26 @@ priv->features13.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_FEATURES; priv->features12.pNext = &priv->features13; +#endif +#if defined (VK_KHR_sampler_ycbcr_conversion) + priv->sampler_ycbcr_conversion.sType = + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES_KHR; + vk_link_struct (&priv->features12, &priv->sampler_ycbcr_conversion); +#endif +#if defined (VK_KHR_synchronization2) + priv->synchronization2.sType = + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SYNCHRONIZATION_2_FEATURES_KHR; + vk_link_struct (&priv->features12, &priv->synchronization2); +#endif +#if defined (VK_KHR_timeline_semaphore) + priv->timeline_semaphore.sType = + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES_KHR; + vk_link_struct (&priv->features12, &priv->timeline_semaphore); +#endif #if defined (VK_KHR_video_maintenance1) priv->videomaintenance1.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_MAINTENANCE_1_FEATURES_KHR; - priv->features13.pNext = &priv->videomaintenance1; -#endif + vk_link_struct (&priv->features12, &priv->videomaintenance1); #endif } @@ -487,16 +511,42 @@ DEBUG_BOOL_STRUCT ("support for (1.3)", features, maintenance4); /* *INDENT-ON* */ } +#endif /* defined (VK_API_VERSION_1_3) */ -#if defined(VK_KHR_video_maintenance1) static void -dump_videomaintenance1 (GstVulkanPhysicalDevice * device, - VkPhysicalDeviceVideoMaintenance1FeaturesKHR * features) +dump_extras (GstVulkanPhysicalDevice * device, VkBaseOutStructure * chain) { - DEBUG_BOOL_STRUCT ("support for (1.3)", features, videoMaintenance1); -} + GstVulkanPhysicalDevicePrivate *priv = GET_PRIV (device); + +#if defined (VK_KHR_sampler_ycbcr_conversion) + if (chain->sType == + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES_KHR) { + DEBUG_BOOL_STRUCT ("support for", &priv->sampler_ycbcr_conversion, + samplerYcbcrConversion); + } #endif -#endif /* defined (VK_API_VERSION_1_3) */ +#if defined (VK_KHR_synchronization2) + if (chain->sType == + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SYNCHRONIZATION_2_FEATURES_KHR) { + DEBUG_BOOL_STRUCT ("support for", &priv->synchronization2, + synchronization2); + } +#endif +#if defined (VK_KHR_timeline_semaphore) + if (chain->sType == + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES_KHR) { + DEBUG_BOOL_STRUCT ("support for", &priv->timeline_semaphore, + timelineSemaphore); + } +#endif +#if defined (VK_KHR_video_maintenance1) + if (chain->sType == + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_MAINTENANCE_1_FEATURES_KHR) { + DEBUG_BOOL_STRUCT ("support for", &priv->videomaintenance1, + videoMaintenance1); + } +#endif +} static gboolean dump_features (GstVulkanPhysicalDevice * device, GError ** error) @@ -522,14 +572,9 @@ && iter->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_FEATURES) dump_features13 (device, (VkPhysicalDeviceVulkan13Features *) iter); -#if defined(VK_KHR_video_maintenance1) - else if (gst_vulkan_physical_device_check_api_version (device, 1, 3, 283) - && iter->sType == - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_MAINTENANCE_1_FEATURES_KHR) - dump_videomaintenance1 (device, - (VkPhysicalDeviceVideoMaintenance1FeaturesKHR *) iter); -#endif #endif + else + dump_extras (device, iter); } } else #endif
View file
_service:download_url:gst-plugins-bad-1.26.4.tar.xz/gst-plugins-bad.doap -> _service:download_url:gst-plugins-bad-1.26.5.tar.xz/gst-plugins-bad.doap
Changed
@@ -35,6 +35,16 @@ <release> <Version> + <revision>1.26.5</revision> + <branch>1.26</branch> + <name></name> + <created>2025-08-07</created> + <file-release rdf:resource="https://gstreamer.freedesktop.org/src/gst-plugins-bad/gst-plugins-bad-1.26.5.tar.xz" /> + </Version> + </release> + + <release> + <Version> <revision>1.26.4</revision> <branch>1.26</branch> <name></name>
View file
_service:download_url:gst-plugins-bad-1.26.4.tar.xz/meson.build -> _service:download_url:gst-plugins-bad-1.26.5.tar.xz/meson.build
Changed
@@ -1,5 +1,5 @@ project('gst-plugins-bad', 'c', 'cpp', - version : '1.26.4', + version : '1.26.5', meson_version : '>= 1.4', default_options : 'warning_level=1', 'buildtype=debugoptimized' )
View file
_service:download_url:gst-plugins-bad-1.26.4.tar.xz/po/gst-plugins-bad-1.0.pot -> _service:download_url:gst-plugins-bad-1.26.5.tar.xz/po/gst-plugins-bad-1.0.pot
Changed
@@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: gst-plugins-bad-1.26.4\n" +"Project-Id-Version: gst-plugins-bad-1.26.5\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-07-16 15:27+0200\n" +"POT-Creation-Date: 2025-08-07 19:08+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
View file
_service:download_url:gst-plugins-bad-1.26.4.tar.xz/po/gst-plugins-bad.pot -> _service:download_url:gst-plugins-bad-1.26.5.tar.xz/po/gst-plugins-bad.pot
Changed
@@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: gst-plugins-bad-1.26.4\n" +"Project-Id-Version: gst-plugins-bad-1.26.5\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-07-16 15:27+0200\n" +"POT-Creation-Date: 2025-08-07 19:08+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
View file
_service:download_url:gst-plugins-bad-1.26.4.tar.xz/sys/d3d12/gstd3d12graphicscapture.cpp -> _service:download_url:gst-plugins-bad-1.26.5.tar.xz/sys/d3d12/gstd3d12graphicscapture.cpp
Changed
@@ -48,6 +48,8 @@ #include <windows.graphics.capture.interop.h> #include <windows.graphics.directx.direct3d11.h> #include <windows.graphics.directx.direct3d11.interop.h> +#include <queue> +#include <functional> GST_DEBUG_CATEGORY_EXTERN (gst_d3d12_screen_capture_debug); #define GST_CAT_DEFAULT gst_d3d12_screen_capture_debug @@ -191,6 +193,249 @@ return g_vtable.WindowsDeleteString (class_id_hstring); } +struct QueueManger; + +static gpointer dispatcher_main_thread (QueueManger * m); + +struct EnqueueData +{ + ComPtr<IDispatcherQueueHandler> handler; + std::mutex lock; + std::condition_variable cond; + bool signalled = false; + HRESULT hr; +}; + +enum LoopState +{ + LOOP_STATE_INIT, + LOOP_STATE_RUNNING, + LOOP_STATE_STOPPED, +}; + +struct QueueManger +{ + QueueManger (const QueueManger &) = delete; + QueueManger& operator= (const QueueManger &) = delete; + + static QueueManger * GetInstance () + { + static QueueManger *ins = nullptr; + GST_D3D12_CALL_ONCE_BEGIN { + ins = new QueueManger (); + } GST_D3D12_CALL_ONCE_END; + + return ins; + } + + HRESULT RunOnDispatcherThread (IDispatcherQueueHandler * handler) + { + if (!Init ()) + return E_FAIL; + + auto item = std::make_shared<EnqueueData> (); + item->handler = handler; + + { + std::lock_guard <std::mutex> lk (loop_lock); + user_events.push (item); + } + + SetEvent (enqueue_handle); + + std::unique_lock <std::mutex> lk (item->lock); + while (!item->signalled) + item->cond.wait (lk); + + return item->hr; + } + + static void Deinit () + { + auto ins = GetInstance (); + SetEvent (ins->shutdown_handle); + if (ins->thread) + g_thread_join (ins->thread); + + delete ins; + } + +private: + QueueManger () + { + shutdown_handle = CreateEventEx (nullptr, nullptr, 0, EVENT_ALL_ACCESS); + enqueue_handle = CreateEventEx (nullptr, nullptr, 0, EVENT_ALL_ACCESS); + } + + ~QueueManger () + { + CloseHandle (shutdown_handle); + CloseHandle (enqueue_handle); + } + + bool Init () + { + static std::once_flag once; + std::call_once (once, { + gst_d3d12_graphics_capture_load_library (); + }); + + if (!g_vtable.loaded) + return false; + + std::unique_lock <std::mutex> lk (loop_lock); + if (!thread) { + thread = g_thread_new ("DispatcherThread", + (GThreadFunc) dispatcher_main_thread, this); + } + + while (loop_state == LOOP_STATE_INIT) + loop_cond.wait (lk); + + if (loop_state == LOOP_STATE_RUNNING) + return true; + + return false; + } + +public: + LoopState loop_state = LOOP_STATE_INIT; + IDispatcherQueueController *queue_ctrl = nullptr; + HANDLE shutdown_handle; + HANDLE enqueue_handle; + GThread *thread = nullptr; + std::mutex loop_lock; + std::condition_variable loop_cond; + std::queue<std::shared_ptr<EnqueueData>> user_events; +}; + +class AsyncWaiter : public RuntimeClass<RuntimeClassFlags<ClassicCom>, + FtmBase, IAsyncActionCompletedHandler> +{ +public: + STDMETHODIMP + RuntimeClassInitialize (HANDLE event_handle) + { + event_handle_ = event_handle; + return S_OK; + } + + STDMETHOD (Invoke) (IAsyncAction * action, AsyncStatus status) + { + SetEvent (event_handle_); + + return S_OK; + } + +private: + HANDLE event_handle_; +}; + +static void +dispatcher_main_thread_inner (QueueManger * m) +{ + DispatcherQueueOptions queue_opt; + queue_opt.dwSize = sizeof (DispatcherQueueOptions); + queue_opt.threadType = DQTYPE_THREAD_CURRENT; + queue_opt.apartmentType = DQTAT_COM_NONE; + + auto hr = g_vtable.CreateDispatcherQueueController (queue_opt, + &m->queue_ctrl); + if (FAILED (hr)) { + GST_ERROR ("Couldn't create queue ctrl"); + return; + } + + ComPtr < AsyncWaiter > async_waiter; + ComPtr < IAsyncAction > shutdown_action; + + HANDLE event_handle = CreateEventEx (nullptr, nullptr, 0, EVENT_ALL_ACCESS); + hr = MakeAndInitialize < AsyncWaiter > (&async_waiter, event_handle); + if (FAILED (hr)) { + GST_ERROR ("Couldn't create async waiter"); + return; + } + + { + std::lock_guard <std::mutex> lk (m->loop_lock); + GST_DEBUG ("Loop running"); + m->loop_state = LOOP_STATE_RUNNING; + m->loop_cond.notify_all (); + } + + HANDLE waitables = { m->shutdown_handle, event_handle, m->enqueue_handle }; + + while (true) { + MSG msg; + while (PeekMessage (&msg, nullptr, 0, 0, PM_REMOVE)) { + TranslateMessage (&msg); + DispatchMessage (&msg); + } + + auto wait_ret = MsgWaitForMultipleObjects (G_N_ELEMENTS (waitables), + waitables, FALSE, INFINITE, QS_ALLINPUT); + + if (wait_ret == WAIT_OBJECT_0) { + hr = m->queue_ctrl->ShutdownQueueAsync (&shutdown_action); + if (FAILED (hr)) { + GST_ERROR ("Shutdown failed"); + return;
View file
_service:download_url:gst-plugins-bad-1.26.4.tar.xz/sys/d3d12/gstd3d12graphicscapture.h -> _service:download_url:gst-plugins-bad-1.26.5.tar.xz/sys/d3d12/gstd3d12graphicscapture.h
Changed
@@ -30,6 +30,8 @@ gboolean gst_d3d12_graphics_capture_load_library (void); +void gst_d3d12_graphics_capture_deinit (void); + GstD3D12ScreenCapture * gst_d3d12_graphics_capture_new (GstD3D12Device * device, HWND window_handle, HMONITOR monitor_handle);
View file
_service:download_url:gst-plugins-bad-1.26.4.tar.xz/sys/d3d12/gstd3d12screencapturedevice.cpp -> _service:download_url:gst-plugins-bad-1.26.5.tar.xz/sys/d3d12/gstd3d12screencapturedevice.cpp
Changed
@@ -72,8 +72,11 @@ GstDevice parent; HMONITOR monitor_handle; + + gchar *device_path; }; +static void gst_d3d12_screen_capture_device_finalize (GObject * object); static void gst_d3d12_screen_capture_device_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec); static void gst_d3d12_screen_capture_device_set_property (GObject * object, @@ -81,6 +84,7 @@ static GstElement *gst_d3d12_screen_capture_device_create_element (GstDevice * device, const gchar * name); +#define gst_d3d12_screen_capture_device_parent_class device_parent_class G_DEFINE_TYPE (GstD3D12ScreenCaptureDevice, gst_d3d12_screen_capture_device, GST_TYPE_DEVICE); @@ -91,6 +95,7 @@ auto object_class = G_OBJECT_CLASS (klass); auto dev_class = GST_DEVICE_CLASS (klass); + object_class->finalize = gst_d3d12_screen_capture_device_finalize; object_class->get_property = gst_d3d12_screen_capture_device_get_property; object_class->set_property = gst_d3d12_screen_capture_device_set_property; @@ -109,6 +114,16 @@ } static void +gst_d3d12_screen_capture_device_finalize (GObject * object) +{ + auto self = GST_D3D12_SCREEN_CAPTURE_DEVICE (object); + + g_free (self->device_path); + + G_OBJECT_CLASS (device_parent_class)->finalize (object); +} + +static void gst_d3d12_screen_capture_device_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec) { @@ -482,6 +497,9 @@ "Source/Monitor", "properties", props, "monitor-handle", (guint64) output_desc->Monitor, nullptr); + auto screen_dev = GST_D3D12_SCREEN_CAPTURE_DEVICE (device); + screen_dev->device_path = g_strdup (device_path.c_str ()); + gst_caps_unref (caps); return device; @@ -594,7 +612,7 @@ GList *new_devices = nullptr; GList *to_add = nullptr; GList *to_remove = nullptr; - GList *iter; + GList *iter, *walk; GST_DEBUG_OBJECT (self, "Device updated"); @@ -627,6 +645,44 @@ } } + iter = to_remove; + while (iter) { + auto prev_dev = GST_D3D12_SCREEN_CAPTURE_DEVICE (iter->data); + + if (!prev_dev->device_path) { + iter = g_list_next (iter); + continue; + } + + walk = to_add; + bool found = false; + while (walk) { + auto new_dev = GST_D3D12_SCREEN_CAPTURE_DEVICE (walk->data); + + if (!new_dev->device_path || + g_strcmp0 (prev_dev->device_path, new_dev->device_path)) { + walk = g_list_next (walk); + continue; + } + + gst_device_provider_device_changed (provider, GST_DEVICE (new_dev), + GST_DEVICE (prev_dev)); + gst_object_unref (new_dev); + to_add = g_list_delete_link (to_add, walk); + found = true; + break; + } + + if (found) { + gst_object_unref (prev_dev); + auto next = iter->next; + to_remove = g_list_delete_link (to_remove, iter); + iter = next; + } else { + iter = g_list_next (iter); + } + } + for (iter = to_remove; iter; iter = g_list_next (iter)) gst_device_provider_device_remove (provider, GST_DEVICE (iter->data));
View file
_service:download_url:gst-plugins-bad-1.26.4.tar.xz/sys/d3d12/meson.build -> _service:download_url:gst-plugins-bad-1.26.5.tar.xz/sys/d3d12/meson.build
Changed
@@ -198,7 +198,7 @@ name: 'DirectXMath support in Windows SDK') if not have_dx_math - directxmath_dep = dependency('directxmath', + directxmath_dep = dependency('DirectXMath', 'directxmath', allow_fallback: true, required: d3d12_option) if not directxmath_dep.found()
View file
_service:download_url:gst-plugins-bad-1.26.4.tar.xz/sys/d3d12/plugin.cpp -> _service:download_url:gst-plugins-bad-1.26.5.tar.xz/sys/d3d12/plugin.cpp
Changed
@@ -66,6 +66,10 @@ #include "gstd3d12upload.h" #endif +#ifdef HAVE_WGC +#include "gstd3d12graphicscapture.h" +#endif + /* *INDENT-OFF* */ using namespace Microsoft::WRL; /* *INDENT-ON* */ @@ -73,6 +77,9 @@ static void plugin_deinit (gpointer data) { +#ifdef HAVE_WGC + gst_d3d12_graphics_capture_deinit (); +#endif gst_d3d12_ipc_client_deinit (); gst_d3d12_flush_all_devices (); }
View file
_service:download_url:gst-plugins-bad-1.26.4.tar.xz/sys/va/gstvaav1dec.c -> _service:download_url:gst-plugins-bad-1.26.5.tar.xz/sys/va/gstvaav1dec.c
Changed
@@ -95,9 +95,12 @@ GstVaAV1Dec *self = GST_VA_AV1_DEC (decoder); GstVaBaseDec *base = GST_VA_BASE_DEC (decoder); - /* Ignore downstream renegotiation request. */ - if (!base->need_negotiation) - return TRUE; + /* Do not (re-)open the decoder in case the input state hasn't changed. */ + if (!base->need_negotiation) { + GST_DEBUG_OBJECT (decoder, + "Input state hasn't changed, no need to (re-)open the decoder"); + goto done; + } base->need_negotiation = FALSE; @@ -128,6 +131,7 @@ } self->preferred_format = GST_VIDEO_INFO_FORMAT (&base->output_state->info); +done: return GST_VIDEO_DECODER_CLASS (parent_class)->negotiate (decoder); }
View file
_service:download_url:gst-plugins-bad-1.26.4.tar.xz/sys/va/gstvaav1enc.c -> _service:download_url:gst-plugins-bad-1.26.5.tar.xz/sys/va/gstvaav1enc.c
Changed
@@ -2768,7 +2768,7 @@ GstVideoCodecState *output_state; GstVideoFormat format, reconf_format = GST_VIDEO_FORMAT_UNKNOWN; VAProfile profile; - gboolean do_renegotiation = TRUE, do_reopen, need_negotiation; + gboolean do_renegotiation = TRUE, do_reopen, need_negotiation, rc_same; guint max_ref_frames, max_surfaces = 0, rt_format, depth = 0, chrome = 0, codedbuf_size, latency_num; gint width, height; @@ -2800,11 +2800,15 @@ if (profile == VAProfileNone) return FALSE; + GST_OBJECT_LOCK (self); + rc_same = (self->prop.rc_ctrl == self->rc.rc_ctrl_mode); + GST_OBJECT_UNLOCK (self); + /* first check */ do_reopen = !(base->profile == profile && base->rt_format == rt_format && format == reconf_format && width == base->width - && height == base->height && self->prop.rc_ctrl == self->rc.rc_ctrl_mode - && depth == self->depth && chrome == self->chrome); + && height == base->height && rc_same && depth == self->depth + && chrome == self->chrome); if (do_reopen && gst_va_encoder_is_open (base->encoder)) gst_va_encoder_close (base->encoder); @@ -2869,8 +2873,8 @@ /* Set the latency */ latency = gst_util_uint64_scale (latency_num, - GST_VIDEO_INFO_FPS_D (&base->input_state->info) * GST_SECOND, - GST_VIDEO_INFO_FPS_N (&base->input_state->info)); + GST_VIDEO_INFO_FPS_D (&base->in_info) * GST_SECOND, + GST_VIDEO_INFO_FPS_N (&base->in_info)); gst_video_encoder_set_latency (venc, latency, latency); max_ref_frames = GST_AV1_NUM_REF_FRAMES;
View file
_service:download_url:gst-plugins-bad-1.26.4.tar.xz/sys/va/gstvabasedec.c -> _service:download_url:gst-plugins-bad-1.26.5.tar.xz/sys/va/gstvabasedec.c
Changed
@@ -673,27 +673,39 @@ { GstVaBaseDec *base = GST_VA_BASE_DEC (decoder); - /* Ignore downstream renegotiation request. */ - if (!base->need_negotiation) - return TRUE; + /* Do not (re-)open the decoder in case the input state hasn't changed. */ + if (!base->need_negotiation) { + GST_DEBUG_OBJECT (decoder, + "Input state hasn't changed, no need to (re-)open the decoder"); + goto done; + } base->need_negotiation = FALSE; if (!gst_va_decoder_config_is_equal (base->decoder, base->profile, base->rt_format, base->width, base->height)) { if (gst_va_decoder_is_open (base->decoder) && - !gst_va_decoder_close (base->decoder)) + !gst_va_decoder_close (base->decoder)) { + GST_WARNING_OBJECT (decoder, "Failed to close decoder"); return FALSE; - if (!gst_va_decoder_open (base->decoder, base->profile, base->rt_format)) + } + if (!gst_va_decoder_open (base->decoder, base->profile, base->rt_format)) { + GST_WARNING_OBJECT (decoder, "Failed to open decoder"); return FALSE; + } if (!gst_va_decoder_set_frame_size (base->decoder, base->width, - base->height)) + base->height)) { + GST_WARNING_OBJECT (decoder, "Failed to set frame size"); return FALSE; + } } - if (!gst_va_base_dec_set_output_state (base)) + if (!gst_va_base_dec_set_output_state (base)) { + GST_WARNING_OBJECT (decoder, "Failed to set output state"); return FALSE; + } +done: return GST_VIDEO_DECODER_CLASS (GST_VA_BASE_DEC_GET_PARENT_CLASS (decoder)) ->negotiate (decoder); }
View file
_service:download_url:gst-plugins-bad-1.26.4.tar.xz/sys/va/gstvah264dec.c -> _service:download_url:gst-plugins-bad-1.26.5.tar.xz/sys/va/gstvah264dec.c
Changed
@@ -500,7 +500,7 @@ error: { GST_WARNING_OBJECT (self, - "Failed to allocated output buffer, return %s", + "Failed to allocate output buffer, returning %s", gst_flow_get_name (ret)); return ret; }
View file
_service:download_url:gst-plugins-bad-1.26.4.tar.xz/sys/va/gstvah264enc.c -> _service:download_url:gst-plugins-bad-1.26.5.tar.xz/sys/va/gstvah264enc.c
Changed
@@ -1586,7 +1586,7 @@ GstVideoCodecState *output_state = NULL; GstVideoFormat format, reconf_format = GST_VIDEO_FORMAT_UNKNOWN; VAProfile profile = VAProfileNone; - gboolean do_renegotiation = TRUE, do_reopen, need_negotiation; + gboolean do_renegotiation = TRUE, do_reopen, need_negotiation, rc_same; guint max_ref_frames, max_surfaces = 0, rt_format = 0, codedbuf_size, latency_num; gint width, height; @@ -1611,10 +1611,14 @@ if (!_decide_profile (self, &profile, &rt_format)) return FALSE; + GST_OBJECT_LOCK (self); + rc_same = (self->prop.rc_ctrl == self->rc.rc_ctrl_mode); + GST_OBJECT_UNLOCK (self); + /* first check */ do_reopen = !(base->profile == profile && base->rt_format == rt_format && format == reconf_format && width == base->width - && height == base->height && self->prop.rc_ctrl == self->rc.rc_ctrl_mode); + && height == base->height && rc_same); if (do_reopen && gst_va_encoder_is_open (base->encoder)) gst_va_encoder_close (base->encoder); @@ -1681,11 +1685,10 @@ /* Set the latency */ latency = gst_util_uint64_scale (latency_num, - GST_VIDEO_INFO_FPS_D (&base->input_state->info) * GST_SECOND, - GST_VIDEO_INFO_FPS_N (&base->input_state->info)); + GST_VIDEO_INFO_FPS_D (&base->in_info) * GST_SECOND, + GST_VIDEO_INFO_FPS_N (&base->in_info)); gst_video_encoder_set_latency (venc, latency, latency); - max_ref_frames = self->gop.b_pyramid ? self->gop.highest_pyramid_level + 2 : self->gop.num_ref_frames; max_ref_frames += base->preferred_output_delay;
View file
_service:download_url:gst-plugins-bad-1.26.4.tar.xz/sys/va/gstvah265enc.c -> _service:download_url:gst-plugins-bad-1.26.5.tar.xz/sys/va/gstvah265enc.c
Changed
@@ -4506,7 +4506,7 @@ GstVideoCodecState *output_state = NULL; GstVideoFormat format, reconf_format = GST_VIDEO_FORMAT_UNKNOWN; VAProfile profile = VAProfileNone; - gboolean do_renegotiation = TRUE, do_reopen, need_negotiation; + gboolean do_renegotiation = TRUE, do_reopen, need_negotiation, rc_same; guint max_ref_frames, max_surfaces = 0, rt_format = 0, codedbuf_size, latency_num; gint width, height; @@ -4532,10 +4532,14 @@ if (!_h265_decide_profile (self, &profile, &rt_format)) return FALSE; + GST_OBJECT_LOCK (self); + rc_same = (self->prop.rc_ctrl == self->rc.rc_ctrl_mode); + GST_OBJECT_UNLOCK (self); + /* first check */ do_reopen = !(base->profile == profile && base->rt_format == rt_format && format == reconf_format && width == base->width - && height == base->height && self->prop.rc_ctrl == self->rc.rc_ctrl_mode); + && height == base->height && rc_same); if (do_reopen && gst_va_encoder_is_open (base->encoder)) gst_va_encoder_close (base->encoder); @@ -4652,8 +4656,8 @@ /* Set the latency */ latency = gst_util_uint64_scale (latency_num, - GST_VIDEO_INFO_FPS_D (&base->input_state->info) * GST_SECOND, - GST_VIDEO_INFO_FPS_N (&base->input_state->info)); + GST_VIDEO_INFO_FPS_D (&base->in_info) * GST_SECOND, + GST_VIDEO_INFO_FPS_N (&base->in_info)); gst_video_encoder_set_latency (venc, latency, latency); max_ref_frames = self->gop.b_pyramid ?
View file
_service:download_url:gst-plugins-bad-1.26.4.tar.xz/sys/va/gstvajpegdec.c -> _service:download_url:gst-plugins-bad-1.26.5.tar.xz/sys/va/gstvajpegdec.c
Changed
@@ -360,9 +360,12 @@ guint64 modifier; GstCapsFeatures *capsfeatures = NULL; - /* Ignore downstream renegotiation request. */ - if (!base->need_negotiation) - return TRUE; + /* Do not (re-)open the decoder in case the input state hasn't changed. */ + if (!base->need_negotiation) { + GST_DEBUG_OBJECT (decoder, + "Input state hasn't changed, no need to (re-)open the decoder"); + goto done; + } base->need_negotiation = FALSE; @@ -420,6 +423,7 @@ GST_INFO_OBJECT (self, "Negotiated caps %" GST_PTR_FORMAT, base->output_state->caps); +done: return GST_VIDEO_DECODER_CLASS (parent_class)->negotiate (decoder); }
View file
_service:download_url:gst-plugins-bad-1.26.4.tar.xz/sys/va/gstvajpegenc.c -> _service:download_url:gst-plugins-bad-1.26.5.tar.xz/sys/va/gstvajpegenc.c
Changed
@@ -378,8 +378,7 @@ } /* Unknown frame rate is allowed for jpeg, such as a single still image. */ - if (GST_VIDEO_INFO_FPS_N (&base->in_info) == 0 - || GST_VIDEO_INFO_FPS_D (&base->in_info) == 0) { + if (GST_VIDEO_INFO_FPS_D (&base->in_info) == 0) { GST_DEBUG_OBJECT (self, "Unknown framerate"); GST_VIDEO_INFO_FPS_N (&base->in_info) = 0; GST_VIDEO_INFO_FPS_D (&base->in_info) = 1; @@ -395,8 +394,8 @@ /* Set the latency */ latency = gst_util_uint64_scale (latency_num, - GST_VIDEO_INFO_FPS_D (&base->input_state->info) * GST_SECOND, - GST_VIDEO_INFO_FPS_N (&base->input_state->info)); + GST_VIDEO_INFO_FPS_D (&base->in_info) * GST_SECOND, + GST_VIDEO_INFO_FPS_N (&base->in_info)); gst_video_encoder_set_latency (venc, latency, latency); }
View file
_service:download_url:gst-plugins-bad-1.26.4.tar.xz/sys/va/gstvavp8enc.c -> _service:download_url:gst-plugins-bad-1.26.5.tar.xz/sys/va/gstvavp8enc.c
Changed
@@ -577,7 +577,7 @@ GstVideoCodecState *output_state; GstVideoFormat format, reconf_format = GST_VIDEO_FORMAT_UNKNOWN; const GstVideoFormatInfo *format_info; - gboolean do_renegotiation = TRUE, do_reopen, need_negotiation; + gboolean do_renegotiation = TRUE, do_reopen, need_negotiation, rc_same; guint max_ref_frames, max_surfaces = 0, codedbuf_size, latency_num; gint width, height; GstClockTime latency; @@ -605,9 +605,13 @@ reconf_format = GST_VIDEO_INFO_FORMAT (&vi); } + GST_OBJECT_LOCK (self); + rc_same = (self->prop.rc_ctrl == self->rc.rc_ctrl_mode); + GST_OBJECT_UNLOCK (self); + /* First check */ do_reopen = !(format == reconf_format && width == base->width - && height == base->height && self->prop.rc_ctrl == self->rc.rc_ctrl_mode); + && height == base->height && rc_same); if (do_reopen && gst_va_encoder_is_open (base->encoder)) gst_va_encoder_close (base->encoder); @@ -655,8 +659,8 @@ /* Set the latency */ latency = gst_util_uint64_scale (latency_num, - GST_VIDEO_INFO_FPS_D (&base->input_state->info) * GST_SECOND, - GST_VIDEO_INFO_FPS_N (&base->input_state->info)); + GST_VIDEO_INFO_FPS_D (&base->in_info) * GST_SECOND, + GST_VIDEO_INFO_FPS_N (&base->in_info)); gst_video_encoder_set_latency (venc, latency, latency); max_ref_frames = GST_VP8_MAX_REF_FRAMES;
View file
_service:download_url:gst-plugins-bad-1.26.4.tar.xz/sys/va/gstvavp9dec.c -> _service:download_url:gst-plugins-bad-1.26.5.tar.xz/sys/va/gstvavp9dec.c
Changed
@@ -555,9 +555,12 @@ GstVaVp9Dec *self = GST_VA_VP9_DEC (decoder); gboolean need_open; - /* Ignore downstream renegotiation request. */ - if (!base->need_negotiation) - return TRUE; + /* Do not (re-)open the decoder in case the input state hasn't changed. */ + if (!base->need_negotiation) { + GST_DEBUG_OBJECT (decoder, + "Input state hasn't changed, no need to (re-)open the decoder"); + goto done; + } base->need_negotiation = FALSE; @@ -601,6 +604,7 @@ if (!gst_va_base_dec_set_output_state (base)) return FALSE; +done: return GST_VIDEO_DECODER_CLASS (parent_class)->negotiate (decoder); }
View file
_service:download_url:gst-plugins-bad-1.26.4.tar.xz/sys/va/gstvavp9enc.c -> _service:download_url:gst-plugins-bad-1.26.5.tar.xz/sys/va/gstvavp9enc.c
Changed
@@ -2097,7 +2097,7 @@ GstVideoCodecState *output_state; GstVideoFormat format, reconf_format = GST_VIDEO_FORMAT_UNKNOWN; VAProfile profile; - gboolean do_renegotiation = TRUE, do_reopen, need_negotiation; + gboolean do_renegotiation = TRUE, do_reopen, need_negotiation, rc_same; guint max_ref_frames, max_surfaces = 0, rt_format, depth = 0, chrome = 0, codedbuf_size, latency_num; gint width, height; @@ -2129,11 +2129,15 @@ if (profile == VAProfileNone) return FALSE; + GST_OBJECT_LOCK (self); + rc_same = (self->prop.rc_ctrl == self->rc.rc_ctrl_mode); + GST_OBJECT_UNLOCK (self); + /* first check */ do_reopen = !(base->profile == profile && base->rt_format == rt_format && format == reconf_format && width == base->width - && height == base->height && self->prop.rc_ctrl == self->rc.rc_ctrl_mode - && depth == self->depth && chrome == self->chrome); + && height == base->height && rc_same && depth == self->depth + && chrome == self->chrome); if (do_reopen && gst_va_encoder_is_open (base->encoder)) gst_va_encoder_close (base->encoder); @@ -2188,8 +2192,8 @@ /* Set the latency */ latency = gst_util_uint64_scale (latency_num, - GST_VIDEO_INFO_FPS_D (&base->input_state->info) * GST_SECOND, - GST_VIDEO_INFO_FPS_N (&base->input_state->info)); + GST_VIDEO_INFO_FPS_D (&base->in_info) * GST_SECOND, + GST_VIDEO_INFO_FPS_N (&base->in_info)); gst_video_encoder_set_latency (venc, latency, latency); max_ref_frames = GST_VP9_REF_FRAMES;
View file
_service:download_url:gst-plugins-bad-1.26.5.tar.xz/sys/wasapi2/gstwasapi2activator.cpp
Added
@@ -0,0 +1,151 @@ +/* GStreamer + * Copyright (C) 2025 Seungha Yang <seungha@centricular.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include "gstwasapi2activator.h" +#include <objidl.h> + +GST_DEBUG_CATEGORY_EXTERN (gst_wasapi2_debug); +#define GST_CAT_DEFAULT gst_wasapi2_debug + +/* *INDENT-OFF* */ +using namespace Microsoft::WRL; + +void +Wasapi2ActivationHandler::CreateInstance (Wasapi2ActivationHandler ** handler, + const wchar_t * device_id, + const AUDIOCLIENT_ACTIVATION_PARAMS * params) +{ + auto self = new Wasapi2ActivationHandler (); + self->device_id_ = device_id; + + if (params) { + self->params_ = *params; + self->prop_.vt = VT_BLOB; + self->prop_.blob.cbSize = sizeof (AUDIOCLIENT_ACTIVATION_PARAMS); + self->prop_.blob.pBlobData = (BYTE *) &self->params_; + self->have_params_ = true; + } + + *handler = self; +} + +STDMETHODIMP_ (ULONG) +Wasapi2ActivationHandler::AddRef (void) +{ + return InterlockedIncrement (&refcount_); +} + +STDMETHODIMP_ (ULONG) +Wasapi2ActivationHandler::Release (void) +{ + ULONG ref_count; + + ref_count = InterlockedDecrement (&refcount_); + + if (ref_count == 0) + delete this; + + return ref_count; +} + +STDMETHODIMP +Wasapi2ActivationHandler::QueryInterface (REFIID riid, void ** object) +{ + if (riid == __uuidof(IUnknown) || riid == __uuidof(IAgileObject)) { + *object = static_cast<IUnknown *>(static_cast<Wasapi2ActivationHandler*>(this)); + } else if (riid == __uuidof(IActivateAudioInterfaceCompletionHandler)) { + *object = static_cast<IActivateAudioInterfaceCompletionHandler *>( + static_cast<Wasapi2ActivationHandler*>(this)); + } else if (riid == IID_Wasapi2ActivationHandler) { + *object = this; + } else { + *object = nullptr; + return E_NOINTERFACE; + } + + AddRef (); + + return S_OK; +} + +STDMETHODIMP +Wasapi2ActivationHandler::ActivateCompleted (IActivateAudioInterfaceAsyncOperation * op) +{ + ComPtr<IUnknown> iface; + HRESULT hr = S_OK; + hr = op->GetActivateResult (&hr, &iface); + if (FAILED (hr)) { + GST_ERROR ("Couldn't get activate result, hr: 0x%x", (guint) hr); + activate_hr_ = hr; + SetEvent (event_); + return hr; + } + + hr = iface.As (&client_); + activate_hr_ = hr; + + GST_LOG ("Activation result 0x%x", (guint) hr); + + SetEvent (event_); + + return hr; +} + +HRESULT +Wasapi2ActivationHandler::ActivateAsync () +{ + ComPtr<IActivateAudioInterfaceAsyncOperation> async_op; + auto hr = ActivateAudioInterfaceAsync (device_id_.c_str (), + __uuidof (IAudioClient), have_params_ ? &prop_ : nullptr, + this, &async_op); + if (!gst_wasapi2_result (hr)) { + activate_hr_ = hr; + SetEvent (event_); + } + + return hr; +} + +HRESULT +Wasapi2ActivationHandler::GetClient (IAudioClient ** client, DWORD timeout) +{ + WaitForSingleObject (event_, timeout); + auto hr = activate_hr_.load (); + if (!gst_wasapi2_result (hr)) + return hr; + + if (!client) + return S_OK; + + *client = client_.Get (); + (*client)->AddRef (); + + return S_OK; +} + +Wasapi2ActivationHandler::Wasapi2ActivationHandler () +{ + event_ = CreateEvent (nullptr, TRUE, FALSE, nullptr); +} + +Wasapi2ActivationHandler::~Wasapi2ActivationHandler () +{ + CloseHandle (event_); +} +/* *INDENT-ON* */
View file
_service:download_url:gst-plugins-bad-1.26.5.tar.xz/sys/wasapi2/gstwasapi2activator.h
Added
@@ -0,0 +1,94 @@ +/* GStreamer + * Copyright (C) 2025 Seungha Yang <seungha@centricular.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#pragma once + +#include <gst/gst.h> +#include "gstwasapi2util.h" +#include <wrl.h> +#include <atomic> +#include <string> + +/* Copy of audioclientactivationparams.h since those types are defined only for + * NTDDI_VERSION >= NTDDI_WIN10_FE */ +#define VIRTUAL_AUDIO_DEVICE_PROCESS_LOOPBACK L"VAD\\Process_Loopback" +typedef enum +{ + PROCESS_LOOPBACK_MODE_INCLUDE_TARGET_PROCESS_TREE = 0, + PROCESS_LOOPBACK_MODE_EXCLUDE_TARGET_PROCESS_TREE = 1 +} PROCESS_LOOPBACK_MODE; + +typedef struct +{ + DWORD TargetProcessId; + PROCESS_LOOPBACK_MODE ProcessLoopbackMode; +} AUDIOCLIENT_PROCESS_LOOPBACK_PARAMS; + +typedef enum +{ + AUDIOCLIENT_ACTIVATION_TYPE_DEFAULT = 0, + AUDIOCLIENT_ACTIVATION_TYPE_PROCESS_LOOPBACK = 1 +} AUDIOCLIENT_ACTIVATION_TYPE; + +typedef struct +{ + AUDIOCLIENT_ACTIVATION_TYPE ActivationType; + union + { + AUDIOCLIENT_PROCESS_LOOPBACK_PARAMS ProcessLoopbackParams; + } DUMMYUNIONNAME; +} AUDIOCLIENT_ACTIVATION_PARAMS; +/* End of audioclientactivationparams.h */ + +DEFINE_GUID (IID_Wasapi2ActivationHandler, 0xaa7e8f85, 0x211e, + 0x42cc, 0x8c, 0x86, 0x99, 0x83, 0x5b, 0xef, 0x54, 0x86); +class Wasapi2ActivationHandler : + public IActivateAudioInterfaceCompletionHandler +{ +public: + static void CreateInstance (Wasapi2ActivationHandler ** handler, + const wchar_t * device_id, + const AUDIOCLIENT_ACTIVATION_PARAMS * params); + + STDMETHODIMP_ (ULONG) AddRef (void); + + STDMETHODIMP_ (ULONG) Release (void); + + STDMETHODIMP QueryInterface (REFIID riid, void ** object); + + STDMETHODIMP ActivateCompleted (IActivateAudioInterfaceAsyncOperation * op); + + HRESULT ActivateAsync (void); + + HRESULT GetClient (IAudioClient ** client, DWORD timeout); + +private: + Wasapi2ActivationHandler (); + virtual ~Wasapi2ActivationHandler (); + +private: + Microsoft::WRL::ComPtr<IAudioClient> client_; + std::atomic<HRESULT> activate_hr_ = { E_FAIL }; + HANDLE event_; + PROPVARIANT prop_ = { }; + AUDIOCLIENT_ACTIVATION_PARAMS params_ = { }; + bool have_params_ = false; + std::wstring device_id_; + ULONG refcount_ = 1; +};
View file
_service:download_url:gst-plugins-bad-1.26.5.tar.xz/sys/wasapi2/gstwasapi2device.cpp
Added
@@ -0,0 +1,395 @@ +/* GStreamer + * Copyright (C) 2018 Nirbheek Chauhan <nirbheek@centricular.com> + * Copyright (C) 2020 Seungha Yang <seungha@centricular.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "gstwasapi2device.h" +#include "gstwasapi2util.h" +#include "gstwasapi2enumerator.h" + +GST_DEBUG_CATEGORY_EXTERN (gst_wasapi2_debug); +#define GST_CAT_DEFAULT gst_wasapi2_debug + +enum +{ + PROP_0, + PROP_DEVICE, +}; + +struct _GstWasapi2Device +{ + GstDevice parent; + + gchar *device_id; + const gchar *factory_name; + GstWasapi2EndpointClass device_class; +}; + +G_DEFINE_TYPE (GstWasapi2Device, gst_wasapi2_device, GST_TYPE_DEVICE); + +static void gst_wasapi2_device_get_property (GObject * object, + guint prop_id, GValue * value, GParamSpec * pspec); +static void gst_wasapi2_device_set_property (GObject * object, + guint prop_id, const GValue * value, GParamSpec * pspec); +static void gst_wasapi2_device_finalize (GObject * object); +static GstElement *gst_wasapi2_device_create_element (GstDevice * device, + const gchar * name); + +static void +gst_wasapi2_device_class_init (GstWasapi2DeviceClass * klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GstDeviceClass *dev_class = GST_DEVICE_CLASS (klass); + + dev_class->create_element = gst_wasapi2_device_create_element; + + gobject_class->get_property = gst_wasapi2_device_get_property; + gobject_class->set_property = gst_wasapi2_device_set_property; + gobject_class->finalize = gst_wasapi2_device_finalize; + + g_object_class_install_property (gobject_class, PROP_DEVICE, + g_param_spec_string ("device", "Device", + "Audio device ID as provided by " + "Windows.Devices.Enumeration.DeviceInformation.Id", nullptr, + (GParamFlags) (G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_STRINGS))); +} + +static void +gst_wasapi2_device_init (GstWasapi2Device * self) +{ +} + +static void +gst_wasapi2_device_finalize (GObject * object) +{ + GstWasapi2Device *self = GST_WASAPI2_DEVICE (object); + + g_free (self->device_id); + + G_OBJECT_CLASS (gst_wasapi2_device_parent_class)->finalize (object); +} + +static GstElement * +gst_wasapi2_device_create_element (GstDevice * device, const gchar * name) +{ + GstWasapi2Device *self = GST_WASAPI2_DEVICE (device); + GstElement *elem; + + elem = gst_element_factory_make (self->factory_name, name); + + g_object_set (elem, "device", self->device_id, nullptr); + + if (self->device_class == GST_WASAPI2_ENDPOINT_CLASS_LOOPBACK_CAPTURE) + g_object_set (elem, "loopback", TRUE, nullptr); + + return elem; +} + +static void +gst_wasapi2_device_get_property (GObject * object, guint prop_id, + GValue * value, GParamSpec * pspec) +{ + GstWasapi2Device *self = GST_WASAPI2_DEVICE (object); + + switch (prop_id) { + case PROP_DEVICE: + g_value_set_string (value, self->device_id); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +gst_wasapi2_device_set_property (GObject * object, guint prop_id, + const GValue * value, GParamSpec * pspec) +{ + GstWasapi2Device *self = GST_WASAPI2_DEVICE (object); + + switch (prop_id) { + case PROP_DEVICE: + /* G_PARAM_CONSTRUCT_ONLY */ + self->device_id = g_value_dup_string (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +struct _GstWasapi2DeviceProvider +{ + GstDeviceProvider parent; + + GstWasapi2Enumerator *enumerator; + GPtrArray *device_list; +}; + +G_DEFINE_TYPE (GstWasapi2DeviceProvider, gst_wasapi2_device_provider, + GST_TYPE_DEVICE_PROVIDER); + +static void gst_wasapi2_device_provider_dispose (GObject * object); + +static GList *gst_wasapi2_device_provider_probe (GstDeviceProvider * provider); +static gboolean +gst_wasapi2_device_provider_start (GstDeviceProvider * provider); +static void gst_wasapi2_device_provider_stop (GstDeviceProvider * provider); +static void gst_wasapi2_device_provider_on_updated (GstWasapi2Enumerator * + object, GstWasapi2DeviceProvider * self); + +static void +gst_wasapi2_device_provider_class_init (GstWasapi2DeviceProviderClass * klass) +{ + auto gobject_class = G_OBJECT_CLASS (klass); + auto provider_class = GST_DEVICE_PROVIDER_CLASS (klass); + + gobject_class->dispose = gst_wasapi2_device_provider_dispose; + + provider_class->probe = GST_DEBUG_FUNCPTR (gst_wasapi2_device_provider_probe); + provider_class->start = GST_DEBUG_FUNCPTR (gst_wasapi2_device_provider_start); + provider_class->stop = GST_DEBUG_FUNCPTR (gst_wasapi2_device_provider_stop); + + gst_device_provider_class_set_static_metadata (provider_class, + "WASAPI (Windows Audio Session API) Device Provider", + "Source/Sink/Audio", "List WASAPI source devices", + "Nirbheek Chauhan <nirbheek@centricular.com>, " + "Seungha Yang <seungha@centricular.com>"); +} + +static void +gst_wasapi2_device_provider_init (GstWasapi2DeviceProvider * self) +{ + self->enumerator = gst_wasapi2_enumerator_new (); + g_signal_connect (self->enumerator, "updated", + G_CALLBACK (gst_wasapi2_device_provider_on_updated), self); + + self->device_list = g_ptr_array_new_with_free_func ((GDestroyNotify) + gst_wasapi2_enumerator_entry_free); +} + +static void +gst_wasapi2_device_provider_dispose (GObject * object) +{ + auto self = GST_WASAPI2_DEVICE_PROVIDER (object); + + gst_clear_object (&self->enumerator); + + g_clear_pointer (&self->device_list, g_ptr_array_unref); +
View file
_service:download_url:gst-plugins-bad-1.26.4.tar.xz/sys/wasapi2/gstwasapi2device.h -> _service:download_url:gst-plugins-bad-1.26.5.tar.xz/sys/wasapi2/gstwasapi2device.h
Changed
@@ -28,7 +28,9 @@ G_DECLARE_FINAL_TYPE (GstWasapi2Device, gst_wasapi2_device, GST, WASAPI2_DEVICE, GstDevice); -void gst_wasapi2_device_provider_register (GstPlugin * plugin, guint rank); +#define GST_TYPE_WASAPI2_DEVICE_PROVIDER (gst_wasapi2_device_provider_get_type()) +G_DECLARE_FINAL_TYPE (GstWasapi2DeviceProvider, gst_wasapi2_device_provider, + GST, WASAPI2_DEVICE_PROVIDER, GstDeviceProvider); G_END_DECLS
View file
_service:download_url:gst-plugins-bad-1.26.5.tar.xz/sys/wasapi2/gstwasapi2enumerator.cpp
Added
@@ -0,0 +1,620 @@ +/* GStreamer + * Copyright (C) 2025 Seungha Yang <seungha@centricular.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "gstwasapi2enumerator.h" +#include "gstwasapi2activator.h" +#include <mutex> +#include <condition_variable> +#include <wrl.h> +#include <functiondiscoverykeys_devpkey.h> +#include <string> + +/* *INDENT-OFF* */ +using namespace Microsoft::WRL; + +GST_DEBUG_CATEGORY_EXTERN (gst_wasapi2_debug); +#define GST_CAT_DEFAULT gst_wasapi2_debug + +static GstStaticCaps template_caps = GST_STATIC_CAPS (GST_WASAPI2_STATIC_CAPS); + +static void gst_wasapi2_on_device_updated (GstWasapi2Enumerator * object); + +/* IMMNotificationClient implementation */ +class IWasapi2NotificationClient : public IMMNotificationClient +{ +public: + static void + CreateInstance (GstWasapi2Enumerator * object, IMMNotificationClient ** client) + { + auto self = new IWasapi2NotificationClient (); + + g_weak_ref_set (&self->obj_, object); + + *client = (IMMNotificationClient *) self; + } + + /* IUnknown */ + STDMETHODIMP + QueryInterface (REFIID riid, void ** object) + { + if (!object) + return E_POINTER; + + if (riid == IID_IUnknown) { + *object = static_cast<IUnknown *> (this); + } else if (riid == __uuidof(IMMNotificationClient)) { + *object = static_cast<IMMNotificationClient *> (this); + } else { + *object = nullptr; + return E_NOINTERFACE; + } + + AddRef (); + + return S_OK; + } + + STDMETHODIMP_ (ULONG) + AddRef (void) + { + GST_TRACE ("%p, %d", this, (guint) ref_count_); + return InterlockedIncrement (&ref_count_); + } + + STDMETHODIMP_ (ULONG) + Release (void) + { + ULONG ref_count; + + GST_TRACE ("%p, %d", this, (guint) ref_count_); + ref_count = InterlockedDecrement (&ref_count_); + + if (ref_count == 0) { + GST_TRACE ("Delete instance %p", this); + delete this; + } + + return ref_count; + } + + /* IMMNotificationClient */ + STDMETHODIMP + OnDeviceStateChanged (LPCWSTR device_id, DWORD new_state) + { + auto object = (GstWasapi2Enumerator *) g_weak_ref_get (&obj_); + if (!object) + return S_OK; + + gst_wasapi2_on_device_updated (object); + gst_object_unref (object); + + return S_OK; + } + + STDMETHODIMP + OnDeviceAdded (LPCWSTR device_id) + { + auto object = (GstWasapi2Enumerator *) g_weak_ref_get (&obj_); + if (!object) + return S_OK; + + gst_wasapi2_on_device_updated (object); + gst_object_unref (object); + + return S_OK; + } + + STDMETHODIMP + OnDeviceRemoved (LPCWSTR device_id) + { + auto object = (GstWasapi2Enumerator *) g_weak_ref_get (&obj_); + if (!object) + return S_OK; + + gst_wasapi2_on_device_updated (object); + gst_object_unref (object); + + return S_OK; + } + + STDMETHODIMP + OnDefaultDeviceChanged (EDataFlow flow, ERole role, LPCWSTR default_device_id) + { + auto object = (GstWasapi2Enumerator *) g_weak_ref_get (&obj_); + if (!object) + return S_OK; + + gst_wasapi2_on_device_updated (object); + gst_object_unref (object); + + return S_OK; + } + + STDMETHODIMP + OnPropertyValueChanged (LPCWSTR device_id, const PROPERTYKEY key) + { + return S_OK; + } + +private: + IWasapi2NotificationClient () + { + g_weak_ref_init (&obj_, nullptr); + } + + virtual ~IWasapi2NotificationClient () + { + g_weak_ref_clear (&obj_); + } + +private: + ULONG ref_count_ = 1; + GWeakRef obj_; +}; + +enum +{ + PROP_0, + PROP_ENUMERATOR, +}; + +enum +{ + SIGNAL_UPDATED, + SIGNAL_LAST, +}; + +static guint wasapi2_device_signalsSIGNAL_LAST = { }; + +struct GstWasapi2EnumeratorPrivate +{ + ComPtr<IMMDeviceEnumerator> handle; + std::mutex lock; + std::condition_variable cond; + + ComPtr<IMMNotificationClient> client; + Wasapi2ActivationHandler *capture_activator = nullptr; + Wasapi2ActivationHandler *render_activator = nullptr; + + void ClearCOM ()
View file
_service:download_url:gst-plugins-bad-1.26.5.tar.xz/sys/wasapi2/gstwasapi2enumerator.h
Added
@@ -0,0 +1,51 @@ +/* GStreamer + * Copyright (C) 2025 Seungha Yang <seungha@centricular.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#pragma once + +#include <gst/gst.h> +#include "gstwasapi2util.h" + +G_BEGIN_DECLS + +#define GST_TYPE_WASAPI2_ENUMERATOR (gst_wasapi2_enumerator_get_type ()) +G_DECLARE_FINAL_TYPE (GstWasapi2Enumerator, gst_wasapi2_enumerator, + GST, WASAPI2_ENUMERATOR, GstObject); + +typedef struct _GstWasapi2EnumeratorEntry +{ + gchar *device_id; + gchar *device_name; + gboolean is_default; + GstCaps *caps; + EDataFlow flow; +} GstWasapi2EnumeratorEntry; + +GstWasapi2Enumerator * gst_wasapi2_enumerator_new (void); + +void gst_wasapi2_enumerator_activate_notification (GstWasapi2Enumerator * object, + gboolean active); + +void gst_wasapi2_enumerator_entry_free (GstWasapi2EnumeratorEntry * entry); + +void gst_wasapi2_enumerator_enumerate_devices (GstWasapi2Enumerator * object, + GPtrArray * entry); + +G_END_DECLS +
View file
_service:download_url:gst-plugins-bad-1.26.5.tar.xz/sys/wasapi2/gstwasapi2object.cpp
Added
@@ -0,0 +1,461 @@ +/* GStreamer + * Copyright (C) 2025 Seungha Yang <seungha@centricular.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "gstwasapi2object.h" +#include "gstwasapi2activator.h" +#include <endpointvolume.h> +#include <mutex> +#include <condition_variable> +#include <wrl.h> +#include <string> +#include <atomic> +#include <string.h> + +/* *INDENT-OFF* */ +using namespace Microsoft::WRL; + +GST_DEBUG_CATEGORY_EXTERN (gst_wasapi2_debug); +#define GST_CAT_DEFAULT gst_wasapi2_debug + +static GstStaticCaps template_caps = GST_STATIC_CAPS (GST_WASAPI2_STATIC_CAPS); + +static void gst_wasapi2_object_set_endpoint_muted (GstWasapi2Object * object, + bool muted); + +DEFINE_GUID (IID_Wasapi2EndpointVolumeCallback, 0x21ba991f, 0x4d78, + 0x418c, 0xa1, 0xea, 0x8a, 0xc7, 0xdd, 0xa2, 0xdc, 0x39); +class Wasapi2EndpointVolumeCallback : public IAudioEndpointVolumeCallback +{ +public: + static void CreateInstance (Wasapi2EndpointVolumeCallback ** iface, + GstWasapi2Object * client) + { + auto self = new Wasapi2EndpointVolumeCallback (); + g_weak_ref_set (&self->client_, client); + *iface = self; + } + + STDMETHODIMP_ (ULONG) + AddRef (void) + { + return InterlockedIncrement (&refcount_); + } + + STDMETHODIMP_ (ULONG) + Release (void) + { + ULONG ref_count; + + ref_count = InterlockedDecrement (&refcount_); + + if (ref_count == 0) + delete this; + + return ref_count; + } + + STDMETHODIMP + QueryInterface (REFIID riid, void ** object) + { + if (riid == __uuidof(IUnknown) || riid == __uuidof(IAgileObject)) { + *object = static_cast<IUnknown *>( + static_cast<Wasapi2EndpointVolumeCallback*>(this)); + } else if (riid == __uuidof(IAudioEndpointVolumeCallback)) { + *object = static_cast<IAudioEndpointVolumeCallback *>( + static_cast<Wasapi2EndpointVolumeCallback*>(this)); + } else if (riid == IID_Wasapi2EndpointVolumeCallback) { + *object = static_cast<Wasapi2EndpointVolumeCallback *> (this); + } else { + *object = nullptr; + return E_NOINTERFACE; + } + + AddRef (); + + return S_OK; + } + + STDMETHODIMP + OnNotify (AUDIO_VOLUME_NOTIFICATION_DATA * notify) + { + auto client = (GstWasapi2Object *) g_weak_ref_get (&client_); + + if (client) { + gst_wasapi2_object_set_endpoint_muted (client, notify->bMuted); + gst_object_unref (client); + } + + return S_OK; + } + +private: + Wasapi2EndpointVolumeCallback () + { + g_weak_ref_init (&client_, nullptr); + } + + virtual ~Wasapi2EndpointVolumeCallback () + { + g_weak_ref_set (&client_, nullptr); + } + +private: + ULONG refcount_ = 1; + GWeakRef client_; +}; + +struct GstWasapi2ObjectPrivate +{ + ComPtr<IMMDeviceEnumerator> enumerator; + ComPtr<IMMDevice> device; + ComPtr<IAudioClient> client; + ComPtr<IAudioEndpointVolume> endpoint_volume; + std::atomic<bool> endpoint_muted = { false }; + Wasapi2EndpointVolumeCallback *volume_callback = nullptr; + Wasapi2ActivationHandler *activator = nullptr; + std::mutex lock; + std::condition_variable cond; + std::string device_id; + GstWasapi2EndpointClass device_class; + guint target_pid; + gboolean is_default_device = FALSE; + + void ClearCOM () + { + if (volume_callback && endpoint_volume) + endpoint_volume->UnregisterControlChangeNotify (volume_callback); + if (activator) + activator->Release (); + client = nullptr; + if (volume_callback) + volume_callback->Release (); + endpoint_volume = nullptr; + device = nullptr; + enumerator = nullptr; + } +}; +/* *INDENT-ON* */ + +struct _GstWasapi2Object +{ + GstObject parent; + + GstWasapi2ObjectPrivate *priv; + + GThread *thread; + GMainContext *context; + GMainLoop *loop; + GstCaps *caps; +}; + +static void gst_wasapi2_object_finalize (GObject * object); + +#define gst_wasapi2_object_parent_class parent_class +G_DEFINE_TYPE (GstWasapi2Object, gst_wasapi2_object, GST_TYPE_OBJECT); + +static void +gst_wasapi2_object_class_init (GstWasapi2ObjectClass * klass) +{ + auto object_class = G_OBJECT_CLASS (klass); + + object_class->finalize = gst_wasapi2_object_finalize; +} + +static void +gst_wasapi2_object_init (GstWasapi2Object * self) +{ + self->priv = new GstWasapi2ObjectPrivate (); + self->context = g_main_context_new (); + self->loop = g_main_loop_new (self->context, FALSE); +} + +static void +gst_wasapi2_object_finalize (GObject * object) +{ + auto self = GST_WASAPI2_OBJECT (object); + + g_main_loop_quit (self->loop); + g_thread_join (self->thread); + g_main_loop_unref (self->loop);
View file
_service:download_url:gst-plugins-bad-1.26.5.tar.xz/sys/wasapi2/gstwasapi2object.h
Added
@@ -0,0 +1,44 @@ +/* GStreamer + * Copyright (C) 2025 Seungha Yang <seungha@centricular.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#pragma once + +#include <gst/gst.h> +#include "gstwasapi2util.h" + +G_BEGIN_DECLS + +#define GST_TYPE_WASAPI2_OBJECT (gst_wasapi2_object_get_type ()) +G_DECLARE_FINAL_TYPE (GstWasapi2Object, gst_wasapi2_object, + GST, WASAPI2_OBJECT, GstObject); + +GstWasapi2Object * gst_wasapi2_object_new (GstWasapi2EndpointClass device_class, + const gchar * device_id, + guint target_pid); + +GstCaps * gst_wasapi2_object_get_caps (GstWasapi2Object * object); + +IAudioClient * gst_wasapi2_object_get_handle (GstWasapi2Object * object); + +gboolean gst_wasapi2_object_is_endpoint_muted (GstWasapi2Object * object); + +gboolean gst_wasapi2_object_auto_routing_supported (GstWasapi2Object * object); + +G_END_DECLS +
View file
_service:download_url:gst-plugins-bad-1.26.4.tar.xz/sys/wasapi2/gstwasapi2ringbuffer.cpp -> _service:download_url:gst-plugins-bad-1.26.5.tar.xz/sys/wasapi2/gstwasapi2ringbuffer.cpp
Changed
@@ -18,6 +18,7 @@ */ #include "gstwasapi2ringbuffer.h" +#include "gstwasapi2object.h" #include <string.h> #include <mfapi.h> #include <wrl.h> @@ -59,11 +60,13 @@ { } + virtual ~GstWasapiAsyncCallback () { } + /* IUnknown */ STDMETHODIMP_ (ULONG) AddRef (void) { - GST_TRACE ("%p, %d", this, ref_count_); + GST_TRACE ("%p, %u", this, (guint) ref_count_); return InterlockedIncrement (&ref_count_); } STDMETHODIMP_ (ULONG) @@ -71,7 +74,7 @@ { ULONG ref_count; - GST_TRACE ("%p, %d", this, ref_count_); + GST_TRACE ("%p, %u", this, (guint) ref_count_); ref_count = InterlockedDecrement (&ref_count_); if (ref_count == 0) { @@ -151,7 +154,7 @@ { GstAudioRingBuffer parent; - GstWasapi2ClientDeviceClass device_class; + GstWasapi2EndpointClass device_class; gchar *device_id; gboolean low_latency; gboolean mute; @@ -160,8 +163,8 @@ gboolean can_auto_routing; guint loopback_target_pid; - GstWasapi2Client *client; - GstWasapi2Client *loopback_client; + GstWasapi2Object *client; + GstWasapi2Object *loopback_client; IAudioCaptureClient *capture_client; IAudioRenderClient *render_client; IAudioStreamVolume *volume_object; @@ -344,7 +347,7 @@ return; } - if (self->device_class == GST_WASAPI2_CLIENT_DEVICE_CLASS_RENDER) { + if (self->device_class == GST_WASAPI2_ENDPOINT_CLASS_RENDER) { GST_ELEMENT_ERROR (parent, RESOURCE, OPEN_WRITE, (nullptr), ("Failed to open device")); } else { @@ -380,13 +383,14 @@ error_msg = gst_wasapi2_util_get_error_message (hr); - GST_ERROR_OBJECT (self, "Posting I/O error %s (hr: 0x%x)", error_msg, hr); - if (self->device_class == GST_WASAPI2_CLIENT_DEVICE_CLASS_RENDER) { + GST_ERROR_OBJECT (self, "Posting I/O error %s (hr: 0x%x)", error_msg, + (guint) hr); + if (self->device_class == GST_WASAPI2_ENDPOINT_CLASS_RENDER) { GST_ELEMENT_ERROR (parent, RESOURCE, WRITE, - ("Failed to write to device"), ("%s, hr: 0x%x", error_msg, hr)); + ("Failed to write to device"), ("%s, hr: 0x%x", error_msg, (guint) hr)); } else { GST_ELEMENT_ERROR (parent, RESOURCE, READ, - ("Failed to read from device"), ("%s hr: 0x%x", error_msg, hr)); + ("Failed to read from device"), ("%s hr: 0x%x", error_msg, (guint) hr)); } g_free (error_msg); @@ -404,20 +408,21 @@ return TRUE; } - self->client = gst_wasapi2_client_new (self->device_class, - -1, self->device_id, self->loopback_target_pid, self->dispatcher); + self->client = gst_wasapi2_object_new (self->device_class, + self->device_id, self->loopback_target_pid); if (!self->client) { gst_wasapi2_ring_buffer_post_open_error (self); return FALSE; } - g_object_get (self->client, "auto-routing", &self->can_auto_routing, nullptr); + self->can_auto_routing = + gst_wasapi2_object_auto_routing_supported (self->client); /* Open another render client to feed silence */ - if (gst_wasapi2_device_class_is_loopback (self->device_class)) { + if (gst_wasapi2_is_loopback_class (self->device_class)) { self->loopback_client = - gst_wasapi2_client_new (GST_WASAPI2_CLIENT_DEVICE_CLASS_RENDER, - -1, self->device_id, 0, self->dispatcher); + gst_wasapi2_object_new (GST_WASAPI2_ENDPOINT_CLASS_RENDER, + self->device_id, 0); if (!self->loopback_client) { gst_wasapi2_ring_buffer_post_open_error (self); @@ -500,7 +505,7 @@ is_device_muted = self->priv->monitor_device_mute.load (std::memory_order_acquire) && - gst_wasapi2_client_is_endpoint_muted (self->client); + gst_wasapi2_object_is_endpoint_muted (self->client); to_read_bytes = to_read * GST_AUDIO_INFO_BPF (info); @@ -509,7 +514,7 @@ self->expected_position); /* XXX: position might not be increased in case of process loopback */ - if (!gst_wasapi2_device_class_is_process_loopback (self->device_class)) { + if (!gst_wasapi2_is_process_loopback_class (self->device_class)) { if (self->is_first) { self->expected_position = position + to_read; self->is_first = FALSE; @@ -540,7 +545,7 @@ g_assert (self->segoffset >= 0); len -= self->segoffset; - if (len > gap_size) + if (len > (gint) gap_size) len = gap_size; gst_audio_format_info_fill_silence (ringbuffer->spec.info.finfo, @@ -563,7 +568,7 @@ } len -= self->segoffset; - if (len > to_read_bytes) + if (len > (gint) to_read_bytes) len = to_read_bytes; if (((flags & AUDCLNT_BUFFERFLAGS_SILENT) == AUDCLNT_BUFFERFLAGS_SILENT) || @@ -607,7 +612,7 @@ gint len; BYTE *data = nullptr; - client_handle = gst_wasapi2_client_get_handle (self->client); + client_handle = gst_wasapi2_object_get_handle (self->client); if (!client_handle) { GST_ERROR_OBJECT (self, "IAudioClient is not available"); return E_FAIL; @@ -667,7 +672,7 @@ len -= self->segoffset; - if (len > can_write_bytes) + if (len > (gint) can_write_bytes) len = can_write_bytes; can_write = len / GST_AUDIO_INFO_BPF (&ringbuffer->spec.info); @@ -712,13 +717,13 @@ } switch (self->device_class) { - case GST_WASAPI2_CLIENT_DEVICE_CLASS_CAPTURE: - case GST_WASAPI2_CLIENT_DEVICE_CLASS_LOOPBACK_CAPTURE: - case GST_WASAPI2_CLIENT_DEVICE_CLASS_INCLUDE_PROCESS_LOOPBACK_CAPTURE: - case GST_WASAPI2_CLIENT_DEVICE_CLASS_EXCLUDE_PROCESS_LOOPBACK_CAPTURE: + case GST_WASAPI2_ENDPOINT_CLASS_CAPTURE: + case GST_WASAPI2_ENDPOINT_CLASS_LOOPBACK_CAPTURE: + case GST_WASAPI2_ENDPOINT_CLASS_INCLUDE_PROCESS_LOOPBACK_CAPTURE: + case GST_WASAPI2_ENDPOINT_CLASS_EXCLUDE_PROCESS_LOOPBACK_CAPTURE: hr = gst_wasapi2_ring_buffer_read (self); break; - case GST_WASAPI2_CLIENT_DEVICE_CLASS_RENDER: + case GST_WASAPI2_ENDPOINT_CLASS_RENDER: hr = gst_wasapi2_ring_buffer_write (self, FALSE); break; default: @@ -731,8 +736,8 @@ * loopback capture client doesn't seem to be able to recover status from this * situation */ if (self->can_auto_routing && - !gst_wasapi2_device_class_is_loopback (self->device_class) && - !gst_wasapi2_device_class_is_process_loopback (self->device_class) && + !gst_wasapi2_is_loopback_class (self->device_class) && + !gst_wasapi2_is_process_loopback_class (self->device_class) && (hr == AUDCLNT_E_ENDPOINT_CREATE_FAILED || hr == AUDCLNT_E_DEVICE_INVALIDATED)) { GST_WARNING_OBJECT (self, @@ -744,7 +749,7 @@ if (gst_wasapi2_result (hr) && /* In case of normal loopback capture, this method is called from * silence feeding thread. Don't schedule again in that case */ - self->device_class != GST_WASAPI2_CLIENT_DEVICE_CLASS_LOOPBACK_CAPTURE) { + self->device_class != GST_WASAPI2_ENDPOINT_CLASS_LOOPBACK_CAPTURE) { hr = MFPutWaitingWorkItem (self->event_handle, 0, self->callback_result, &self->callback_key);
View file
_service:download_url:gst-plugins-bad-1.26.4.tar.xz/sys/wasapi2/gstwasapi2ringbuffer.h -> _service:download_url:gst-plugins-bad-1.26.5.tar.xz/sys/wasapi2/gstwasapi2ringbuffer.h
Changed
@@ -22,7 +22,7 @@ #include <gst/gst.h> #include <gst/audio/audio.h> -#include "gstwasapi2client.h" +#include "gstwasapi2util.h" G_BEGIN_DECLS @@ -30,7 +30,7 @@ G_DECLARE_FINAL_TYPE (GstWasapi2RingBuffer, gst_wasapi2_ring_buffer, GST, WASAPI2_RING_BUFFER, GstAudioRingBuffer); -GstAudioRingBuffer * gst_wasapi2_ring_buffer_new (GstWasapi2ClientDeviceClass device_class, +GstAudioRingBuffer * gst_wasapi2_ring_buffer_new (GstWasapi2EndpointClass device_class, gboolean low_latency, const gchar *device_id, gpointer dispatcher,
View file
_service:download_url:gst-plugins-bad-1.26.4.tar.xz/sys/wasapi2/gstwasapi2sink.c -> _service:download_url:gst-plugins-bad-1.26.5.tar.xz/sys/wasapi2/gstwasapi2sink.c
Changed
@@ -124,7 +124,7 @@ g_object_class_install_property (gobject_class, PROP_DEVICE, g_param_spec_string ("device", "Device", "Audio device ID as provided by " - "Windows.Devices.Enumeration.DeviceInformation.Id", + "WASAPI device endpoint ID as provided by IMMDevice::GetId", NULL, GST_PARAM_MUTABLE_READY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); @@ -333,7 +333,7 @@ name = g_strdup_printf ("%s-ringbuffer", GST_OBJECT_NAME (sink)); ringbuffer = - gst_wasapi2_ring_buffer_new (GST_WASAPI2_CLIENT_DEVICE_CLASS_RENDER, + gst_wasapi2_ring_buffer_new (GST_WASAPI2_ENDPOINT_CLASS_RENDER, self->low_latency, self->device_id, self->dispatcher, name, 0); g_free (name);
View file
_service:download_url:gst-plugins-bad-1.26.4.tar.xz/sys/wasapi2/gstwasapi2src.c -> _service:download_url:gst-plugins-bad-1.26.5.tar.xz/sys/wasapi2/gstwasapi2src.c
Changed
@@ -194,7 +194,7 @@ g_object_class_install_property (gobject_class, PROP_DEVICE, g_param_spec_string ("device", "Device", "Audio device ID as provided by " - "Windows.Devices.Enumeration.DeviceInformation.Id", + "WASAPI device endpoint ID as provided by IMMDevice::GetId", NULL, GST_PARAM_MUTABLE_READY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); @@ -493,20 +493,19 @@ GstWasapi2Src *self = GST_WASAPI2_SRC (src); GstAudioRingBuffer *ringbuffer; gchar *name; - GstWasapi2ClientDeviceClass device_class = - GST_WASAPI2_CLIENT_DEVICE_CLASS_CAPTURE; + GstWasapi2EndpointClass device_class = GST_WASAPI2_ENDPOINT_CLASS_CAPTURE; if (self->loopback_pid) { if (self->loopback_mode == GST_WASAPI2_SRC_LOOPBACK_INCLUDE_PROCESS_TREE) { device_class = - GST_WASAPI2_CLIENT_DEVICE_CLASS_INCLUDE_PROCESS_LOOPBACK_CAPTURE; + GST_WASAPI2_ENDPOINT_CLASS_INCLUDE_PROCESS_LOOPBACK_CAPTURE; } else if (self->loopback_mode == GST_WASAPI2_SRC_LOOPBACK_EXCLUDE_PROCESS_TREE) { device_class = - GST_WASAPI2_CLIENT_DEVICE_CLASS_EXCLUDE_PROCESS_LOOPBACK_CAPTURE; + GST_WASAPI2_ENDPOINT_CLASS_EXCLUDE_PROCESS_LOOPBACK_CAPTURE; } } else if (self->loopback) { - device_class = GST_WASAPI2_CLIENT_DEVICE_CLASS_LOOPBACK_CAPTURE; + device_class = GST_WASAPI2_ENDPOINT_CLASS_LOOPBACK_CAPTURE; } GST_DEBUG_OBJECT (self, "Device class %d", device_class);
View file
_service:download_url:gst-plugins-bad-1.26.5.tar.xz/sys/wasapi2/gstwasapi2util.cpp
Added
@@ -0,0 +1,594 @@ +/* + * Copyright (C) 2008 Ole André Vadla Ravnås <ole.andre.ravnas@tandberg.com> + * Copyright (C) 2018 Centricular Ltd. + * Author: Nirbheek Chauhan <nirbheek@centricular.com> + * Copyright (C) 2020 Seungha Yang <seungha@centricular.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include "gstwasapi2util.h" +#include <audioclient.h> +#include <mmdeviceapi.h> +#include <winternl.h> +#include <mutex> +#include <string.h> + +GST_DEBUG_CATEGORY_EXTERN (gst_wasapi2_debug); +#define GST_CAT_DEFAULT gst_wasapi2_debug + +/* Desktop only defines */ +#ifndef KSAUDIO_SPEAKER_MONO +#define KSAUDIO_SPEAKER_MONO (SPEAKER_FRONT_CENTER) +#endif +#ifndef KSAUDIO_SPEAKER_1POINT1 +#define KSAUDIO_SPEAKER_1POINT1 (SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY) +#endif +#ifndef KSAUDIO_SPEAKER_STEREO +#define KSAUDIO_SPEAKER_STEREO (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT) +#endif +#ifndef KSAUDIO_SPEAKER_2POINT1 +#define KSAUDIO_SPEAKER_2POINT1 (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_LOW_FREQUENCY) +#endif +#ifndef KSAUDIO_SPEAKER_3POINT0 +#define KSAUDIO_SPEAKER_3POINT0 (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER) +#endif +#ifndef KSAUDIO_SPEAKER_3POINT1 +#define KSAUDIO_SPEAKER_3POINT1 (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | \ + SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY) +#endif +#ifndef KSAUDIO_SPEAKER_QUAD +#define KSAUDIO_SPEAKER_QUAD (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | \ + SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT) +#endif +#define KSAUDIO_SPEAKER_SURROUND (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | \ + SPEAKER_FRONT_CENTER | SPEAKER_BACK_CENTER) +#ifndef KSAUDIO_SPEAKER_5POINT0 +#define KSAUDIO_SPEAKER_5POINT0 (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | \ + SPEAKER_SIDE_LEFT | SPEAKER_SIDE_RIGHT) +#endif +#define KSAUDIO_SPEAKER_5POINT1 (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | \ + SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | \ + SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT) +#ifndef KSAUDIO_SPEAKER_7POINT0 +#define KSAUDIO_SPEAKER_7POINT0 (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | \ + SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT | \ + SPEAKER_SIDE_LEFT | SPEAKER_SIDE_RIGHT) +#endif +#ifndef KSAUDIO_SPEAKER_7POINT1 +#define KSAUDIO_SPEAKER_7POINT1 (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | \ + SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | \ + SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT | \ + SPEAKER_FRONT_LEFT_OF_CENTER | SPEAKER_FRONT_RIGHT_OF_CENTER) +#endif + +/* *INDENT-OFF* */ +static struct +{ + guint64 wasapi_pos; + GstAudioChannelPosition gst_pos; +} wasapi_to_gst_pos = { + {SPEAKER_FRONT_LEFT, GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT}, + {SPEAKER_FRONT_RIGHT, GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT}, + {SPEAKER_FRONT_CENTER, GST_AUDIO_CHANNEL_POSITION_FRONT_CENTER}, + {SPEAKER_LOW_FREQUENCY, GST_AUDIO_CHANNEL_POSITION_LFE1}, + {SPEAKER_BACK_LEFT, GST_AUDIO_CHANNEL_POSITION_REAR_LEFT}, + {SPEAKER_BACK_RIGHT, GST_AUDIO_CHANNEL_POSITION_REAR_RIGHT}, + {SPEAKER_FRONT_LEFT_OF_CENTER, + GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT_OF_CENTER}, + {SPEAKER_FRONT_RIGHT_OF_CENTER, + GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT_OF_CENTER}, + {SPEAKER_BACK_CENTER, GST_AUDIO_CHANNEL_POSITION_REAR_CENTER}, + /* Enum values diverge from this point onwards */ + {SPEAKER_SIDE_LEFT, GST_AUDIO_CHANNEL_POSITION_SIDE_LEFT}, + {SPEAKER_SIDE_RIGHT, GST_AUDIO_CHANNEL_POSITION_SIDE_RIGHT}, + {SPEAKER_TOP_CENTER, GST_AUDIO_CHANNEL_POSITION_TOP_CENTER}, + {SPEAKER_TOP_FRONT_LEFT, GST_AUDIO_CHANNEL_POSITION_TOP_FRONT_LEFT}, + {SPEAKER_TOP_FRONT_CENTER, GST_AUDIO_CHANNEL_POSITION_TOP_FRONT_CENTER}, + {SPEAKER_TOP_FRONT_RIGHT, GST_AUDIO_CHANNEL_POSITION_TOP_FRONT_RIGHT}, + {SPEAKER_TOP_BACK_LEFT, GST_AUDIO_CHANNEL_POSITION_TOP_REAR_LEFT}, + {SPEAKER_TOP_BACK_CENTER, GST_AUDIO_CHANNEL_POSITION_TOP_REAR_CENTER}, + {SPEAKER_TOP_BACK_RIGHT, GST_AUDIO_CHANNEL_POSITION_TOP_REAR_RIGHT} +}; + +static DWORD default_ch_masks = { + 0, + KSAUDIO_SPEAKER_MONO, + /* 2ch */ + KSAUDIO_SPEAKER_STEREO, + /* 2.1ch */ + /* KSAUDIO_SPEAKER_3POINT0 ? */ + KSAUDIO_SPEAKER_2POINT1, + /* 4ch */ + /* KSAUDIO_SPEAKER_3POINT1 or KSAUDIO_SPEAKER_SURROUND ? */ + KSAUDIO_SPEAKER_QUAD, + /* 5ch */ + KSAUDIO_SPEAKER_5POINT0, + /* 5.1ch */ + KSAUDIO_SPEAKER_5POINT1, + /* 7ch */ + KSAUDIO_SPEAKER_7POINT0, + /* 7.1ch */ + KSAUDIO_SPEAKER_7POINT1, +}; +/* *INDENT-ON* */ + +static const gchar * +hresult_to_string_fallback (HRESULT hr) +{ + const gchar *s = "unknown error"; + + switch (hr) { + case AUDCLNT_E_NOT_INITIALIZED: + s = "AUDCLNT_E_NOT_INITIALIZED"; + break; + case AUDCLNT_E_ALREADY_INITIALIZED: + s = "AUDCLNT_E_ALREADY_INITIALIZED"; + break; + case AUDCLNT_E_WRONG_ENDPOINT_TYPE: + s = "AUDCLNT_E_WRONG_ENDPOINT_TYPE"; + break; + case AUDCLNT_E_DEVICE_INVALIDATED: + s = "AUDCLNT_E_DEVICE_INVALIDATED"; + break; + case AUDCLNT_E_NOT_STOPPED: + s = "AUDCLNT_E_NOT_STOPPED"; + break; + case AUDCLNT_E_BUFFER_TOO_LARGE: + s = "AUDCLNT_E_BUFFER_TOO_LARGE"; + break; + case AUDCLNT_E_OUT_OF_ORDER: + s = "AUDCLNT_E_OUT_OF_ORDER"; + break; + case AUDCLNT_E_UNSUPPORTED_FORMAT: + s = "AUDCLNT_E_UNSUPPORTED_FORMAT"; + break; + case AUDCLNT_E_INVALID_DEVICE_PERIOD: + s = "AUDCLNT_E_INVALID_DEVICE_PERIOD"; + break; + case AUDCLNT_E_INVALID_SIZE: + s = "AUDCLNT_E_INVALID_SIZE"; + break; + case AUDCLNT_E_DEVICE_IN_USE: + s = "AUDCLNT_E_DEVICE_IN_USE"; + break; + case AUDCLNT_E_BUFFER_OPERATION_PENDING: + s = "AUDCLNT_E_BUFFER_OPERATION_PENDING"; + break; + case AUDCLNT_E_BUFFER_SIZE_ERROR: + s = "AUDCLNT_E_BUFFER_SIZE_ERROR"; + break; + case AUDCLNT_E_BUFFER_SIZE_NOT_ALIGNED: + s = "AUDCLNT_E_BUFFER_SIZE_NOT_ALIGNED"; + break; + case AUDCLNT_E_THREAD_NOT_REGISTERED: + s = "AUDCLNT_E_THREAD_NOT_REGISTERED"; + break; + case AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED: + s = "AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED"; + break; + case AUDCLNT_E_ENDPOINT_CREATE_FAILED: + s = "AUDCLNT_E_ENDPOINT_CREATE_FAILED"; + break; + case AUDCLNT_E_SERVICE_NOT_RUNNING: + s = "AUDCLNT_E_SERVICE_NOT_RUNNING"; + break; + case AUDCLNT_E_EVENTHANDLE_NOT_EXPECTED: + s = "AUDCLNT_E_EVENTHANDLE_NOT_EXPECTED"; + break; + case AUDCLNT_E_EXCLUSIVE_MODE_ONLY: + s = "AUDCLNT_E_EXCLUSIVE_MODE_ONLY"; + break; + case AUDCLNT_E_BUFDURATION_PERIOD_NOT_EQUAL: + s = "AUDCLNT_E_BUFDURATION_PERIOD_NOT_EQUAL";
View file
_service:download_url:gst-plugins-bad-1.26.4.tar.xz/sys/wasapi2/gstwasapi2util.h -> _service:download_url:gst-plugins-bad-1.26.5.tar.xz/sys/wasapi2/gstwasapi2util.h
Changed
@@ -26,6 +26,8 @@ #include <initguid.h> #include <audioclient.h> #include <endpointvolume.h> +#include <string.h> +#include <mmdeviceapi.h> G_BEGIN_DECLS @@ -57,6 +59,42 @@ _gst_wasapi2_result (result, NULL, __FILE__, GST_FUNCTION, __LINE__) #endif +typedef enum +{ + GST_WASAPI2_ENDPOINT_CLASS_CAPTURE = 0, + GST_WASAPI2_ENDPOINT_CLASS_RENDER, + GST_WASAPI2_ENDPOINT_CLASS_LOOPBACK_CAPTURE, + GST_WASAPI2_ENDPOINT_CLASS_INCLUDE_PROCESS_LOOPBACK_CAPTURE, + GST_WASAPI2_ENDPOINT_CLASS_EXCLUDE_PROCESS_LOOPBACK_CAPTURE, +} GstWasapi2EndpointClass; + +static inline gboolean +gst_wasapi2_is_loopback_class (GstWasapi2EndpointClass device_class) +{ + switch (device_class) { + case GST_WASAPI2_ENDPOINT_CLASS_LOOPBACK_CAPTURE: + return TRUE; + default: + break; + } + + return FALSE; +} + +static inline gboolean +gst_wasapi2_is_process_loopback_class (GstWasapi2EndpointClass device_class) +{ + switch (device_class) { + case GST_WASAPI2_ENDPOINT_CLASS_INCLUDE_PROCESS_LOOPBACK_CAPTURE: + case GST_WASAPI2_ENDPOINT_CLASS_EXCLUDE_PROCESS_LOOPBACK_CAPTURE: + return TRUE; + default: + break; + } + + return FALSE; +} + guint64 gst_wasapi2_util_waveformatex_to_channel_mask (WAVEFORMATEX * format, GstAudioChannelPosition ** out_position); @@ -75,6 +113,20 @@ WAVEFORMATEX * gst_wasapi2_get_default_mix_format (void); +const wchar_t * gst_wasapi2_get_default_device_id_wide (EDataFlow flow); + +const char * gst_wasapi2_get_default_device_id (EDataFlow flow); + G_END_DECLS +#ifdef __cplusplus +#include <mutex> + +#define GST_WASAPI2_CALL_ONCE_BEGIN \ + static std::once_flag __once_flag; \ + std::call_once (__once_flag, &() + +#define GST_WASAPI2_CALL_ONCE_END ) +#endif + #endif /* __GST_WASAPI_UTIL_H__ */
View file
_service:download_url:gst-plugins-bad-1.26.4.tar.xz/sys/wasapi2/meson.build -> _service:download_url:gst-plugins-bad-1.26.5.tar.xz/sys/wasapi2/meson.build
Changed
@@ -1,11 +1,13 @@ wasapi2_sources = 'gstwasapi2src.c', 'gstwasapi2sink.c', - 'gstwasapi2util.c', - 'gstwasapi2client.cpp', - 'gstwasapi2device.c', + 'gstwasapi2util.cpp', + 'gstwasapi2device.cpp', 'gstwasapi2ringbuffer.cpp', - 'plugin.c', + 'gstwasapi2activator.cpp', + 'gstwasapi2enumerator.cpp', + 'gstwasapi2object.cpp', + 'plugin.cpp', wasapi2_headers = @@ -14,8 +16,7 @@ 'gstwasapi2util.h', 'gstwasapi2src.h', 'gstwasapi2sink.h', - 'gstwasapi2client.h', - 'AsyncOperations.h', + 'gstwasapi2object.h', mmdeviceapi_symbols = @@ -44,11 +45,10 @@ ole32_dep = cc.find_library('ole32', required : get_option('wasapi2')) ksuser_dep = cc.find_library('ksuser', required : get_option('wasapi2')) -runtimeobject_dep = cc.find_library('runtimeobject', required : get_option('wasapi2')) mmdeviceapi_dep = cc.find_library('mmdevapi', required : get_option('wasapi2')) mfplat_dep = cc.find_library('mfplat', required : get_option('wasapi2')) -wasapi2_dep = ole32_dep, ksuser_dep, runtimeobject_dep, mmdeviceapi_dep, mfplat_dep -extra_args = '-DGST_USE_UNSTABLE_API' +wasapi2_dep = ole32_dep, ksuser_dep, mmdeviceapi_dep, mfplat_dep +extra_args = foreach dep: wasapi2_dep if not dep.found() @@ -78,40 +78,6 @@ endif endforeach -winapi_app = cxx.compiles('''#include <winapifamily.h> - #include <windows.applicationmodel.core.h> - #include <wrl.h> - #include <wrl/wrappers/corewrappers.h> - #include <audioclient.h> - #include <mmdeviceapi.h> - #if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) - #error "not winrt" - #endif - int main (int argc, char ** argv) { - IAudioClient3 *client = NULL; - return 0; - } ''', - dependencies: wasapi2_dep, - name: 'building for WINAPI_PARTITION_APP') - -if not winapi_app - if wasapi2_option.enabled() - error('wasapi2 plugin was enabled explicitly, but build target is not include WINAPI_PARTITION_APP') - else - subdir_done() - endif -endif - -winapi_desktop = cxx.compiles('''#include <winapifamily.h> - #if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) - #error "not win32" - #endif''', - name: 'building for WINAPI_PARTITION_DESKTOP') - -if winapi_app and not winapi_desktop - extra_args += '-DGST_WASAPI2_WINAPI_ONLY_APP' -endif - win10_sdk = cxx.compiles('''#include <windows.h> #ifndef WDK_NTDDI_VERSION #error "unknown Windows SDK version" @@ -145,24 +111,13 @@ extra_args += '-U_WIN32_WINNT', '-UWINVER', '-DWINVER=0x0A00', '-D_WIN32_WINNT=0x0A00', '-DNTDDI_VERSION=WDK_NTDDI_VERSION' endif -if not gstwinrt_dep.found() - if wasapi2_option.enabled() - error('wasapi2 plugin was enabled explicitly, but GstWinRt library is unavailable') - else - subdir_done() - endif -endif - -# Work around for Windows SDK header issue -# https://docs.microsoft.com/en-us/cpp/build/reference/permissive-standards-conformance?view=msvc-160#windows-header-issues -extra_cpp_args = cxx.get_supported_arguments('/Zc:twoPhase-') - gstwasapi2 = library('gstwasapi2', wasapi2_sources, - c_args : gst_plugins_bad_args + '-DCOBJMACROS' + extra_args, - cpp_args : gst_plugins_bad_args + extra_args + extra_cpp_args, + c_args : gst_plugins_bad_args + extra_args, + cpp_args : gst_plugins_bad_args + extra_args, include_directories : configinc, - dependencies : gstaudio_dep, gstwinrt_dep + wasapi2_dep, + dependencies : gstaudio_dep + wasapi2_dep, + override_options : 'cpp_std=c++14', install : true, install_dir : plugins_install_dir) plugins += gstwasapi2
View file
_service:download_url:gst-plugins-bad-1.26.5.tar.xz/sys/wasapi2/plugin.cpp
Added
@@ -0,0 +1,80 @@ +/* GStreamer + * Copyright (C) 2020 Seungha Yang <seungha@centricular.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include <winapifamily.h> + +#include "gstwasapi2sink.h" +#include "gstwasapi2src.h" +#include "gstwasapi2device.h" +#include "gstwasapi2util.h" +#include <mfapi.h> + +GST_DEBUG_CATEGORY (gst_wasapi2_debug); +GST_DEBUG_CATEGORY (gst_wasapi2_client_debug); + +static void +plugin_deinit (gpointer data) +{ + MFShutdown (); +} + +static gboolean +plugin_init (GstPlugin * plugin) +{ + guint rank = GST_RANK_PRIMARY + 1; + HRESULT hr; + + /** + * plugin-wasapi2: + * + * Since: 1.18 + */ + + hr = MFStartup (MF_VERSION, MFSTARTUP_NOSOCKET); + if (!gst_wasapi2_result (hr)) { + GST_WARNING ("MFStartup failure, hr: 0x%x", (guint) hr); + return TRUE; + } + + GST_DEBUG_CATEGORY_INIT (gst_wasapi2_debug, "wasapi2", 0, "wasapi2"); + GST_DEBUG_CATEGORY_INIT (gst_wasapi2_client_debug, "wasapi2client", + 0, "wasapi2client"); + + gst_element_register (plugin, "wasapi2sink", rank, GST_TYPE_WASAPI2_SINK); + gst_element_register (plugin, "wasapi2src", rank, GST_TYPE_WASAPI2_SRC); + + gst_device_provider_register (plugin, "wasapi2deviceprovider", rank, + GST_TYPE_WASAPI2_DEVICE_PROVIDER); + + g_object_set_data_full (G_OBJECT (plugin), + "plugin-wasapi2-shutdown", (gpointer) "shutdown-data", + (GDestroyNotify) plugin_deinit); + + return TRUE; +} + +GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, + GST_VERSION_MINOR, + wasapi2, + "Windows audio session API plugin", + plugin_init, VERSION, "LGPL", GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.