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>,
7 * Seungbae Shin <seungbae.shin@samsung.com>, YoungHwan An <younghwan_.an@samsung.com>,
8 * naveen cherukuri <naveen.ch@samsung.com>
10 * Licensed under the Apache License, Version 2.0 (the "License");
11 * you may not use this file except in compliance with the License.
12 * You may obtain a copy of the License at
14 * http://www.apache.org/licenses/LICENSE-2.0
16 * Unless required by applicable law or agreed to in writing, software
17 * distributed under the License is distributed on an "AS IS" BASIS,
18 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 * See the License for the specific language governing permissions and
20 * limitations under the License.
24 #ifndef __MM_PLAYER_AHS_H__
25 #define __MM_PLAYER_AHS_H__
28 #include "mm_player_ahs_hls.h"
30 #include <gst/app/gstappsrc.h>
31 #include <gst/app/gstappsink.h>
35 #define HLS_POSIX_PATH_MAX 256
36 #define HLS_MANIFEST_DEFAULT_PATH "/opt/media/"
37 #define HLS_MANIFEST_DEFAULT_FILE_NAME HLS_MANIFEST_DEFAULT_PATH"XXXXXX"
42 GstElement *appsrc; /* appsrc to push data */
45 gboolean need_bw_switch;
47 /* manifest file (mf) uris */
56 gchar cur_key_data[16];
59 char ahs_manifest_dmp_location[HLS_POSIX_PATH_MAX]; /* manifest file dumped location */
60 char ahs_key_dmp_location [HLS_POSIX_PATH_MAX];
65 /* manifest/playlist download */
66 GThread *manifest_thread;
67 gboolean manifest_thread_exit;
68 GstElement *manifest_download_pipeline;
69 GstElement *manifest_download_src;
70 GstElement *manifest_download_sink;
71 GCond* manifest_start_cond;
72 GCond* manifest_update_cond;
73 GCond* manifest_eos_cond;
74 GCond* manifest_exit_cond;
75 GMutex* manifest_mutex;
78 GThread *media_thread;
80 gboolean media_thread_exit;
81 GstElement *media_download_pipeline;
82 GstElement *media_download_src;
83 GstElement *media_download_sink;
84 GCond *media_eos_cond;
85 GCond *media_start_cond;
88 GstElement *key_download_pipeline;
89 GstElement *key_download_src;
90 GstElement *key_download_sink;
93 guint64 seg_start_time; /* segment start time in usec*/
94 guint64 seg_end_time; /* segment end time usec*/
97 gint cache_frag_count;
99 gboolean hls_is_wait_for_reload;
103 gboolean is_initialized;
108 mm_player_ahs_t * __mm_player_ahs_create ();
109 gboolean __mm_player_ahs_initialize (mm_player_ahs_t *ahs_player, int uri_type, char *uri, GstElement *appsrc);
110 gboolean __mm_player_ahs_start (mm_player_ahs_t *ahs_player);
111 gboolean __mm_player_ahs_deinitialize (mm_player_ahs_t *ahs_player);
112 gboolean __mm_player_ahs_stop (mm_player_ahs_t *ahs_player);
113 gboolean __mm_player_ahs_destroy (mm_player_ahs_t *ahs_player);
115 ahs_store_media_presentation (mm_player_ahs_t *ahs_player, unsigned char *buffer, unsigned int buffer_len);
116 gboolean ahs_check_allow_cache (mm_player_ahs_t *ahs_player);