gallium: add flags parameter to pipe_screen::context_create
[mesa.git] / src / gallium / state_trackers / va / context.c
index a7a55f961398ca5002d49c8a5c9de9649e66ee14..8b003aedaece4f9eb46e7b203703b30bf2358463 100644 (file)
@@ -100,7 +100,8 @@ VA_DRIVER_INIT_FUNC(VADriverContextP ctx)
    if (!drv->vscreen)
       goto error_screen;
 
-   drv->pipe = drv->vscreen->pscreen->context_create(drv->vscreen->pscreen, drv->vscreen);
+   drv->pipe = drv->vscreen->pscreen->context_create(drv->vscreen->pscreen,
+                                                     drv->vscreen, 0);
    if (!drv->pipe)
       goto error_pipe;
 
@@ -167,6 +168,11 @@ vlVaCreateContext(VADriverContextP ctx, VAConfigID config_id, int picture_width,
    templat.max_references = num_render_targets;
    templat.expect_chunked_decode = true;
 
+   if (u_reduce_video_profile(templat.profile) ==
+       PIPE_VIDEO_FORMAT_MPEG4_AVC)
+      templat.level = u_get_h264_level(templat.width, templat.height,
+                            &templat.max_references);
+
    context->decoder = drv->pipe->create_video_codec(drv->pipe, &templat);
    if (!context->decoder) {
       FREE(context);