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"
34 vlVdpVideoMixerCreate(VdpDevice device
,
35 uint32_t feature_count
,
36 VdpVideoMixerFeature
const *features
,
37 uint32_t parameter_count
,
38 VdpVideoMixerParameter
const *parameters
,
39 void const *const *parameter_values
,
43 vlVdpVideoMixer
*vmixer
= NULL
;
45 debug_printf("[VDPAU] Creating VideoMixer\n");
47 vlVdpDevice
*dev
= vlGetDataHTAB(device
);
49 return VDP_STATUS_INVALID_HANDLE
;
51 vmixer
= CALLOC(1, sizeof(vlVdpVideoMixer
));
53 return VDP_STATUS_RESOURCES
;
57 * TODO: Handle features and parameters
60 *mixer
= vlAddDataHTAB(vmixer
);
62 ret
= VDP_STATUS_ERROR
;
72 vlVdpVideoMixerSetFeatureEnables(VdpVideoMixer mixer
,
73 uint32_t feature_count
,
74 VdpVideoMixerFeature
const *features
,
75 VdpBool
const *feature_enables
)
77 debug_printf("[VDPAU] Setting VideoMixer features\n");
79 if (!(features
&& feature_enables
))
80 return VDP_STATUS_INVALID_POINTER
;
82 vlVdpVideoMixer
*vmixer
= vlGetDataHTAB(mixer
);
84 return VDP_STATUS_INVALID_HANDLE
;
93 VdpStatus
vlVdpVideoMixerRender(VdpVideoMixer mixer
,
94 VdpOutputSurface background_surface
,
95 VdpRect
const *background_source_rect
,
96 VdpVideoMixerPictureStructure current_picture_structure
,
97 uint32_t video_surface_past_count
,
98 VdpVideoSurface
const *video_surface_past
,
99 VdpVideoSurface video_surface_current
,
100 uint32_t video_surface_future_count
,
101 VdpVideoSurface
const *video_surface_future
,
102 VdpRect
const *video_source_rect
,
103 VdpOutputSurface destination_surface
,
104 VdpRect
const *destination_rect
,
105 VdpRect
const *destination_video_rect
,
106 uint32_t layer_count
,
107 VdpLayer
const *layers
)
109 if (!(background_source_rect
&& video_surface_past
&& video_surface_future
&&
110 video_source_rect
&& destination_rect
&& destination_video_rect
&& layers
))
111 return VDP_STATUS_INVALID_POINTER
;
113 return VDP_STATUS_NO_IMPLEMENTATION
;
117 vlVdpVideoMixerSetAttributeValues(VdpVideoMixer mixer
,
118 uint32_t attribute_count
,
119 VdpVideoMixerAttribute
const *attributes
,
120 void const *const *attribute_values
)
122 if (!(attributes
&& attribute_values
))
123 return VDP_STATUS_INVALID_POINTER
;
125 vlVdpVideoMixer
*vmixer
= vlGetDataHTAB(mixer
);
127 return VDP_STATUS_INVALID_HANDLE
;
130 * TODO: Implement the function
134 return VDP_STATUS_OK
;