devide files to resolve build break
[platform/core/multimedia/libmm-player.git] / src / include / mm_player_streaming.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>, YeJin Cho <cho.yejin@samsung.com>, YoungHwan An <younghwan_.an@samsung.com>
7  *
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
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
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.
19  *
20  */
21
22 #ifndef __MM_PLAYER_STREAMING_H__
23 #define __MM_PLAYER_STREAMING_H__
24
25 #include <glib.h>
26 #include <gst/gst.h>
27 #include <string.h>
28 #include "mm_debug.h"
29
30 #define MAX_FILE_BUFFER_NAME_LEN 256
31
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
36
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
41
42 #define DEFAULT_FILE_BUFFER_PATH "/opt/media"
43
44 #define STREAMING_USE_FILE_BUFFER
45 #define STREAMING_USE_MEMORY_BUFFER
46
47 typedef struct
48 {
49         GstElement *buffer; /* buffering element of playback pipeline */
50
51         gboolean is_buffering;
52         gint buffering_percent;
53
54         gboolean need_update;
55         guint buffer_size;
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;
62
63
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);
68
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);
74
75 #endif