directx_va.h 2.69 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
/*****************************************************************************
 * directx_va.h: DirectX Generic Video Acceleration helpers
 *****************************************************************************
 * Copyright (C) 2009 Geoffroy Couprie
 * Copyright (C) 2009 Laurent Aimar
 * Copyright (C) 2015 Steve Lhomme
 *
 * Authors: Geoffroy Couprie <geal@videolan.org>
 *          Laurent Aimar <fenrir _AT_ videolan _DOT_ org>
 *          Steve Lhomme <robux4@gmail.com>
 *
 * This program 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.
 *
 * This program 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 Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
 *****************************************************************************/

#ifndef AVCODEC_DIRECTX_VA_H
#define AVCODEC_DIRECTX_VA_H

30
# if _WIN32_WINNT < _WIN32_WINNT_VISTA
31 32
/* d3d11 needs Vista support */
#  undef _WIN32_WINNT
33
#  define _WIN32_WINNT _WIN32_WINNT_VISTA
34 35 36 37 38 39 40 41
# endif

#include <vlc_common.h>

#include <libavcodec/avcodec.h>
#include "va.h"

#include <unknwn.h>
42
#include <stdatomic.h>
43

44
#include "va_surface_internal.h"
45 46 47 48 49 50 51 52 53 54

typedef struct input_list_t {
    void (*pf_release)(struct input_list_t *);
    GUID *list;
    unsigned count;
} input_list_t;

#define MAX_SURFACE_COUNT (64)
typedef struct
{
55
    va_pool_t             va_pool;
56 57 58 59 60 61 62 63 64

    /**
     * Read the list of possible input GUIDs
     */
    int (*pf_get_input_list)(vlc_va_t *, input_list_t *);
    /**
     * Find a suitable decoder configuration for the input and set the
     * internal state to use that output
     */
65
    int (*pf_setup_output)(vlc_va_t *, const GUID *input, const video_format_t *fmt);
66 67 68

} directx_sys_t;

69
int directx_va_Open(vlc_va_t *, const struct va_pool_cfg *, directx_sys_t *);
70
void directx_va_Close(vlc_va_t *, directx_sys_t *);
71 72
int directx_va_Setup(vlc_va_t *, directx_sys_t *, const AVCodecContext *avctx, const es_format_t *, int flag_xbox,
                     video_format_t *fmt_out, unsigned *surface_count, GUID *found_guid);
73
char *directx_va_GetDecoderName(const GUID *guid);
74
bool directx_va_canUseDecoder(vlc_va_t *, UINT VendorId, UINT DeviceId, const GUID *pCodec, UINT driverBuild);
75 76

#endif /* AVCODEC_DIRECTX_VA_H */