Commit 0dbf312b authored by yanzg's avatar yanzg

参数处理

parent 8d83f8e9
......@@ -13,51 +13,51 @@ public class YzgFileVideoImageInfoVo extends YzgFileBaseVo {
* 分辨率x,如: 1920*1080中的1920.
*/
@ApiModelProperty(notes = "分辨率x,如: 1920*1080中的1920.")
private Double width;
private Long width;
/**
* 分辨率y,如: 1920*1080中的1080.
*/
@ApiModelProperty(notes = "分辨率y,如: 1920*1080中的1080.")
private Double height;
private Long height;
/**
* 质量
*/
@ApiModelProperty(notes = "质量", position = 1040)
private Double bitrate;
private Long bitrate;
public YzgFileVideoImageInfoVo() {
}
public YzgFileVideoImageInfoVo(String server, String display, long size, String mime, int type, double width, double height, double bitrate) {
public YzgFileVideoImageInfoVo(String server, String display, long size, String mime, int type, Long width, Long height, Long bitrate) {
super(server, display, size, mime, type);
this.width = width;
this.height = height;
this.bitrate = bitrate;
}
public Double getWidth() {
public Long getWidth() {
return width;
}
public void setWidth(Double width) {
public void setWidth(Long width) {
this.width = width;
}
public Double getHeight() {
public Long getHeight() {
return height;
}
public void setHeight(Double height) {
public void setHeight(Long height) {
this.height = height;
}
public Double getBitrate() {
public Long getBitrate() {
return bitrate;
}
public void setBitrate(Double bitrate) {
public void setBitrate(Long bitrate) {
this.bitrate = bitrate;
}
}
......@@ -35,15 +35,15 @@ public class YzgFileVideoImageItemReqVo extends BaseVo {
private double quote = 1D;
@ApiModelProperty(notes = "分辨率x,如: 1920*1080中的1920.")
private double width = 0;
private long width = 0;
@ApiModelProperty(notes = "分辨率x,如: 1920*1080中的1080.")
private double height = 0;
private long height = 0;
public YzgFileVideoImageItemReqVo() {
}
private YzgFileVideoImageItemReqVo(double size, double quote, double width, double height) {
private YzgFileVideoImageItemReqVo(double size, double quote, long width, long height) {
this.size = size;
this.quote = quote;
this.width = width;
......@@ -55,7 +55,7 @@ public class YzgFileVideoImageItemReqVo extends BaseVo {
this.toFile = toFile;
}
public YzgFileVideoImageItemReqVo(String toFile, double size, double quote, double width, double height) {
public YzgFileVideoImageItemReqVo(String toFile, double size, double quote, long width, long height) {
this(size, quote, width, height);
this.toFile = toFile;
}
......@@ -84,19 +84,19 @@ public class YzgFileVideoImageItemReqVo extends BaseVo {
this.quote = quote;
}
public double getWidth() {
public long getWidth() {
return width;
}
public void setWidth(double width) {
public void setWidth(long width) {
this.width = width;
}
public double getHeight() {
public long getHeight() {
return height;
}
public void setHeight(double height) {
public void setHeight(long height) {
this.height = height;
}
}
......@@ -195,20 +195,20 @@ public class YzgFileServiceImpl implements YzgFileService {
switch (info.getType()) {
case FileHelper.FILE_TYPE_AUDIO: {
MediaParameter parameter = MediaHelper.getGrabberParameter(serverFullPath);
info.setBitrate(Double.valueOf(parameter.getAudioBitRate()));
info.setBitrate(Long.valueOf(parameter.getAudioBitRate()));
break;
}
case FileHelper.FILE_TYPE_VIDEO: {
MediaParameter parameter = MediaHelper.getGrabberParameter(serverFullPath);
info.setBitrate(Double.valueOf(parameter.getVideoBitRate()));
info.setWidth(Double.valueOf(parameter.getVideoWidth()));
info.setHeight(Double.valueOf(parameter.getVideoHeight()));
info.setBitrate(Long.valueOf(parameter.getVideoBitRate()));
info.setWidth(Long.valueOf(parameter.getVideoWidth()));
info.setHeight(Long.valueOf(parameter.getVideoHeight()));
break;
}
case FileHelper.FILE_TYPE_IMAGE: {
BufferedImage sourceImg = ImageIO.read(new FileInputStream(serverFullPath));
info.setWidth(Double.valueOf(sourceImg.getWidth()));
info.setHeight(Double.valueOf(sourceImg.getHeight()));
info.setWidth(Long.valueOf(sourceImg.getWidth()));
info.setHeight(Long.valueOf(sourceImg.getHeight()));
break;
}
case FileHelper.FILE_TYPE_NONE:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment