4 * Copyright (C) 2005-2013 Team XBMC
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)
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.
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/>.
23 #include "DVDVideoCodec.h"
24 #include "DllLibMpeg2.h"
26 class CDVDVideoCodecLibMpeg2 : public CDVDVideoCodec
29 CDVDVideoCodecLibMpeg2();
30 virtual ~CDVDVideoCodecLibMpeg2();
31 virtual bool Open(CDVDStreamInfo &hints, CDVDCodecOptions &options);
32 virtual void Dispose();
33 virtual int Decode(BYTE* pData, int iSize, double dts, double pts);
35 virtual bool GetPicture(DVDVideoPicture* pDvdVideoPicture);
36 virtual bool GetUserData(DVDVideoUserData* pDvdVideoUserData);
38 virtual void SetDropState(bool bDrop);
39 virtual const char* GetName() { return "libmpeg2"; }
42 DVDVideoPicture* GetBuffer(unsigned int width, unsigned int height);
43 inline void ReleaseBuffer(DVDVideoPicture* pPic);
44 inline void DeleteBuffer(DVDVideoPicture* pPic);
46 int GuessAspect(const mpeg2_sequence_t *sequence, unsigned int *pixel_width, unsigned int *pixel_height);
48 mpeg2dec_t* m_pHandle;
49 const mpeg2_info_t* m_pInfo;
52 unsigned int m_irffpattern;
53 bool m_bFilm; //Signals that we have film material
59 //The buffer of pictures we need
60 DVDVideoPicture m_pVideoBuffer[3];
61 DVDVideoPicture* m_pCurrentBuffer;