forked from xbmc/xbmc
-
Notifications
You must be signed in to change notification settings - Fork 24
/
DVDVideoCodecOpenMax.h
74 lines (63 loc) · 2.26 KB
/
DVDVideoCodecOpenMax.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#pragma once
/*
* Copyright (C) 2010-2013 Team XBMC
* http://xbmc.org
*
* 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, 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 XBMC; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
#if defined(HAVE_LIBOPENMAX)
#include "DVDVideoCodec.h"
class COpenVideoMax;
class CDVDVideoCodecOpenMax : public CDVDVideoCodec
{
public:
CDVDVideoCodecOpenMax(CProcessInfo &processInfo);
virtual ~CDVDVideoCodecOpenMax();
// Required overrides
virtual bool Open(CDVDStreamInfo &hints, CDVDCodecOptions &options);
virtual int Decode(uint8_t *pData, int iSize, double dts, double pts);
virtual void Reset(void);
virtual bool GetPicture(DVDVideoPicture *pDvdVideoPicture);
virtual void SetDropState(bool bDrop);
virtual const char* GetName(void) { return (const char*)m_pFormatName; }
protected:
void Dispose(void);
const char *m_pFormatName;
COpenMaxVideo *m_omx_decoder;
DVDVideoPicture m_videobuffer;
// bitstream to bytestream (Annex B) conversion support.
bool bitstream_convert_init(void *in_extradata, int in_extrasize);
bool bitstream_convert(uint8_t* pData, int iSize, uint8_t **poutbuf, int *poutbuf_size);
static void bitstream_alloc_and_copy( uint8_t **poutbuf, int *poutbuf_size,
const uint8_t *sps_pps, uint32_t sps_pps_size, const uint8_t *in, uint32_t in_size);
typedef struct omx_bitstream_ctx {
uint8_t length_size;
uint8_t first_idr;
uint8_t *sps_pps_data;
uint32_t size;
omx_bitstream_ctx()
{
length_size = 0;
first_idr = 0;
sps_pps_data = NULL;
size = 0;
}
} omx_bitstream_ctx;
uint32_t m_sps_pps_size;
omx_bitstream_ctx m_sps_pps_context;
bool m_convert_bitstream;
};
#endif