4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
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>
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
13 * http://www.apache.org/licenses/LICENSE-2.0
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.
23 #ifndef __MM_PLAYER_GST_H__
24 #define __MM_PLAYER_GST_H__
26 /*=======================================================================================
28 ========================================================================================*/
30 #include "mm_player_priv.h"
38 #define MMPLAYER_GST_GET_CAPS_INFO(x_caps, x_str, x_name, x_ret) \
42 LOGE("input caps is NULL"); \
46 x_str = gst_caps_get_structure(x_caps, 0); \
48 x_name = gst_structure_get_name(x_str); \
49 if (!(x_str) || !(x_name)) { \
50 LOGE("failed to get caps info"); \
55 #define MMPLAYER_GST_GET_CAPS_INFO_FROM_PAD(x_pad, x_caps, x_str, x_name, x_ret) \
57 x_caps = gst_pad_get_current_caps(x_pad); \
59 x_caps = gst_pad_query_caps(x_pad, NULL); \
60 MMPLAYER_GST_GET_CAPS_INFO(x_caps, x_str, x_name, x_ret); \
63 /*=======================================================================================
64 | GLOBAL FUNCTION PROTOTYPES |
65 ========================================================================================*/
67 int _mmplayer_gst_set_state(mmplayer_t *player, GstElement *element, GstState state, gboolean async, gint timeout);
69 int _mmplayer_gst_start(mmplayer_t *player);
70 int _mmplayer_gst_stop(mmplayer_t *player);
71 int _mmplayer_gst_pause(mmplayer_t *player, gboolean async);
72 int _mmplayer_gst_resume(mmplayer_t *player, gboolean async);
73 gboolean _mmplayer_gst_send_event_to_sink(mmplayer_t *player, GstEvent *event);
74 gboolean _mmplayer_gst_seek(mmplayer_t *player, GstElement *element, gdouble rate,
75 GstFormat format, GstSeekFlags flags, GstSeekType cur_type,
76 gint64 cur, GstSeekType stop_type, gint64 stop);
77 int _mmplayer_gst_set_position(mmplayer_t *player, gint64 position, gboolean internal_called);
78 int _mmplayer_gst_get_position(mmplayer_t *player, gint64 *position);
79 int _mmplayer_gst_get_buffer_position(mmplayer_t *player, int *start_pos, int *end_pos);
80 GstElement *_mmplayer_gst_create_source(mmplayer_t *player);
81 int _mmplayer_gst_build_es_pipeline(mmplayer_t *player);
82 int _mmplayer_gst_build_pipeline(mmplayer_t *player);
83 int _mmplayer_gst_build_pipeline_with_src(mmplayer_t *player);
84 int _mmplayer_gst_add_bus_watch(mmplayer_t *player);
85 void _mmplayer_activate_next_source(mmplayer_t *player, GstState target);
91 #endif /* __MM_PLAYER_GST_H__ */