wcap: Add GCC_CFLAGS and fix more compiler warnings
This commit is contained in:
+1
-1
@@ -5,5 +5,5 @@ wcap_decode_SOURCES = \
|
|||||||
wcap-decode.c \
|
wcap-decode.c \
|
||||||
wcap-decode.h
|
wcap-decode.h
|
||||||
|
|
||||||
wcap_decode_CFLAGS = $(WCAP_CFLAGS)
|
wcap_decode_CFLAGS = $(GCC_CFLAGS) $(WCAP_CFLAGS)
|
||||||
wcap_decode_LDADD = $(WCAP_LIBS)
|
wcap_decode_LDADD = $(WCAP_LIBS)
|
||||||
|
|||||||
@@ -30,6 +30,7 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
#include <cairo.h>
|
#include <cairo.h>
|
||||||
|
|
||||||
@@ -65,6 +66,8 @@ rgb_to_yuv(uint32_t format, uint32_t p, int *u, int *v)
|
|||||||
g = (p >> 8) & 0xff;
|
g = (p >> 8) & 0xff;
|
||||||
b = (p >> 16) & 0xff;
|
b = (p >> 16) & 0xff;
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
assert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
y = (19595 * r + 38469 * g + 7472 * b) >> 16;
|
y = (19595 * r + 38469 * g + 7472 * b) >> 16;
|
||||||
|
|||||||
+1
-6
@@ -85,9 +85,7 @@ wcap_decoder_get_frame(struct wcap_decoder *decoder)
|
|||||||
{
|
{
|
||||||
struct wcap_rectangle *rects;
|
struct wcap_rectangle *rects;
|
||||||
struct wcap_frame_header *header;
|
struct wcap_frame_header *header;
|
||||||
uint32_t *s;
|
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
int width, height;
|
|
||||||
|
|
||||||
if (decoder->p == decoder->end)
|
if (decoder->p == decoder->end)
|
||||||
return 0;
|
return 0;
|
||||||
@@ -98,11 +96,8 @@ wcap_decoder_get_frame(struct wcap_decoder *decoder)
|
|||||||
|
|
||||||
rects = (void *) (header + 1);
|
rects = (void *) (header + 1);
|
||||||
decoder->p = (uint32_t *) (rects + header->nrects);
|
decoder->p = (uint32_t *) (rects + header->nrects);
|
||||||
for (i = 0; i < header->nrects; i++) {
|
for (i = 0; i < header->nrects; i++)
|
||||||
width = rects[i].x2 - rects[i].x1;
|
|
||||||
height = rects[i].y2 - rects[i].y1;
|
|
||||||
wcap_decoder_decode_rectangle(decoder, &rects[i]);
|
wcap_decoder_decode_rectangle(decoder, &rects[i]);
|
||||||
}
|
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user