DLNA DMS
上源码:
#if defined(TARGET_OS_IPHONE)
#import <UIKit/UIKit.h>
#else
#import <Foundation/NSArray.h>
#import <Foundation/NSString.h>
#endif
#import <CyberLink/UPnP.h>
@class CGUpnpAvContentDirectory;
@class CGUpnpAvObject;
@class CGUpnpAvContainer;
@class CGUpnpAvServer;
#if !defined(_CG_CLINKCAV_SERVER_H_)
typedef void CgUpnpAvServer;
#endif
@protocol CGUpnpAvServerDelegate <NSObject>
@optional
- (void)upnpAvServer:(CGUpnpAvServer *)upnpAvServer browse:(CGUpnpAction *)browseAction avObject:(CGUpnpAvObject *)avObject;
- (void)upnpAvServer:(CGUpnpAvServer *)upnpAvServer search:(CGUpnpAction *)searchAction avObject:(CGUpnpAvObject *)avObject;
@end
/**
* The CGUpnpAvServer class is a UPnP/AV media server class.
* 这个 CGUpnpAvServer 类是UPnP/AV 谜题资源服务类
*/
@interface CGUpnpAvServer : CGUpnpDevice
{
}
@property(readonly) CGUpnpAvContentDirectory *contentDirectory;
// DMS 可以持有子服务作为属性
@property(readonly) CgUpnpAvServer *cAvObject;
// 设置代理
@property(assign) id<CGUpnpAvServerDelegate> delegate;
#if defined(TARGET_OS_IPHONE)
@property(retain) UIImage *thumbnailImage;
#endif
/*
* Create a new UPnP/AV server.
*
* @return New instance if successfull; otherwise nil.
*/
- (id)init;
/**
* Create a new UPnP/AV server with the C instance.
*
* @return New instance if successfull; otherwise nil.
*/
- (id)initWithCObject:(CgUpnpDevice *)cobj;
- (void)setUserObject:(id)aUserObj;
- (id)userObject;
// 浏览某一个CGUpnpAvObject 的ID 是否成功
- (BOOL)browse:(NSString *)aObjectId browseFlag:(NSString *)aBrowseFlag options:(NSDictionary *)options;
// 浏览二进制
- (CGUpnpAvObject *)browseMetadata:(NSString *)aObjectId;
// 所有子对象个数
- (NSArray *)browseDirectChildren:(NSString *)aObjectId;
// 获取指定个数的子对象
- (NSArray *)browseDirectChildren:(NSString *)aObjectId requestedCount:(NSUInteger) aRequestedCount;
// 获取指定个数的子对象
- (NSArray *)browseDirectChildren:(NSString *)aObjectId requestedCount:(NSUInteger)aRequestedCount startingIndex:(NSUInteger)aStartingIndex;
// 浏览行为
- (CGUpnpAction *)browseAction;
// 查找某个东西
- (NSArray *)search:(NSString *)aSearchCriteria;
// 同上
- (NSArray *)searchByBrowse:(NSString *)aSearchCriteria;
- (NSArray *)searchByBrowse:(NSString *)aSearchCriteria objectId:(NSString *)objectId;
// 查找UPnPAction
- (CGUpnpAction *)searchAction;
// 跟对象 (对象可以持有别的对象作为属性)
- (CGUpnpAvContainer *)rootObject;
// 通过ID获取AVObject
- (CGUpnpAvObject *)objectForId:(NSString *)aObjectId;
// 通过titlePath 获取AVObject对象
- (CGUpnpAvObject *)objectForTitlePath:(NSString *)aTitlePath;
// 开始
- (BOOL)start;
// 停止
- (BOOL)stop;
// 锁定
- (void)lock;
// 解锁
- (void)unlock;
@end