mirror of
https://github.com/mpv-player/mpv
synced 2025-04-11 04:01:31 +00:00
ao_wasapi: remove unnecessary header file
All the wasapi files were including both ao_wasapi.h and ao_wasapi_utils.h. Just merge them into a single file.
This commit is contained in:
parent
bf611ff0f6
commit
27ccad541a
@ -17,23 +17,14 @@
|
|||||||
* with mpv. If not, see <http://www.gnu.org/licenses/>.
|
* with mpv. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
#include <process.h>
|
|
||||||
#include <initguid.h>
|
|
||||||
#include <audioclient.h>
|
|
||||||
#include <endpointvolume.h>
|
|
||||||
#include <mmdeviceapi.h>
|
|
||||||
#include <avrt.h>
|
|
||||||
#include <libavutil/mathematics.h>
|
#include <libavutil/mathematics.h>
|
||||||
|
|
||||||
#include "audio/out/ao_wasapi.h"
|
#include "options/m_option.h"
|
||||||
#include "audio/out/ao_wasapi_utils.h"
|
|
||||||
|
|
||||||
#include "audio/format.h"
|
|
||||||
#include "osdep/timer.h"
|
#include "osdep/timer.h"
|
||||||
#include "osdep/io.h"
|
#include "osdep/io.h"
|
||||||
|
#include "ao_wasapi.h"
|
||||||
|
|
||||||
// naive av_rescale for unsigned
|
// naive av_rescale for unsigned
|
||||||
static UINT64 uint64_scale(UINT64 x, UINT64 num, UINT64 den)
|
static UINT64 uint64_scale(UINT64 x, UINT64 num, UINT64 den)
|
||||||
|
@ -20,13 +20,18 @@
|
|||||||
#ifndef MP_AO_WASAPI_H_
|
#ifndef MP_AO_WASAPI_H_
|
||||||
#define MP_AO_WASAPI_H_
|
#define MP_AO_WASAPI_H_
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
#include <windows.h>
|
||||||
|
#include <mmdeviceapi.h>
|
||||||
#include <audioclient.h>
|
#include <audioclient.h>
|
||||||
#include <audiopolicy.h>
|
#include <audiopolicy.h>
|
||||||
#include <mmdeviceapi.h>
|
#include <endpointvolume.h>
|
||||||
#include <avrt.h>
|
|
||||||
|
|
||||||
|
#include "common/msg.h"
|
||||||
#include "osdep/atomics.h"
|
#include "osdep/atomics.h"
|
||||||
|
#include "internal.h"
|
||||||
|
#include "ao.h"
|
||||||
|
|
||||||
typedef struct change_notify {
|
typedef struct change_notify {
|
||||||
IMMNotificationClient client; // this must be first in the structure!
|
IMMNotificationClient client; // this must be first in the structure!
|
||||||
@ -109,4 +114,22 @@ typedef struct wasapi_state {
|
|||||||
change_notify change;
|
change_notify change;
|
||||||
} wasapi_state;
|
} wasapi_state;
|
||||||
|
|
||||||
|
char *mp_GUID_to_str_buf(char *buf, size_t buf_size, const GUID *guid);
|
||||||
|
char *mp_PKEY_to_str_buf(char *buf, size_t buf_size, const PROPERTYKEY *pkey);
|
||||||
|
char *mp_HRESULT_to_str_buf(char *buf, size_t buf_size, HRESULT hr);
|
||||||
|
#define mp_GUID_to_str(guid) mp_GUID_to_str_buf((char[40]){0}, 40, (guid))
|
||||||
|
#define mp_PKEY_to_str(pkey) mp_PKEY_to_str_buf((char[42]){0}, 42, (pkey))
|
||||||
|
#define mp_HRESULT_to_str(hr) mp_HRESULT_to_str_buf((char[60]){0}, 60, (hr))
|
||||||
|
#define mp_LastError_to_str() mp_HRESULT_to_str(HRESULT_FROM_WIN32(GetLastError()))
|
||||||
|
|
||||||
|
void wasapi_list_devs(struct ao *ao, struct ao_device_list *list);
|
||||||
|
LPWSTR find_deviceID(struct ao *ao);
|
||||||
|
|
||||||
|
void wasapi_dispatch(struct ao *ao);
|
||||||
|
HRESULT wasapi_thread_init(struct ao *ao);
|
||||||
|
void wasapi_thread_uninit(struct ao *ao);
|
||||||
|
|
||||||
|
void wasapi_receive_proxies(wasapi_state *state);
|
||||||
|
void wasapi_release_proxies(wasapi_state *state);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -17,15 +17,9 @@
|
|||||||
* with mpv. If not, see <http://www.gnu.org/licenses/>.
|
* with mpv. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <initguid.h>
|
|
||||||
#include <audioclient.h>
|
|
||||||
#include <endpointvolume.h>
|
|
||||||
#include <mmdeviceapi.h>
|
|
||||||
#include <wchar.h>
|
#include <wchar.h>
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
#include "ao_wasapi.h"
|
#include "ao_wasapi.h"
|
||||||
#include "ao_wasapi_utils.h"
|
|
||||||
|
|
||||||
static HRESULT STDMETHODCALLTYPE sIMMNotificationClient_QueryInterface(
|
static HRESULT STDMETHODCALLTYPE sIMMNotificationClient_QueryInterface(
|
||||||
IMMNotificationClient* This, REFIID riid, void **ppvObject)
|
IMMNotificationClient* This, REFIID riid, void **ppvObject)
|
||||||
|
@ -18,21 +18,18 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <libavutil/common.h>
|
#include <wchar.h>
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
#include <initguid.h>
|
||||||
#include <errors.h>
|
#include <errors.h>
|
||||||
#include <ksguid.h>
|
#include <ksguid.h>
|
||||||
#include <ksmedia.h>
|
#include <ksmedia.h>
|
||||||
#include <audioclient.h>
|
|
||||||
#include <endpointvolume.h>
|
|
||||||
#include <mmdeviceapi.h>
|
|
||||||
#include <avrt.h>
|
#include <avrt.h>
|
||||||
|
|
||||||
#include "audio/out/ao_wasapi_utils.h"
|
|
||||||
|
|
||||||
#include "audio/format.h"
|
#include "audio/format.h"
|
||||||
#include "osdep/io.h"
|
|
||||||
#include "osdep/timer.h"
|
#include "osdep/timer.h"
|
||||||
|
#include "osdep/io.h"
|
||||||
|
#include "ao_wasapi.h"
|
||||||
|
|
||||||
#define MIXER_DEFAULT_LABEL L"mpv - video player"
|
#define MIXER_DEFAULT_LABEL L"mpv - video player"
|
||||||
|
|
||||||
|
@ -1,48 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is part of mpv.
|
|
||||||
*
|
|
||||||
* Original author: Jonathan Yong <10walls@gmail.com>
|
|
||||||
*
|
|
||||||
* mpv is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* mpv 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 General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License along
|
|
||||||
* with mpv. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef MP_AO_WASAPI_UTILS_H_
|
|
||||||
#define MP_AO_WASAPI_UTILS_H_
|
|
||||||
|
|
||||||
#include "audio/out/ao_wasapi.h"
|
|
||||||
|
|
||||||
#include "options/m_option.h"
|
|
||||||
#include "common/msg.h"
|
|
||||||
#include "ao.h"
|
|
||||||
#include "internal.h"
|
|
||||||
|
|
||||||
char *mp_GUID_to_str_buf(char *buf, size_t buf_size, const GUID *guid);
|
|
||||||
char *mp_PKEY_to_str_buf(char *buf, size_t buf_size, const PROPERTYKEY *pkey);
|
|
||||||
char *mp_HRESULT_to_str_buf(char *buf, size_t buf_size, HRESULT hr);
|
|
||||||
#define mp_GUID_to_str(guid) mp_GUID_to_str_buf((char[40]){0}, 40, (guid))
|
|
||||||
#define mp_PKEY_to_str(pkey) mp_PKEY_to_str_buf((char[42]){0}, 42, (pkey))
|
|
||||||
#define mp_HRESULT_to_str(hr) mp_HRESULT_to_str_buf((char[60]){0}, 60, (hr))
|
|
||||||
#define mp_LastError_to_str() mp_HRESULT_to_str(HRESULT_FROM_WIN32(GetLastError()))
|
|
||||||
|
|
||||||
void wasapi_list_devs(struct ao *ao, struct ao_device_list *list);
|
|
||||||
LPWSTR find_deviceID(struct ao *ao);
|
|
||||||
|
|
||||||
void wasapi_dispatch(struct ao *ao);
|
|
||||||
HRESULT wasapi_thread_init(struct ao *ao);
|
|
||||||
void wasapi_thread_uninit(struct ao *ao);
|
|
||||||
|
|
||||||
void wasapi_receive_proxies(wasapi_state *state);
|
|
||||||
void wasapi_release_proxies(wasapi_state *state);
|
|
||||||
|
|
||||||
#endif
|
|
Loading…
Reference in New Issue
Block a user