PageRenderTime 7ms CodeModel.GetById 2ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecVDA.h

http://github.com/xbmc/xbmc
C++ Header | 71 lines | 42 code | 9 blank | 20 comment | 0 complexity | 60fe266e439bbc05225c767626257793 MD5 | raw file
 1#pragma once
 2/*
 3 *      Copyright (C) 2005-2013 Team XBMC
 4 *      http://xbmc.org
 5 *
 6 *  This Program is free software; you can redistribute it and/or modify
 7 *  it under the terms of the GNU General Public License as published by
 8 *  the Free Software Foundation; either version 2, or (at your option)
 9 *  any later version.
10 *
11 *  This Program is distributed in the hope that it will be useful,
12 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 *  GNU General Public License for more details.
15 *
16 *  You should have received a copy of the GNU General Public License
17 *  along with XBMC; see the file COPYING.  If not, see
18 *  <http://www.gnu.org/licenses/>.
19 *
20 */
21
22#include "DVDVideoCodec.h"
23#include <CoreVideo/CoreVideo.h>
24
25class DllSwScale;
26class CBitstreamConverter;
27struct frame_queue;
28
29class CDVDVideoCodecVDA : public CDVDVideoCodec
30{
31public:
32  CDVDVideoCodecVDA();
33  virtual ~CDVDVideoCodecVDA();
34
35  // Required overrides
36  virtual bool Open(CDVDStreamInfo &hints, CDVDCodecOptions &options);
37  virtual void Dispose(void);
38  virtual int  Decode(uint8_t *pData, int iSize, double dts, double pts);
39  virtual void Reset(void);
40  virtual bool GetPicture(DVDVideoPicture *pDvdVideoPicture);
41  virtual bool ClearPicture(DVDVideoPicture* pDvdVideoPicture);
42  virtual void SetDropState(bool bDrop);
43  virtual const char* GetName(void) { return (const char*)m_pFormatName; }
44  virtual unsigned GetAllowedReferences();
45protected:
46  void DisplayQueuePop(void);
47  void UYVY422_to_YUV420P(uint8_t *yuv422_ptr, int yuv422_stride, DVDVideoPicture *picture);
48  void BGRA_to_YUV420P(uint8_t *bgra_ptr, int bgra_stride, DVDVideoPicture *picture);
49
50  static void VDADecoderCallback(
51    void *decompressionOutputRefCon, CFDictionaryRef frameInfo,
52    OSStatus status, uint32_t infoFlags, CVImageBufferRef imageBuffer);
53
54  void              *m_vda_decoder;   // opaque vdadecoder reference
55  int32_t           m_format;
56  const char        *m_pFormatName;
57  bool              m_DropPictures;
58  bool              m_decode_async;
59
60  int64_t           m_sort_time;
61  pthread_mutex_t   m_queue_mutex;    // mutex protecting queue manipulation
62  frame_queue       *m_display_queue; // display-order queue - next display frame is always at the queue head
63  int32_t           m_queue_depth;    // we will try to keep the queue depth around 16+1 frames
64  int32_t           m_max_ref_frames;
65  bool              m_use_cvBufferRef;
66
67  CBitstreamConverter *m_bitstream;
68
69  DllSwScale        *m_dllSwScale;
70  DVDVideoPicture   m_videobuffer;
71};