TVCClientInner.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. //
  2. // TVCClientInner.h
  3. // TVCClientSDK
  4. //
  5. // Created by tomzhu on 16/10/20.
  6. // Copyright © 2016年 tencent. All rights reserved.
  7. //
  8. #import "TVCHeader.h"
  9. #define UCG_HTTP_URL @"http://vod2.qcloud.com/v3/index.php"
  10. #define UCG_HTTPS_URL @"https://vod2.qcloud.com/v3/index.php"
  11. #pragma mark - UCG rsp parse
  12. #define kCode @"code"
  13. #define kMessage @"message"
  14. #define kData @"data"
  15. #define TVCVersion @"1.0.5.1"
  16. #pragma mark - COS config
  17. //字段废弃,作为InitUploadUGC的占位字段
  18. #define kRegion @"gz"
  19. //超时时间
  20. #define kTimeoutInterval 8
  21. //log
  22. #ifndef __OPTIMIZE__
  23. #define NSLog(...) NSLog(__VA_ARGS__)
  24. #else
  25. #define NSLog(...){}
  26. #endif
  27. @interface TVCHttpsDelegate : NSObject <NSURLSessionTaskDelegate>
  28. @end
  29. @interface TVCUGCResult : NSObject
  30. @property(nonatomic,strong) NSString * videoFileId;
  31. @property(nonatomic,strong) NSString * imageFileId;
  32. /**
  33. json中为数字
  34. */
  35. @property(nonatomic,strong) NSString * uploadAppid;
  36. @property(nonatomic,strong) NSString * uploadBucket;
  37. @property(nonatomic,strong) NSString * videoPath;
  38. @property(nonatomic,strong) NSString * imagePath;
  39. @property(nonatomic,strong) NSString * videoSign;
  40. @property(nonatomic,strong) NSString * imageSign;
  41. @property(nonatomic,strong) NSString * uploadSession;
  42. @property(nonatomic,strong) NSString * uploadRegion;
  43. @property(nonatomic,strong) NSString * domain;
  44. @property(nonatomic,strong) NSString * userAppid; // 用户appid,用于数据上报
  45. @property(nonatomic,strong) NSString * tmpSecretId; // cos临时密钥SecretId
  46. @property(nonatomic,strong) NSString * tmpSecretKey; // cos临时密钥SecretKey
  47. @property(nonatomic,strong) NSString * tmpToken; // cos临时密钥Token
  48. @property(atomic,assign) uint64_t tmpExpiredTime; // cos临时密钥ExpiredTime
  49. @property(atomic,assign) uint64_t currentTS; // 后台返回的校准时间戳
  50. @end
  51. @interface TVCUploadContext : NSObject
  52. @property(nonatomic,strong) TVCUploadParam * uploadParam;
  53. @property(nonatomic,strong) TVCResultBlock resultBlock;
  54. @property(nonatomic,strong) TVCProgressBlock progressBlock;
  55. @property(nonatomic,assign) BOOL isUploadVideo;
  56. @property(nonatomic,assign) BOOL isUploadCover;
  57. @property(atomic,assign) TVCResult lastStatus;
  58. @property(nonatomic,strong) NSString * desc;
  59. @property(nonatomic,strong) TVCUGCResult * cugResult;
  60. @property(nonatomic,strong) dispatch_group_t gcdGroup;
  61. @property(nonatomic,strong) dispatch_semaphore_t gcdSem;
  62. @property(nonatomic,strong) dispatch_queue_t gcdQueue;
  63. @property(atomic,assign) uint64_t videoSize;
  64. @property(atomic,assign) uint64_t coverSize;
  65. @property(atomic,assign) uint64_t currentUpload;
  66. @property(atomic,assign) uint64_t videoLastModTime; // 文件最后修改时间
  67. @property(atomic,assign) uint64_t reqTime; // 请求开始时间,用于统计各请求耗时
  68. @property(atomic,assign) uint64_t initReqTime; // 请求上传时间,用于和视频最后修改时间组成reqKey,串联发布流程
  69. @property(nonatomic,assign) BOOL isShouldRetry; // 由于临时签名过期导致的上传失败,重试
  70. @property(nonatomic,strong) NSData * resumeData; // cos分片上传resumeData
  71. @end
  72. @interface TVCReportInfo : NSObject
  73. @property(atomic,assign) int reqType;
  74. @property(atomic,assign) int errCode;
  75. @property(nonatomic,strong) NSString * errMsg;
  76. @property(atomic,assign) uint64_t reqTime;
  77. @property(atomic,assign) uint64_t reqTimeCost;
  78. @property(atomic,assign) uint64_t fileSize;
  79. @property(nonatomic,strong) NSString * fileType;
  80. @property(nonatomic,strong) NSString * fileName;
  81. @property(nonatomic,strong) NSString * fileId;
  82. @property(atomic,assign) uint64_t appId;
  83. @property(nonatomic,strong) NSString * reqServerIp;
  84. @property(nonatomic,strong) NSString * reportId;
  85. @property(nonatomic,strong) NSString * reqKey;
  86. @property(nonatomic,strong) NSString * vodSessionKey;
  87. @property(atomic,assign) int retryCount;
  88. @property(nonatomic,assign) BOOL reporting;
  89. @end