diff options
author | Eric Anholt <eric@anholt.net> | 2014-03-18 09:42:47 +0100 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2014-03-26 12:58:39 -0700 |
commit | 84ff8960722fa9baf6ad70756b9c335bf2a5e515 (patch) | |
tree | e7a4f6958f4b9101651fe40f333a3d4a598a4e9f /hw | |
parent | 370c8c75ca6aebb5d93d2ab87c9c8ffac21fc57d (diff) |
kdrive: Remove duplicated definitions of some XV-related structs.
v2: Fix crash because of removed strdup. (by Markus Wick)
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net> (v2)
Diffstat (limited to 'hw')
-rw-r--r-- | hw/kdrive/src/kxv.c | 27 | ||||
-rw-r--r-- | hw/kdrive/src/kxv.h | 36 |
2 files changed, 4 insertions, 59 deletions
diff --git a/hw/kdrive/src/kxv.c b/hw/kdrive/src/kxv.c index 445eb605b..9cc0edd8a 100644 --- a/hw/kdrive/src/kxv.c +++ b/hw/kdrive/src/kxv.c @@ -385,28 +385,7 @@ KdXVInitAdaptors(ScreenPtr pScreen, KdVideoAdaptorPtr * infoPtr, int number) for (i = 0, pi = pImage, imagePtr = adaptorPtr->pImages; i < adaptorPtr->nImages; i++, pi++, imagePtr++) { - pi->id = imagePtr->id; - pi->type = imagePtr->type; - pi->byte_order = imagePtr->byte_order; - memcpy(pi->guid, imagePtr->guid, 16); - pi->bits_per_pixel = imagePtr->bits_per_pixel; - pi->format = imagePtr->format; - pi->num_planes = imagePtr->num_planes; - pi->depth = imagePtr->depth; - pi->red_mask = imagePtr->red_mask; - pi->green_mask = imagePtr->green_mask; - pi->blue_mask = imagePtr->blue_mask; - pi->y_sample_bits = imagePtr->y_sample_bits; - pi->u_sample_bits = imagePtr->u_sample_bits; - pi->v_sample_bits = imagePtr->v_sample_bits; - pi->horz_y_period = imagePtr->horz_y_period; - pi->horz_u_period = imagePtr->horz_u_period; - pi->horz_v_period = imagePtr->horz_v_period; - pi->vert_y_period = imagePtr->vert_y_period; - pi->vert_u_period = imagePtr->vert_u_period; - pi->vert_v_period = imagePtr->vert_v_period; - memcpy(pi->component_order, imagePtr->component_order, 32); - pi->scanline_order = imagePtr->scanline_order; + memcpy(pi, imagePtr, sizeof(*pi)); } pa->nImages = adaptorPtr->nImages; pa->pImages = pImage; @@ -417,9 +396,7 @@ KdXVInitAdaptors(ScreenPtr pScreen, KdVideoAdaptorPtr * infoPtr, int number) calloc(adaptorPtr->nAttributes, sizeof(XvAttributeRec)))) { for (pat = pAttribute, attributePtr = adaptorPtr->pAttributes, i = 0; i < adaptorPtr->nAttributes; pat++, i++, attributePtr++) { - pat->flags = attributePtr->flags; - pat->min_value = attributePtr->min_value; - pat->max_value = attributePtr->max_value; + memcpy(pat, attributePtr, sizeof(*pat)); pat->name = strdup(attributePtr->name); } pa->nAttributes = adaptorPtr->nAttributes; diff --git a/hw/kdrive/src/kxv.h b/hw/kdrive/src/kxv.h index 4f644c246..85a030ee9 100644 --- a/hw/kdrive/src/kxv.h +++ b/hw/kdrive/src/kxv.h @@ -56,34 +56,7 @@ of the copyright holder. #define VIDEO_OVERLAID_STILLS 0x00000008 #define VIDEO_CLIP_TO_VIEWPORT 0x00000010 -typedef struct { - int id; - int type; - int byte_order; - unsigned char guid[16]; - int bits_per_pixel; - int format; - int num_planes; - - /* for RGB formats only */ - int depth; - unsigned int red_mask; - unsigned int green_mask; - unsigned int blue_mask; - - /* for YUV formats only */ - unsigned int y_sample_bits; - unsigned int u_sample_bits; - unsigned int v_sample_bits; - unsigned int horz_y_period; - unsigned int horz_u_period; - unsigned int horz_v_period; - unsigned int vert_y_period; - unsigned int vert_u_period; - unsigned int vert_v_period; - char component_order[32]; - int scanline_order; -} KdImageRec, *KdImagePtr; +typedef XvImageRec KdImageRec, *KdImagePtr; typedef struct { KdScreenInfo *screen; @@ -158,12 +131,7 @@ typedef struct { short class; } KdVideoFormatRec, *KdVideoFormatPtr; -typedef struct { - int flags; - int min_value; - int max_value; - char *name; -} KdAttributeRec, *KdAttributePtr; +typedef XvAttributeRec KdAttributeRec, *KdAttributePtr; typedef struct { unsigned int type; |