kodi
IFileTypes.h
1 /*
2  * Copyright (C) 2005-2018 Team Kodi
3  * This file is part of Kodi - https://kodi.tv
4  *
5  * SPDX-License-Identifier: GPL-2.0-or-later
6  * See LICENSES/README.md for more information.
7  */
8 
9 #pragma once
10 
11 #include <stdint.h>
12 
13 namespace XFILE
14 {
15 
16 /* indicate that caller can handle truncated reads, where function returns before entire buffer has been filled */
17  static const unsigned int READ_TRUNCATED = 0x01;
18 
19 /* indicate that that caller support read in the minimum defined chunk size, this disables internal cache then */
20  static const unsigned int READ_CHUNKED = 0x02;
21 
22 /* use cache to access this file */
23  static const unsigned int READ_CACHED = 0x04;
24 
25 /* open without caching. regardless to file type. */
26  static const unsigned int READ_NO_CACHE = 0x08;
27 
28 /* calculate bitrate for file while reading */
29  static const unsigned int READ_BITRATE = 0x10;
30 
31 /* indicate to the caller we will seek between multiple streams in the file frequently */
32  static const unsigned int READ_MULTI_STREAM = 0x20;
33 
34 /* indicate to the caller file is audio and/or video (and e.g. may grow) */
35  static const unsigned int READ_AUDIO_VIDEO = 0x40;
36 
37 /* indicate that caller will do write operations before reading */
38  static const unsigned int READ_AFTER_WRITE = 0x80;
39 
40 /* indicate that caller want to reopen a file if its already open */
41  static const unsigned int READ_REOPEN = 0x100;
42 
44 {
45  unsigned long int request;
46  void* param;
47 };
48 
50 {
51  uint64_t maxforward;
52  uint64_t forward;
53  uint32_t maxrate;
54  uint32_t currate;
55  uint32_t lowrate;
56 };
57 
58 enum CACHE_BUFFER_MODES
59 {
60  CACHE_BUFFER_MODE_INTERNET = 0,
61  CACHE_BUFFER_MODE_ALL = 1,
62  CACHE_BUFFER_MODE_TRUE_INTERNET = 2,
63  CACHE_BUFFER_MODE_NONE = 3,
64  CACHE_BUFFER_MODE_NETWORK = 4,
65 };
66 
67 typedef enum {
68  IOCTRL_NATIVE = 1,
69  IOCTRL_SEEK_POSSIBLE = 2,
70  IOCTRL_CACHE_STATUS = 3,
71  IOCTRL_CACHE_SETRATE = 4,
72  IOCTRL_SET_CACHE = 8,
73  IOCTRL_SET_RETRY = 16,
74 } EIoControl;
75 
76 enum CURLOPTIONTYPE
77 {
78  CURL_OPTION_OPTION,
79  CURL_OPTION_PROTOCOL,
80  CURL_OPTION_CREDENTIALS,
81  CURL_OPTION_HEADER
82 };
83 
102 enum FileProperty
103 {
104  FILE_PROPERTY_RESPONSE_PROTOCOL,
105  FILE_PROPERTY_RESPONSE_HEADER,
106  FILE_PROPERTY_CONTENT_TYPE,
107  FILE_PROPERTY_CONTENT_CHARSET,
108  FILE_PROPERTY_MIME_TYPE,
109  FILE_PROPERTY_EFFECTIVE_URL
110 };
111 
113 {
114 public:
115  virtual bool OnFileCallback(void* pContext, int ipercent, float avgSpeed) = 0;
116  virtual ~IFileCallback() = default;
117 };
118 }
Definition: Scraper.h:41
uint32_t currate
average read rate (bytes/second) since last position change
Definition: IFileTypes.h:54
Definition: IFileTypes.h:43
uint32_t lowrate
low speed read rate (bytes/second) (if any, else 0)
Definition: IFileTypes.h:55
Definition: IFileTypes.h:49
uint64_t forward
number of bytes cached forward of current position
Definition: IFileTypes.h:52
uint64_t maxforward
forward cache max capacity in bytes
Definition: IFileTypes.h:51
uint32_t maxrate
maximum allowed read(fill) rate (bytes/second)
Definition: IFileTypes.h:53
Definition: IFileTypes.h:112