tizen 2.3 release
[framework/multimedia/gst-plugins-ext0.10.git] / drmsrc / src / gstdrmsrc.h
1 /*
2  * drmsrc
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: JongHyuk Choi <jhchoi.choi@samsung.com>
7  *
8  * This library is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU Lesser General Public License as published by the
10  * Free Software Foundation; either version 2.1 of the License, or (at your option)
11  * any later version.
12  *
13  * This library is distributed in the hope that it will be useful, but WITHOUT ANY
14  * WARRANTY; without even the implied warranty of MERCHANTABILITY or
15  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
16  * License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public License
19  * along with this library; if not, write to the Free Software Foundation, Inc., 51
20  * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21  *
22  */
23
24
25 #ifndef __GST_DRM_SRC_H__
26 #define __GST_DRM_SRC_H__
27
28 #include <sys/types.h>
29 #include <gst/gst.h>
30 #include <gst/base/gstbasesrc.h>
31 #include <drm_trusted_client_types.h>
32 #include <stdio.h>
33 #include <sys/stat.h>
34 #include <fcntl.h>
35 #include <unistd.h>
36 #include <errno.h>
37 #include <string.h>
38
39 #ifndef S_ISREG
40 #define S_ISREG(mode) ((mode)&_S_IFREG)
41 #endif
42 #ifndef S_ISDIR
43 #define S_ISDIR(mode) ((mode)&_S_IFDIR)
44 #endif
45 #ifndef S_ISSOCK
46 #define S_ISSOCK(x) (0)
47 #endif
48 #ifndef O_BINARY
49 #define O_BINARY (0)
50 #endif
51
52 G_BEGIN_DECLS
53
54 #define GST_TYPE_DRM_SRC (gst_drm_src_get_type())
55 #define GST_DRM_SRC(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_DRM_SRC,GstDrmSrc))
56 #define GST_DRM_SRC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_DRM_SRC,GstDrmSrcClass))
57 #define GST_IS_DRM_SRC(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_DRM_SRC))
58 #define GST_IS_DRM_SRC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_DRM_SRC))
59
60 typedef struct _GstDrmSrc GstDrmSrc;
61 typedef struct _GstDrmSrcClass GstDrmSrcClass;
62
63 struct _GstDrmSrc 
64 {
65         GstBaseSrc element;
66         gchar *filename;                        
67         gchar *uri;                              
68         gint fd;                                 
69         guint64 read_position;  
70         gboolean seekable;
71         gboolean is_regular;    
72         gboolean is_drm;          // flag indicating drm file
73         DRM_DECRYPT_HANDLE hfile;
74         gboolean is_playready;
75         gboolean is_oma;
76         gboolean event_posted;
77         gboolean isopen;
78 #ifdef CONTROL_PAGECACHE
79         guint64 accum;
80 #endif
81 };
82
83 struct _GstDrmSrcClass 
84 {
85         GstBaseSrcClass parent_class;
86 };
87
88 GType gst_drm_src_get_type (void);
89
90 G_END_DECLS
91
92 #endif /* __GST_DRM_SRC_H__ */