1 /**************************************************************************
3 * Copyright 2010 Thomas Balling Sørensen.
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sub license, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial portions
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
21 * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
22 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 **************************************************************************/
28 #include <vdpau/vdpau.h>
29 #include <util/u_memory.h>
30 #include <util/u_debug.h>
31 #include "vdpau_private.h"
35 vlVdpVideoMixerCreate (VdpDevice device
,
36 uint32_t feature_count
,
37 VdpVideoMixerFeature
const *features
,
38 uint32_t parameter_count
,
39 VdpVideoMixerParameter
const *parameters
,
40 void const *const *parameter_values
,
44 vlVdpVideoMixer
*vmixer
= NULL
;
46 debug_printf("[VDPAU] Creating VideoMixer\n");
48 vlVdpDevice
*dev
= vlGetDataHTAB(device
);
50 return VDP_STATUS_INVALID_HANDLE
;
52 vmixer
= CALLOC(1, sizeof(vlVdpVideoMixer
));
54 return VDP_STATUS_RESOURCES
;
58 * TODO: Handle features and parameters
61 *mixer
= vlAddDataHTAB(vmixer
);
63 ret
= VDP_STATUS_ERROR
;
74 vlVdpVideoMixerSetFeatureEnables (
76 uint32_t feature_count
,
77 VdpVideoMixerFeature
const *features
,
78 VdpBool
const *feature_enables
)
80 debug_printf("[VDPAU] Setting VideoMixer features\n");
82 if (!(features
&& feature_enables
))
83 return VDP_STATUS_INVALID_POINTER
;
85 vlVdpVideoMixer
*vmixer
= vlGetDataHTAB(mixer
);
87 return VDP_STATUS_INVALID_HANDLE
;
97 VdpStatus
vlVdpVideoMixerRender (
99 VdpOutputSurface background_surface
,
100 VdpRect
const *background_source_rect
,
101 VdpVideoMixerPictureStructure current_picture_structure
,
102 uint32_t video_surface_past_count
,
103 VdpVideoSurface
const *video_surface_past
,
104 VdpVideoSurface video_surface_current
,
105 uint32_t video_surface_future_count
,
106 VdpVideoSurface
const *video_surface_future
,
107 VdpRect
const *video_source_rect
,
108 VdpOutputSurface destination_surface
,
109 VdpRect
const *destination_rect
,
110 VdpRect
const *destination_video_rect
,
111 uint32_t layer_count
,
112 VdpLayer
const *layers
)
114 if (!(background_source_rect
&& video_surface_past
&& video_surface_future
&& video_source_rect
&& destination_rect
&& destination_video_rect
&& layers
))
115 return VDP_STATUS_INVALID_POINTER
;
117 return VDP_STATUS_NO_IMPLEMENTATION
;
121 vlVdpVideoMixerSetAttributeValues (
123 uint32_t attribute_count
,
124 VdpVideoMixerAttribute
const *attributes
,
125 void const *const *attribute_values
)
127 if (!(attributes
&& attribute_values
))
128 return VDP_STATUS_INVALID_POINTER
;
130 vlVdpVideoMixer
*vmixer
= vlGetDataHTAB(mixer
);
132 return VDP_STATUS_INVALID_HANDLE
;
135 * TODO: Implement the function
139 return VDP_STATUS_OK
;