Wasabi ExpressPlay SDK for iOS  1.23.0
WsbMediaDownload.h
Go to the documentation of this file.
1 /*****************************************************************
2 |
3 | Wasabi - Media Download interface
4 |
5 | $Id: WsbMediaDownload.h 13313 2017-09-08 02:29:47Z ehodzic $
6 | Original author: Edin Hodzic ([email protected])
7 |
8 | This software is provided to you pursuant to your agreement
9 | with Intertrust Technologies Corporation ("Intertrust").
10 | This software may be used only in accordance with the terms
11 | of the agreement.
12 |
13 | Copyright (c) 2017 by Intertrust. All rights reserved.
14 |
15 ****************************************************************/
21 #ifndef _WSB_MEDIA_DOWNLOAD_H_
22 #define _WSB_MEDIA_DOWNLOAD_H_
23 
24 /*----------------------------------------------------------------------
25 | includes
26 +---------------------------------------------------------------------*/
27 #include "WsbTypes.h"
28 
29 /*----------------------------------------------------------------------
30 | constants
31 +---------------------------------------------------------------------*/
32 #define WSB_MD_MAX_TRACKS 3
33 
34 /*----------------------------------------------------------------------
35 | types
36 +---------------------------------------------------------------------*/
42 
47 typedef enum {
58 
69 
71 
77 typedef struct {
78  WSB_UInt32 max_bandwidth_bps; /* bits per second */
81 
87 typedef struct {
91  const char** path;
93 
98 typedef enum {
102 
109  const char* url;
110 
112  union {
114  struct {
118  const char* media_file_name;
122  const char* subtitles_file_name;
131  const char* track[WSB_MD_MAX_TRACKS];
132  } dash;
133 
135  struct {
139  const char* media_file_name;
140  } single_file;
141  } u;
142 
144 
149 typedef enum {
156 
161 typedef struct {
164  const char* path;
167 
176 typedef struct {
177 
181  void (*State)(void* client_context, WSB_MediaDownload_State state);
182 
186  void (*Progress)(void* client_context,
187  const WSB_MediaDownload_ContentStatus* content_status);
188 
190 
191 /*----------------------------------------------------------------------
192 | functions
193 +---------------------------------------------------------------------*/
194 #if defined(__cplusplus)
195 extern "C" {
196 #endif
197 
225 WSB_EXPORT WSB_Result
227 
237 WSB_EXPORT WSB_Result
239 
256 WSB_EXPORT WSB_Result
258  void* client_context,
259  const WSB_MediaDownload_Listener* listener);
260 
266 WSB_EXPORT WSB_Result
268 
278 WSB_EXPORT WSB_Result
280 
290 WSB_EXPORT WSB_Result
292 
307 WSB_EXPORT WSB_Result
309  const WSB_MediaDownload_Constraints* constraints);
310 
326 WSB_EXPORT WSB_Result
328  WSB_MediaDownload_Status** status);
329 
339 WSB_EXPORT WSB_Result
341  WSB_MediaDownload_Status* status);
342 
356 WSB_EXPORT WSB_Result
358  const char* path,
359  const WSB_MediaDownload_Content* content);
360 
370 WSB_EXPORT WSB_Result
372  const char* path);
373 
395 WSB_EXPORT WSB_Result
397  const char* path,
398  WSB_MediaDownload_ContentStatus** content_status);
399 
409 WSB_EXPORT WSB_Result
411  WSB_MediaDownload_ContentStatus* content_status);
412 
415 #ifdef __cplusplus
416 }
417 #endif
418 
419 #endif // _WSB_MEDIA_DOWNLOAD_H_
WSB_MediaDownload_Content content
Definition: WsbMediaDownload.h:163
WSB_EXPORT WSB_Result WSB_MediaDownload_ReleaseContentStatus(WSB_MediaDownload *download, WSB_MediaDownload_ContentStatus *content_status)
Release content status object earlier obtained through WSB_MediaDownload_QueryContentStatus.
WSB_EXPORT WSB_Result WSB_MediaDownload_SetListener(WSB_MediaDownload *download, void *client_context, const WSB_MediaDownload_Listener *listener)
Set the listener.
Definition: WsbMediaDownload.h:99
Definition: WsbMediaDownload.h:152
#define WSB_MD_MAX_TRACKS
Definition: WsbMediaDownload.h:32
struct WSB_MediaDownload WSB_MediaDownload
An opaque Media Download instance handle.
Definition: WsbMediaDownload.h:41
Definition: WsbMediaDownload.h:151
WSB_EXPORT WSB_Result WSB_MediaDownload_Get(WSB_MediaDownload **download)
Obtain a Media Download singleton reference.
The download content status.
Definition: WsbMediaDownload.h:161
WSB_EXPORT WSB_Result WSB_MediaDownload_SetConstraints(WSB_MediaDownload *download, const WSB_MediaDownload_Constraints *constraints)
Assign the Media Download constraints.
const char ** path
Definition: WsbMediaDownload.h:91
Definition: WsbMediaDownload.h:153
The Media Download status.
Definition: WsbMediaDownload.h:87
WSB_UInt32 track_count
Number of tracks to download.
Definition: WsbMediaDownload.h:126
WSB_MediaDownload_SourceType
The content source type.
Definition: WsbMediaDownload.h:98
Media Download resource constrains not to be exceeded.
Definition: WsbMediaDownload.h:77
const char * media_file_name
Will save as "video" if NULL.
Definition: WsbMediaDownload.h:118
The download content parameters.
Definition: WsbMediaDownload.h:107
const char * path
Definition: WsbMediaDownload.h:164
The Media Download listener interface.
Definition: WsbMediaDownload.h:176
WSB_EXPORT WSB_Result WSB_MediaDownload_Release(WSB_MediaDownload *download)
Release a Media Download singleton reference.
WSB_MediaDownload_State
The overall Media Download status.
Definition: WsbMediaDownload.h:47
WSB_EXPORT WSB_Result WSB_MediaDownload_RemoveListener(WSB_MediaDownload *download)
Remove the listener, if any.
WSB_UInt32 max_connections
Definition: WsbMediaDownload.h:79
WSB_UInt32 max_bandwidth_bps
Definition: WsbMediaDownload.h:78
const char * url
Definition: WsbMediaDownload.h:109
WSB_MediaDownload_State state
Definition: WsbMediaDownload.h:88
Definition: WsbMediaDownload.h:154
const char * subtitles_file_name
Will save as "subtitles" if NULL.
Definition: WsbMediaDownload.h:122
The Media Download is running, i.e.
Definition: WsbMediaDownload.h:68
WSB_EXPORT WSB_Result WSB_MediaDownload_Pause(WSB_MediaDownload *download)
Pause the Media Download.
WSB_EXPORT WSB_Result WSB_MediaDownload_Resume(WSB_MediaDownload *download)
Resume the Media Download.
WSB_UInt32 content_count
Definition: WsbMediaDownload.h:90
WSB_EXPORT WSB_Result WSB_MediaDownload_AddContent(WSB_MediaDownload *download, const char *path, const WSB_MediaDownload_Content *content)
Register a new content for download.
WSB_EXPORT WSB_Result WSB_MediaDownload_ReleaseStatus(WSB_MediaDownload *download, WSB_MediaDownload_Status *status)
Release a Media Download status object earlier obtained through WSB_MediaDownload_QueryStatus.
Definition: WsbMediaDownload.h:150
int WSB_Result
Signed integer value representing a function or method result (return value).
Definition: WsbTypes.h:83
Definition: WsbMediaDownload.h:100
WSB_MediaDownload_SourceType type
Definition: WsbMediaDownload.h:108
struct WSB_MediaDownload_Content WSB_MediaDownload_Content
The download content parameters.
unsigned int WSB_UInt32
32-bit (or more) unsigned integer
Definition: WsbTypes.h:36
WSB_EXPORT WSB_Result WSB_MediaDownload_CancelContent(WSB_MediaDownload *download, const char *path)
Cancel the content from download.
WSB_MediaDownload_Constraints constraints
Definition: WsbMediaDownload.h:89
WSB_MediaDownload_ContentState content_state
Definition: WsbMediaDownload.h:162
The Media Download has been paused, or it hasn't been resumed.
Definition: WsbMediaDownload.h:57
WSB_EXPORT WSB_Result WSB_MediaDownload_QueryContentStatus(WSB_MediaDownload *download, const char *path, WSB_MediaDownload_ContentStatus **content_status)
Query the status of the content being downloaded.
WSB_EXPORT WSB_Result WSB_MediaDownload_QueryStatus(WSB_MediaDownload *download, WSB_MediaDownload_Status **status)
Query the Media Download status.
Wasabi Result.
WSB_UInt32 downloaded_percentage
Definition: WsbMediaDownload.h:165
WSB_MediaDownload_ContentState
Content download states.
Definition: WsbMediaDownload.h:149