summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-03-17 18:19:57 +0100
committerwm4 <wm4@nowhere>2014-03-17 18:19:57 +0100
commit5ed24862c01b217b4db0b04d74f29bad9bc80569 (patch)
treeafb9133ac23119c3aceabb1cfb1f2b7e8ee57175
parent6aa2d1f12073c65a30a0b3a8c6d7191165ca0286 (diff)
downloadmpv-5ed24862c01b217b4db0b04d74f29bad9bc80569.tar.bz2
mpv-5ed24862c01b217b4db0b04d74f29bad9bc80569.tar.xz
video: change image format from unsigned int to int in some places
Image formats used to be FourCCs, so unsigned int was better. But now it's annoying and the only difference is that unsigned int is more to type than int.
-rw-r--r--video/img_format.c4
-rw-r--r--video/img_format.h8
-rw-r--r--video/mp_image.c4
-rw-r--r--video/mp_image.h4
-rw-r--r--video/mp_image_pool.c2
-rw-r--r--video/mp_image_pool.h2
6 files changed, 12 insertions, 12 deletions
diff --git a/video/img_format.c b/video/img_format.c
index e1636e1eb6..8681744e5c 100644
--- a/video/img_format.c
+++ b/video/img_format.c
@@ -126,7 +126,7 @@ struct mp_imgfmt_entry mp_imgfmt_list[] = {
{0}
};
-unsigned int mp_imgfmt_from_name(bstr name, bool allow_hwaccel)
+int mp_imgfmt_from_name(bstr name, bool allow_hwaccel)
{
int img_fmt = 0;
for(struct mp_imgfmt_entry *p = mp_imgfmt_list; p->name; ++p) {
@@ -147,7 +147,7 @@ unsigned int mp_imgfmt_from_name(bstr name, bool allow_hwaccel)
return img_fmt;
}
-const char *mp_imgfmt_to_name(unsigned int fmt)
+const char *mp_imgfmt_to_name(int fmt)
{
struct mp_imgfmt_entry *p = mp_imgfmt_list;
for(; p->name; ++p) {
diff --git a/video/img_format.h b/video/img_format.h
index 10268febaa..3707018477 100644
--- a/video/img_format.h
+++ b/video/img_format.h
@@ -333,7 +333,7 @@ enum mp_imgfmt {
IMGFMT_XYZ12 = MP_SELECT_LE_BE(IMGFMT_XYZ12_LE, IMGFMT_XYZ12_BE),
};
-static inline bool IMGFMT_IS_RGB(unsigned int fmt)
+static inline bool IMGFMT_IS_RGB(int fmt)
{
struct mp_imgfmt_desc desc = mp_imgfmt_get_desc(fmt);
return (desc.flags & MP_IMGFLAG_RGB) && desc.num_planes == 1;
@@ -350,13 +350,13 @@ static inline bool IMGFMT_IS_RGB(unsigned int fmt)
struct mp_imgfmt_entry {
const char *name;
- unsigned int fmt;
+ int fmt;
};
extern struct mp_imgfmt_entry mp_imgfmt_list[];
-unsigned int mp_imgfmt_from_name(bstr name, bool allow_hwaccel);
-const char *mp_imgfmt_to_name(unsigned int fmt);
+int mp_imgfmt_from_name(bstr name, bool allow_hwaccel);
+const char *mp_imgfmt_to_name(int fmt);
#define vo_format_name mp_imgfmt_to_name
diff --git a/video/mp_image.c b/video/mp_image.c
index 8b79489f31..67d7168bf1 100644
--- a/video/mp_image.c
+++ b/video/mp_image.c
@@ -149,7 +149,7 @@ static void mp_image_alloc_planes(struct mp_image *mpi)
}
}
-void mp_image_setfmt(struct mp_image *mpi, unsigned int out_fmt)
+void mp_image_setfmt(struct mp_image *mpi, int out_fmt)
{
struct mp_imgfmt_desc fmt = mp_imgfmt_get_desc(out_fmt);
mpi->fmt = fmt;
@@ -195,7 +195,7 @@ void mp_image_set_display_size(struct mp_image *mpi, int dw, int dh)
mpi->display_h = dh;
}
-struct mp_image *mp_image_alloc(unsigned int imgfmt, int w, int h)
+struct mp_image *mp_image_alloc(int imgfmt, int w, int h)
{
struct mp_image *mpi = talloc_zero(NULL, struct mp_image);
talloc_set_destructor(mpi, mp_image_destructor);
diff --git a/video/mp_image.h b/video/mp_image.h
index c882a59caa..1e2933170a 100644
--- a/video/mp_image.h
+++ b/video/mp_image.h
@@ -109,7 +109,7 @@ typedef struct mp_image {
void* priv;
} mp_image_t;
-struct mp_image *mp_image_alloc(unsigned int fmt, int w, int h);
+struct mp_image *mp_image_alloc(int fmt, int w, int h);
void mp_image_copy(struct mp_image *dmpi, struct mp_image *mpi);
void mp_image_copy_attributes(struct mp_image *dmpi, struct mp_image *mpi);
struct mp_image *mp_image_new_copy(struct mp_image *img);
@@ -127,7 +127,7 @@ void mp_image_vflip(struct mp_image *img);
void mp_image_set_size(struct mp_image *mpi, int w, int h);
void mp_image_set_display_size(struct mp_image *mpi, int dw, int dh);
-void mp_image_setfmt(mp_image_t* mpi,unsigned int out_fmt);
+void mp_image_setfmt(mp_image_t* mpi, int out_fmt);
void mp_image_steal_data(struct mp_image *dst, struct mp_image *src);
struct mp_image *mp_image_new_custom_ref(struct mp_image *img, void *arg,
diff --git a/video/mp_image_pool.c b/video/mp_image_pool.c
index 07cbc94e45..6b907706c5 100644
--- a/video/mp_image_pool.c
+++ b/video/mp_image_pool.c
@@ -106,7 +106,7 @@ static void unref_image(void *ptr)
// mp_image_alloc() is that there is a transparent mechanism to recycle image
// data allocations through this pool.
// The image can be free'd with talloc_free().
-struct mp_image *mp_image_pool_get(struct mp_image_pool *pool, unsigned int fmt,
+struct mp_image *mp_image_pool_get(struct mp_image_pool *pool, int fmt,
int w, int h)
{
struct mp_image *new = NULL;
diff --git a/video/mp_image_pool.h b/video/mp_image_pool.h
index 0982fd94f8..6ea041c527 100644
--- a/video/mp_image_pool.h
+++ b/video/mp_image_pool.h
@@ -4,7 +4,7 @@
struct mp_image_pool;
struct mp_image_pool *mp_image_pool_new(int max_count);
-struct mp_image *mp_image_pool_get(struct mp_image_pool *pool, unsigned int fmt,
+struct mp_image *mp_image_pool_get(struct mp_image_pool *pool, int fmt,
int w, int h);
void mp_image_pool_clear(struct mp_image_pool *pool);