mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-27 09:38:17 +00:00
wasapi: Fix indentation issues missed by the commit hook
These were missed because the relevant commits were made on Windows where `indent` wasn't installed.
This commit is contained in:
parent
e5c4135e81
commit
3f1e039007
5 changed files with 37 additions and 30 deletions
|
@ -27,12 +27,10 @@ G_DEFINE_TYPE (GstWasapiDeviceProvider, gst_wasapi_device_provider,
|
||||||
GST_TYPE_DEVICE_PROVIDER);
|
GST_TYPE_DEVICE_PROVIDER);
|
||||||
|
|
||||||
static void gst_wasapi_device_provider_finalize (GObject * object);
|
static void gst_wasapi_device_provider_finalize (GObject * object);
|
||||||
static GList *gst_wasapi_device_provider_probe (GstDeviceProvider *
|
static GList *gst_wasapi_device_provider_probe (GstDeviceProvider * provider);
|
||||||
provider);
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_wasapi_device_provider_class_init (GstWasapiDeviceProviderClass *
|
gst_wasapi_device_provider_class_init (GstWasapiDeviceProviderClass * klass)
|
||||||
klass)
|
|
||||||
{
|
{
|
||||||
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
||||||
GstDeviceProviderClass *dm_class = GST_DEVICE_PROVIDER_CLASS (klass);
|
GstDeviceProviderClass *dm_class = GST_DEVICE_PROVIDER_CLASS (klass);
|
||||||
|
|
|
@ -35,11 +35,13 @@ typedef struct _GstWasapiDeviceProviderClass GstWasapiDeviceProviderClass;
|
||||||
#define GST_WASAPI_DEVICE_PROVIDER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_DEVICE_PROVIDER, GstWasapiDeviceProviderClass))
|
#define GST_WASAPI_DEVICE_PROVIDER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_DEVICE_PROVIDER, GstWasapiDeviceProviderClass))
|
||||||
#define GST_WASAPI_DEVICE_PROVIDER_CAST(obj) ((GstWasapiDeviceProvider *)(obj))
|
#define GST_WASAPI_DEVICE_PROVIDER_CAST(obj) ((GstWasapiDeviceProvider *)(obj))
|
||||||
|
|
||||||
struct _GstWasapiDeviceProvider {
|
struct _GstWasapiDeviceProvider
|
||||||
|
{
|
||||||
GstDeviceProvider parent;
|
GstDeviceProvider parent;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _GstWasapiDeviceProviderClass {
|
struct _GstWasapiDeviceProviderClass
|
||||||
|
{
|
||||||
GstDeviceProviderClass parent_class;
|
GstDeviceProviderClass parent_class;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -57,14 +59,16 @@ typedef struct _GstWasapiDeviceClass GstWasapiDeviceClass;
|
||||||
#define GST_WASAPI_DEVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_DEVICE, GstWasapiDeviceClass))
|
#define GST_WASAPI_DEVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_DEVICE, GstWasapiDeviceClass))
|
||||||
#define GST_WASAPI_DEVICE_CAST(obj) ((GstWasapiDevice *)(obj))
|
#define GST_WASAPI_DEVICE_CAST(obj) ((GstWasapiDevice *)(obj))
|
||||||
|
|
||||||
struct _GstWasapiDevice {
|
struct _GstWasapiDevice
|
||||||
|
{
|
||||||
GstDevice parent;
|
GstDevice parent;
|
||||||
|
|
||||||
gchar *strid;
|
gchar *strid;
|
||||||
const gchar *element;
|
const gchar *element;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _GstWasapiDeviceClass {
|
struct _GstWasapiDeviceClass
|
||||||
|
{
|
||||||
GstDeviceClass parent_class;
|
GstDeviceClass parent_class;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -429,8 +429,8 @@ gst_wasapi_sink_prepare (GstAudioSink * asink, GstAudioRingBufferSpec * spec)
|
||||||
self->render_client = render_client;
|
self->render_client = render_client;
|
||||||
render_client = NULL;
|
render_client = NULL;
|
||||||
|
|
||||||
gst_audio_ring_buffer_set_channel_positions (
|
gst_audio_ring_buffer_set_channel_positions (GST_AUDIO_BASE_SINK
|
||||||
GST_AUDIO_BASE_SINK (self)->ringbuffer, self->positions);
|
(self)->ringbuffer, self->positions);
|
||||||
|
|
||||||
res = TRUE;
|
res = TRUE;
|
||||||
|
|
||||||
|
|
|
@ -350,7 +350,8 @@ gst_wasapi_src_prepare (GstAudioSrc * asrc, GstAudioRingBufferSpec * spec)
|
||||||
guint bpf, rate, buffer_frames;
|
guint bpf, rate, buffer_frames;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
hr = IAudioClient_GetDevicePeriod (self->client, &default_period, &min_period);
|
hr = IAudioClient_GetDevicePeriod (self->client, &default_period,
|
||||||
|
&min_period);
|
||||||
if (hr != S_OK) {
|
if (hr != S_OK) {
|
||||||
GST_ERROR_OBJECT (self, "IAudioClient::GetDevicePeriod failed");
|
GST_ERROR_OBJECT (self, "IAudioClient::GetDevicePeriod failed");
|
||||||
goto beach;
|
goto beach;
|
||||||
|
@ -437,8 +438,8 @@ gst_wasapi_src_prepare (GstAudioSrc * asrc, GstAudioRingBufferSpec * spec)
|
||||||
self->client_clock_freq = client_clock_freq;
|
self->client_clock_freq = client_clock_freq;
|
||||||
self->capture_client = capture_client;
|
self->capture_client = capture_client;
|
||||||
|
|
||||||
gst_audio_ring_buffer_set_channel_positions (
|
gst_audio_ring_buffer_set_channel_positions (GST_AUDIO_BASE_SRC
|
||||||
GST_AUDIO_BASE_SRC (self)->ringbuffer, self->positions);
|
(self)->ringbuffer, self->positions);
|
||||||
|
|
||||||
res = TRUE;
|
res = TRUE;
|
||||||
|
|
||||||
|
|
|
@ -29,12 +29,14 @@
|
||||||
|
|
||||||
/* This was only added to MinGW in ~2015 and our Cerbero toolchain is too old */
|
/* This was only added to MinGW in ~2015 and our Cerbero toolchain is too old */
|
||||||
#if defined(_MSC_VER)
|
#if defined(_MSC_VER)
|
||||||
#include <functiondiscoverykeys_devpkey.h>
|
#include <functiondiscoverykeys_devpkey.h>
|
||||||
#elif !defined(PKEY_Device_FriendlyName)
|
#elif !defined(PKEY_Device_FriendlyName)
|
||||||
#include <initguid.h>
|
#include <initguid.h>
|
||||||
#include <propkey.h>
|
#include <propkey.h>
|
||||||
DEFINE_PROPERTYKEY(PKEY_Device_FriendlyName, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 14);
|
DEFINE_PROPERTYKEY (PKEY_Device_FriendlyName, 0xa45c254e, 0xdf1c, 0x4efd, 0x80,
|
||||||
DEFINE_PROPERTYKEY(PKEY_AudioEngine_DeviceFormat, 0xf19f064d, 0x82c, 0x4e27, 0xbc, 0x73, 0x68, 0x82, 0xa1, 0xbb, 0x8e, 0x4c, 0);
|
0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 14);
|
||||||
|
DEFINE_PROPERTYKEY (PKEY_AudioEngine_DeviceFormat, 0xf19f064d, 0x82c, 0x4e27,
|
||||||
|
0xbc, 0x73, 0x68, 0x82, 0xa1, 0xbb, 0x8e, 0x4c, 0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -78,7 +80,8 @@ const IID IID_IAudioRenderClient = { 0xf294acfc, 0x3146, 0x4483,
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static struct {
|
static struct
|
||||||
|
{
|
||||||
guint64 wasapi_pos;
|
guint64 wasapi_pos;
|
||||||
GstAudioChannelPosition gst_pos;
|
GstAudioChannelPosition gst_pos;
|
||||||
} wasapi_to_gst_pos[] = {
|
} wasapi_to_gst_pos[] = {
|
||||||
|
@ -88,8 +91,10 @@ static struct {
|
||||||
{SPEAKER_LOW_FREQUENCY, GST_AUDIO_CHANNEL_POSITION_LFE1},
|
{SPEAKER_LOW_FREQUENCY, GST_AUDIO_CHANNEL_POSITION_LFE1},
|
||||||
{SPEAKER_BACK_LEFT, GST_AUDIO_CHANNEL_POSITION_REAR_LEFT},
|
{SPEAKER_BACK_LEFT, GST_AUDIO_CHANNEL_POSITION_REAR_LEFT},
|
||||||
{SPEAKER_BACK_RIGHT, GST_AUDIO_CHANNEL_POSITION_REAR_RIGHT},
|
{SPEAKER_BACK_RIGHT, GST_AUDIO_CHANNEL_POSITION_REAR_RIGHT},
|
||||||
{SPEAKER_FRONT_LEFT_OF_CENTER, GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT_OF_CENTER},
|
{SPEAKER_FRONT_LEFT_OF_CENTER,
|
||||||
{SPEAKER_FRONT_RIGHT_OF_CENTER, GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT_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},
|
{SPEAKER_BACK_CENTER, GST_AUDIO_CHANNEL_POSITION_REAR_CENTER},
|
||||||
/* Enum values diverge from this point onwards */
|
/* Enum values diverge from this point onwards */
|
||||||
{SPEAKER_SIDE_LEFT, GST_AUDIO_CHANNEL_POSITION_SIDE_LEFT},
|
{SPEAKER_SIDE_LEFT, GST_AUDIO_CHANNEL_POSITION_SIDE_LEFT},
|
||||||
|
@ -100,7 +105,7 @@ static struct {
|
||||||
{SPEAKER_TOP_FRONT_RIGHT, GST_AUDIO_CHANNEL_POSITION_TOP_FRONT_RIGHT},
|
{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_LEFT, GST_AUDIO_CHANNEL_POSITION_TOP_REAR_LEFT},
|
||||||
{SPEAKER_TOP_BACK_CENTER, GST_AUDIO_CHANNEL_POSITION_TOP_REAR_CENTER},
|
{SPEAKER_TOP_BACK_CENTER, GST_AUDIO_CHANNEL_POSITION_TOP_REAR_CENTER},
|
||||||
{SPEAKER_TOP_BACK_RIGHT, GST_AUDIO_CHANNEL_POSITION_TOP_REAR_RIGHT},
|
{SPEAKER_TOP_BACK_RIGHT, GST_AUDIO_CHANNEL_POSITION_TOP_REAR_RIGHT}
|
||||||
};
|
};
|
||||||
|
|
||||||
GType
|
GType
|
||||||
|
@ -252,7 +257,7 @@ gst_wasapi_util_hresult_to_string (HRESULT hr)
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
static IMMDeviceEnumerator*
|
static IMMDeviceEnumerator *
|
||||||
gst_wasapi_util_get_device_enumerator (GstElement * element)
|
gst_wasapi_util_get_device_enumerator (GstElement * element)
|
||||||
{
|
{
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
@ -379,7 +384,7 @@ gst_wasapi_util_get_devices (GstElement * element, gboolean active,
|
||||||
|
|
||||||
if (!gst_wasapi_util_parse_waveformatex ((WAVEFORMATEXTENSIBLE *) format,
|
if (!gst_wasapi_util_parse_waveformatex ((WAVEFORMATEXTENSIBLE *) format,
|
||||||
gst_static_caps_get (&scaps), &caps, NULL))
|
gst_static_caps_get (&scaps), &caps, NULL))
|
||||||
goto next;
|
goto next;
|
||||||
|
|
||||||
/* Set some useful properties */
|
/* Set some useful properties */
|
||||||
props = gst_structure_new ("wasapi-proplist",
|
props = gst_structure_new ("wasapi-proplist",
|
||||||
|
@ -390,13 +395,13 @@ gst_wasapi_util_get_devices (GstElement * element, gboolean active,
|
||||||
device = g_object_new (GST_TYPE_WASAPI_DEVICE, "device", strid,
|
device = g_object_new (GST_TYPE_WASAPI_DEVICE, "device", strid,
|
||||||
"display-name", description, "caps", caps,
|
"display-name", description, "caps", caps,
|
||||||
"device-class", device_class, "properties", props, NULL);
|
"device-class", device_class, "properties", props, NULL);
|
||||||
GST_WASAPI_DEVICE(device)->element = element_name;
|
GST_WASAPI_DEVICE (device)->element = element_name;
|
||||||
|
|
||||||
gst_structure_free (props);
|
gst_structure_free (props);
|
||||||
gst_caps_unref (caps);
|
gst_caps_unref (caps);
|
||||||
*devices = g_list_prepend (*devices, device);
|
*devices = g_list_prepend (*devices, device);
|
||||||
|
|
||||||
next:
|
next:
|
||||||
PropVariantClear (&var);
|
PropVariantClear (&var);
|
||||||
if (prop_store)
|
if (prop_store)
|
||||||
IUnknown_Release (prop_store);
|
IUnknown_Release (prop_store);
|
||||||
|
@ -631,7 +636,7 @@ gst_wasapi_util_waveformatex_to_channel_mask (WAVEFORMATEXTENSIBLE * format,
|
||||||
if (!(dwChannelMask & wasapi_to_gst_pos[ii].wasapi_pos))
|
if (!(dwChannelMask & wasapi_to_gst_pos[ii].wasapi_pos))
|
||||||
/* Non-positional or unknown position, warn? */
|
/* Non-positional or unknown position, warn? */
|
||||||
continue;
|
continue;
|
||||||
mask |= G_GUINT64_CONSTANT(1) << wasapi_to_gst_pos[ii].gst_pos;
|
mask |= G_GUINT64_CONSTANT (1) << wasapi_to_gst_pos[ii].gst_pos;
|
||||||
pos[ii] = wasapi_to_gst_pos[ii].gst_pos;
|
pos[ii] = wasapi_to_gst_pos[ii].gst_pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -682,8 +687,7 @@ gst_wasapi_util_parse_waveformatex (WAVEFORMATEXTENSIBLE * format,
|
||||||
"format", G_TYPE_STRING, afmt,
|
"format", G_TYPE_STRING, afmt,
|
||||||
"channels", G_TYPE_INT, format->Format.nChannels,
|
"channels", G_TYPE_INT, format->Format.nChannels,
|
||||||
"rate", G_TYPE_INT, format->Format.nSamplesPerSec,
|
"rate", G_TYPE_INT, format->Format.nSamplesPerSec,
|
||||||
"channel-mask", GST_TYPE_BITMASK, channel_mask,
|
"channel-mask", GST_TYPE_BITMASK, channel_mask, NULL);
|
||||||
NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
Loading…
Reference in a new issue