4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: JongHyuk Choi <jhchoi.choi@samsung.com>, YeJin Cho <cho.yejin@samsung.com>, YoungHwan An <younghwan_.an@samsung.com>
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
12 * http://www.apache.org/licenses/LICENSE-2.0
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.
22 #ifndef __MM_PLAYER_STREAMING_H__
23 #define __MM_PLAYER_STREAMING_H__
30 #define MAX_FILE_BUFFER_NAME_LEN 256
32 #define MIN_BUFFER_PERCENT 0.0
33 #define MAX_BUFFER_PERCENT 100.0
34 #define MIN_BUFFERING_TIME 2.0
35 #define MAX_BUFFERING_TIME 10.0
37 #define DEFAULT_BUFFER_SIZE 4194304 // 4 MBytes
38 #define DEFAULT_BUFFER_LOW_PERCENT 1.0 // 1%
39 #define DEFAULT_BUFFER_HIGH_PERCENT 99.0 // 15%
40 #define DEFAULT_BUFFERING_TIME 3.0 // about 3sec
42 #define DEFAULT_FILE_BUFFER_PATH "/opt/media"
44 #define STREAMING_USE_FILE_BUFFER
45 #define STREAMING_USE_MEMORY_BUFFER
49 GstElement *buffer; /* buffering element of playback pipeline */
51 gboolean is_buffering;
52 gint buffering_percent;
56 gdouble buffer_high_percent;
57 gdouble buffer_low_percent;
58 gdouble buffering_time;
59 guint buffer_max_bitrate;
60 guint buffer_avg_bitrate;
61 }mm_player_streaming_t;
64 mm_player_streaming_t *__mm_player_streaming_create ();
65 void __mm_player_streaming_initialize (mm_player_streaming_t* streaming_player);
66 void __mm_player_streaming_deinitialize (mm_player_streaming_t* streaming_player);
67 void __mm_player_streaming_destroy(mm_player_streaming_t* streaming_player);
69 void __mm_player_streaming_set_buffer(mm_player_streaming_t* streaming_player, GstElement * buffer,
70 gboolean use_buffering, guint buffer_size, gdouble low_percent, gdouble high_percent, gdouble buffering_time,
71 gboolean use_file, gchar * file_path, guint64 content_size);
72 void __mm_player_streaming_set_content_bitrate(mm_player_streaming_t* streaming_player, guint max_bitrate, guint avg_bitrate);
73 void __mm_player_streaming_buffering (mm_player_streaming_t* streaming_player , GstMessage *buffering_msg);