77 lines
2.4 KiB
C
77 lines
2.4 KiB
C
/*
|
|
* This file is part of mpv.
|
|
*
|
|
* mpv is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
* License as published by the Free Software Foundation; either
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
*/
|
|
|
|
#ifndef MPV_HARMONY_HWDEC_H
|
|
#define MPV_HARMONY_HWDEC_H
|
|
|
|
#include <stdint.h>
|
|
|
|
#include "mpv/client.h"
|
|
|
|
struct OH_AVBuffer;
|
|
struct mp_log;
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
enum mp_harmony_hwdec_state {
|
|
MP_HARMONY_HWDEC_DISABLED,
|
|
MP_HARMONY_HWDEC_REQUESTED,
|
|
MP_HARMONY_HWDEC_CAPABILITY_CHECK,
|
|
MP_HARMONY_HWDEC_DEVICE_CREATED,
|
|
MP_HARMONY_HWDEC_DECODER_CREATED,
|
|
MP_HARMONY_HWDEC_DIRECT_SURFACE,
|
|
MP_HARMONY_HWDEC_GPU_INTEROP,
|
|
MP_HARMONY_HWDEC_ACTIVE,
|
|
MP_HARMONY_HWDEC_FALLBACK,
|
|
MP_HARMONY_HWDEC_ERROR,
|
|
};
|
|
|
|
#define MP_HARMONY_HWDEC_TEXT 128
|
|
|
|
struct mpv_harmony_hwdec_stats {
|
|
int hwdec_requested;
|
|
int hwdec_active;
|
|
int state;
|
|
int64_t hardware_frame_count;
|
|
int64_t software_frame_count;
|
|
int64_t hw_fallback_count;
|
|
int64_t native_buffer_import_count;
|
|
int64_t native_buffer_import_failure;
|
|
int64_t surface_present_count;
|
|
int64_t gpu_interop_frame_count;
|
|
char hwdec_backend[MP_HARMONY_HWDEC_TEXT];
|
|
char hw_device_type[MP_HARMONY_HWDEC_TEXT];
|
|
char decoder_name[MP_HARMONY_HWDEC_TEXT];
|
|
char fallback_reason[MP_HARMONY_HWDEC_TEXT];
|
|
char capability_summary[MP_HARMONY_HWDEC_TEXT];
|
|
};
|
|
|
|
MPV_EXPORT void mpv_harmony_hwdec_set_requested(int requested);
|
|
MPV_EXPORT void mpv_harmony_hwdec_set_state(enum mp_harmony_hwdec_state state);
|
|
MPV_EXPORT void mpv_harmony_hwdec_set_active(const char *backend,
|
|
const char *device_type);
|
|
MPV_EXPORT void mpv_harmony_hwdec_set_decoder(const char *decoder_name);
|
|
MPV_EXPORT void mpv_harmony_hwdec_set_capability(const char *summary);
|
|
MPV_EXPORT void mpv_harmony_hwdec_set_fallback(const char *reason);
|
|
MPV_EXPORT void mpv_harmony_hwdec_record_hardware_frame(void);
|
|
MPV_EXPORT void mpv_harmony_hwdec_record_software_frame(void);
|
|
MPV_EXPORT void mpv_harmony_hwdec_record_surface_present(void);
|
|
MPV_EXPORT void mpv_harmony_hwdec_record_gpu_interop_frame(void);
|
|
MPV_EXPORT int mpv_harmony_hwdec_get_stats(struct mpv_harmony_hwdec_stats *stats);
|
|
MPV_EXPORT int mpv_harmony_ohcodec_gl_probe(struct mp_log *log,
|
|
struct OH_AVBuffer *buffer);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif
|