tizen 2.0 init
[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 <stdio.h>
32 #include <sys/stat.h>
33 #include <fcntl.h>
34 #include <unistd.h>
35 #include <errno.h>
36 #include <string.h>
37
38 #ifndef S_ISREG
39 #define S_ISREG(mode) ((mode)&_S_IFREG)
40 #endif
41 #ifndef S_ISDIR
42 #define S_ISDIR(mode) ((mode)&_S_IFDIR)
43 #endif
44 #ifndef S_ISSOCK
45 #define S_ISSOCK(x) (0)
46 #endif
47 #ifndef O_BINARY
48 #define O_BINARY (0)
49 #endif
50
51 #define ENABLE_PROFILING_INFO
52 #ifdef ENABLE_PROFILING_INFO
53 #define   PROFILE_FUNC_BEGIN\
54         char *newname; \
55         newname=__FUNCTION__; \ 
56         gst_ta_accum_item_begin(newname,FALSE,__FILE__,__LINE__);       
57         
58 #define PROFILE_FUNC_END  \     
59         gst_ta_accum_item_end(newname,FALSE,__FILE__,__LINE__);
60
61 #define PROFILE_BLOCK_BEGIN(name)               gst_ta_accum_item_begin(name,FALSE,__FILE__,__LINE__);
62 #define PROFILE_BLOCK_END(name)         gst_ta_accum_item_end(name,FALSE,__FILE__,__LINE__);
63 #define PROFILE_INIT                                            gst_ta_init();
64 #define PROFILE_SHOW_RESULT                     gst_ta_accum_show_result(0);//MMTA_SHOW_FILE);  
65 #define PROFILE_CLEAR_DATA                              gst_ta_release();
66 #else
67 #define PROFILE_FUNC_BEGIN
68 #define PROFILE_FUNC_END
69 #define PROFILE_BLOCK_BEGIN(name)
70 #define PROFILE_BLOCK_END(name)
71 #define PROFILE_INIT
72 #define PROFILE_SHOW_RESULT
73 #define PROFILE_CLEAR_DATA 
74 #endif
75 G_BEGIN_DECLS
76
77 #define GST_TYPE_DRM_SRC (gst_drm_src_get_type())
78 #define GST_DRM_SRC(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_DRM_SRC,GstDrmSrc))
79 #define GST_DRM_SRC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_DRM_SRC,GstDrmSrcClass))
80 #define GST_IS_DRM_SRC(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_DRM_SRC))
81 #define GST_IS_DRM_SRC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_DRM_SRC))
82
83 typedef struct _GstDrmSrc GstDrmSrc;
84 typedef struct _GstDrmSrcClass GstDrmSrcClass;
85
86 struct _GstDrmSrc 
87 {
88         GstBaseSrc element;
89         gchar *filename;                        
90         gchar *uri;                              
91         gint fd;                                 
92         guint64 read_position;  
93       gboolean seekable;      
94         gboolean is_regular;    
95 };
96
97 struct _GstDrmSrcClass 
98 {
99         GstBaseSrcClass parent_class;
100 };
101
102 GType gst_drm_src_get_type (void);
103
104 G_END_DECLS
105
106 #endif /* __GST_DRM_SRC_H__ */