tizen 2.3.1 release
[framework/multimedia/libmm-player.git] / src / include / mm_player_pd.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>, naveen cherukuri <naveen.ch@samsung.com>,
7  * YeJin Cho <cho.yejin@samsung.com>, YoungHwan An <younghwan_.an@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_PD_H__
24 #define __MM_PLAYER_PD_H__
25
26 #include <glib.h>
27 #include <gst/gst.h>
28 #include <string.h>
29 #include <mm_types.h>
30 #include <mm_message.h>
31
32 #ifdef __cplusplus
33         extern "C" {
34 #endif
35
36 typedef struct
37 {
38         gchar *path_read_from;          // path for download and playback
39         gchar *location_to_save;                // path for saving to local
40         gint64 total_size;                              // size of file to download (bytes)
41
42         GstElement *playback_pipeline_src;  // src element of playback pipeline
43         GstElement *downloader_pipeline;
44         GstElement *downloader_src;
45         GstElement *downloader_queue;
46         GstElement *downloader_sink;
47 }mm_player_pd_t;
48
49 /**
50  * This function allocates handle of progressive download.
51  *
52  * @return      This function returns allocated handle.
53  * @remarks
54  * @see         _mmplayer_destroy_pd_downloader()
55  *
56  */
57 mm_player_pd_t * _mmplayer_create_pd_downloader ();
58 /**
59  * This function destroy progressive download.
60  *
61  * @param[in]   handle  Handle of player.
62  * @return      This function returns true on success, or false on failure.
63  * @remarks
64  * @see         _mmplayer_create_pd_downloader()
65  *
66  */
67 gboolean _mmplayer_destroy_pd_downloader  (MMHandleType handle);
68 /**
69  * This function realize progressive download.
70  *
71  * @param[in]   handle  Handle of player.
72  * @param[in]   src_uri path to download.
73  * @param[in]   dst_uri path to save in local system.
74  * @param[in]   pushsrc source element of playback pipeline
75  * @return      This function returns true on success, or false on failure.
76  * @remarks
77  * @see
78  *
79  */
80 gboolean _mmplayer_realize_pd_downloader (MMHandleType handle, gchar *src_uri, gchar *dst_uri, GstElement *pushsrc);
81 /**
82  * This function unrealize progressive download.
83  *
84  * @param[in]   handle  Handle of player.
85  * @return      This function returns true on success, or false on failure.
86  * @remarks
87  * @see         _mmplayer_realize_pd_downloader()
88  *
89  */
90 gboolean _mmplayer_unrealize_pd_downloader (MMHandleType handle);
91 /**
92  * This function start progressive download.
93  *
94  * @param[in]   handle  Handle of player.
95  * @return      This function returns true on success, or false on failure.
96  * @remarks
97  * @see
98  *
99  */
100 gboolean _mmplayer_start_pd_downloader (MMHandleType handle);
101 /**
102  * This function get pd current status.
103  *
104  * @param[in]   handle  Handle of player.
105  * @param[in]   current_pos     current downloaded size
106  * @param[in]   total_size              total file size to download
107  * @return      This function returns true on success, or false on failure.
108  * @remarks
109  * @see
110  *
111  */
112 gboolean _mmplayer_get_pd_downloader_status(MMHandleType handle, guint64 *current_pos, guint64 *total_size);
113 /**
114  * This function set message callback of PD downloader.
115  *
116  * @param[in]   handle  Handle of player.
117  * @param[in]   MMMessageCallback       Message callback function
118  * @param[in]   user_param              User parameter which is passed to callback function.
119  * @return      This function returns true on success, or false on failure.
120  * @remarks
121  * @see
122  *
123  */
124 gint _mm_player_set_pd_downloader_message_cb(MMHandleType player, MMMessageCallback callback, gpointer user_param);
125
126 #ifdef __cplusplus
127         }
128 #endif
129
130 #endif