Tizen 2.1 base
[profile/ivi/gst-openmax0.10.git] / omx / gstomx_mpeg4dec.h
1 /*
2  * Copyright (C) 2007-2009 Nokia Corporation.
3  *
4  * Author: Felipe Contreras <felipe.contreras@nokia.com>
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation
9  * version 2.1 of the License.
10  *
11  * This library 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 GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
19  *
20  */
21
22 #ifndef GSTOMX_MPEG4DEC_H
23 #define GSTOMX_MPEG4DEC_H
24
25 #include <gst/gst.h>
26 #include <stdint.h>
27 #include <dlfcn.h>
28 #include <stdlib.h>
29
30 G_BEGIN_DECLS
31 #define GST_OMX_MPEG4DEC(obj) (GstOmxMpeg4Dec *) (obj)
32 #define GST_OMX_MPEG4DEC_TYPE (gst_omx_mpeg4dec_get_type ())
33 typedef struct DivXSymbolTable DivXSymbolTable;
34 typedef struct GstOmxMpeg4Dec GstOmxMpeg4Dec;
35 typedef struct GstOmxMpeg4DecClass GstOmxMpeg4DecClass;
36
37 #include "gstomx_base_videodec.h"
38
39 #define DIVX_SDK_PLUGIN_NAME "libmm_divxsdk.so"
40
41 typedef enum drmErrorCodes
42 {
43   DRM_SUCCESS = 0,
44   DRM_NOT_AUTHORIZED,
45   DRM_NOT_REGISTERED,
46   DRM_RENTAL_EXPIRED,
47   DRM_GENERAL_ERROR,
48   DRM_NEVER_REGISTERED,
49 } drmErrorCodes_t;
50
51 struct DivXSymbolTable
52 {
53   uint8_t* (*init_decrypt) (int*);
54   int (*commit) (uint8_t *);
55   int (*decrypt_video) (uint8_t *, uint8_t *, uint32_t);
56   int (*prepare_video_bitstream) (uint8_t *, uint8_t * , uint32_t ,  uint8_t * , uint32_t * );
57   int (*finalize) (uint8_t *);
58 };
59
60 struct GstOmxMpeg4Dec
61 {
62   GstOmxBaseVideoDec omx_base;
63   uint8_t* drmContext;
64   void *divx_handle;
65   DivXSymbolTable divx_sym_table;
66 };
67
68 struct GstOmxMpeg4DecClass
69 {
70   GstOmxBaseVideoDecClass parent_class;
71 };
72
73 GType gst_omx_mpeg4dec_get_type (void);
74
75 G_END_DECLS
76 #endif /* GSTOMX_MPEG4DEC_H */