~ubuntu-branches/ubuntu/raring/xbmc/raring-proposed

1.1.4 by Till Kamppeter
Import upstream version 12.0~git20121220.0939-rc2
1
#pragma once
2
/*
3
 *      Copyright (C) 2010-2012 Team XBMC
4
 *      http://www.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
#if defined(HAVE_OMXLIB)
23
24
#include "OMXCore.h"
25
#include "DVDStreamInfo.h"
26
27
#include <IL/OMX_Video.h>
28
29
#include "OMXClock.h"
30
31
#include "guilib/Geometry.h"
32
#include "DVDDemuxers/DVDDemux.h"
33
#include <string>
34
35
#define VIDEO_BUFFERS 60
36
37
#define CLASSNAME "COMXVideo"
38
39
class COMXVideo
40
{
41
public:
42
  COMXVideo();
43
  ~COMXVideo();
44
45
  // Required overrides
46
  bool SendDecoderConfig();
47
  bool Open(CDVDStreamInfo &hints, OMXClock *clock, bool deinterlace = false, bool hdmi_clock_sync = false);
48
  void Close(void);
49
  unsigned int GetFreeSpace();
50
  unsigned int GetSize();
51
  int  Decode(uint8_t *pData, int iSize, double dts, double pts);
52
  void Reset(void);
53
  void SetDropState(bool bDrop);
54
  bool Pause();
55
  bool Resume();
56
  std::string GetDecoderName() { return m_video_codec_name; };
57
  void SetVideoRect(const CRect& SrcRect, const CRect& DestRect);
58
  int GetInputBufferSize();
59
  void WaitCompletion();
60
  bool BadState() { return m_omx_decoder.BadState(); };
61
protected:
62
  // Video format
63
  bool              m_drop_state;
64
  unsigned int      m_decoded_width;
65
  unsigned int      m_decoded_height;
66
67
  OMX_VIDEO_CODINGTYPE m_codingType;
68
69
  COMXCoreComponent m_omx_decoder;
70
  COMXCoreComponent m_omx_render;
71
  COMXCoreComponent m_omx_sched;
72
  COMXCoreComponent m_omx_image_fx;
73
  COMXCoreComponent *m_omx_clock;
74
  OMXClock           *m_av_clock;
75
76
  COMXCoreTunel     m_omx_tunnel_decoder;
77
  COMXCoreTunel     m_omx_tunnel_clock;
78
  COMXCoreTunel     m_omx_tunnel_sched;
79
  COMXCoreTunel     m_omx_tunnel_image_fx;
80
  bool              m_is_open;
81
82
  bool              m_Pause;
83
84
  uint8_t           *m_extradata;
85
  int               m_extrasize;
86
87
  bool              m_video_convert;
88
  std::string       m_video_codec_name;
89
90
  bool              m_deinterlace;
91
  bool              m_hdmi_clock_sync;
92
  bool              m_first_frame;
93
94
  bool NaluFormatStartCodes(enum CodecID codec, uint8_t *in_extradata, int in_extrasize);
95
};
96
97
#endif