summaryrefslogtreecommitdiffstats
path: root/stream/tv.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-06-18 15:00:36 +0200
committerwm4 <wm4@nowhere>2017-06-18 15:13:45 +0200
commitb6d0b57e8531c2cacb237e2144e858cfdbf1eb32 (patch)
treec339318aa6acb18c841013ce639389d43ca44c66 /stream/tv.h
parent32833fa3d14b78cd2a481641cfa174d4bee6533e (diff)
downloadmpv-b6d0b57e8531c2cacb237e2144e858cfdbf1eb32.tar.bz2
mpv-b6d0b57e8531c2cacb237e2144e858cfdbf1eb32.tar.xz
Drop/move img_fourcc.h
This file is an leftover from when img_format.h was changed from using the ancient FourCCs (based on Microsoft multimedia conventions) for pixel formats to a simple enum. The remaining cases still inherently used FourCCs for whatever reasons. Instead of worrying about residual copyrights in this file, just move it into code we don't want to relicense (the ancient Linux TV code). We have to fix some other code depending on it. For the most part, we just replace the MP_FOURCC macro with libavutil's MKTAG (although the macro definition is exactly the same). In demux_raw, we drop some pre-defined FourCCs, but it's not like it matters. (Instead of --demuxer-rawvideo-format use --demuxer-rawvideo-mp-format.)
Diffstat (limited to 'stream/tv.h')
-rw-r--r--stream/tv.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/stream/tv.h b/stream/tv.h
index 434a52d4fd..64be22298b 100644
--- a/stream/tv.h
+++ b/stream/tv.h
@@ -24,6 +24,8 @@
#ifndef MPLAYER_TV_H
#define MPLAYER_TV_H
+#include "osdep/endian.h"
+
struct mp_log;
typedef struct tv_params {
@@ -238,4 +240,40 @@ int tv_stream_control(tvi_handle_t *tvh, int cmd, void *arg);
extern const struct m_sub_options tv_params_conf;
+#define MP_FOURCC(a,b,c,d) ((a) | ((b)<<8) | ((c)<<16) | ((unsigned)(d)<<24))
+
+#if BYTE_ORDER == BIG_ENDIAN
+#define MP_FOURCC_E(a,b,c,d) MP_FOURCC(a,b,c,d)
+#else
+#define MP_FOURCC_E(a,b,c,d) MP_FOURCC(d,c,b,a)
+#endif
+
+#define MP_FOURCC_RGB8 MP_FOURCC_E(8, 'B', 'G', 'R')
+#define MP_FOURCC_RGB12 MP_FOURCC_E(12, 'B', 'G', 'R')
+#define MP_FOURCC_RGB15 MP_FOURCC_E(15, 'B', 'G', 'R')
+#define MP_FOURCC_RGB16 MP_FOURCC_E(16, 'B', 'G', 'R')
+#define MP_FOURCC_RGB24 MP_FOURCC_E(24, 'B', 'G', 'R')
+#define MP_FOURCC_RGB32 MP_FOURCC_E('A', 'B', 'G', 'R')
+
+#define MP_FOURCC_BGR8 MP_FOURCC_E(8, 'R', 'G', 'B')
+#define MP_FOURCC_BGR12 MP_FOURCC_E(12, 'R', 'G', 'B')
+#define MP_FOURCC_BGR15 MP_FOURCC_E(15, 'R', 'G', 'B')
+#define MP_FOURCC_BGR16 MP_FOURCC_E(16, 'R', 'G', 'B')
+#define MP_FOURCC_BGR24 MP_FOURCC_E(24, 'R', 'G', 'B')
+#define MP_FOURCC_BGR32 MP_FOURCC_E('A', 'R', 'G', 'B')
+
+#define MP_FOURCC_YVU9 MP_FOURCC('Y', 'U', 'V', '9')
+#define MP_FOURCC_YUV9 MP_FOURCC('Y', 'V', 'U', '9')
+#define MP_FOURCC_YV12 MP_FOURCC('Y', 'V', '1', '2')
+#define MP_FOURCC_I420 MP_FOURCC('I', '4', '2', '0')
+#define MP_FOURCC_IYUV MP_FOURCC('I', 'Y', 'U', 'V')
+#define MP_FOURCC_Y800 MP_FOURCC('Y', '8', '0', '0')
+#define MP_FOURCC_NV12 MP_FOURCC('N', 'V', '1', '2')
+#define MP_FOURCC_NV21 MP_FOURCC('N', 'V', '2', '1')
+
+#define MP_FOURCC_UYVY MP_FOURCC('U', 'Y', 'V', 'Y')
+#define MP_FOURCC_YUY2 MP_FOURCC('Y', 'U', 'Y', '2')
+
+#define MP_FOURCC_MJPEG MP_FOURCC('M', 'J', 'P', 'G')
+
#endif /* MPLAYER_TV_H */