2009-10-01 22:16:10 -04:00
|
|
|
/**************************************************************************
|
2011-01-11 21:54:30 +01:00
|
|
|
*
|
2009-10-01 22:16:10 -04:00
|
|
|
* Copyright 2009 Younes Manton.
|
|
|
|
|
* All Rights Reserved.
|
2011-01-11 21:54:30 +01:00
|
|
|
*
|
2009-10-01 22:16:10 -04:00
|
|
|
* 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:
|
2011-01-11 21:54:30 +01:00
|
|
|
*
|
2009-10-01 22:16:10 -04:00
|
|
|
* The above copyright notice and this permission notice (including the
|
|
|
|
|
* next paragraph) shall be included in all copies or substantial portions
|
|
|
|
|
* of the Software.
|
2011-01-11 21:54:30 +01:00
|
|
|
*
|
2009-10-01 22:16:10 -04:00
|
|
|
* 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.
|
s/Tungsten Graphics/VMware/
Tungsten Graphics Inc. was acquired by VMware Inc. in 2008. Leaving the
old copyright name is creating unnecessary confusion, hence this change.
This was the sed script I used:
$ cat tg2vmw.sed
# Run as:
#
# git reset --hard HEAD && find include scons src -type f -not -name 'sed*' -print0 | xargs -0 sed -i -f tg2vmw.sed
#
# Rename copyrights
s/Tungsten Gra\(ph\|hp\)ics,\? [iI]nc\.\?\(, Cedar Park\)\?\(, Austin\)\?\(, \(Texas\|TX\)\)\?\.\?/VMware, Inc./g
/Copyright/s/Tungsten Graphics\(,\? [iI]nc\.\)\?\(, Cedar Park\)\?\(, Austin\)\?\(, \(Texas\|TX\)\)\?\.\?/VMware, Inc./
s/TUNGSTEN GRAPHICS/VMWARE/g
# Rename emails
s/alanh@tungstengraphics.com/alanh@vmware.com/
s/jens@tungstengraphics.com/jowen@vmware.com/g
s/jrfonseca-at-tungstengraphics-dot-com/jfonseca-at-vmware-dot-com/
s/jrfonseca\?@tungstengraphics.com/jfonseca@vmware.com/g
s/keithw\?@tungstengraphics.com/keithw@vmware.com/g
s/michel@tungstengraphics.com/daenzer@vmware.com/g
s/thomas-at-tungstengraphics-dot-com/thellstom-at-vmware-dot-com/
s/zack@tungstengraphics.com/zackr@vmware.com/
# Remove dead links
s@Tungsten Graphics (http://www.tungstengraphics.com)@Tungsten Graphics@g
# C string src/gallium/state_trackers/vega/api_misc.c
s/"Tungsten Graphics, Inc"/"VMware, Inc"/
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-01-17 16:27:50 +00:00
|
|
|
* IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
|
2009-10-01 22:16:10 -04:00
|
|
|
* 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.
|
2011-01-11 21:54:30 +01:00
|
|
|
*
|
2009-10-01 22:16:10 -04:00
|
|
|
**************************************************************************/
|
|
|
|
|
|
2009-09-27 19:49:06 -04:00
|
|
|
#ifndef PIPE_VIDEO_CONTEXT_H
|
|
|
|
|
#define PIPE_VIDEO_CONTEXT_H
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
2011-08-27 17:51:52 +02:00
|
|
|
#include "pipe/p_video_state.h"
|
2009-09-27 19:49:06 -04:00
|
|
|
|
|
|
|
|
struct pipe_screen;
|
|
|
|
|
struct pipe_surface;
|
|
|
|
|
struct pipe_macroblock;
|
|
|
|
|
struct pipe_picture_desc;
|
|
|
|
|
struct pipe_fence_handle;
|
|
|
|
|
|
|
|
|
|
/**
|
2013-07-15 03:48:04 -06:00
|
|
|
* Gallium video codec for a specific format/profile
|
2011-04-06 00:06:20 +02:00
|
|
|
*/
|
2013-07-15 03:48:04 -06:00
|
|
|
struct pipe_video_codec
|
2011-04-06 00:06:20 +02:00
|
|
|
{
|
2011-07-08 19:22:43 +02:00
|
|
|
struct pipe_context *context;
|
2011-04-06 00:06:20 +02:00
|
|
|
|
|
|
|
|
enum pipe_video_profile profile;
|
2014-06-12 12:27:29 -04:00
|
|
|
unsigned level;
|
2011-04-07 20:10:55 +02:00
|
|
|
enum pipe_video_entrypoint entrypoint;
|
2011-04-06 00:06:20 +02:00
|
|
|
enum pipe_video_chroma_format chroma_format;
|
|
|
|
|
unsigned width;
|
|
|
|
|
unsigned height;
|
2011-09-12 23:39:27 +02:00
|
|
|
unsigned max_references;
|
2013-07-15 01:50:24 -06:00
|
|
|
bool expect_chunked_decode;
|
2011-04-03 16:09:23 +02:00
|
|
|
|
2009-09-27 19:49:06 -04:00
|
|
|
/**
|
2011-04-06 00:06:20 +02:00
|
|
|
* destroy this video decoder
|
2009-09-27 19:49:06 -04:00
|
|
|
*/
|
2013-07-15 03:48:04 -06:00
|
|
|
void (*destroy)(struct pipe_video_codec *codec);
|
2011-03-22 19:58:21 +01:00
|
|
|
|
2011-08-09 18:45:13 +02:00
|
|
|
/**
|
|
|
|
|
* start decoding of a new frame
|
|
|
|
|
*/
|
2013-07-15 03:48:04 -06:00
|
|
|
void (*begin_frame)(struct pipe_video_codec *codec,
|
2012-01-04 14:46:33 +01:00
|
|
|
struct pipe_video_buffer *target,
|
|
|
|
|
struct pipe_picture_desc *picture);
|
2011-08-09 18:45:13 +02:00
|
|
|
|
2011-04-23 13:24:35 +02:00
|
|
|
/**
|
2011-08-10 18:07:01 +02:00
|
|
|
* decode a macroblock
|
2011-04-23 13:24:35 +02:00
|
|
|
*/
|
2013-07-15 03:48:04 -06:00
|
|
|
void (*decode_macroblock)(struct pipe_video_codec *codec,
|
2012-01-04 14:46:33 +01:00
|
|
|
struct pipe_video_buffer *target,
|
|
|
|
|
struct pipe_picture_desc *picture,
|
2011-08-10 18:07:01 +02:00
|
|
|
const struct pipe_macroblock *macroblocks,
|
|
|
|
|
unsigned num_macroblocks);
|
2011-04-20 13:44:26 +02:00
|
|
|
|
2011-03-26 00:20:16 +01:00
|
|
|
/**
|
2011-04-06 00:06:20 +02:00
|
|
|
* decode a bitstream
|
2011-03-26 00:20:16 +01:00
|
|
|
*/
|
2013-07-15 03:48:04 -06:00
|
|
|
void (*decode_bitstream)(struct pipe_video_codec *codec,
|
2012-01-04 14:46:33 +01:00
|
|
|
struct pipe_video_buffer *target,
|
|
|
|
|
struct pipe_picture_desc *picture,
|
2011-12-22 15:24:46 +01:00
|
|
|
unsigned num_buffers,
|
|
|
|
|
const void * const *buffers,
|
|
|
|
|
const unsigned *sizes);
|
2011-04-06 00:06:20 +02:00
|
|
|
|
2013-07-15 09:16:22 -06:00
|
|
|
/**
|
|
|
|
|
* encode to a bitstream
|
|
|
|
|
*/
|
|
|
|
|
void (*encode_bitstream)(struct pipe_video_codec *codec,
|
|
|
|
|
struct pipe_video_buffer *source,
|
|
|
|
|
struct pipe_resource *destination,
|
|
|
|
|
void **feedback);
|
|
|
|
|
|
2011-03-26 00:20:16 +01:00
|
|
|
/**
|
2011-08-09 18:45:13 +02:00
|
|
|
* end decoding of the current frame
|
|
|
|
|
*/
|
2013-07-15 03:48:04 -06:00
|
|
|
void (*end_frame)(struct pipe_video_codec *codec,
|
2012-01-04 14:46:33 +01:00
|
|
|
struct pipe_video_buffer *target,
|
|
|
|
|
struct pipe_picture_desc *picture);
|
2011-08-09 18:45:13 +02:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* flush any outstanding command buffers to the hardware
|
|
|
|
|
* should be called before a video_buffer is acessed by the state tracker again
|
2011-03-26 00:20:16 +01:00
|
|
|
*/
|
2013-07-15 03:48:04 -06:00
|
|
|
void (*flush)(struct pipe_video_codec *codec);
|
2013-07-15 09:16:22 -06:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* get encoder feedback
|
|
|
|
|
*/
|
|
|
|
|
void (*get_feedback)(struct pipe_video_codec *codec, void *feedback, unsigned *size);
|
2011-04-06 00:06:20 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* output for decoding / input for displaying
|
|
|
|
|
*/
|
|
|
|
|
struct pipe_video_buffer
|
|
|
|
|
{
|
2011-07-08 16:56:11 +02:00
|
|
|
struct pipe_context *context;
|
2011-04-06 00:06:20 +02:00
|
|
|
|
|
|
|
|
enum pipe_format buffer_format;
|
|
|
|
|
enum pipe_video_chroma_format chroma_format;
|
|
|
|
|
unsigned width;
|
|
|
|
|
unsigned height;
|
2012-01-04 00:51:40 +01:00
|
|
|
bool interlaced;
|
2011-03-22 19:58:21 +01:00
|
|
|
|
2011-03-26 00:20:16 +01:00
|
|
|
/**
|
2011-04-06 00:06:20 +02:00
|
|
|
* destroy this video buffer
|
2011-03-26 00:20:16 +01:00
|
|
|
*/
|
2011-04-06 00:06:20 +02:00
|
|
|
void (*destroy)(struct pipe_video_buffer *buffer);
|
2011-03-22 19:58:21 +01:00
|
|
|
|
2011-04-06 00:06:20 +02:00
|
|
|
/**
|
|
|
|
|
* get a individual sampler view for each plane
|
|
|
|
|
*/
|
2011-04-24 19:20:33 +02:00
|
|
|
struct pipe_sampler_view **(*get_sampler_view_planes)(struct pipe_video_buffer *buffer);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* get a individual sampler view for each component
|
|
|
|
|
*/
|
|
|
|
|
struct pipe_sampler_view **(*get_sampler_view_components)(struct pipe_video_buffer *buffer);
|
2011-04-03 16:09:23 +02:00
|
|
|
|
2011-04-06 00:06:20 +02:00
|
|
|
/**
|
|
|
|
|
* get a individual surfaces for each plane
|
|
|
|
|
*/
|
|
|
|
|
struct pipe_surface **(*get_surfaces)(struct pipe_video_buffer *buffer);
|
2011-12-23 16:14:31 +01:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* auxiliary associated data
|
|
|
|
|
*/
|
|
|
|
|
void *associated_data;
|
|
|
|
|
|
|
|
|
|
/*
|
2013-07-15 03:48:04 -06:00
|
|
|
* codec where the associated data came from
|
2011-12-23 16:14:31 +01:00
|
|
|
*/
|
2013-07-15 03:48:04 -06:00
|
|
|
struct pipe_video_codec *codec;
|
2011-12-23 16:14:31 +01:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* destroy the associated data
|
|
|
|
|
*/
|
|
|
|
|
void (*destroy_associated_data)(void *associated_data);
|
2011-04-03 16:09:23 +02:00
|
|
|
};
|
|
|
|
|
|
2009-09-27 19:49:06 -04:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#endif /* PIPE_VIDEO_CONTEXT_H */
|