Lines Matching refs:p_surf
60 vlVdpSurface *p_surf;
68 p_surf = CALLOC(1, sizeof(vlVdpSurface));
69 if (!p_surf) {
80 DeviceReference(&p_surf->device, dev);
84 memset(&p_surf->templat, 0, sizeof(p_surf->templat));
86 p_surf->templat.buffer_format = pipe->screen->get_video_param
93 p_surf->templat.width = width;
94 p_surf->templat.height = height;
95 p_surf->templat.interlaced = pipe->screen->get_video_param
102 if (p_surf->templat.buffer_format != PIPE_FORMAT_NONE)
103 p_surf->video_buffer = pipe->create_video_buffer(pipe, &p_surf->templat);
106 vlVdpVideoSurfaceClear(p_surf);
109 *surface = vlAddDataHTAB(p_surf);
118 p_surf->video_buffer->destroy(p_surf->video_buffer);
121 DeviceReference(&p_surf->device, NULL);
122 FREE(p_surf);
135 vlVdpSurface *p_surf;
137 p_surf = (vlVdpSurface *)vlGetDataHTAB((vlHandle)surface);
138 if (!p_surf)
141 mtx_lock(&p_surf->device->mutex);
142 if (p_surf->video_buffer)
143 p_surf->video_buffer->destroy(p_surf->video_buffer);
144 mtx_unlock(&p_surf->device->mutex);
147 DeviceReference(&p_surf->device, NULL);
148 FREE(p_surf);
164 vlVdpSurface *p_surf = vlGetDataHTAB(surface);
165 if (!p_surf)
168 if (p_surf->video_buffer) {
169 *width = p_surf->video_buffer->width;
170 *height = p_surf->video_buffer->height;
171 *chroma_type = PipeToChroma(pipe_format_to_chroma_format(p_surf->video_buffer->buffer_format));
173 *width = p_surf->templat.width;
174 *height = p_surf->templat.height;
175 *chroma_type = PipeToChroma(pipe_format_to_chroma_format(p_surf->templat.buffer_format));
182 vlVdpVideoSurfaceSize(vlVdpSurface *p_surf, int component,
185 *width = p_surf->templat.width;
186 *height = p_surf->templat.height;
189 pipe_format_to_chroma_format(p_surf->templat.buffer_format),
190 p_surf->templat.interlaced);
313 vlVdpSurface *p_surf = vlGetDataHTAB(surface);
314 if (!p_surf)
317 pipe = p_surf->device->context;
324 mtx_lock(&p_surf->device->mutex);
326 if (p_surf->video_buffer == NULL ||
327 ((pformat != p_surf->video_buffer->buffer_format))) {
340 mtx_unlock(&p_surf->device->mutex);
345 if (p_surf->video_buffer == NULL ||
346 nformat != p_surf->video_buffer->buffer_format) {
348 if (p_surf->video_buffer)
349 p_surf->video_buffer->destroy(p_surf->video_buffer);
352 p_surf->templat.buffer_format = nformat;
354 p_surf->templat.interlaced = false;
357 p_surf->video_buffer = pipe->create_video_buffer(pipe, &p_surf->templat);
360 if (!p_surf->video_buffer) {
361 mtx_unlock(&p_surf->device->mutex);
364 vlVdpVideoSurfaceClear(p_surf);
368 if (pformat != p_surf->video_buffer->buffer_format) {
370 p_surf->video_buffer->buffer_format == PIPE_FORMAT_NV12)
373 mtx_unlock(&p_surf->device->mutex);
378 sampler_views = p_surf->video_buffer->get_sampler_view_planes(p_surf->video_buffer);
380 mtx_unlock(&p_surf->device->mutex);
391 vlVdpVideoSurfaceSize(p_surf, i, &width, &height);
406 mtx_unlock(&p_surf->device->mutex);
429 mtx_unlock(&p_surf->device->mutex);
468 vlVdpSurface *p_surf = vlGetDataHTAB(surface);
469 if (!p_surf)
472 mtx_lock(&p_surf->device->mutex);
473 if (p_surf->video_buffer == NULL) {
474 struct pipe_context *pipe = p_surf->device->context;
477 p_surf->video_buffer = pipe->create_video_buffer(pipe, &p_surf->templat);
479 mtx_unlock(&p_surf->device->mutex);
481 return p_surf->video_buffer;
488 vlVdpSurface *p_surf = vlGetDataHTAB(surface);
495 if (!p_surf)
507 mtx_lock(&p_surf->device->mutex);
508 if (p_surf->video_buffer == NULL) {
509 struct pipe_context *pipe = p_surf->device->context;
512 p_surf->video_buffer = pipe->create_video_buffer(pipe, &p_surf->templat);
516 if (p_surf->video_buffer == NULL || !p_surf->video_buffer->interlaced ||
517 p_surf->video_buffer->buffer_format != PIPE_FORMAT_NV12) {
518 mtx_unlock(&p_surf->device->mutex);
522 surf = p_surf->video_buffer->get_surfaces(p_surf->video_buffer)[plane];
524 mtx_unlock(&p_surf->device->mutex);
533 if (!pscreen->resource_get_handle(pscreen, p_surf->device->context,
536 mtx_unlock(&p_surf->device->mutex);
540 mtx_unlock(&p_surf->device->mutex);