[Mesa-dev] [PATCH 3/9] g3dvl: Add max_references parameter to vl_create_decoder()

Emeric Grange emeric.grange at gmail.com
Mon Sep 12 14:39:27 PDT 2011


Signed-off-by: Emeric Grange <emeric.grange at gmail.com>
---
 src/gallium/auxiliary/vl/vl_decoder.c          |    4 ++--
 src/gallium/auxiliary/vl/vl_decoder.h          |    2 +-
 src/gallium/auxiliary/vl/vl_mpeg12_decoder.c   |    3 ++-
 src/gallium/auxiliary/vl/vl_mpeg12_decoder.h   |    2 +-
 src/gallium/include/pipe/p_context.h           |    2 +-
 src/gallium/include/pipe/p_video_decoder.h     |    1 +
 src/gallium/state_trackers/vdpau/decode.c      |    4 ++--
 src/gallium/state_trackers/xorg/xvmc/context.c |    2 +-
 8 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/src/gallium/auxiliary/vl/vl_decoder.c b/src/gallium/auxiliary/vl/vl_decoder.c
index 41e5f75..383e02d 100644
--- a/src/gallium/auxiliary/vl/vl_decoder.c
+++ b/src/gallium/auxiliary/vl/vl_decoder.c
@@ -62,7 +62,7 @@ vl_create_decoder(struct pipe_context *pipe,
                   enum pipe_video_profile profile,
                   enum pipe_video_entrypoint entrypoint,
                   enum pipe_video_chroma_format chroma_format,
-                  unsigned width, unsigned height)
+                  unsigned width, unsigned height, unsigned max_references)
 {
    unsigned buffer_width, buffer_height;
    bool pot_buffers;
@@ -82,7 +82,7 @@ vl_create_decoder(struct pipe_context *pipe,
 
    switch (u_reduce_video_profile(profile)) {
       case PIPE_VIDEO_CODEC_MPEG12:
-         return vl_create_mpeg12_decoder(pipe, profile, entrypoint, chroma_format, buffer_width, buffer_height);
+         return vl_create_mpeg12_decoder(pipe, profile, entrypoint, chroma_format, buffer_width, buffer_height, max_references);
       default:
          return NULL;
    }
diff --git a/src/gallium/auxiliary/vl/vl_decoder.h b/src/gallium/auxiliary/vl/vl_decoder.h
index 54dc423..a997516 100644
--- a/src/gallium/auxiliary/vl/vl_decoder.h
+++ b/src/gallium/auxiliary/vl/vl_decoder.h
@@ -51,6 +51,6 @@ vl_create_decoder(struct pipe_context *pipe,
                   enum pipe_video_profile profile,
                   enum pipe_video_entrypoint entrypoint,
                   enum pipe_video_chroma_format chroma_format,
-                  unsigned width, unsigned height);
+                  unsigned width, unsigned height, unsigned max_references);
 
 #endif /* vl_decoder_h */
diff --git a/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c b/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c
index 9ea84dc..f370669 100644
--- a/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c
+++ b/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c
@@ -1035,7 +1035,7 @@ vl_create_mpeg12_decoder(struct pipe_context *context,
                          enum pipe_video_profile profile,
                          enum pipe_video_entrypoint entrypoint,
                          enum pipe_video_chroma_format chroma_format,
-                         unsigned width, unsigned height)
+                         unsigned width, unsigned height, unsigned max_references)
 {
    const unsigned block_size_pixels = BLOCK_WIDTH * BLOCK_HEIGHT;
    const struct format_config *format_config;
@@ -1054,6 +1054,7 @@ vl_create_mpeg12_decoder(struct pipe_context *context,
    dec->base.chroma_format = chroma_format;
    dec->base.width = width;
    dec->base.height = height;
+   dec->base.max_references = max_references;
 
    dec->base.destroy = vl_mpeg12_destroy;
    dec->base.create_buffer = vl_mpeg12_create_buffer;
diff --git a/src/gallium/auxiliary/vl/vl_mpeg12_decoder.h b/src/gallium/auxiliary/vl/vl_mpeg12_decoder.h
index 5f048f0..817c1ff 100644
--- a/src/gallium/auxiliary/vl/vl_mpeg12_decoder.h
+++ b/src/gallium/auxiliary/vl/vl_mpeg12_decoder.h
@@ -111,6 +111,6 @@ vl_create_mpeg12_decoder(struct pipe_context *pipe,
                          enum pipe_video_profile profile,
                          enum pipe_video_entrypoint entrypoint,
                          enum pipe_video_chroma_format chroma_format,
-                         unsigned width, unsigned height);
+                         unsigned width, unsigned height, unsigned max_references);
 
 #endif /* vl_mpeg12_decoder_h */
diff --git a/src/gallium/include/pipe/p_context.h b/src/gallium/include/pipe/p_context.h
index da3ee87..49c12ec 100644
--- a/src/gallium/include/pipe/p_context.h
+++ b/src/gallium/include/pipe/p_context.h
@@ -406,7 +406,7 @@ struct pipe_context {
                                                        enum pipe_video_profile profile,
                                                        enum pipe_video_entrypoint entrypoint,
                                                        enum pipe_video_chroma_format chroma_format,
-                                                       unsigned width, unsigned height );
+                                                       unsigned width, unsigned height, unsigned max_references );
 
    /**
     * Creates a video buffer as decoding target
diff --git a/src/gallium/include/pipe/p_video_decoder.h b/src/gallium/include/pipe/p_video_decoder.h
index 31e411c..40b7dcd 100644
--- a/src/gallium/include/pipe/p_video_decoder.h
+++ b/src/gallium/include/pipe/p_video_decoder.h
@@ -52,6 +52,7 @@ struct pipe_video_decoder
    enum pipe_video_chroma_format chroma_format;
    unsigned width;
    unsigned height;
+   unsigned max_references;
 
    /**
     * destroy this video decoder
diff --git a/src/gallium/state_trackers/vdpau/decode.c b/src/gallium/state_trackers/vdpau/decode.c
index 2bf782e..3501166 100644
--- a/src/gallium/state_trackers/vdpau/decode.c
+++ b/src/gallium/state_trackers/vdpau/decode.c
@@ -69,14 +69,14 @@ vlVdpDecoderCreate(VdpDevice device,
 
    vldecoder->device = dev;
 
-   // TODO: Define max_references. Used mainly for H264
    vldecoder->decoder = pipe->create_video_decoder
    (
       pipe, p_profile,
       PIPE_VIDEO_ENTRYPOINT_BITSTREAM,
       PIPE_VIDEO_CHROMA_FORMAT_420,
-      width, height
+      width, height, max_references
    );
+
    if (!vldecoder->decoder) {
       ret = VDP_STATUS_ERROR;
       goto error_decoder;
diff --git a/src/gallium/state_trackers/xorg/xvmc/context.c b/src/gallium/state_trackers/xorg/xvmc/context.c
index 172f16c..848da40 100644
--- a/src/gallium/state_trackers/xorg/xvmc/context.c
+++ b/src/gallium/state_trackers/xorg/xvmc/context.c
@@ -250,7 +250,7 @@ Status XvMCCreateContext(Display *dpy, XvPortID port, int surface_type_id,
       ProfileToPipe(mc_type),
       (mc_type & XVMC_IDCT) ? PIPE_VIDEO_ENTRYPOINT_IDCT : PIPE_VIDEO_ENTRYPOINT_MC,
       FormatToPipe(chroma_format),
-      width, height
+      width, height, 2
    );
 
    if (!context_priv->decoder) {
-- 
1.7.6.1



More information about the mesa-dev mailing list