@@ -5,42 +5,42 @@ |
||
5 | 5 | /**多媒体操作的输入输出资源信息。视频截图和视频转码都继承该类*/ |
6 | 6 | abstract class MediaResOption |
7 | 7 | { |
8 | - private $input; //输入的资源 |
|
9 | - private $output; //输出的资源 |
|
10 | - /**设置输入的文件。*/ |
|
11 | - public function setInputResource($namespace = null, $dir = null, $name = null) |
|
12 | - { |
|
13 | - $this->input = new ResourceInfo($namespace, $dir, $name); |
|
14 | - } |
|
15 | - /**设置输出的文件。*/ |
|
16 | - public function setOutputResource($namespace = null, $dir = null, $name = null) |
|
17 | - { |
|
18 | - $this->output = new ResourceInfo($namespace, $dir, $name); |
|
19 | - } |
|
20 | - /**检测参数选项是否合法*/ |
|
21 | - public function checkOptionParameters() |
|
22 | - { |
|
23 | - if (empty($this->input) || empty($this->output)) { |
|
24 | - return array(false, "input or output resources is empty."); // 判断是否设置输入输出文件,或者转码模板 |
|
25 | - } |
|
26 | - list($valid, $msg) = $this->input->checkResourceInfo(true, true); //检测输入的资源信息是否合法 |
|
27 | - if (!$valid) { |
|
28 | - return array($valid, $msg); |
|
29 | - } |
|
30 | - list($valid, $msg) = $this->output->checkResourceInfo(true, true); //检测输入的资源信息是否合法 |
|
31 | - if (!$valid) { |
|
32 | - return array($valid, $msg); |
|
33 | - } |
|
34 | - return array(true, null); |
|
35 | - } |
|
36 | - public function getInputResId() |
|
37 | - { |
|
38 | - return $this->input->buildResourceId(); |
|
39 | - } |
|
40 | - public function getOutputResId() |
|
41 | - { |
|
42 | - return $this->output->buildResourceId(); |
|
43 | - } |
|
44 | - /**得到属性的http请求体*/ |
|
45 | - abstract public function getOptionsHttpBody(); |
|
8 | + private $input; //输入的资源 |
|
9 | + private $output; //输出的资源 |
|
10 | + /**设置输入的文件。*/ |
|
11 | + public function setInputResource($namespace = null, $dir = null, $name = null) |
|
12 | + { |
|
13 | + $this->input = new ResourceInfo($namespace, $dir, $name); |
|
14 | + } |
|
15 | + /**设置输出的文件。*/ |
|
16 | + public function setOutputResource($namespace = null, $dir = null, $name = null) |
|
17 | + { |
|
18 | + $this->output = new ResourceInfo($namespace, $dir, $name); |
|
19 | + } |
|
20 | + /**检测参数选项是否合法*/ |
|
21 | + public function checkOptionParameters() |
|
22 | + { |
|
23 | + if (empty($this->input) || empty($this->output)) { |
|
24 | + return array(false, "input or output resources is empty."); // 判断是否设置输入输出文件,或者转码模板 |
|
25 | + } |
|
26 | + list($valid, $msg) = $this->input->checkResourceInfo(true, true); //检测输入的资源信息是否合法 |
|
27 | + if (!$valid) { |
|
28 | + return array($valid, $msg); |
|
29 | + } |
|
30 | + list($valid, $msg) = $this->output->checkResourceInfo(true, true); //检测输入的资源信息是否合法 |
|
31 | + if (!$valid) { |
|
32 | + return array($valid, $msg); |
|
33 | + } |
|
34 | + return array(true, null); |
|
35 | + } |
|
36 | + public function getInputResId() |
|
37 | + { |
|
38 | + return $this->input->buildResourceId(); |
|
39 | + } |
|
40 | + public function getOutputResId() |
|
41 | + { |
|
42 | + return $this->output->buildResourceId(); |
|
43 | + } |
|
44 | + /**得到属性的http请求体*/ |
|
45 | + abstract public function getOptionsHttpBody(); |
|
46 | 46 | } |
@@ -5,8 +5,8 @@ |
||
5 | 5 | /**多媒体操作的输入输出资源信息。视频截图和视频转码都继承该类*/ |
6 | 6 | abstract class MediaResOption |
7 | 7 | { |
8 | - private $input; //输入的资源 |
|
9 | - private $output; //输出的资源 |
|
8 | + private $input; //输入的资源 |
|
9 | + private $output; //输出的资源 |
|
10 | 10 | /**设置输入的文件。*/ |
11 | 11 | public function setInputResource($namespace = null, $dir = null, $name = null) |
12 | 12 | { |
@@ -8,10 +8,10 @@ |
||
8 | 8 | */ |
9 | 9 | class UpOptionType |
10 | 10 | { |
11 | - //下面的常量用于标识UploadOption对象适用的类型 |
|
12 | - const COMMON_UPLOAD_TYPE = 0; //普通上传时的UploadOption类型 |
|
13 | - const BLOCK_INIT_UPLOAD = 1; //分片初始化时的UploadOption类型 |
|
14 | - const BLOCK_RUN_UPLOAD = 2; //分片上传过程中的UploadOption类型 |
|
15 | - const BLOCK_COMPLETE_UPLOAD = 3; //分片上传完成时的UploadOption类型 |
|
16 | - const BLOCK_CANCEL_UPLOAD = 4; //分片上传取消时的UploadOption类型 |
|
11 | + //下面的常量用于标识UploadOption对象适用的类型 |
|
12 | + const COMMON_UPLOAD_TYPE = 0; //普通上传时的UploadOption类型 |
|
13 | + const BLOCK_INIT_UPLOAD = 1; //分片初始化时的UploadOption类型 |
|
14 | + const BLOCK_RUN_UPLOAD = 2; //分片上传过程中的UploadOption类型 |
|
15 | + const BLOCK_COMPLETE_UPLOAD = 3; //分片上传完成时的UploadOption类型 |
|
16 | + const BLOCK_CANCEL_UPLOAD = 4; //分片上传取消时的UploadOption类型 |
|
17 | 17 | } |
@@ -9,9 +9,9 @@ |
||
9 | 9 | class UpOptionType |
10 | 10 | { |
11 | 11 | //下面的常量用于标识UploadOption对象适用的类型 |
12 | - const COMMON_UPLOAD_TYPE = 0; //普通上传时的UploadOption类型 |
|
13 | - const BLOCK_INIT_UPLOAD = 1; //分片初始化时的UploadOption类型 |
|
14 | - const BLOCK_RUN_UPLOAD = 2; //分片上传过程中的UploadOption类型 |
|
15 | - const BLOCK_COMPLETE_UPLOAD = 3; //分片上传完成时的UploadOption类型 |
|
16 | - const BLOCK_CANCEL_UPLOAD = 4; //分片上传取消时的UploadOption类型 |
|
12 | + const COMMON_UPLOAD_TYPE = 0; //普通上传时的UploadOption类型 |
|
13 | + const BLOCK_INIT_UPLOAD = 1; //分片初始化时的UploadOption类型 |
|
14 | + const BLOCK_RUN_UPLOAD = 2; //分片上传过程中的UploadOption类型 |
|
15 | + const BLOCK_COMPLETE_UPLOAD = 3; //分片上传完成时的UploadOption类型 |
|
16 | + const BLOCK_CANCEL_UPLOAD = 4; //分片上传取消时的UploadOption类型 |
|
17 | 17 | } |