summaryrefslogtreecommitdiffstats
path: root/libmpcodecs/mp_image.h
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2009-02-16 02:39:58 +0200
committerUoti Urpala <uau@glyph.nonexistent.invalid>2009-02-16 02:39:58 +0200
commit0bf2bd91ec69dfd908d78557a17f38e0904a52e7 (patch)
treebf9e5e145ff802e7b5ff7b9ab387bfc3ba0331d7 /libmpcodecs/mp_image.h
parent738f66b1bc98073d74af7031c4454322157a15ec (diff)
parenteacf4421f4fe16674aefe8b628321188c4912521 (diff)
downloadmpv-0bf2bd91ec69dfd908d78557a17f38e0904a52e7.tar.bz2
mpv-0bf2bd91ec69dfd908d78557a17f38e0904a52e7.tar.xz
Merge svn changes up to r28610
Diffstat (limited to 'libmpcodecs/mp_image.h')
-rw-r--r--libmpcodecs/mp_image.h25
1 files changed, 12 insertions, 13 deletions
diff --git a/libmpcodecs/mp_image.h b/libmpcodecs/mp_image.h
index 364c7937ab..fb06e62fc9 100644
--- a/libmpcodecs/mp_image.h
+++ b/libmpcodecs/mp_image.h
@@ -4,6 +4,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include "mp_msg.h"
//--------- codec's requirements (filled by the codec/vf) ---------
@@ -53,6 +54,8 @@
// buffer type was printed (do NOT set this flag - it's for INTERNAL USE!!!)
#define MP_IMGFLAG_TYPE_DISPLAYED 0x8000
+// set if it can not be reused yet (for MP_IMGTYPE_NUMBERED)
+#define MP_IMGFLAG_IN_USE 0x10000
// codec doesn't support any form of direct rendering - it has own buffer
// allocation. so we just export its buffer pointers:
@@ -65,6 +68,8 @@
#define MP_IMGTYPE_IP 3
// I+P+B type, requires 2+ independent static R/W and 1+ temp WO buffers
#define MP_IMGTYPE_IPB 4
+// Upper 16 bits give desired buffer number, -1 means get next available
+#define MP_IMGTYPE_NUMBERED 5
#define MP_MAX_PLANES 4
@@ -76,8 +81,9 @@
#define MP_IMGFIELD_INTERLACED 0x20
typedef struct mp_image {
- unsigned short flags;
+ unsigned int flags;
unsigned char type;
+ int number;
unsigned char bpp; // bits/pixel. NOT depth! for RGB it will be n*8
unsigned int imgfmt;
int width,height; // stored dimensions
@@ -103,17 +109,10 @@ typedef struct mp_image {
static inline void mp_image_setfmt(mp_image_t* mpi,unsigned int out_fmt){
mpi->flags&=~(MP_IMGFLAG_PLANAR|MP_IMGFLAG_YUV|MP_IMGFLAG_SWAPPED);
mpi->imgfmt=out_fmt;
- if(out_fmt == IMGFMT_MPEGPES){
- mpi->bpp=0;
- return;
- }
- if(out_fmt == IMGFMT_ZRMJPEGNI ||
- out_fmt == IMGFMT_ZRMJPEGIT ||
- out_fmt == IMGFMT_ZRMJPEGIB){
- mpi->bpp=0;
- return;
- }
- if(IMGFMT_IS_XVMC(out_fmt)){
+ // compressed formats
+ if(out_fmt == IMGFMT_MPEGPES ||
+ out_fmt == IMGFMT_ZRMJPEGNI || out_fmt == IMGFMT_ZRMJPEGIT || out_fmt == IMGFMT_ZRMJPEGIB ||
+ IMGFMT_IS_VDPAU(out_fmt) || IMGFMT_IS_XVMC(out_fmt)){
mpi->bpp=0;
return;
}
@@ -206,7 +205,7 @@ static inline void mp_image_setfmt(mp_image_t* mpi,unsigned int out_fmt){
mpi->chroma_y_shift=1;
return;
}
- fprintf(stderr,"mp_image: unknown out_fmt: 0x%X\n",out_fmt);
+ mp_msg(MSGT_DECVIDEO,MSGL_WARN,"mp_image: unknown out_fmt: 0x%X\n",out_fmt);
mpi->bpp=0;
}
#endif