Skip to content

Commit

Permalink
add comments about copyright for the code from mpv
Browse files Browse the repository at this point in the history
wm4 says the table va_to_imgfmt in commit 479e57a is copied from mpv. That file is under GPL.  So I revert to the `switch...case...` style.
ass_to_plaintext() is confirmed can be under LGPL.
  • Loading branch information
wang-bin committed Jan 19, 2016
1 parent 933b082 commit 56841c1
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
27 changes: 11 additions & 16 deletions src/codec/video/VideoDecoderVAAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,24 +167,19 @@ struct fmtentry {
uint32_t va;
VideoFormat::PixelFormat fmt;
};
static const struct fmtentry va_to_imgfmt[] = {
{VA_FOURCC_NV12, VideoFormat::Format_NV12},
{VA_FOURCC_YV12, VideoFormat::Format_YUV420P},
{VA_FOURCC_IYUV, VideoFormat::Format_YUV420P},
{VA_FOURCC_UYVY, VideoFormat::Format_UYVY},
{VA_FOURCC_YUY2, VideoFormat::Format_YUYV},
// Note: not sure about endian issues
{VA_FOURCC_RGBA, VideoFormat::Format_RGB32},
{VA_FOURCC_RGBX, VideoFormat::Format_RGB32},
{VA_FOURCC_BGRA, VideoFormat::Format_RGB32},
{VA_FOURCC_BGRX, VideoFormat::Format_RGB32},
{0 , VideoFormat::Format_Invalid}
};

VideoFormat::PixelFormat pixelFormatFromVA(uint32_t fourcc)
{
for (const struct fmtentry *entry = va_to_imgfmt; entry->va; ++entry) {
if (entry->va == fourcc)
return entry->fmt;
switch (fourcc) {
case VA_FOURCC_NV12:
return VideoFormat::Format_NV12;
case VA_FOURCC_YV12:
case VA_FOURCC_IYUV:
return VideoFormat::Format_YUV420P;
case VA_FOURCC_UYVY:
return VideoFormat::Format_UYVY;
default:
return VideoFormat::Format_Invalid;
}
return VideoFormat::Format_Invalid;
}
Expand Down
5 changes: 4 additions & 1 deletion src/subtitle/PlainText.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@
namespace QtAV {
namespace PlainText {

// from mpv/sub/sd_ass.c
/*
* from mpv/sub/sd_ass.c
* ass_to_plaintext() was written by wm4 and he says it can be under LGPL
*/

struct buf {
char *start;
Expand Down
4 changes: 3 additions & 1 deletion src/vaapi/SurfaceInteropVAAPI.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/******************************************************************************
QtAV: Media play library based on Qt and FFmpeg
Copyright (C) 2014-2015 Wang Bin <[email protected]>
Copyright (C) 2014-2016 Wang Bin <[email protected]>
* This file is part of QtAV
Expand All @@ -18,6 +18,8 @@
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
******************************************************************************/
/// The EGL+DMA part is from mpv and under LGPL

#include "SurfaceInteropVAAPI.h"
#ifndef QT_NO_OPENGL
#include "utils/OpenGLHelper.h"
Expand Down

0 comments on commit 56841c1

Please sign in to comment.