4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
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>
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_PD_H__
24 #define __MM_PLAYER_PD_H__
30 #include <mm_message.h>
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)
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;
50 * This function allocates handle of progressive download.
52 * @return This function returns allocated handle.
54 * @see _mmplayer_destroy_pd_downloader()
57 mm_player_pd_t * _mmplayer_create_pd_downloader ();
59 * This function destroy progressive download.
61 * @param[in] handle Handle of player.
62 * @return This function returns true on success, or false on failure.
64 * @see _mmplayer_create_pd_downloader()
67 gboolean _mmplayer_destroy_pd_downloader (MMHandleType handle);
69 * This function realize progressive download.
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.
80 gboolean _mmplayer_realize_pd_downloader (MMHandleType handle, gchar *src_uri, gchar *dst_uri, GstElement *pushsrc);
82 * This function unrealize progressive download.
84 * @param[in] handle Handle of player.
85 * @return This function returns true on success, or false on failure.
87 * @see _mmplayer_realize_pd_downloader()
90 gboolean _mmplayer_unrealize_pd_downloader (MMHandleType handle);
92 * This function start progressive download.
94 * @param[in] handle Handle of player.
95 * @return This function returns true on success, or false on failure.
100 gboolean _mmplayer_start_pd_downloader (MMHandleType handle);
102 * This function get pd current status.
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.
112 gboolean _mmplayer_get_pd_downloader_status(MMHandleType handle, guint64 *current_pos, guint64 *total_size);
114 * This function set message callback of PD downloader.
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.
124 gint _mm_player_set_pd_downloader_message_cb(MMHandleType player, MMMessageCallback callback, gpointer user_param);