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_HLS_H__
25 #define __MM_PLAYER_AHS_HLS_H__
27 #include "mm_player_m3u8.h"
32 #include <openssl/evp.h>
33 #include <openssl/aes.h>
38 EVP_CIPHER_CTX decrypt;
39 GstM3U8Client *client;
40 GstBuffer *remained; /* remained data in aes decryption */
41 gboolean discontinuity; /* discontinuity flag */
42 GList *list_to_switch;
45 #define DEFAULT_FRAGMENTS_CACHE 2
48 void * __mm_player_hls_create ();
49 gboolean __mm_player_hls_destroy (void *hls_handle);
50 gboolean __mm_player_hls_initialize (void *hls_handle, gchar *uri);
51 gboolean hls_decryption_initialize (void *hls_handle, gchar *key_data, unsigned char *iv);
52 gboolean hls_decrypt_media_fragment (void *hls_handle,GstBuffer *InBuf, GstBuffer **OutBuf);
53 gboolean hls_get_next_media_fragment (void *hls_handle, gchar **media_uri, gchar **key_uri, char **iv);
54 gboolean hls_switch_playlist (void *hls_handle, guint download_rate, gboolean *need_bw_switch);
55 gboolean hls_playlist_update_interval (void *hls_handle, GTimeVal *next_update);
56 gboolean hls_has_variant_playlist (void *hls_handle);
57 gchar *hls_get_current_playlist (mm_player_hls_t *hls_player);
58 gboolean hls_set_current_playlist (mm_player_hls_t *hls_player);
59 gboolean hls_parse_playlist_update_client (void *hls_handle, char* playlist);
60 gboolean hls_client_is_live (void *hls_handle);
61 gboolean hls_determining_next_file_load (void *hls_handle, gboolean *is_ready);
62 gboolean hls_is_buffer_discontinuous (void *hls_handle);
63 gboolean hls_downloaded_variant_playlist (void *hls_handle, gchar *cur_mf_uri);
64 gboolean hls_clear_discontinuous (void *hls_handle);
65 gboolean hls_check_allow_cache (void *hls_handle);
66 gboolean hls_store_media_presentation (void *hls_handle, unsigned char *buffer, unsigned int buffer_len);