ephyr: Remove the host/server split for XV formats.
Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Julien Cristau <jcristau@debian.org>
This commit is contained in:
parent
41134d393a
commit
28a37757e1
@ -43,31 +43,6 @@
|
|||||||
#define FALSE 0
|
#define FALSE 0
|
||||||
#endif /*FALSE*/
|
#endif /*FALSE*/
|
||||||
|
|
||||||
EphyrHostVideoFormat*
|
|
||||||
ephyrHostXVAdaptorGetVideoFormats (const xcb_xv_adaptor_info_t *a_this,
|
|
||||||
int *a_nb_formats)
|
|
||||||
{
|
|
||||||
EphyrHostVideoFormat *formats = NULL;
|
|
||||||
int nb_formats = 0, i = 0;
|
|
||||||
xcb_xv_format_t *format = xcb_xv_adaptor_info_formats(a_this);
|
|
||||||
|
|
||||||
EPHYR_RETURN_VAL_IF_FAIL(a_this, NULL);
|
|
||||||
|
|
||||||
nb_formats = a_this->num_formats;
|
|
||||||
formats = calloc(nb_formats, sizeof(EphyrHostVideoFormat));
|
|
||||||
for (i = 0; i < nb_formats; i++) {
|
|
||||||
xcb_visualtype_t *visual =
|
|
||||||
xcb_aux_find_visual_by_id(
|
|
||||||
xcb_aux_get_screen(hostx_get_xcbconn(), hostx_get_screen()),
|
|
||||||
format[i].visual);
|
|
||||||
formats[i].depth = format[i].depth;
|
|
||||||
formats[i].visual_class = visual->_class;
|
|
||||||
}
|
|
||||||
if (a_nb_formats)
|
|
||||||
*a_nb_formats = nb_formats;
|
|
||||||
return formats;
|
|
||||||
}
|
|
||||||
|
|
||||||
Bool
|
Bool
|
||||||
ephyrHostXVQueryEncodings(int a_port_id,
|
ephyrHostXVQueryEncodings(int a_port_id,
|
||||||
EphyrHostEncoding ** a_encodings,
|
EphyrHostEncoding ** a_encodings,
|
||||||
|
@ -31,11 +31,6 @@
|
|||||||
#include <xcb/xv.h>
|
#include <xcb/xv.h>
|
||||||
#include <X11/Xdefs.h>
|
#include <X11/Xdefs.h>
|
||||||
|
|
||||||
typedef struct _EphyrHostVideoFormat {
|
|
||||||
char depth;
|
|
||||||
short visual_class;
|
|
||||||
} EphyrHostVideoFormat;
|
|
||||||
|
|
||||||
typedef struct _EphyrHostRational {
|
typedef struct _EphyrHostRational {
|
||||||
int numerator;
|
int numerator;
|
||||||
int denominator;
|
int denominator;
|
||||||
@ -81,12 +76,6 @@ typedef struct {
|
|||||||
unsigned short x1, y1, x2, y2;
|
unsigned short x1, y1, x2, y2;
|
||||||
} EphyrHostBox;
|
} EphyrHostBox;
|
||||||
|
|
||||||
/*
|
|
||||||
* host adaptor
|
|
||||||
*/
|
|
||||||
EphyrHostVideoFormat *ephyrHostXVAdaptorGetVideoFormats
|
|
||||||
(const xcb_xv_adaptor_info_t *a_this, int *a_nb_formats);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* encoding
|
* encoding
|
||||||
*/
|
*/
|
||||||
|
@ -401,10 +401,9 @@ ephyrXVPrivQueryHostAdaptors(EphyrXVPriv * a_this)
|
|||||||
{
|
{
|
||||||
xcb_connection_t *conn = hostx_get_xcbconn();
|
xcb_connection_t *conn = hostx_get_xcbconn();
|
||||||
xcb_screen_t *xscreen = xcb_aux_get_screen(conn, hostx_get_screen());
|
xcb_screen_t *xscreen = xcb_aux_get_screen(conn, hostx_get_screen());
|
||||||
EphyrHostVideoFormat *video_formats = NULL;
|
|
||||||
EphyrHostEncoding *encodings = NULL;
|
EphyrHostEncoding *encodings = NULL;
|
||||||
EphyrHostImageFormat *image_formats = NULL;
|
EphyrHostImageFormat *image_formats = NULL;
|
||||||
int num_video_formats = 0, base_port_id = 0,
|
int base_port_id = 0,
|
||||||
num_formats = 0, i = 0, port_priv_offset = 0;
|
num_formats = 0, i = 0, port_priv_offset = 0;
|
||||||
unsigned num_encodings = 0;
|
unsigned num_encodings = 0;
|
||||||
Bool is_ok = FALSE;
|
Bool is_ok = FALSE;
|
||||||
@ -425,6 +424,7 @@ ephyrXVPrivQueryHostAdaptors(EphyrXVPriv * a_this)
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (a_this->host_adaptors)
|
if (a_this->host_adaptors)
|
||||||
a_this->num_adaptors = a_this->host_adaptors->num_adaptors;
|
a_this->num_adaptors = a_this->host_adaptors->num_adaptors;
|
||||||
if (a_this->num_adaptors < 0) {
|
if (a_this->num_adaptors < 0) {
|
||||||
@ -447,6 +447,7 @@ ephyrXVPrivQueryHostAdaptors(EphyrXVPriv * a_this)
|
|||||||
it = xcb_xv_query_adaptors_info_iterator(a_this->host_adaptors);
|
it = xcb_xv_query_adaptors_info_iterator(a_this->host_adaptors);
|
||||||
for (i = 0; i < a_this->num_adaptors; i++) {
|
for (i = 0; i < a_this->num_adaptors; i++) {
|
||||||
xcb_xv_adaptor_info_t *cur_host_adaptor = it.data;
|
xcb_xv_adaptor_info_t *cur_host_adaptor = it.data;
|
||||||
|
xcb_xv_format_t *format = xcb_xv_adaptor_info_formats(cur_host_adaptor);
|
||||||
int j = 0;
|
int j = 0;
|
||||||
|
|
||||||
a_this->adaptors[i].nPorts = cur_host_adaptor->num_ports;
|
a_this->adaptors[i].nPorts = cur_host_adaptor->num_ports;
|
||||||
@ -480,11 +481,18 @@ ephyrXVPrivQueryHostAdaptors(EphyrXVPriv * a_this)
|
|||||||
a_this->adaptors[i].nEncodings = num_encodings;
|
a_this->adaptors[i].nEncodings = num_encodings;
|
||||||
a_this->adaptors[i].pEncodings =
|
a_this->adaptors[i].pEncodings =
|
||||||
videoEncodingDup(encodings, num_encodings);
|
videoEncodingDup(encodings, num_encodings);
|
||||||
video_formats = (EphyrHostVideoFormat *)
|
|
||||||
ephyrHostXVAdaptorGetVideoFormats(cur_host_adaptor,
|
a_this->adaptors[i].nFormats = cur_host_adaptor->num_formats;
|
||||||
&num_video_formats);
|
a_this->adaptors[i].pFormats =
|
||||||
a_this->adaptors[i].pFormats = (KdVideoFormatPtr) video_formats;
|
calloc(cur_host_adaptor->num_formats,
|
||||||
a_this->adaptors[i].nFormats = num_video_formats;
|
sizeof(*a_this->adaptors[i].pFormats));
|
||||||
|
for (j = 0; j < cur_host_adaptor->num_formats; j++) {
|
||||||
|
xcb_visualtype_t *visual =
|
||||||
|
xcb_aux_find_visual_by_id(xscreen, format[j].visual);
|
||||||
|
a_this->adaptors[i].pFormats[j].depth = format[j].depth;
|
||||||
|
a_this->adaptors[i].pFormats[j].class = visual->_class;
|
||||||
|
}
|
||||||
|
|
||||||
a_this->adaptors[i].pPortPrivates =
|
a_this->adaptors[i].pPortPrivates =
|
||||||
calloc(a_this->adaptors[i].nPorts,
|
calloc(a_this->adaptors[i].nPorts,
|
||||||
sizeof(DevUnion) + sizeof(EphyrPortPriv));
|
sizeof(DevUnion) + sizeof(EphyrPortPriv));
|
||||||
|
Loading…
Reference in New Issue
Block a user