提交 b77b9feb 编写于 作者: P Palana

Add helper to convert from FOURCC to VIDEO_FORMAT

上级 8830c410
......@@ -116,6 +116,7 @@ set(libobs_graphics_HEADERS
set(libobs_mediaio_SOURCES
media-io/video-io.c
media-io/video-fourcc.c
media-io/audio-io.c
media-io/video-frame.c
media-io/format-conversion.c
......
/******************************************************************************
Copyright (C) 2014 by Ruwen Hahn <palana@stunned.de>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
******************************************************************************/
#include "../util/c99defs.h"
#include "video-io.h"
enum video_format video_format_from_fourcc(uint32_t fourcc)
{
switch (fourcc) {
case 'UYVY':
case 'HDYC':
case 'UYNV':
case 'UYNY':
case 'uyv1':
case '2vuy':
case '2Vuy':
return VIDEO_FORMAT_UYVY;
case 'YUY2':
case 'Y422':
case 'V422':
case 'VYUY':
case 'YUNV':
case 'yuv2':
case 'yuvs':
return VIDEO_FORMAT_YUY2;
case 'YVYU':
return VIDEO_FORMAT_YVYU;
}
return VIDEO_FORMAT_NONE;
}
......@@ -109,6 +109,8 @@ struct video_scale_info {
enum video_colorspace colorspace;
};
EXPORT enum video_format video_format_from_fourcc(uint32_t fourcc);
#define VIDEO_OUTPUT_SUCCESS 0
#define VIDEO_OUTPUT_INVALIDPARAM -1
#define VIDEO_OUTPUT_FAIL -2
......
......@@ -98,6 +98,7 @@
<ClCompile Include="..\..\..\libobs\media-io\audio-io.c" />
<ClCompile Include="..\..\..\libobs\media-io\audio-resampler-ffmpeg.c" />
<ClCompile Include="..\..\..\libobs\media-io\format-conversion.c" />
<ClCompile Include="..\..\..\libobs\media-io\video-fourcc.c" />
<ClCompile Include="..\..\..\libobs\media-io\video-frame.c" />
<ClCompile Include="..\..\..\libobs\media-io\video-io.c" />
<ClCompile Include="..\..\..\libobs\media-io\video-scaler-ffmpeg.c" />
......@@ -293,4 +294,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
\ No newline at end of file
</Project>
......@@ -383,5 +383,8 @@
<ClCompile Include="..\..\..\libobs\obs-service.c">
<Filter>libobs\Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\libobs\media-io\video-fourcc.c">
<Filter>media-io\Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>
\ No newline at end of file
</Project>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册