[0.6.184] change mute type
[platform/core/multimedia/libmm-player.git] / src / include / mm_player_gst.h
1 /*
2  * libmm-player
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: JongHyuk Choi <jhchoi.choi@samsung.com>, heechul jeon <heechul.jeon@samsung.co>,
7  * YoungHwan An <younghwan_.an@samsung.com>, Eunhae Choi <eunhae1.choi@samsung.com>
8  *
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  * http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  *
21  */
22
23 #ifndef __MM_PLAYER_GST_H__
24 #define __MM_PLAYER_GST_H__
25
26 /*=======================================================================================
27 | INCLUDE FILES                                                                         |
28 ========================================================================================*/
29 #include <mm_types.h>
30 #include "mm_player_priv.h"
31
32 #ifdef __cplusplus
33 extern "C"
34 {
35 #endif
36
37 /* get caps info */
38 #define MMPLAYER_GST_GET_CAPS_INFO(x_pad, x_caps, x_str, x_name, x_ret) \
39         do { \
40                 if (!x_caps) \
41                         x_caps = gst_pad_query_caps(x_pad, NULL); \
42                 if (x_caps) { \
43                         x_str = gst_caps_get_structure(x_caps, 0); \
44                         if (x_str) { \
45                                 x_name = gst_structure_get_name(x_str); \
46                         } \
47                 } \
48                 if (!x_caps || !x_str || !x_name) { \
49                         LOGE("failed to get caps info"); \
50                         x_ret = FALSE; \
51                 } \
52         } while (0)
53
54 /*=======================================================================================
55 | GLOBAL FUNCTION PROTOTYPES                                                            |
56 ========================================================================================*/
57
58 gint __mmplayer_gst_handle_core_error(mmplayer_t *player, int code);
59 gint __mmplayer_gst_handle_library_error(mmplayer_t *player, int code);
60 gint __mmplayer_gst_handle_resource_error(mmplayer_t *player, int code, GstMessage *message);
61 gint __mmplayer_gst_handle_stream_error(mmplayer_t *player, GError *error, GstMessage *message);
62
63 gboolean __mmplayer_handle_gst_error(mmplayer_t *player, GstMessage *message, GError *error);
64 int __mmplayer_gst_set_state(mmplayer_t *player, GstElement *element,  GstState state, gboolean async, gint timeout);
65
66 int __mmplayer_gst_start(mmplayer_t *player);
67 int __mmplayer_gst_stop(mmplayer_t *player);
68 int __mmplayer_gst_pause(mmplayer_t *player, gboolean async);
69 int __mmplayer_gst_resume(mmplayer_t *player, gboolean async);
70 gboolean __mmplayer_gst_send_event_to_sink(mmplayer_t *player, GstEvent *event);
71 gboolean __mmplayer_gst_seek(mmplayer_t *player, GstElement *element, gdouble rate,
72                         GstFormat format, GstSeekFlags flags, GstSeekType cur_type,
73                         gint64 cur, GstSeekType stop_type, gint64 stop);
74 int __mmplayer_gst_set_position(mmplayer_t *player, gint64 position, gboolean internal_called);
75 int __mmplayer_gst_get_position(mmplayer_t *player, gint64 *position);
76 int __mmplayer_gst_get_buffer_position(mmplayer_t *player, int *start_pos, int *end_pos);
77 GstElement *__mmplayer_gst_create_source(mmplayer_t *player);
78 int __mmplayer_gst_build_es_pipeline(mmplayer_t *player);
79 int __mmplayer_gst_build_pipeline(mmplayer_t *player);
80 int __mmplayer_gst_add_bus_watch(mmplayer_t *player);
81
82 #ifdef __cplusplus
83 }
84 #endif
85
86 #endif /* __MM_PLAYER_GST_H__ */