summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary
diff options
context:
space:
mode:
authorChristian König <deathsimple@vodafone.de>2011-08-09 19:27:57 +0200
committerChristian König <deathsimple@vodafone.de>2011-08-26 12:10:34 +0200
commit231fce7d630bcf6aaf0e435e461ad5af842e437f (patch)
tree434a3680ecbebff66be6e2d8e6feecbee44f7343 /src/gallium/auxiliary
parent1d1d038c85ebb37f1da4540f092563e8ecab7dfb (diff)
downloadexternal_mesa3d-231fce7d630bcf6aaf0e435e461ad5af842e437f.zip
external_mesa3d-231fce7d630bcf6aaf0e435e461ad5af842e437f.tar.gz
external_mesa3d-231fce7d630bcf6aaf0e435e461ad5af842e437f.tar.bz2
g3dvl: Rework the decoder interface part 2/5
Implement PIPE_CAP_NUM_BUFFERS_DESIRED giving the decoder control over the number of buffers a state tracker should allocate. Signed-off-by: Christian König <deathsimple@vodafone.de> Reviewed-by: Younes Manton <younes.m@gmail.com>
Diffstat (limited to 'src/gallium/auxiliary')
-rw-r--r--src/gallium/auxiliary/vl/vl_decoder.c13
-rw-r--r--src/gallium/auxiliary/vl/vl_decoder.h6
2 files changed, 19 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/vl/vl_decoder.c b/src/gallium/auxiliary/vl/vl_decoder.c
index fac0335..b23827d 100644
--- a/src/gallium/auxiliary/vl/vl_decoder.c
+++ b/src/gallium/auxiliary/vl/vl_decoder.c
@@ -44,6 +44,19 @@ vl_profile_supported(struct pipe_screen *screen, enum pipe_video_profile profile
}
}
+unsigned
+vl_num_buffers_desired(struct pipe_screen *screen, enum pipe_video_profile profile)
+{
+ assert(screen);
+ switch (u_reduce_video_profile(profile)) {
+ case PIPE_VIDEO_CODEC_MPEG12:
+ return 4;
+
+ default:
+ return 1;
+ }
+}
+
struct pipe_video_decoder *
vl_create_decoder(struct pipe_context *pipe,
enum pipe_video_profile profile,
diff --git a/src/gallium/auxiliary/vl/vl_decoder.h b/src/gallium/auxiliary/vl/vl_decoder.h
index 0e9280d..fed529c 100644
--- a/src/gallium/auxiliary/vl/vl_decoder.h
+++ b/src/gallium/auxiliary/vl/vl_decoder.h
@@ -38,6 +38,12 @@ bool
vl_profile_supported(struct pipe_screen *screen, enum pipe_video_profile profile);
/**
+ * the desired number of buffers for optimal operation
+ */
+unsigned
+vl_num_buffers_desired(struct pipe_screen *screen, enum pipe_video_profile profile);
+
+/**
* standard implementation of pipe->create_video_decoder
*/
struct pipe_video_decoder *