diff options
author | wm4 <wm4@nowhere> | 2017-06-18 15:00:36 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2017-06-18 15:13:45 +0200 |
commit | b6d0b57e8531c2cacb237e2144e858cfdbf1eb32 (patch) | |
tree | c339318aa6acb18c841013ce639389d43ca44c66 /demux | |
parent | 32833fa3d14b78cd2a481641cfa174d4bee6533e (diff) | |
download | mpv-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 'demux')
-rw-r--r-- | demux/demux_mkv.c | 7 | ||||
-rw-r--r-- | demux/demux_raw.c | 28 | ||||
-rw-r--r-- | demux/demux_tv.c | 1 |
3 files changed, 11 insertions, 25 deletions
diff --git a/demux/demux_mkv.c b/demux/demux_mkv.c index 97c7d3e09b..c3988b8bf8 100644 --- a/demux/demux_mkv.c +++ b/demux/demux_mkv.c @@ -56,7 +56,6 @@ #include "ebml.h" #include "matroska.h" #include "codec_tags.h" -#include "video/img_fourcc.h" #include "common/msg.h" @@ -1392,8 +1391,8 @@ static int demux_mkv_open_video(demuxer_t *demuxer, mkv_track_t *track) fourcc1 = AV_RL32(track->private_data + 0); fourcc2 = AV_RL32(track->private_data + 4); } - if (fourcc1 == MP_FOURCC('S', 'V', 'Q', '3') || - fourcc2 == MP_FOURCC('S', 'V', 'Q', '3')) + if (fourcc1 == MKTAG('S', 'V', 'Q', '3') || + fourcc2 == MKTAG('S', 'V', 'Q', '3')) { sh_v->codec = "svq3"; extradata = track->private_data; @@ -1417,7 +1416,7 @@ static int demux_mkv_open_video(demuxer_t *demuxer, mkv_track_t *track) track->parse = true; track->parse_timebase = 1e9; } else if (!strcmp(codec, "mjpeg")) { - sh_v->codec_tag = MP_FOURCC('m', 'j', 'p', 'g'); + sh_v->codec_tag = MKTAG('m', 'j', 'p', 'g'); } if (extradata_size > 0x1000000) { diff --git a/demux/demux_raw.c b/demux/demux_raw.c index c0948c59dc..7dffa1caa7 100644 --- a/demux/demux_raw.c +++ b/demux/demux_raw.c @@ -23,6 +23,7 @@ #include <string.h> #include <libavcodec/avcodec.h> +#include <libavutil/common.h> #include "common/av_common.h" @@ -36,7 +37,6 @@ #include "video/fmt-conversion.h" #include "video/img_format.h" -#include "video/img_fourcc.h" #include "osdep/endian.h" @@ -118,7 +118,7 @@ const struct m_sub_options demux_rawvideo_conf = { }, .size = sizeof(struct demux_rawvideo_opts), .defaults = &(const struct demux_rawvideo_opts){ - .vformat = MP_FOURCC_I420, + .vformat = MKTAG('I', '4', '2', '0'), .width = 1280, .height = 720, .fps = 25, @@ -208,28 +208,16 @@ static int demux_rawvideo_open(demuxer_t *demuxer, enum demux_check check) if (!imgsize) { int bpp = 0; switch (imgfmt) { - case MP_FOURCC_I420: case MP_FOURCC_IYUV: - case MP_FOURCC_NV12: case MP_FOURCC_NV21: - case MP_FOURCC_HM12: - case MP_FOURCC_YV12: + case MKTAG('Y', 'V', '1', '2'): + case MKTAG('I', '4', '2', '0'): + case MKTAG('I', 'Y', 'U', 'V'): + case MKTAG('N', 'V', '1', '2'): bpp = 12; break; - case MP_FOURCC_RGB12: case MP_FOURCC_BGR12: - case MP_FOURCC_RGB15: case MP_FOURCC_BGR15: - case MP_FOURCC_RGB16: case MP_FOURCC_BGR16: - case MP_FOURCC_YUY2: case MP_FOURCC_UYVY: + case MKTAG('U', 'Y', 'V', 'Y'): + case MKTAG('Y', 'U', 'Y', '2'): bpp = 16; break; - case MP_FOURCC_RGB8: case MP_FOURCC_BGR8: - case MP_FOURCC_Y800: case MP_FOURCC_Y8: - bpp = 8; - break; - case MP_FOURCC_RGB24: case MP_FOURCC_BGR24: - bpp = 24; - break; - case MP_FOURCC_RGB32: case MP_FOURCC_BGR32: - bpp = 32; - break; } if (!bpp) { MP_ERR(demuxer, "rawvideo: img size not specified and unknown format!\n"); diff --git a/demux/demux_tv.c b/demux/demux_tv.c index 4a8e0c70fa..94bb71284e 100644 --- a/demux/demux_tv.c +++ b/demux/demux_tv.c @@ -11,7 +11,6 @@ #include "codec_tags.h" #include "audio/format.h" -#include "video/img_fourcc.h" #include "osdep/endian.h" #include "stream/stream.h" |