我已将Quickblox iOS(Objc)库集成到我的聊天模块应用程序中.
作为QBRequest TUploadFile方法下的附件的图像是可能的.但我找不到任何有效的解决方案来制作同一请求下的视频附件.
我已经通过阅读Quickblog中的文件证实了这一点 - 在Quickblox聊天SDK下可以使用视频附件.
有没有人有任何工作解决方案来制作视频文件附件?
下面的代码是为了在QBRequest TUploadFile下上传视频而编写的.
提前致谢!
- (void)uploadAndSendAttachmentMessage:(QBChatMessage*)message toDialog:(QBChatDialog*)dialog withChatService:(QMChatService*)chatService withAttachedVideo:(NSData*)videoData completion:(QBChatCompletionBlock)completion {
[self changeMessageAttachmentStatus:QMMessageAttachmentStatusLoading forMessage:message];
[QBRequest TUploadFile:videoData fileName:@"attachment video" contentType:@"video/mp4" isPublic:YES successBlock:^(QBResponse* response, QBCBlob* blob) {
QBChatAttachment* attachment = [QBChatAttachment new];
attachment.type = @"video";
attachment.ID = blob.UID;
attachment.url = [blob publicUrl];
message.attachments = @[attachment];
message.text = @"Attachment video";
[self saveData:videoData chatAttachment:attachment error:nil];
[self.attachmentsStorage setObject:videoData forKey:attachment.ID];
[self changeMessageAttachmentStatus:QMMessageAttachmentStatusLoaded forMessage:message];
[chatService sendMessage:message type:QMMessageTypeText toDialog:dialog saveToHistory:YES saveToStorage:YES completion:completion];
} …Run Code Online (Sandbox Code Playgroud) 我正在使用 GPUImage 框架进行图像过滤器。
我在相机上应用了 ToonFilter() 以获得卡通滤镜效果。
我的问题是在使用 GPUImage 使用 ToonFilter 效果在相机上捕获图像时。
下面是使用 GPUImage 相机显示 ToonFilter 的代码,并捕获具有相同效果的新图像。
请指导我如何使用相同的过滤器捕获图像?
注意:我能够成功地打开带有 ToonFilter 效果的相机 - 问题仅在于捕获带有滤镜效果的新图像。
代码 :
import UIKit
import GPUImage
import AVFoundation
class SelfieFilterVC: UIViewController, UISplitViewControllerDelegate {
@IBOutlet var filterSlider: UISlider?
@IBOutlet var filterView: RenderView?
let videoCamera:Camera?
var blendImage:PictureInput?
override func viewDidLoad() {
super.viewDidLoad()
self.filterOperation = FilterOperation(
filter:{ToonFilter()},
listName:"Toon",
titleName:"Toon",
sliderConfiguration:.disabled,
sliderUpdateCallback: nil,
filterOperationType:.singleInput
)
self.configureView()
}
required init(coder aDecoder: NSCoder)
{
do {
videoCamera = try Camera(sessionPreset:AVCaptureSessionPreset640x480, location:.backFacing)
videoCamera!.runBenchmark = …Run Code Online (Sandbox Code Playgroud) 我要求通过单击"向右"按钮使UICollectionView单元滚动到数组中的下5个项目,并通过单击"向左"按钮显示前5次.
任何人都可以通过提出任何建议来帮助我迅速做到这一点.
下面是编写的代码,在水平滚动中显示集合视图上的列表.
override func viewDidLoad() {
super.viewDidLoad()
self.arrFalconList = ["ic_falcon_1","ic_falcon_2","ic_falcon_3","ic_falcon_4","ic_falcon_5","ic_falcon_6","ic_falcon_7"]
}
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return self.arrFalconList.count
}
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let aFalconCell = collectionView.dequeueReusableCell(withReuseIdentifier: "FalconCollectionViewCell", for: indexPath) as! FalconCollectionViewCell
aFalconCell.imgFalcon.image = UIImage(named: self.arrFalconList[indexPath.row])
aFalconCell.lblFalcon.text = self.arrFalconList[indexPath.row]
aFalconCell.imgFalcon.layer.cornerRadius = ((aFalconCell.imgFalcon.frame.width) / 2)
aFalconCell.imgFalcon.clipsToBounds = true
if aFalconCell.isSelected {
aFalconCell.imgFalcon.layer.borderColor = UIColor.init(red: 241.0/255.0, green: 55.0/255.0, blue: 61.0/255.0, alpha: 1.0).cgColor
aFalconCell.imgFalcon.layer.borderWidth = 2
}else{
aFalconCell.imgFalcon.layer.borderColor = UIColor.clear.cgColor
aFalconCell.imgFalcon.layer.borderWidth …Run Code Online (Sandbox Code Playgroud)