Merge pull request #5101 from FernetMenta/ffmpeg-threads
[vuplus_xbmc] / xbmc / cores / dvdplayer / DVDCodecs / DVDCodecUtils.h
1 #pragma once
2
3 /*
4  *      Copyright (C) 2005-2013 Team XBMC
5  *      http://xbmc.org
6  *
7  *  This Program is free software; you can redistribute it and/or modify
8  *  it under the terms of the GNU General Public License as published by
9  *  the Free Software Foundation; either version 2, or (at your option)
10  *  any later version.
11  *
12  *  This Program is distributed in the hope that it will be useful,
13  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  *  GNU General Public License for more details.
16  *
17  *  You should have received a copy of the GNU General Public License
18  *  along with XBMC; see the file COPYING.  If not, see
19  *  <http://www.gnu.org/licenses/>.
20  *
21  */
22
23 #include "Video/DVDVideoCodec.h"
24 #include "cores/VideoRenderers/RenderFormats.h"
25
26 struct YV12Image;
27
28 class CDVDCodecUtils
29 {
30 public:
31   static DVDVideoPicture* AllocatePicture(int iWidth, int iHeight);
32   static void FreePicture(DVDVideoPicture* pPicture);
33   static bool CopyPicture(DVDVideoPicture* pDst, DVDVideoPicture* pSrc);
34   static bool CopyPicture(YV12Image* pDst, DVDVideoPicture *pSrc);
35   
36   static DVDVideoPicture* ConvertToNV12Picture(DVDVideoPicture *pSrc);
37   static DVDVideoPicture* ConvertToYUV422PackedPicture(DVDVideoPicture *pSrc, ERenderFormat format);
38   static bool CopyNV12Picture(YV12Image* pImage, DVDVideoPicture *pSrc);
39   static bool CopyYUV422PackedPicture(YV12Image* pImage, DVDVideoPicture *pSrc);
40   static bool CopyDXVA2Picture(YV12Image* pImage, DVDVideoPicture *pSrc);
41
42   static bool IsVP3CompatibleWidth(int width);
43
44   static double NormalizeFrameduration(double frameduration);
45
46   static ERenderFormat EFormatFromPixfmt(int fmt);
47   static int           PixfmtFromEFormat(ERenderFormat format);
48 };
49