summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Hutchinson <qyot27@gmail.com>2013-03-08 17:42:24 -0500
committerDerek Buitenhuis <derek.buitenhuis@gmail.com>2013-03-08 20:45:49 -0500
commit98c4268ecac1dfb5d3e534bbea684fc80e8aef17 (patch)
tree565914c942e8c370e280eaad32caccaca351eda2
parent309d6f5077e4b81cf519c004abace374f5d357b4 (diff)
libutvideo: Prioritize compatibility with new versions
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
-rw-r--r--libavcodec/libutvideo.h16
-rw-r--r--libavcodec/libutvideodec.cpp4
-rw-r--r--libavcodec/libutvideoenc.cpp4
3 files changed, 14 insertions, 10 deletions
diff --git a/libavcodec/libutvideo.h b/libavcodec/libutvideo.h
index ac665b2190..b35d19ce19 100644
--- a/libavcodec/libutvideo.h
+++ b/libavcodec/libutvideo.h
@@ -31,14 +31,18 @@
#include <utvideo/utvideo.h>
#include <utvideo/Codec.h>
-/* Ut Video version 12.0.0 removed the _WIN names, so if those are
- * absent, redefine them to maintain compatibility with pre-v12 versions.*/
-#if !defined(UTVF_RGB24_WIN)
-#define UTVF_RGB24_WIN UTVF_NFCC_BGR_BU
+/*
+ * Ut Video version 12.0.0 changed the RGB format names and removed
+ * the _WIN names, so if the new names are absent, define them
+ * against the old names so compatibility with pre-v12 versions
+ * is maintained.
+ */
+#if !defined(UTVF_NFCC_BGR_BU)
+#define UTVF_NFCC_BGR_BU UTVF_RGB24_WIN
#endif
-#if !defined(UTVF_RGB32_WIN)
-#define UTVF_RGB32_WIN UTVF_NFCC_BGRA_BU
+#if !defined(UTVF_NFCC_BGRA_BU)
+#define UTVF_NFCC_BGRA_BU UTVF_RGB32_WIN
#endif
typedef struct {
diff --git a/libavcodec/libutvideodec.cpp b/libavcodec/libutvideodec.cpp
index f70ac4f48f..bc491e2329 100644
--- a/libavcodec/libutvideodec.cpp
+++ b/libavcodec/libutvideodec.cpp
@@ -61,11 +61,11 @@ static av_cold int utvideo_decode_init(AVCodecContext *avctx)
break;
case MKTAG('U', 'L', 'R', 'G'):
avctx->pix_fmt = AV_PIX_FMT_BGR24;
- format = UTVF_RGB24_WIN;
+ format = UTVF_NFCC_BGR_BU;
break;
case MKTAG('U', 'L', 'R', 'A'):
avctx->pix_fmt = AV_PIX_FMT_RGB32;
- format = UTVF_RGB32_WIN;
+ format = UTVF_NFCC_BGRA_BU;
break;
default:
av_log(avctx, AV_LOG_ERROR,
diff --git a/libavcodec/libutvideoenc.cpp b/libavcodec/libutvideoenc.cpp
index e9af7dfc90..07205f7139 100644
--- a/libavcodec/libutvideoenc.cpp
+++ b/libavcodec/libutvideoenc.cpp
@@ -51,12 +51,12 @@ static av_cold int utvideo_encode_init(AVCodecContext *avctx)
avctx->codec_tag = MKTAG('U', 'L', 'Y', '2');
break;
case AV_PIX_FMT_BGR24:
- in_format = UTVF_RGB24_WIN;
+ in_format = UTVF_NFCC_BGR_BU;
avctx->bits_per_coded_sample = 24;
avctx->codec_tag = MKTAG('U', 'L', 'R', 'G');
break;
case AV_PIX_FMT_RGB32:
- in_format = UTVF_RGB32_WIN;
+ in_format = UTVF_NFCC_BGRA_BU;
avctx->bits_per_coded_sample = 32;
avctx->codec_tag = MKTAG('U', 'L', 'R', 'A');
break;