xbmc
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 forward;
52  uint32_t maxrate;
53  uint32_t currate;
54  uint32_t lowrate;
55 };
56 
57 typedef enum {
58  IOCTRL_NATIVE = 1,
59  IOCTRL_SEEK_POSSIBLE = 2,
60  IOCTRL_CACHE_STATUS = 3,
61  IOCTRL_CACHE_SETRATE = 4,
62  IOCTRL_SET_CACHE = 8,
63  IOCTRL_SET_RETRY = 16,
64 } EIoControl;
65 
66 enum CURLOPTIONTYPE
67 {
68  CURL_OPTION_OPTION,
69  CURL_OPTION_PROTOCOL,
70  CURL_OPTION_CREDENTIALS,
71  CURL_OPTION_HEADER
72 };
73 
92 enum FileProperty
93 {
94  FILE_PROPERTY_RESPONSE_PROTOCOL,
95  FILE_PROPERTY_RESPONSE_HEADER,
96  FILE_PROPERTY_CONTENT_TYPE,
97  FILE_PROPERTY_CONTENT_CHARSET,
98  FILE_PROPERTY_MIME_TYPE,
99  FILE_PROPERTY_EFFECTIVE_URL
100 };
101 
103 {
104 public:
105  virtual bool OnFileCallback(void* pContext, int ipercent, float avgSpeed) = 0;
106  virtual ~IFileCallback() = default;
107 };
108 }
Definition: Scraper.h:41
uint32_t currate
average read rate (bytes/second) since last position change
Definition: IFileTypes.h:53
Definition: IFileTypes.h:43
uint32_t lowrate
low speed read rate (bytes/second) (if any, else 0)
Definition: IFileTypes.h:54
Definition: IFileTypes.h:49
uint64_t forward
number of bytes cached forward of current position
Definition: IFileTypes.h:51
uint32_t maxrate
maximum allowed read(fill) rate (bytes/second)
Definition: IFileTypes.h:52
Definition: IFileTypes.h:102