Initialize Tizen 2.3
[framework/multimedia/libmm-imgp-gstcs.git] / gstcs / include / mm_util_gstcs_internal.h
1 /*
2  * libmm-imgp-gstcs
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: YoungHun Kim <yh8004.kim@samsung.com>
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  *
20  */
21
22 #ifndef __MM_UTIL_GSTCS_INTERNAL_H__
23 #define __MM_UTIL_GSTCS_INTERNAL_H__
24
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28
29 #include <glib.h>
30 #include <gst/gst.h>
31 #include <gst/gstbuffer.h>
32 #include <gst/app/gstappsrc.h>
33 #include <gst/app/gstappbuffer.h>
34 #include <gst/app/gstappsink.h>
35 #include "mm_util_gstcs.h"
36 #include "mm_log.h"
37 #define GSTCS_FREE(src) { if(src) {g_free(src); src = NULL;} }
38 typedef struct _image_format_s
39 {
40         char *format_label; /*I420, AYUV, RGB888, BGRA8888 */
41         char *colorspace; /* yuv, rgb, RGBA */
42         int width;
43         int height;
44         int stride;
45         int elevation;
46         int blocksize;
47         GstCaps* caps;
48 } image_format_s;
49
50 typedef struct _gstreamer_s
51 {
52         GMainLoop *loop;
53         GstElement *pipeline;
54         GstElement *appsrc;
55         GstElement *colorspace;
56         GstElement *videoscale;
57         GstElement *videoflip;
58         GstElement *appsink;
59         GstBuffer *output_buffer;
60 } gstreamer_s;
61
62 /**
63  *
64  * @remark     image size
65  *
66  * @param      input_format_label                                                                       [in]           "filename.yuv" or  "filename,rgb" etc
67  * @param      input_width, input_height, output_width, output_height   [in]            int value
68  * @return     This function returns image size
69 */
70 static int
71 mm_setup_image_size(const char* image_format_label, int width, int height);
72
73
74 #ifdef __cplusplus
75 }
76 #endif
77
78 #endif  /*__MM_UTIL_GSTCS_INTERNAL_H__*/
79
80