gallium: put video-related enums in separate header

The forward references to video enum types in p_context.h causes
a massive number of compiler warnings (ISO C forbids forward references
to ‘enum’ types).

By putting the new video enums in a separate header that can be included
by p_context.h and p_screen.h we can avoid this.

Acked-by Christian König <deathsimple@vodafone.de>
This commit is contained in:
Brian Paul 2011-07-14 08:09:21 -06:00
parent 9726947b68
commit a5a9422561
5 changed files with 80 additions and 45 deletions

View file

@ -33,6 +33,7 @@ extern "C" {
#endif
#include <pipe/p_defines.h>
#include <pipe/p_video_enums.h>
/* u_reduce_video_profile() needs these */
#include <pipe/p_compiler.h>

View file

@ -29,6 +29,8 @@
#define PIPE_CONTEXT_H
#include "p_compiler.h"
#include "p_format.h"
#include "p_video_enums.h"
#ifdef __cplusplus
extern "C" {
@ -57,12 +59,10 @@ struct pipe_stream_output_state;
struct pipe_surface;
struct pipe_vertex_buffer;
struct pipe_vertex_element;
struct pipe_video_buffer;
struct pipe_video_decoder;
struct pipe_viewport_state;
enum pipe_video_profile;
enum pipe_video_entrypoint;
enum pipe_video_chroma_format;
enum pipe_format;
/**
* Gallium rendering context. Basically:

View file

@ -493,47 +493,6 @@ enum pipe_shader_cap
PIPE_SHADER_CAP_SUBROUTINES = 16, /* BGNSUB, ENDSUB, CAL, RET */
};
/* Video caps, can be different for each codec/profile */
enum pipe_video_cap
{
PIPE_VIDEO_CAP_SUPPORTED = 0,
PIPE_VIDEO_CAP_NPOT_TEXTURES = 1,
PIPE_VIDEO_CAP_MAX_WIDTH = 2,
PIPE_VIDEO_CAP_MAX_HEIGHT = 3,
};
enum pipe_video_codec
{
PIPE_VIDEO_CODEC_UNKNOWN = 0,
PIPE_VIDEO_CODEC_MPEG12, /**< MPEG1, MPEG2 */
PIPE_VIDEO_CODEC_MPEG4, /**< DIVX, XVID */
PIPE_VIDEO_CODEC_VC1, /**< WMV */
PIPE_VIDEO_CODEC_MPEG4_AVC /**< H.264 */
};
enum pipe_video_profile
{
PIPE_VIDEO_PROFILE_UNKNOWN,
PIPE_VIDEO_PROFILE_MPEG1,
PIPE_VIDEO_PROFILE_MPEG2_SIMPLE,
PIPE_VIDEO_PROFILE_MPEG2_MAIN,
PIPE_VIDEO_PROFILE_MPEG4_SIMPLE,
PIPE_VIDEO_PROFILE_MPEG4_ADVANCED_SIMPLE,
PIPE_VIDEO_PROFILE_VC1_SIMPLE,
PIPE_VIDEO_PROFILE_VC1_MAIN,
PIPE_VIDEO_PROFILE_VC1_ADVANCED,
PIPE_VIDEO_PROFILE_MPEG4_AVC_BASELINE,
PIPE_VIDEO_PROFILE_MPEG4_AVC_MAIN,
PIPE_VIDEO_PROFILE_MPEG4_AVC_HIGH
};
enum pipe_video_entrypoint
{
PIPE_VIDEO_ENTRYPOINT_UNKNOWN,
PIPE_VIDEO_ENTRYPOINT_BITSTREAM,
PIPE_VIDEO_ENTRYPOINT_IDCT,
PIPE_VIDEO_ENTRYPOINT_MC
};
/**
* Composite query types

View file

@ -41,6 +41,7 @@
#include "pipe/p_compiler.h"
#include "pipe/p_format.h"
#include "pipe/p_defines.h"
#include "pipe/p_video_enums.h"

View file

@ -0,0 +1,74 @@
/**************************************************************************
*
* Copyright 2009 Younes Manton.
* All Rights Reserved.
*
* 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, sub license, 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 (including the
* next paragraph) 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 NON-INFRINGEMENT.
* IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS 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.
*
**************************************************************************/
#ifndef PIPE_VIDEO_ENUMS_H
#define PIPE_VIDEO_ENUMS_H
enum pipe_video_profile
{
PIPE_VIDEO_PROFILE_UNKNOWN,
PIPE_VIDEO_PROFILE_MPEG1,
PIPE_VIDEO_PROFILE_MPEG2_SIMPLE,
PIPE_VIDEO_PROFILE_MPEG2_MAIN,
PIPE_VIDEO_PROFILE_MPEG4_SIMPLE,
PIPE_VIDEO_PROFILE_MPEG4_ADVANCED_SIMPLE,
PIPE_VIDEO_PROFILE_VC1_SIMPLE,
PIPE_VIDEO_PROFILE_VC1_MAIN,
PIPE_VIDEO_PROFILE_VC1_ADVANCED,
PIPE_VIDEO_PROFILE_MPEG4_AVC_BASELINE,
PIPE_VIDEO_PROFILE_MPEG4_AVC_MAIN,
PIPE_VIDEO_PROFILE_MPEG4_AVC_HIGH
};
/* Video caps, can be different for each codec/profile */
enum pipe_video_cap
{
PIPE_VIDEO_CAP_SUPPORTED = 0,
PIPE_VIDEO_CAP_NPOT_TEXTURES = 1,
PIPE_VIDEO_CAP_MAX_WIDTH = 2,
PIPE_VIDEO_CAP_MAX_HEIGHT = 3,
};
enum pipe_video_codec
{
PIPE_VIDEO_CODEC_UNKNOWN = 0,
PIPE_VIDEO_CODEC_MPEG12, /**< MPEG1, MPEG2 */
PIPE_VIDEO_CODEC_MPEG4, /**< DIVX, XVID */
PIPE_VIDEO_CODEC_VC1, /**< WMV */
PIPE_VIDEO_CODEC_MPEG4_AVC /**< H.264 */
};
enum pipe_video_entrypoint
{
PIPE_VIDEO_ENTRYPOINT_UNKNOWN,
PIPE_VIDEO_ENTRYPOINT_BITSTREAM,
PIPE_VIDEO_ENTRYPOINT_IDCT,
PIPE_VIDEO_ENTRYPOINT_MC
};
#endif /* PIPE_VIDEO_ENUMS_H */