summaryrefslogtreecommitdiffstats
path: root/src/gallium/include
diff options
context:
space:
mode:
authorChristian König <[email protected]>2011-08-09 18:45:13 +0200
committerChristian König <[email protected]>2011-08-26 12:10:34 +0200
commit1d1d038c85ebb37f1da4540f092563e8ecab7dfb (patch)
tree6e3a55e43ddad1bfd70dad96756ecd166b646373 /src/gallium/include
parent6fb12bf031fdceadebc8a3d7b7756bc822fbf6e4 (diff)
g3dvl: Rework the decoder interface part 1/5
First of all get ride of the decode_buffer structure, while still giving the decoder the ability to organize it's buffers depending on the needs of the state tracker. Signed-off-by: Christian König <[email protected]> Reviewed-by: Younes Manton <[email protected]>
Diffstat (limited to 'src/gallium/include')
-rw-r--r--src/gallium/include/pipe/p_video_decoder.h70
1 files changed, 42 insertions, 28 deletions
diff --git a/src/gallium/include/pipe/p_video_decoder.h b/src/gallium/include/pipe/p_video_decoder.h
index f063d8f3a1b..ae071136bac 100644
--- a/src/gallium/include/pipe/p_video_decoder.h
+++ b/src/gallium/include/pipe/p_video_decoder.h
@@ -59,75 +59,89 @@ struct pipe_video_decoder
void (*destroy)(struct pipe_video_decoder *decoder);
/**
- * Creates a buffer as decoding input
+ * Creates a decoder buffer
*/
- struct pipe_video_decode_buffer *(*create_buffer)(struct pipe_video_decoder *decoder);
+ void *(*create_buffer)(struct pipe_video_decoder *decoder);
/**
- * flush decoder buffer to video hardware
+ * Destroys a decoder buffer
*/
- void (*flush_buffer)(struct pipe_video_decode_buffer *decbuf,
- unsigned num_ycbcr_blocks[3],
- struct pipe_video_buffer *ref_frames[2],
- struct pipe_video_buffer *dst);
-};
-
-/**
- * input buffer for a decoder
- */
-struct pipe_video_decode_buffer
-{
- struct pipe_video_decoder *decoder;
+ void (*destroy_buffer)(struct pipe_video_decoder *decoder, void *buffer);
/**
- * destroy this decode buffer
+ * set the current decoder buffer
*/
- void (*destroy)(struct pipe_video_decode_buffer *decbuf);
+ void (*set_decode_buffer)(struct pipe_video_decoder *decoder, void *buffer);
/**
- * map the input buffer into memory before starting decoding
+ * set the picture parameters for the next frame
+ * only used for bitstream decoding
*/
- void (*begin_frame)(struct pipe_video_decode_buffer *decbuf);
+ void (*set_picture_parameters)(struct pipe_video_decoder *decoder,
+ struct pipe_picture_desc *picture);
/**
* set the quantification matrixes
*/
- void (*set_quant_matrix)(struct pipe_video_decode_buffer *decbuf,
+ void (*set_quant_matrix)(struct pipe_video_decoder *decoder,
const uint8_t intra_matrix[64],
const uint8_t non_intra_matrix[64]);
/**
+ * set target where video data is decoded to
+ */
+ void (*set_decode_target)(struct pipe_video_decoder *decoder,
+ struct pipe_video_buffer *target);
+
+ /**
+ * set reference frames for motion compensation
+ */
+ void (*set_reference_frames)(struct pipe_video_decoder *decoder,
+ struct pipe_video_buffer **ref_frames,
+ unsigned num_ref_frames);
+
+ /**
+ * start decoding of a new frame
+ */
+ void (*begin_frame)(struct pipe_video_decoder *decoder);
+
+ /**
* get the pointer where to put the ycbcr blocks of a component
*/
- struct pipe_ycbcr_block *(*get_ycbcr_stream)(struct pipe_video_decode_buffer *, int component);
+ struct pipe_ycbcr_block *(*get_ycbcr_stream)(struct pipe_video_decoder *decoder, int component);
/**
* get the pointer where to put the ycbcr dct block data of a component
*/
- short *(*get_ycbcr_buffer)(struct pipe_video_decode_buffer *, int component);
+ short *(*get_ycbcr_buffer)(struct pipe_video_decoder *decoder, int component);
/**
* get the stride of the mv buffer
*/
- unsigned (*get_mv_stream_stride)(struct pipe_video_decode_buffer *decbuf);
+ unsigned (*get_mv_stream_stride)(struct pipe_video_decoder *decoder);
/**
* get the pointer where to put the motion vectors of a ref frame
*/
- struct pipe_motionvector *(*get_mv_stream)(struct pipe_video_decode_buffer *decbuf, int ref_frame);
+ struct pipe_motionvector *(*get_mv_stream)(struct pipe_video_decoder *decoder, int ref_frame);
/**
* decode a bitstream
*/
- void (*decode_bitstream)(struct pipe_video_decode_buffer *decbuf,
+ void (*decode_bitstream)(struct pipe_video_decoder *decoder,
unsigned num_bytes, const void *data,
- struct pipe_picture_desc *picture,
unsigned num_ycbcr_blocks[3]);
/**
- * unmap decoder buffer before flushing
+ * end decoding of the current frame
+ */
+ void (*end_frame)(struct pipe_video_decoder *decoder, unsigned num_ycbcr_blocks[3]);
+
+ /**
+ * flush any outstanding command buffers to the hardware
+ * should be called before a video_buffer is acessed by the state tracker again
*/
- void (*end_frame)(struct pipe_video_decode_buffer *decbuf);
+ void (*flush)(struct pipe_video_decoder *decoder);
};
/**