diff options
author | Christoph Bumiller <[email protected]> | 2011-07-21 10:39:41 +0200 |
---|---|---|
committer | Christoph Bumiller <[email protected]> | 2011-07-21 10:39:41 +0200 |
commit | ea316c5e060cbd92b34e0d794c0707d4ca79e6e8 (patch) | |
tree | 1e4f88cbdecb35c5eb45661871d588fed24c5355 /src/gallium/drivers/nouveau/nouveau_video.c | |
parent | 76bccaff0c54aed10ffbc7c7dc744f1708921409 (diff) |
nouveau: hook up video decoding with nouveau_context
This doesn't include nvfx since its context struct is not derived
from common nouveau_context (yet).
Diffstat (limited to 'src/gallium/drivers/nouveau/nouveau_video.c')
-rw-r--r-- | src/gallium/drivers/nouveau/nouveau_video.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/gallium/drivers/nouveau/nouveau_video.c b/src/gallium/drivers/nouveau/nouveau_video.c new file mode 100644 index 00000000000..32f038dae61 --- /dev/null +++ b/src/gallium/drivers/nouveau/nouveau_video.c @@ -0,0 +1,39 @@ + +#include "vl/vl_decoder.h" +#include "vl/vl_video_buffer.h" + +#include "nouveau/nouveau_screen.h" +#include "nouveau/nouveau_context.h" + +static int +nouveau_screen_get_video_param(struct pipe_screen *pscreen, + enum pipe_video_profile profile, + enum pipe_video_cap param) +{ + switch (param) { + case PIPE_VIDEO_CAP_SUPPORTED: + return vl_profile_supported(pscreen, profile); + case PIPE_VIDEO_CAP_NPOT_TEXTURES: + return 1; + case PIPE_VIDEO_CAP_MAX_WIDTH: + case PIPE_VIDEO_CAP_MAX_HEIGHT: + return vl_video_buffer_max_size(pscreen); + default: + debug_printf("unknown video param: %d\n", param); + return 0; + } +} + +void +nouveau_screen_init_vdec(struct nouveau_screen *screen) +{ + screen->base.get_video_param = nouveau_screen_get_video_param; + screen->base.is_video_format_supported = vl_video_buffer_is_format_supported; +} + +void +nouveau_context_init_vdec(struct nouveau_context *nv) +{ + nv->pipe.create_video_decoder = vl_create_decoder; + nv->pipe.create_video_buffer = vl_video_buffer_create; +} |