├── vlc4iphone.xcodeproj └── .svn │ ├── format │ ├── prop-base │ └── project.pbxproj.svn-base │ ├── all-wcprops │ └── entries ├── .DS_Store ├── icon.png ├── Default.png ├── Classes ├── .DS_Store ├── SettingView.h ├── VideoDetailFlippedView.h ├── SettingView.m ├── UIProgressHUD.h ├── SettingEditCell.h ├── SettingPlayerController.h ├── HeadUpView.h ├── SettingPlayerCell.h ├── TableEditorViewController.h ├── VideoListView.h ├── SettingServerCell.h ├── VLCScreen.h ├── LocalViewController.h ├── RecentsViewController.h ├── LocalViewCell.h ├── XMLParser.h ├── CoverViewController.h ├── VideoDetailView.h ├── VideoListView.m ├── CoverFlowView.h ├── PanVViewController.h ├── NowPlayingViewController.h ├── BookmarksViewController.h ├── Schedule.h ├── VideoNode.h ├── VideoListViewController.h ├── SettingEditViewController.h ├── ScheduleViewController.h ├── VideoDetailViewController.h ├── SettingViewController.h ├── LocalViewCell.m ├── VideoStreamingAppDelegate.h ├── RootViewController.h ├── SettingEditCell.m ├── HeadUpView.m ├── VideoNode.m ├── CoverFlowView.m ├── UICoverFlowLayer.h ├── SettingPlayerCell.m ├── SettingServerCell.m ├── NowPlayingViewController.m ├── XMLParser.m ├── TableEditorViewController.m ├── VideoDetailFlippedView.m ├── SettingPlayerController.m ├── VLCScreen.m ├── SettingEditViewController.m └── RootViewController.m ├── include ├── .DS_Store ├── vlc_rand.h ├── vlc_avcodec.h ├── vlc_acl.h ├── vlc_devices.h ├── vlc_main.h ├── vlc_iso_lang.h ├── vlc │ ├── vlc.h │ ├── libvlc_media_library.h │ ├── libvlc_media_discoverer.h │ ├── libvlc_structures.h │ ├── mediacontrol_structures.h │ └── libvlc_media_list_player.h ├── vlc_strings.h ├── vlc_update.h ├── vlc_codec_synchro.h ├── vlc_window.h ├── vlc_md5.h ├── vlc_tls.h ├── vlc_vod.h ├── vlc_modules.h ├── vlc_xml.h ├── vlc_image.h ├── vlc_gcrypt.h ├── vlc_services_discovery.h ├── vlc_epg.h ├── vlc_pgpkey.h ├── vlc_dialog.h ├── vlc_objects.h ├── vlc_charset.h ├── vlc_fixups.h ├── vlc_bits.h ├── vlc_es_out.h ├── vlc_httpd.h └── vlc_mtime.h ├── Interfaces └── .DS_Store ├── Resources ├── .DS_Store ├── Liquid.png ├── Icons │ ├── .DS_Store │ ├── Key_48.png │ ├── Word_48.png │ ├── html_48.png │ ├── rtf_48.png │ ├── txt_48.png │ ├── vlc_62.png │ ├── Archive_48.png │ ├── Excel_48.png │ ├── Generic_48.png │ ├── Numbers_48.png │ ├── Pages_48.png │ ├── VCard_48.png │ ├── gif_64x64.png │ ├── jpeg_64x64.png │ ├── png_64x64.png │ ├── tiff_64x64.png │ ├── DiskImage_48.png │ ├── plist_64x64.png │ ├── PowerPoint_48.png │ ├── Executable_64x64.png │ ├── GenericPCIcon_48.png │ ├── iTunes-generic_48.png │ ├── GenericFolderIcon_48.png │ ├── Movie-QuickTime_48.png │ ├── DocumentsFolderIcon_48.png │ ├── GenericDocumentIcon_48.png │ └── GenericApplicationIcon_48.png ├── local_tabbar_ico.png ├── panv_tabbar_ico.png ├── flipper_list_black.png ├── server_tabbar_ico.png └── setting_tabbar_ico.png ├── VideoStreaming_Prefix.pch ├── main.m ├── appData.plist ├── global.h ├── Info.plist └── Constants.h /vlc4iphone.xcodeproj/.svn/format: -------------------------------------------------------------------------------- 1 | 8 2 | -------------------------------------------------------------------------------- /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zodttd/vlc4iphone/HEAD/.DS_Store -------------------------------------------------------------------------------- /icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zodttd/vlc4iphone/HEAD/icon.png -------------------------------------------------------------------------------- /Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zodttd/vlc4iphone/HEAD/Default.png -------------------------------------------------------------------------------- /Classes/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zodttd/vlc4iphone/HEAD/Classes/.DS_Store -------------------------------------------------------------------------------- /include/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zodttd/vlc4iphone/HEAD/include/.DS_Store -------------------------------------------------------------------------------- /Interfaces/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zodttd/vlc4iphone/HEAD/Interfaces/.DS_Store -------------------------------------------------------------------------------- /Resources/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zodttd/vlc4iphone/HEAD/Resources/.DS_Store -------------------------------------------------------------------------------- /Resources/Liquid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zodttd/vlc4iphone/HEAD/Resources/Liquid.png -------------------------------------------------------------------------------- /Resources/Icons/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zodttd/vlc4iphone/HEAD/Resources/Icons/.DS_Store -------------------------------------------------------------------------------- /Resources/Icons/Key_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zodttd/vlc4iphone/HEAD/Resources/Icons/Key_48.png -------------------------------------------------------------------------------- /Resources/Icons/Word_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zodttd/vlc4iphone/HEAD/Resources/Icons/Word_48.png -------------------------------------------------------------------------------- /Resources/Icons/html_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zodttd/vlc4iphone/HEAD/Resources/Icons/html_48.png -------------------------------------------------------------------------------- /Resources/Icons/rtf_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zodttd/vlc4iphone/HEAD/Resources/Icons/rtf_48.png -------------------------------------------------------------------------------- /Resources/Icons/txt_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zodttd/vlc4iphone/HEAD/Resources/Icons/txt_48.png -------------------------------------------------------------------------------- /Resources/Icons/vlc_62.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zodttd/vlc4iphone/HEAD/Resources/Icons/vlc_62.png -------------------------------------------------------------------------------- /Resources/Icons/Archive_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zodttd/vlc4iphone/HEAD/Resources/Icons/Archive_48.png -------------------------------------------------------------------------------- /Resources/Icons/Excel_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zodttd/vlc4iphone/HEAD/Resources/Icons/Excel_48.png -------------------------------------------------------------------------------- /Resources/Icons/Generic_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zodttd/vlc4iphone/HEAD/Resources/Icons/Generic_48.png -------------------------------------------------------------------------------- /Resources/Icons/Numbers_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zodttd/vlc4iphone/HEAD/Resources/Icons/Numbers_48.png -------------------------------------------------------------------------------- /Resources/Icons/Pages_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zodttd/vlc4iphone/HEAD/Resources/Icons/Pages_48.png -------------------------------------------------------------------------------- /Resources/Icons/VCard_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zodttd/vlc4iphone/HEAD/Resources/Icons/VCard_48.png -------------------------------------------------------------------------------- /Resources/Icons/gif_64x64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zodttd/vlc4iphone/HEAD/Resources/Icons/gif_64x64.png -------------------------------------------------------------------------------- /Resources/Icons/jpeg_64x64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zodttd/vlc4iphone/HEAD/Resources/Icons/jpeg_64x64.png -------------------------------------------------------------------------------- /Resources/Icons/png_64x64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zodttd/vlc4iphone/HEAD/Resources/Icons/png_64x64.png -------------------------------------------------------------------------------- /Resources/Icons/tiff_64x64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zodttd/vlc4iphone/HEAD/Resources/Icons/tiff_64x64.png -------------------------------------------------------------------------------- /Resources/local_tabbar_ico.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zodttd/vlc4iphone/HEAD/Resources/local_tabbar_ico.png -------------------------------------------------------------------------------- /Resources/panv_tabbar_ico.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zodttd/vlc4iphone/HEAD/Resources/panv_tabbar_ico.png -------------------------------------------------------------------------------- /vlc4iphone.xcodeproj/.svn/prop-base/project.pbxproj.svn-base: -------------------------------------------------------------------------------- 1 | K 14 2 | svn:executable 3 | V 0 4 | 5 | END 6 | -------------------------------------------------------------------------------- /Resources/Icons/DiskImage_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zodttd/vlc4iphone/HEAD/Resources/Icons/DiskImage_48.png -------------------------------------------------------------------------------- /Resources/Icons/plist_64x64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zodttd/vlc4iphone/HEAD/Resources/Icons/plist_64x64.png -------------------------------------------------------------------------------- /Resources/flipper_list_black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zodttd/vlc4iphone/HEAD/Resources/flipper_list_black.png -------------------------------------------------------------------------------- /Resources/server_tabbar_ico.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zodttd/vlc4iphone/HEAD/Resources/server_tabbar_ico.png -------------------------------------------------------------------------------- /Resources/setting_tabbar_ico.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zodttd/vlc4iphone/HEAD/Resources/setting_tabbar_ico.png -------------------------------------------------------------------------------- /Resources/Icons/PowerPoint_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zodttd/vlc4iphone/HEAD/Resources/Icons/PowerPoint_48.png -------------------------------------------------------------------------------- /Resources/Icons/Executable_64x64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zodttd/vlc4iphone/HEAD/Resources/Icons/Executable_64x64.png -------------------------------------------------------------------------------- /Resources/Icons/GenericPCIcon_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zodttd/vlc4iphone/HEAD/Resources/Icons/GenericPCIcon_48.png -------------------------------------------------------------------------------- /Resources/Icons/iTunes-generic_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zodttd/vlc4iphone/HEAD/Resources/Icons/iTunes-generic_48.png -------------------------------------------------------------------------------- /Resources/Icons/GenericFolderIcon_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zodttd/vlc4iphone/HEAD/Resources/Icons/GenericFolderIcon_48.png -------------------------------------------------------------------------------- /Resources/Icons/Movie-QuickTime_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zodttd/vlc4iphone/HEAD/Resources/Icons/Movie-QuickTime_48.png -------------------------------------------------------------------------------- /Resources/Icons/DocumentsFolderIcon_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zodttd/vlc4iphone/HEAD/Resources/Icons/DocumentsFolderIcon_48.png -------------------------------------------------------------------------------- /Resources/Icons/GenericDocumentIcon_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zodttd/vlc4iphone/HEAD/Resources/Icons/GenericDocumentIcon_48.png -------------------------------------------------------------------------------- /Resources/Icons/GenericApplicationIcon_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zodttd/vlc4iphone/HEAD/Resources/Icons/GenericApplicationIcon_48.png -------------------------------------------------------------------------------- /Classes/SettingView.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface SettingView : UITableView { 5 | UITableView* tableView; 6 | } 7 | @property (nonatomic, retain) IBOutlet UITableView* tableView; 8 | @end 9 | -------------------------------------------------------------------------------- /VideoStreaming_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'VideoStreaming' target in the 'VideoStreaming' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #import 8 | #endif 9 | -------------------------------------------------------------------------------- /Classes/VideoDetailFlippedView.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | File: VideoDetailFlippedView.h 4 | Abstract: Displays the Atomic Element information with a link to Wikipedia. 5 | 6 | */ 7 | 8 | #import 9 | #import "VideoDetailView.h" 10 | 11 | @interface VideoDetailFlippedView : VideoDetailView { 12 | 13 | } 14 | @end 15 | -------------------------------------------------------------------------------- /Classes/SettingView.m: -------------------------------------------------------------------------------- 1 | #import "SettingView.h" 2 | 3 | @implementation SettingView 4 | @synthesize tableView; 5 | 6 | 7 | - (id)initWithFrame:(CGRect)frame { 8 | if (self = [super initWithFrame:frame]) { 9 | // Initialization code 10 | } 11 | return self; 12 | } 13 | 14 | - (void)dealloc { 15 | [tableView dealloc]; 16 | [super dealloc]; 17 | } 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Classes/UIProgressHUD.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIProgressHUD.h 3 | // VideoStreaming 4 | // 5 | // Created by ZodTTD & Derek Tse on 09年3月25日. 6 | // Copyright 2009 ZodTTD (Spookysoft LLC) & HKUST. All rights reserved. 7 | // 8 | 9 | @interface UIProgressHUD : NSObject 10 | - (void) show: (BOOL) yesOrNo; 11 | - (UIProgressHUD *) initWithWindow: (UIView *) window; 12 | - (void) setText: (NSString *) theText; 13 | @end 14 | -------------------------------------------------------------------------------- /Classes/SettingEditCell.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | File: SettingEditCell.h 4 | Abstract: 5 | Custom table cell used in the editing view's table. Contains a UITextField for 6 | in-place editing of content. 7 | 8 | */ 9 | 10 | #import 11 | 12 | @interface SettingEditCell : UITableViewCell { 13 | UITextField *textField; 14 | } 15 | 16 | @property (nonatomic, retain) UITextField *textField; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Classes/SettingPlayerController.h: -------------------------------------------------------------------------------- 1 | // 2 | // SettingPlayerController.h 3 | // VideoStreaming 4 | // 5 | // Created by nanotang on 4/11/09. 6 | // Copyright 2009 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "SettingViewController.h" 11 | 12 | @interface SettingViewController (SettingPlayerController) 13 | 14 | - (void)create_UIControls; 15 | -(NSDictionary *) getDictionaryItem:(NSString *) name; 16 | @end 17 | -------------------------------------------------------------------------------- /main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // VideoStreaming 4 | // 5 | // Created by ZodTTD & Derek Tse on 08年9月25日. 6 | // Copyright HKUST 2008. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) { 12 | 13 | NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 14 | int retVal = UIApplicationMain(argc, argv, nil, @"VideoStreamingAppDelegate"); 15 | [pool release]; 16 | return retVal; 17 | } 18 | -------------------------------------------------------------------------------- /Classes/HeadUpView.h: -------------------------------------------------------------------------------- 1 | // 2 | // HeadUpView.h 3 | // PanV 4 | // 5 | // Created by nanotang on 3/21/09. 6 | // Copyright 2009 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface HeadUpView : UIView { 13 | CGFloat r; 14 | CGFloat g; 15 | CGFloat b; 16 | CGFloat radius; 17 | } 18 | 19 | - (id)initWithFrame:(CGRect)frame 20 | red:(CGFloat)inputRed green:(CGFloat)inputGreen blue:(CGFloat)inputBlue 21 | radius:(CGFloat)inputRadius; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Classes/SettingPlayerCell.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | File: SettingPlayerCell.h 4 | Abstract: UITableView utility cell that holds a UIView. 5 | 6 | */ 7 | 8 | #import 9 | 10 | // cell identifier for this custom cell 11 | extern NSString *kDisplayCell_ID; 12 | 13 | @interface SettingPlayerCell : UITableViewCell 14 | { 15 | UILabel *nameLabel; 16 | UIView *view; 17 | } 18 | 19 | @property (nonatomic, retain) UIView *view; 20 | @property (nonatomic, retain) UILabel *nameLabel; 21 | 22 | - (void)setView:(UIView *)inView; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /Classes/TableEditorViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // TableEditorViewController.h 3 | // VideoStreaming 4 | // 5 | // Created by ZodTTD & Derek Tse on 09年4月5日. 6 | // Copyright 2009 ZodTTD (Spookysoft LLC) & HKUST. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface TableEditorViewController : UIViewController { 13 | IBOutlet UITextField *editTextField; 14 | } 15 | 16 | @property (nonatomic, retain) IBOutlet UITextField* editTextField; 17 | 18 | -(void) addNewItemInArray:(NSMutableArray*) array; 19 | -(void) editItemAtIndex:(NSInteger) index OfArray:(NSMutableArray*) array; 20 | @end 21 | -------------------------------------------------------------------------------- /Classes/VideoListView.h: -------------------------------------------------------------------------------- 1 | // 2 | // VideoListView.h 3 | // VideoStreaming 4 | // 5 | // Created by ZodTTD & Derek Tse on 08年9月25日. 6 | // Copyright HKUST 2008. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface VideoListView : UITableView { 12 | //UINavigationBar* navigationBar; 13 | //UIBarButtonItem* barButton; 14 | UITableView* tableView; 15 | } 16 | 17 | //@property (nonatomic, retain) IBOutlet UINavigationBar* navigationBar; 18 | //@property (nonatomic, retain) IBOutlet UIBarButtonItem* barButton; 19 | @property (nonatomic, retain) IBOutlet UITableView* tableView; 20 | 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Classes/SettingServerCell.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | File: SettingServerCell.h 4 | Abstract: 5 | Custom table cell used in the main view's table. Capable of displaying in two 6 | modes - a "type:name" mode for existing 7 | data and a "prompt" mode when used as a placeholder for data creation. 8 | 9 | */ 10 | 11 | #import 12 | 13 | @interface SettingServerCell : UITableViewCell { 14 | UITextField *name; 15 | UITextField *prompt; 16 | BOOL promptMode; 17 | } 18 | 19 | @property (readonly, retain) UITextField *name; 20 | @property (readonly, retain) UITextField *prompt; 21 | @property BOOL promptMode; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Classes/VLCScreen.h: -------------------------------------------------------------------------------- 1 | // 2 | // VLCScreen.h 3 | // VideoStreaming 4 | // 5 | // Created by ZodTTD & Derek Tse on 09年4月12日. 6 | // Copyright 2009 ZodTTD (Spookysoft LLC) & HKUST. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import 12 | 13 | #import 14 | #import 15 | 16 | @interface VLCScreen:UIView{ 17 | CoreSurfaceBufferRef _screenSurface; 18 | CALayer * screenLayer; 19 | NSTimer * timer; 20 | } 21 | 22 | - (id)initWithFrame:(struct CGRect)rect; 23 | - (void)drawRect:(CGRect)rect; 24 | - (CoreSurfaceBufferRef)getSurface; 25 | @end 26 | -------------------------------------------------------------------------------- /Classes/LocalViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // LocalViewController.h 3 | // VideoStreaming 4 | // 5 | // Created by ZodTTD & Derek Tse on 09年4月6日. 6 | // Copyright 2009 ZodTTD (Spookysoft LLC) & HKUST. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface LocalViewController : UITableViewController { 13 | IBOutlet UITableView *tableView; 14 | NSMutableArray *currentFolderItems; 15 | NSString* currentPath; 16 | BOOL showHiddenFiles; 17 | } 18 | 19 | @property (nonatomic, retain) IBOutlet UITableView *tableView; 20 | 21 | - (void)backClicked:(id)sender; 22 | - (void)refreshCurrentFolder:(NSString*)path; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /Classes/RecentsViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // RecentsViewController.h 3 | // VideoStreaming 4 | // 5 | // Created by ZodTTD & Derek Tse on 09年4月6日. 6 | // Copyright 2009 ZodTTD (Spookysoft LLC) & HKUST. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface RecentsViewController : UITableViewController { 13 | IBOutlet UITableView *tableView; 14 | NSMutableArray *recentsArray; 15 | } 16 | 17 | @property(nonatomic, retain) IBOutlet UITableView* tableView; 18 | @property(nonatomic, retain) NSMutableArray* recentsArray; 19 | 20 | -(void) addRecentWithPath:(NSString*)path; 21 | @end 22 | -------------------------------------------------------------------------------- /vlc4iphone.xcodeproj/.svn/all-wcprops: -------------------------------------------------------------------------------- 1 | K 25 2 | svn:wc:ra_dav:version-url 3 | V 67 4 | /svn/fyp/!svn/ver/121/trunk/VideoStreaming/VideoStreaming.xcodeproj 5 | END 6 | Derek.pbxuser 7 | K 25 8 | svn:wc:ra_dav:version-url 9 | V 81 10 | /svn/fyp/!svn/ver/122/trunk/VideoStreaming/VideoStreaming.xcodeproj/Derek.pbxuser 11 | END 12 | project.pbxproj 13 | K 25 14 | svn:wc:ra_dav:version-url 15 | V 83 16 | /svn/fyp/!svn/ver/122/trunk/VideoStreaming/VideoStreaming.xcodeproj/project.pbxproj 17 | END 18 | Derek.perspectivev3 19 | K 25 20 | svn:wc:ra_dav:version-url 21 | V 87 22 | /svn/fyp/!svn/ver/122/trunk/VideoStreaming/VideoStreaming.xcodeproj/Derek.perspectivev3 23 | END 24 | -------------------------------------------------------------------------------- /Classes/LocalViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // LocalViewCell.h 3 | // VideoStreaming 4 | // 5 | // Created by nanotang on 4/11/09. 6 | // Copyright 2009 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface LocalViewCell : UITableViewCell { 13 | UILabel* title; 14 | 15 | UILabel* fileType; 16 | UILabel* modifiedTime; 17 | UILabel* more; 18 | 19 | UIImageView* icon; 20 | } 21 | 22 | @property (nonatomic, retain) UILabel* title; 23 | @property (nonatomic, retain) UILabel* fileType; 24 | @property (nonatomic, retain) UILabel* modifiedTime; 25 | @property (nonatomic, retain) UILabel* more; 26 | @property (nonatomic, retain) UIImageView* icon; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /Classes/XMLParser.h: -------------------------------------------------------------------------------- 1 | // 2 | // XMLParser.h 3 | // VideoStreaming 4 | // 5 | // Created by ZodTTD & Derek Tse on 08年10月18日. 6 | // Copyright 2008 HKUST. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "VideoNode.h" 11 | 12 | @interface XMLParser : NSObject{ 13 | 14 | @private 15 | VideoNode* _currentVideoNode; 16 | NSString* currentServer; 17 | NSMutableArray* videoNodes; 18 | } 19 | 20 | @property (nonatomic, retain) VideoNode* currentVideoNode; 21 | @property (nonatomic, retain) NSMutableArray* videoNodes; 22 | @property (nonatomic, copy) NSString* currentServer; 23 | 24 | - (NSMutableArray*)parseXMLFileAtURL:(NSString *)serverURL xmlPath:(NSString *)path parseError:(NSError **)error; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /Classes/CoverViewController.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "CoverFlowView.h" 3 | 4 | @interface CoverViewController : UIViewController // protocol 5 | { 6 | CoverFlowView *cfView; 7 | NSMutableArray *covers; 8 | NSMutableArray *titles; 9 | int whichItem; 10 | id target; 11 | SEL selector; 12 | 13 | NSMutableDictionary *colorDict; 14 | UILabel *flippedView; // flipped detail view 15 | BOOL flipOut; 16 | } 17 | @property (nonatomic, retain) CoverFlowView *cfView; 18 | @property (nonatomic, retain) NSMutableArray *covers; 19 | @property (nonatomic, retain) NSMutableArray *titles; 20 | @property (nonatomic, retain) NSMutableDictionary *colorDict; 21 | @property int whichItem; 22 | @end 23 | -------------------------------------------------------------------------------- /Classes/VideoDetailView.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | File: VideoDetailView.h 4 | Abstract: Displays the Atomic Element information in a large format tile. 5 | 6 | */ 7 | 8 | 9 | #import 10 | 11 | @class VideoNode; 12 | //@class AtomicElement; 13 | @class VideoDetailViewController; 14 | 15 | @interface VideoDetailView : UIView { 16 | VideoNode *video; 17 | 18 | VideoDetailViewController *viewController; 19 | } 20 | 21 | @property (nonatomic, retain) VideoNode *video; 22 | @property (nonatomic, assign) VideoDetailViewController *viewController; 23 | 24 | - (id)initWithFrame:(CGRect)frame videonode:(VideoNode*) videonode; 25 | + (CGSize)preferredViewSize; 26 | - (UIImage *)reflectedImageRepresentationWithHeight:(NSUInteger)height; 27 | @end 28 | -------------------------------------------------------------------------------- /appData.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | name 7 | Video Playing Settings 8 | content 9 | 10 | opt_noaudio 11 | 12 | value 13 | 0 14 | name 15 | No Audio (Restart To Take Effect) 16 | 17 | 18 | 19 | 20 | content 21 | 22 | 23 | Name 24 | temp 25 | 26 | 27 | name 28 | Servers 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Classes/VideoListView.m: -------------------------------------------------------------------------------- 1 | // 2 | // VideoListView.m 3 | // VideoStreaming 4 | // 5 | // Created by ZodTTD & Derek Tse on 08年9月25日. 6 | // Copyright HKUST 2008. All rights reserved. 7 | // 8 | 9 | #import "VideoListView.h" 10 | 11 | @implementation VideoListView 12 | 13 | //@synthesize navigationBar; 14 | //@synthesize barButton; 15 | @synthesize tableView; 16 | 17 | 18 | - (id)initWithFrame:(CGRect)frame { 19 | if (self = [super initWithFrame:frame]) { 20 | // Initialization code 21 | } 22 | return self; 23 | } 24 | 25 | 26 | - (void)drawRect:(CGRect)rect { 27 | // Drawing code 28 | } 29 | 30 | 31 | - (void)dealloc { 32 | //[barButton release]; 33 | //[navigationBar release]; 34 | [tableView release]; 35 | [super dealloc]; 36 | } 37 | 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /Classes/CoverFlowView.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "UICoverFlowLayer.h" 3 | 4 | @protocol CoverFlowHost // protocol 5 | - (void) doubleTapCallback; 6 | @end 7 | 8 | @interface UIView (LayerSet) // category 9 | - (void) setLayer: (id) aLayer; 10 | @end 11 | 12 | @interface CoverFlowView : UIView { 13 | id host; 14 | id info; 15 | UICoverFlowLayer *cfLayer; 16 | UILabel *label; 17 | UIImageView *phimg; 18 | } 19 | - (CoverFlowView *) initWithFrame: (CGRect) aFrame andCount: (int) aCount; 20 | - (void) tick; 21 | - (void) flipSelectedCover; 22 | 23 | @property (nonatomic, retain) UILabel *label; 24 | @property (nonatomic, retain) UIImageView *phimg; 25 | @property (nonatomic, retain) id host; 26 | @property (nonatomic, retain) UICoverFlowLayer *cfLayer; 27 | @end 28 | 29 | -------------------------------------------------------------------------------- /Classes/PanVViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // PanVViewController.h 3 | // PanV 4 | // 5 | // Created by nanotang on 3/21/09. 6 | // Copyright 2009 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "HeadUpView.h" 11 | #import "ScheduleViewController.h" 12 | #import "Schedule.h" 13 | 14 | 15 | @interface PanVViewController : UIViewController { 16 | UIWebView *panVView; 17 | HeadUpView *currentShow; 18 | ScheduleViewController *schedule; 19 | UITextView *currentShowContent; 20 | //NSTimer *timer; 21 | } 22 | 23 | @property (nonatomic, retain) ScheduleViewController *schedule; 24 | @property (nonatomic, retain) HeadUpView *currentShow; 25 | //@property (nonatomic, retain) NSTimer *timer; 26 | 27 | -(void)updateSchedule; 28 | //-(void)autoUpdate:(NSTimer *)timer; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /global.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | /* Externs */ 4 | extern int tArgc; 5 | extern char** tArgv; 6 | //extern char vlc_command[1024]; 7 | //extern char vlc_so_currentsong[1024]; 8 | extern pthread_t main_tid; 9 | 10 | extern char* wrap_set_vlc_so_currentsong(char* setter); 11 | extern char* wrap_set_vlc_command(char* setter); 12 | extern char* wrap_set_vlc_command_value(char* setter); 13 | extern float wrap_set_iphone_audio_volume(float setter); 14 | extern unsigned char* wrap_set_iphone_video_buffer(unsigned char* setter); 15 | 16 | #define set_vlc_so_currentsong wrap_set_vlc_so_currentsong 17 | #define set_vlc_command wrap_set_vlc_command 18 | #define set_vlc_command_value wrap_set_vlc_command_value 19 | #define set_iphone_audio_volume wrap_set_iphone_audio_volume 20 | #define set_iphone_video_buffer wrap_set_iphone_video_buffer 21 | -------------------------------------------------------------------------------- /Classes/NowPlayingViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // NowPlayingViewController.h 3 | // VideoStreaming 4 | // 5 | // Created by ZodTTD & Derek Tse on 09年4月11日. 6 | // Copyright 2009 ZodTTD (Spookysoft LLC) & HKUST. All rights reserved. 7 | // 8 | // 9 | 10 | #import 11 | #import "AltAds.h" 12 | 13 | @class VLCScreen; 14 | 15 | @interface NowPlayingViewController : UIViewController { 16 | IBOutlet UISlider * seekSlider; 17 | IBOutlet UILabel * labelStation; 18 | VLCScreen * screenView; 19 | AltAds * altAds; 20 | } 21 | 22 | - (void)volumeChanged:(id)sender; 23 | - (void)setCurrentlyPlaying:(NSString*) str; 24 | - (void)seekChanged:(id)sender; 25 | //- (void)checkDisplay; 26 | - (void)settingsClicked:(id)sender; 27 | - (void)backClicked:(id)sender; 28 | - (void)addBookmark:(id)sender; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /Classes/BookmarksViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // BookmarksViewController.h 3 | // VideoStreaming 4 | // 5 | // Created by ZodTTD & Derek Tse on 09年4月4日. 6 | // Copyright 2009 ZodTTD (Spookysoft LLC) & HKUST. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class TableEditorViewController; 12 | 13 | @interface BookmarksViewController : UITableViewController { 14 | IBOutlet UITableView *tableView; 15 | NSMutableArray * bookmarksArray; 16 | TableEditorViewController *editViewController; 17 | } 18 | 19 | @property(nonatomic, retain) IBOutlet UITableView* tableView; 20 | @property(nonatomic, retain) NSMutableArray* bookmarksArray; 21 | @property(nonatomic, retain) TableEditorViewController *editViewController; 22 | 23 | -(void) addBookmarkWithPath:(NSString*)path; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Classes/Schedule.h: -------------------------------------------------------------------------------- 1 | // 2 | // Schedule.h 3 | // PanV 4 | // 5 | // Created by nanotang on 3/27/09. 6 | // Copyright 2009 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface Schedule : NSObject { 13 | NSString *channel; 14 | NSMutableArray *timeArray; 15 | NSMutableArray *programArray; 16 | } 17 | 18 | @property (nonatomic, retain) NSString *channel; 19 | @property (nonatomic, retain) NSMutableArray *timeArray; 20 | @property (nonatomic, retain) NSMutableArray *programArray; 21 | 22 | -(id)initWithChannel:(NSString *)chan; 23 | //-(id)initWithChannel:(NSString *)chan time:(NSMutableArray *)timeArr program:(NSMutableArray *)programArr; 24 | -(void)getTVBSchedule; 25 | -(void)getATVSchedule; 26 | -(NSString *)getCurrentProgram; 27 | -(NSString *)getStartTime; 28 | -(NSString *)getEndTime; 29 | -(NSDate *)convertToDate:(NSString *)time; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /Classes/VideoNode.h: -------------------------------------------------------------------------------- 1 | // 2 | // VideoNode.h 3 | // VideoStreaming 4 | // 5 | // Created by ZodTTD & Derek Tse on 08年10月18日. 6 | // Copyright 2008 HKUST. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface VideoNode : NSObject // 13 | { 14 | NSString* _title; 15 | NSString* _performer; 16 | NSString* _seriesName; 17 | NSString* _videoPath; 18 | NSString* _imagePath; 19 | NSString* _cellImagePath; 20 | NSString* _serverPath; 21 | } 22 | 23 | @property (nonatomic, retain) NSString* title; 24 | @property (nonatomic, retain) NSString* performer; 25 | @property (nonatomic, retain) NSString* seriesName; 26 | @property (nonatomic, retain) NSString* videoPath; 27 | @property (nonatomic, retain) NSString* imagePath; 28 | @property (nonatomic, retain) NSString* cellImagePath; 29 | @property (nonatomic, retain) NSString* serverPath; 30 | 31 | @property (readonly) UIImage *flipperImageForVideoDetailViewNavigationItem; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /vlc4iphone.xcodeproj/.svn/entries: -------------------------------------------------------------------------------- 1 | 8 2 | 3 | dir 4 | 121 5 | https://derek@localhost/svn/fyp/trunk/VideoStreaming/VideoStreaming.xcodeproj 6 | https://derek@localhost/svn/fyp 7 | 8 | 9 | 10 | 2009-04-12T11:56:52.332992Z 11 | 121 12 | derek 13 | 14 | 15 | svn:special svn:externals svn:needs-lock 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 4e06130d-fd23-41f4-a886-dfe8c56f2740 28 | 29 | Derek.pbxuser 30 | file 31 | 122 32 | 33 | 34 | 35 | 2009-04-12T17:43:46.000000Z 36 | 8aa9f51d8fee4267be466ddedf8779fc 37 | 2009-04-12T17:44:02.165331Z 38 | 122 39 | derek 40 | 41 | project.pbxproj 42 | file 43 | 122 44 | 45 | 46 | 47 | 2009-04-12T17:43:46.000000Z 48 | 4e064ea5b922b0ef15ec6eb26dcec268 49 | 2009-04-12T17:44:02.165331Z 50 | 122 51 | derek 52 | has-props 53 | 54 | Derek.perspectivev3 55 | file 56 | 122 57 | 58 | 59 | 60 | 2009-04-12T17:43:46.000000Z 61 | 6019fcd5a5609dfccf373046d087de75 62 | 2009-04-12T17:44:02.165331Z 63 | 122 64 | derek 65 | 66 | -------------------------------------------------------------------------------- /Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFile 12 | icon 13 | CFBundleIdentifier 14 | com.Spookysoft.${PRODUCT_NAME:identifier} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleSignature 22 | SPKS 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UIStatusBarHidden 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /Classes/VideoListViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // VideoListViewController.h 3 | // VideoStreaming 4 | // 5 | // Created by ZodTTD & Derek Tse on 08年9月25日. 6 | // Copyright HKUST 2008. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @class VideoDetailViewController; 13 | 14 | @interface VideoListViewController : UITableViewController { 17 | UITableView *tableView; 18 | NSIndexPath *oldIndexPath; 19 | NSURL* videoURL; 20 | NSMutableArray *videoListSection; 21 | BOOL selected; 22 | 23 | VideoDetailViewController* videoDetailViewController; 24 | } 25 | @property (nonatomic, retain) IBOutlet UITableView *tableView; 26 | @property (nonatomic, retain) NSURL* videoURL; 27 | @property (nonatomic, retain) NSMutableArray *videoListSection; 28 | @property (nonatomic, retain) VideoDetailViewController* videoDetailViewController; 29 | 30 | -(void) loadVideoListFromServers; 31 | -(void) removeAllVideos; 32 | -(void) reloadTable; 33 | @end 34 | -------------------------------------------------------------------------------- /Classes/SettingEditViewController.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | File: EditingViewController.h 4 | Abstract: 5 | View controller for editing the content of a specific item. 6 | 7 | */ 8 | 9 | #import 10 | 11 | @class SettingEditCell; 12 | 13 | @interface SettingEditViewController : UIViewController { 14 | NSMutableDictionary *editingItem; 15 | NSDictionary *editingItemCopy; 16 | UITextField *nameField; 17 | // UITextField *typeField; 18 | UITableView *tableView; 19 | SettingEditCell *nameCell; 20 | BOOL newItem; 21 | NSMutableArray *editingContent; 22 | NSString *sectionName; 23 | UIView *headerView; 24 | } 25 | 26 | @property (nonatomic, retain) NSMutableDictionary *editingItem; 27 | @property (nonatomic, copy) NSDictionary *editingItemCopy; 28 | @property (nonatomic, retain) NSMutableArray *editingContent; 29 | @property (nonatomic, copy) NSString *sectionName; 30 | @property (nonatomic, retain) IBOutlet UITableView *tableView; 31 | @property (nonatomic, retain) UIView *headerView; 32 | 33 | - (IBAction)cancel:(id)sender; 34 | - (IBAction)save:(id)sender; 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /Classes/ScheduleViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ScheduleViewController.h 3 | // PanV 4 | // 5 | // Created by nanotang on 3/23/09. 6 | // Copyright 2009 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "HeadUpView.h" 11 | #import "Schedule.h" 12 | 13 | 14 | @interface ScheduleViewController : UIViewController { 15 | HeadUpView *largeLayer; 16 | UITextView *tvbScheduleView; 17 | UITextView *pearlScheduleView; 18 | UITextView *atvScheduleView; 19 | UITextView *worldScheduleView; 20 | Schedule *tvbSchedule; 21 | Schedule *pearlSchedule; 22 | Schedule *atvSchedule; 23 | Schedule *worldSchedule; 24 | UIButton *tvbChannel; 25 | UIButton *pearlChannel; 26 | UIButton *atvChannel; 27 | UIButton *worldChannel; 28 | UIButton *exitSchedule; 29 | } 30 | 31 | @property (nonatomic, retain) Schedule *tvbSchedule; 32 | @property (nonatomic, retain) Schedule *pearlSchedule; 33 | @property (nonatomic, retain) Schedule *atvSchedule; 34 | @property (nonatomic, retain) Schedule *worldSchedule; 35 | @property (nonatomic, retain) HeadUpView *largeLayer; 36 | 37 | -(void)moveIn; 38 | -(void)moveOut; 39 | -(void)changeToTVB; 40 | -(void)changeToPearl; 41 | -(void)changeToATV; 42 | -(void)changeToWorld; 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /Classes/VideoDetailViewController.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | File: VideoDetailViewController.h 4 | Abstract: Controller that manages the full tile view of the atomic information, 5 | creating the reflection, and the flipping of the tile. 6 | 7 | */ 8 | 9 | 10 | #import 11 | 12 | @class VideoDetailView; 13 | @class VideoDetailFlippedView; 14 | 15 | @class VideoNode; 16 | 17 | @interface VideoDetailViewController : UIViewController { 18 | VideoNode *video; 19 | 20 | VideoDetailView *videoDetailView; 21 | VideoDetailFlippedView *videoDetailFlippedView; 22 | UIImageView *reflectionView; 23 | UIView *containerView; 24 | UIButton *flipIndicatorButton; 25 | BOOL frontViewIsVisible; 26 | } 27 | 28 | @property (nonatomic, retain)VideoNode *video; 29 | 30 | @property (assign) BOOL frontViewIsVisible; 31 | @property (nonatomic,retain) UIView *containerView; 32 | @property (nonatomic,retain) VideoDetailView *videoDetailView; 33 | @property (nonatomic,retain) UIImageView *reflectionView; 34 | @property (nonatomic,retain) VideoDetailFlippedView *videoDetailFlippedView; 35 | @property (nonatomic,retain) UIButton *flipIndicatorButton; 36 | 37 | 38 | -(id)init:(VideoNode *)inputVideo; 39 | - (void)flipCurrentView; 40 | - (void)transitionDidStop:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context; 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /include/vlc_rand.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * vlc_rand.h: RNG 3 | ***************************************************************************** 4 | * Copyright © 2007 Rémi Denis-Courmont 5 | * $Id$ 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. 20 | *****************************************************************************/ 21 | 22 | #ifndef VLC_RAND_H 23 | # define VLC_RAND_H 24 | 25 | /** 26 | * \file 27 | * This file defined random number generator function in vlc 28 | */ 29 | 30 | VLC_EXPORT( void, vlc_rand_bytes, (void *buf, size_t len) ); 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /Classes/SettingViewController.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | File: DetailViewController.h 4 | Abstract: 5 | Main view controller for the app. Displays a grouped table view and manages 6 | edits to the table, including 7 | add, delete, reorder, and navigation to edit the contents of individual items. 8 | 9 | */ 10 | 11 | #import 12 | 13 | // Forward declaration of the editing view controller's class for the compiler. 14 | @class SettingEditViewController; 15 | 16 | @interface SettingViewController : UITableViewController { 17 | UITableView *tableView; 18 | NSMutableArray *data; 19 | SettingEditViewController *editViewController; 20 | NSString *pathToUserCopyOfPlist; 21 | 22 | UISwitch *switchCtl1; 23 | UISwitch *switchCtl2; 24 | UISwitch *switchCtl3; 25 | UISegmentedControl *segmentedControl; 26 | } 27 | 28 | @property (nonatomic, retain) NSMutableArray *data; 29 | @property (nonatomic, retain) IBOutlet UITableView *tableView; 30 | @property (nonatomic, retain) SettingEditViewController *editViewController; 31 | @property (nonatomic, copy) NSString *pathToUserCopyOfPlist; 32 | //@property (nonatomic, retain) UISegmentedControl *segmentedControl; 33 | 34 | -(void) loadAppSettings; 35 | -(NSUInteger) countOfServers; 36 | -(NSString*)getSetting:(NSString*) settingName; 37 | -(void) writeToUserPlist; 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /include/vlc_avcodec.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * vlc_avcodec.h: VLC thread support for FFMPEG/libavcodec 3 | ***************************************************************************** 4 | * Copyright (C) 2009 Rémi Denis-Courmont 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. 19 | *****************************************************************************/ 20 | 21 | #ifndef VLC_AVCODEC_H 22 | # define VLC_AVCODEC_H 1 23 | 24 | VLC_EXPORT( void, vlc_avcodec_mutex, (bool) ); 25 | 26 | static inline void vlc_avcodec_lock (void) 27 | { 28 | vlc_avcodec_mutex (true); 29 | } 30 | 31 | static inline void vlc_avcodec_unlock (void) 32 | { 33 | vlc_avcodec_mutex (false); 34 | } 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /Classes/LocalViewCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // LocalViewCell.m 3 | // VideoStreaming 4 | // 5 | // Created by nanotang on 4/11/09. 6 | // Copyright 2009 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "LocalViewCell.h" 10 | 11 | 12 | @implementation LocalViewCell 13 | 14 | @synthesize icon, fileType, modifiedTime, more, title; 15 | 16 | - (id)initWithFrame:(CGRect)frame reuseIdentifier:(NSString *)reuseIdentifier { 17 | if (self = [super initWithFrame:frame reuseIdentifier:reuseIdentifier]) { 18 | // Initialization code 19 | } 20 | return self; 21 | } 22 | 23 | 24 | - (void)setSelected:(BOOL)selected animated:(BOOL)animated { 25 | 26 | [super setSelected:selected animated:animated]; 27 | 28 | // Configure the view for the selected state 29 | } 30 | 31 | - (void)layoutSubviews 32 | { 33 | [super layoutSubviews]; 34 | 35 | 36 | 37 | // // Start with a rect that is inset from the content view by 10 pixels on all sides. 38 | CGRect baseRect = CGRectInset(self.contentView.bounds, 10, 10); 39 | CGRect rect = baseRect; 40 | rect.origin.x += baseRect.size.width - 25; 41 | rect.origin.y += baseRect.size.height + 20; 42 | title.frame = rect; 43 | // // Position each label with a modified version of the base rect. 44 | // prompt.frame = rect; 45 | // rect.origin.x += 20; 46 | // rect.size.width = baseRect.size.width - 40; 47 | // name.frame = rect; 48 | 49 | } 50 | 51 | - (void)dealloc { 52 | [super dealloc]; 53 | } 54 | 55 | 56 | @end 57 | -------------------------------------------------------------------------------- /Classes/VideoStreamingAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // VideoStreamingAppDelegate.h 3 | // VideoStreaming 4 | // 5 | // Created by ZodTTD & Derek Tse on 08年9月25日. 6 | // Copyright HKUST 2008. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "global.h" 11 | 12 | #define appDelegate ((VideoStreamingAppDelegate*)[[UIApplication sharedApplication] delegate]) 13 | 14 | extern char media_file[1024]; 15 | extern int media_done; 16 | extern int media_playing; 17 | extern float media_seek; 18 | extern float media_volume; 19 | extern void *app_Thread_Start(void *args); 20 | 21 | @class MPMoviePlayerController; 22 | @class UIProgressHUD; 23 | @class RootViewController; 24 | @class VideoListViewController; 25 | @class NowPlayingViewController; 26 | 27 | @interface VideoStreamingAppDelegate : NSObject { 28 | UIWindow *window; 29 | RootViewController *rootViewController; 30 | MPMoviePlayerController* theMovie; 31 | } 32 | 33 | @property (nonatomic, retain) UIWindow *window; 34 | @property (nonatomic, retain) RootViewController *rootViewController; 35 | @property (nonatomic, retain) MPMoviePlayerController* theMovie; 36 | 37 | -(BOOL) hostAvailable: (NSString *) theHost; 38 | -(void)alertSimpleAction:(NSString*) serverURL; 39 | 40 | - (void) showProgressHUD; 41 | 42 | - (NSString*) getDocumentsDirectory; 43 | 44 | - (void) playVideoInDefaultPlayerWithPath:(NSString*) path usingURL:(NSInteger)isURL; 45 | - (void) playVideoInVLCPlayerWithPath:(NSString*) path; 46 | @end 47 | 48 | -------------------------------------------------------------------------------- /Classes/RootViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // RootViewController.h 3 | // VideoStreaming 4 | // 5 | // Created by ZodTTD & Derek Tse on 08年9月25日. 6 | // Copyright HKUST 2008. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class LocalViewController; 12 | @class VideoListViewController; 13 | @class SettingViewController; 14 | @class BookmarksViewController; 15 | @class RecentsViewController; 16 | @class PanVViewController; 17 | @class NowPlayingViewController; 18 | 19 | @interface RootViewController : UITabBarController { 20 | LocalViewController *localViewController; 21 | VideoListViewController *videoListViewController; 22 | SettingViewController *settingViewController; 23 | BookmarksViewController *bookmarksViewController; 24 | RecentsViewController *recentsViewController; 25 | PanVViewController *panVViewController; 26 | NowPlayingViewController *nowPlayingViewController; 27 | } 28 | 29 | @property (nonatomic, retain) LocalViewController *localViewController; 30 | @property (nonatomic, retain) VideoListViewController *videoListViewController; 31 | @property (nonatomic, retain) SettingViewController *settingViewController; 32 | @property (nonatomic, retain) BookmarksViewController *bookmarksViewController; 33 | @property (nonatomic, retain) RecentsViewController *recentsViewController; 34 | @property (nonatomic, retain) PanVViewController *panVViewController; 35 | @property (nonatomic, retain) NowPlayingViewController *nowPlayingViewController; 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /Constants.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | File: Constants.h 4 | Abstract: Common constants across source files (screen coordinate consts, etc.) 5 | 6 | */ 7 | 8 | // these are the various screen placement constants used across all the UIViewControllers 9 | 10 | // padding for margins 11 | #define kLeftMargin 20.0 12 | #define kTopMargin 20.0 13 | #define kRightMargin 20.0 14 | #define kBottomMargin 20.0 15 | #define kTweenMargin 10.0 16 | 17 | // control dimensions 18 | #define kPageControlHeight 20.0 19 | #define kPageControlWidth 160.0 20 | //#define kSliderHeight 7.0 21 | #define kSwitchButtonWidth 94.0 22 | #define kSwitchButtonHeight 27.0 23 | #define kSegmentedControlWidth 110.0 24 | #define kSegmentedControlHeight 27.0 25 | //#define kTextFieldHeight 30.0 26 | #define kSearchBarHeight 40.0 27 | //#define kLabelHeight 20.0 28 | //#define kProgressIndicatorSize 40.0 29 | //#define kToolbarHeight 40.0 30 | //#define kUIProgressBarWidth 160.0 31 | //#define kUIProgressBarHeight 24.0 32 | 33 | // specific font metrics used in our text fields and text views 34 | #define kFontName @"Arial" 35 | #define kTextFieldFontSize 18.0 36 | #define kTextViewFontSize 18.0 37 | 38 | // UITableView row heights 39 | #define kUIRowHeight 50.0 40 | #define kUIRowLabelHeight 22.0 41 | 42 | // table view cell content offsets 43 | #define kCellLeftOffset 20.0 44 | #define kCellTopOffset 12.0 45 | 46 | //accelerometer 47 | #define kAccelerationThreshold 2.0 48 | 49 | enum ControlTableSections 50 | { 51 | kPlayerSection = 0, 52 | kServerSection 53 | }; -------------------------------------------------------------------------------- /Classes/SettingEditCell.m: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | File: SettingEditCell.m 4 | Abstract: 5 | Custom table cell used in the editing view's table. Contains a UITextField for 6 | in-place editing of content. 7 | 8 | */ 9 | 10 | #import "SettingEditCell.h" 11 | 12 | @implementation SettingEditCell 13 | 14 | @synthesize textField; 15 | 16 | - (id)initWithFrame:(CGRect)frame reuseIdentifier:(NSString *)reuseIdentifier { 17 | if (self = [super initWithFrame:frame reuseIdentifier:reuseIdentifier]) { 18 | // Set the frame to CGRectZero as it will be reset in layoutSubviews 19 | textField = [[UITextField alloc] initWithFrame:CGRectZero]; 20 | textField.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter; 21 | textField.font = [UIFont systemFontOfSize:18.0]; 22 | textField.textColor = [UIColor darkGrayColor]; 23 | [self addSubview:textField]; 24 | } 25 | return self; 26 | } 27 | 28 | - (void)dealloc { 29 | // Release allocated resources. 30 | [textField dealloc]; 31 | [super dealloc]; 32 | } 33 | 34 | - (void)layoutSubviews { 35 | // Place the subviews appropriately. 36 | textField.frame = CGRectInset(self.contentView.bounds, 10, 0); 37 | } 38 | 39 | - (void)setSelected:(BOOL)selected animated:(BOOL)animated { 40 | [super setSelected:selected animated:animated]; 41 | // Update text color so that it matches expected selection behavior. 42 | if (selected) { 43 | textField.textColor = [UIColor yellowColor]; 44 | } else { 45 | textField.textColor = [UIColor blueColor]; 46 | } 47 | } 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /Classes/HeadUpView.m: -------------------------------------------------------------------------------- 1 | // 2 | // HeadUpView.m 3 | // PanV 4 | // 5 | // Created by nanotang on 3/21/09. 6 | // Copyright 2009 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "HeadUpView.h" 10 | #import 11 | 12 | 13 | @implementation HeadUpView 14 | 15 | 16 | - (void)fillRoundedRect:(CGRect)rect inContext:(CGContextRef)context 17 | { 18 | //float radius = 5.0f; 19 | 20 | CGContextBeginPath(context); 21 | CGContextSetRGBFillColor(context, r, g, b, 1.0); 22 | //CGContextSetGrayFillColor(context, 0.8, 0.5); 23 | CGContextMoveToPoint(context, CGRectGetMinX(rect) + radius, CGRectGetMinY(rect)); 24 | CGContextAddArc(context, CGRectGetMaxX(rect) - radius, CGRectGetMinY(rect) + radius, radius, 3 * M_PI / 2, 0, 0); 25 | CGContextAddArc(context, CGRectGetMaxX(rect) - radius, CGRectGetMaxY(rect) - radius, radius, 0, M_PI / 2, 0); 26 | CGContextAddArc(context, CGRectGetMinX(rect) + radius, CGRectGetMaxY(rect) - radius, radius, M_PI / 2, M_PI, 0); 27 | CGContextAddArc(context, CGRectGetMinX(rect) + radius, CGRectGetMinY(rect) + radius, radius, M_PI, 3 * M_PI / 2, 0); 28 | 29 | CGContextClosePath(context); 30 | CGContextFillPath(context); 31 | } 32 | 33 | 34 | - (id)initWithFrame:(CGRect)frame 35 | red:(CGFloat)inputRed green:(CGFloat)inputGreen blue:(CGFloat)inputBlue 36 | radius:(CGFloat)inputRadius{ 37 | if (self = [super initWithFrame:frame]) { 38 | // Initialization code 39 | r = inputRed; 40 | g = inputGreen; 41 | b = inputBlue; 42 | radius = inputRadius; 43 | } 44 | return self; 45 | } 46 | 47 | 48 | - (void)drawRect:(CGRect)rect { 49 | // Drawing code 50 | CGRect boxRect = self.bounds; 51 | CGContextRef ctxt = UIGraphicsGetCurrentContext(); 52 | boxRect = CGRectInset(boxRect, 1.0f, 1.0f); 53 | [self fillRoundedRect:boxRect inContext:ctxt]; 54 | self.backgroundColor = [UIColor clearColor]; 55 | } 56 | 57 | 58 | - (void)dealloc { 59 | [super dealloc]; 60 | } 61 | 62 | 63 | @end 64 | -------------------------------------------------------------------------------- /include/vlc_acl.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * vlc_acl.h: interface to the network Access Control List internal API 3 | ***************************************************************************** 4 | * Copyright (C) 2005 Rémi Denis-Courmont 5 | * Copyright (C) 2005 the VideoLAN team 6 | * $Id$ 7 | * 8 | * Authors: Rémi Denis-Courmont 9 | * 10 | * This program is free software; you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License as published by 12 | * the Free Software Foundation; either version 2 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU General Public License 21 | * along with this program; if not, write to the Free Software 22 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. 23 | *****************************************************************************/ 24 | 25 | #ifndef VLC_ACL_H 26 | # define VLC_ACL_H 27 | 28 | #define ACL_Create(a, b) __ACL_Create(VLC_OBJECT(a), b) 29 | #define ACL_Duplicate(a,b) __ACL_Duplicate(VLC_OBJECT(a),b) 30 | 31 | VLC_EXPORT( int, ACL_Check, ( vlc_acl_t *p_acl, const char *psz_ip ) ); 32 | VLC_EXPORT( vlc_acl_t *, __ACL_Create, ( vlc_object_t *p_this, bool b_allow ) LIBVLC_USED ); 33 | VLC_EXPORT( vlc_acl_t *, __ACL_Duplicate, ( vlc_object_t *p_this, const vlc_acl_t *p_acl ) LIBVLC_USED ); 34 | VLC_EXPORT( void, ACL_Destroy, ( vlc_acl_t *p_acl ) ); 35 | 36 | #define ACL_AddHost(a,b,c) ACL_AddNet(a,b,-1,c) 37 | VLC_EXPORT( int, ACL_AddNet, ( vlc_acl_t *p_acl, const char *psz_ip, int i_len, bool b_allow ) ); 38 | VLC_EXPORT( int, ACL_LoadFile, ( vlc_acl_t *p_acl, const char *path ) ); 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /include/vlc_devices.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * vlc_devices.h : Devices handling 3 | ***************************************************************************** 4 | * Copyright (C) 1999-2006 the VideoLAN team 5 | * $Id$ 6 | * 7 | * Authors: Clément Stenac 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation; either version 2 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program; if not, write to the Free Software 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. 22 | *****************************************************************************/ 23 | 24 | #ifndef VLC_DEVICES_H 25 | #define VLC_DEVICES_H 1 26 | 27 | /** 28 | * \file 29 | * This file implements functions, structures for probing devices (DVD, CD, VCD) 30 | */ 31 | 32 | enum 33 | { 34 | DEVICE_CAN_DVD, 35 | DEVICE_CAN_CD, 36 | }; 37 | 38 | enum 39 | { 40 | MEDIA_TYPE_CDDA, 41 | MEDIA_TYPE_VCD, 42 | MEDIA_TYPE_DVD, 43 | }; 44 | 45 | struct device_t 46 | { 47 | int i_capabilities; 48 | int i_media_type; 49 | bool b_seen; 50 | char *psz_uri; 51 | char *psz_name; 52 | }; 53 | 54 | struct device_probe_t 55 | { 56 | VLC_COMMON_MEMBERS; 57 | int i_devices; 58 | device_t **pp_devices; 59 | 60 | probe_sys_t *p_sys; 61 | void ( *pf_run ) ( device_probe_t * ); /** Run function */ 62 | }; 63 | 64 | static inline void device_GetDVD(void) 65 | { 66 | } 67 | 68 | #endif 69 | -------------------------------------------------------------------------------- /include/vlc_main.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * main.h: access to all program variables 3 | * Declaration and extern access to LibVLC instance object. 4 | ***************************************************************************** 5 | * Copyright (C) 1999, 2000, 2001, 2002, 2008 the VideoLAN team 6 | * 7 | * Authors: Vincent Seguin 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation; either version 2 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program; if not, write to the Free Software 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. 22 | *****************************************************************************/ 23 | 24 | /** 25 | * \file 26 | * This file defines libvlc_int_t internal libvlc instance 27 | */ 28 | 29 | TYPEDEF_ARRAY(input_item_t*, input_item_array_t); 30 | 31 | /***************************************************************************** 32 | * libvlc_internal_instance_t 33 | ***************************************************************************** 34 | * This structure is a LibVLC instance, for use by libvlc core and plugins 35 | *****************************************************************************/ 36 | struct libvlc_int_t 37 | { 38 | VLC_COMMON_MEMBERS 39 | 40 | /* Structure storing the action name / key associations */ 41 | const struct hotkey 42 | { 43 | const char *psz_action; 44 | int i_action; 45 | int i_key; 46 | } *p_hotkeys; 47 | }; 48 | 49 | -------------------------------------------------------------------------------- /include/vlc_iso_lang.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * iso_lang.h: function to decode language code (in dvd or a52 for instance). 3 | ***************************************************************************** 4 | * Copyright (C) 1998-2001 the VideoLAN team 5 | * $Id$ 6 | * 7 | * Author: Stéphane Borel 8 | * Arnaud de Bossoreille de Ribou 9 | * 10 | * This program is free software; you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License as published by 12 | * the Free Software Foundation; either version 2 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU General Public License 21 | * along with this program; if not, write to the Free Software 22 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. 23 | *****************************************************************************/ 24 | 25 | /** 26 | * \file 27 | * This file defines functions and structures for iso639 language codes 28 | */ 29 | 30 | struct iso639_lang_t 31 | { 32 | const char * psz_eng_name; /* Description in English */ 33 | const char * psz_native_name; /* Description in native language */ 34 | const char * psz_iso639_1; /* ISO-639-1 (2 characters) code */ 35 | const char * psz_iso639_2T; /* ISO-639-2/T (3 characters) English code */ 36 | const char * psz_iso639_2B; /* ISO-639-2/B (3 characters) native code */ 37 | }; 38 | 39 | #if defined( __cplusplus ) 40 | extern "C" { 41 | #endif 42 | VLC_EXPORT( const iso639_lang_t *, GetLang_1, ( const char * ) ); 43 | VLC_EXPORT( const iso639_lang_t *, GetLang_2T, ( const char * ) ); 44 | VLC_EXPORT( const iso639_lang_t *, GetLang_2B, ( const char * ) ); 45 | #if defined( __cplusplus ) 46 | } 47 | #endif 48 | 49 | -------------------------------------------------------------------------------- /include/vlc/vlc.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * vlc.h: global header for libvlc 3 | ***************************************************************************** 4 | * Copyright (C) 1998-2008 the VideoLAN team 5 | * $Id: 0f34b57f3f53f2bfdaad3fdc544752c902d37461 $ 6 | * 7 | * Authors: Vincent Seguin 8 | * Samuel Hocevar 9 | * Gildas Bazin 10 | * Derk-Jan Hartman 11 | * Pierre d'Herbemont 12 | * 13 | * This program is free software; you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation; either version 2 of the License, or 16 | * (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software 25 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. 26 | *****************************************************************************/ 27 | 28 | #ifndef VLC_VLC_H 29 | #define VLC_VLC_H 1 30 | 31 | /** 32 | * \file 33 | * This file defines libvlc new external API 34 | */ 35 | 36 | # ifdef __cplusplus 37 | extern "C" { 38 | # endif 39 | 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | #include 48 | #include 49 | #include 50 | #include 51 | #include 52 | 53 | # ifdef __cplusplus 54 | } 55 | # endif 56 | 57 | #endif /* _VLC_VLC_H */ 58 | -------------------------------------------------------------------------------- /Classes/VideoNode.m: -------------------------------------------------------------------------------- 1 | // 2 | // VideoNode.m 3 | // VideoStreaming 4 | // 5 | // Created by ZodTTD & Derek Tse on 08年10月18日. 6 | // Copyright 2008 HKUST. All rights reserved. 7 | // 8 | 9 | #import "VideoNode.h" 10 | 11 | 12 | @implementation VideoNode 13 | 14 | @synthesize title = _title; 15 | @synthesize performer = _performer; 16 | @synthesize seriesName = _seriesName; 17 | @synthesize videoPath = _videoPath; 18 | @synthesize imagePath = _imagePath; 19 | @synthesize cellImagePath = _cellImagePath; 20 | @synthesize serverPath = _serverPath; 21 | 22 | - (void) dealloc 23 | { 24 | [self.title release]; 25 | [self.performer release]; 26 | [self.seriesName release]; 27 | [self.videoPath release]; 28 | [self.imagePath release]; 29 | [self.serverPath release]; 30 | [self.cellImagePath release]; 31 | [super dealloc]; 32 | } 33 | // 34 | //-(id) initWithVideoNode:(VideoNode*) inputNode 35 | //{ 36 | // self = [super init]; 37 | // if (self) 38 | // { 39 | // self.title = inputNode.title; 40 | // self.performer = inputNode.performer; 41 | // self.seriesName = inputNode.seriesName; 42 | // } 43 | // return self; 44 | //} 45 | // 46 | //- (id)copyWithZone:(NSZone *)zone 47 | //{ 48 | // VideoNode *copy = [[[self class] allocWithZone: zone] 49 | // initWithVideoNode:self]; 50 | // 51 | // return copy; 52 | //} 53 | - (UIImage *)flipperImageForVideoDetailViewNavigationItem { 54 | 55 | // return a 30 x 30 image that is a reduced version 56 | // of the AtomicElementTileView content 57 | // this is used to display the flipper button in the navigation bar 58 | CGSize itemSize=CGSizeMake(30.0,30.0); 59 | CGRect elementSymbolRectangle = CGRectMake(0,0, itemSize.width, itemSize.height); 60 | UIGraphicsBeginImageContext(itemSize); 61 | 62 | // retrieve the image url 63 | NSString* tempURL = [NSString stringWithFormat:@"http://%@", self.serverPath]; 64 | NSURL *url = [NSURL URLWithString:[tempURL stringByAppendingString:self.cellImagePath]]; 65 | 66 | // create the video image 67 | UIImage *videoImage = [UIImage imageWithData:[NSData dataWithContentsOfURL:url]]; 68 | [videoImage drawInRect:elementSymbolRectangle]; 69 | 70 | // obtain the image context 71 | UIImage *theImage=UIGraphicsGetImageFromCurrentImageContext(); 72 | UIGraphicsEndImageContext(); 73 | return theImage; 74 | } 75 | 76 | @end 77 | -------------------------------------------------------------------------------- /include/vlc_strings.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * vlc_strings.h: String functions 3 | ***************************************************************************** 4 | * Copyright (C) 2006 the VideoLAN team 5 | * $Id$ 6 | * 7 | * Authors: Antoine Cellerier 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation; either version 2 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program; if not, write to the Free Software 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. 22 | *****************************************************************************/ 23 | 24 | #ifndef VLC_STRINGS_H 25 | #define VLC_STRINGS_H 1 26 | 27 | /** 28 | * \file 29 | * This file defines functions and structures handling misc strings 30 | */ 31 | 32 | /** 33 | * \defgroup strings Strings 34 | * @{ 35 | */ 36 | 37 | VLC_EXPORT( void, resolve_xml_special_chars, ( char *psz_value ) ); 38 | VLC_EXPORT( char *, convert_xml_special_chars, ( const char *psz_content ) ); 39 | 40 | VLC_EXPORT( char *, vlc_b64_encode_binary, ( const uint8_t *, size_t ) ); 41 | VLC_EXPORT( char *, vlc_b64_encode, ( const char * ) ); 42 | 43 | VLC_EXPORT( size_t, vlc_b64_decode_binary_to_buffer, ( uint8_t *p_dst, size_t i_dst_max, const char *psz_src ) ); 44 | VLC_EXPORT( size_t, vlc_b64_decode_binary, ( uint8_t **pp_dst, const char *psz_src ) ); 45 | VLC_EXPORT( char *, vlc_b64_decode, ( const char *psz_src ) ); 46 | 47 | VLC_EXPORT( char *, str_format_time, ( const char * ) ); 48 | #define str_format_meta( a, b ) __str_format_meta( VLC_OBJECT( a ), b ) 49 | VLC_EXPORT( char *, __str_format_meta, ( vlc_object_t *, const char * ) ); 50 | #define str_format( a, b ) __str_format( VLC_OBJECT( a ), b ) 51 | VLC_EXPORT( char *, __str_format, ( vlc_object_t *, const char * ) ); 52 | 53 | VLC_EXPORT( char *, filename_sanitize, ( const char * ) ) LIBVLC_USED; 54 | VLC_EXPORT( void, path_sanitize, ( char * ) ); 55 | 56 | /** 57 | * @} 58 | */ 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /include/vlc_update.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * vlc_update.h: VLC update download 3 | ***************************************************************************** 4 | * Copyright © 2005-2007 the VideoLAN team 5 | * $Id$ 6 | * 7 | * Authors: Antoine Cellerier 8 | * Rafaël Carré 9 | * 10 | * This program is free software; you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License as published by 12 | * the Free Software Foundation; either release 2 of the License, or 13 | * (at your option) any later release. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU General Public License 21 | * along with this program; if not, write to the Free Software 22 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. 23 | *****************************************************************************/ 24 | 25 | #ifndef VLC_UPDATE_H 26 | #define VLC_UPDATE_H 27 | 28 | /** 29 | * \file 30 | * This file defines update API in vlc 31 | */ 32 | 33 | /** 34 | * \defgroup update Update 35 | * 36 | * @{ 37 | */ 38 | 39 | #ifdef UPDATE_CHECK 40 | 41 | /** 42 | * Describes an update VLC release number 43 | */ 44 | struct update_release_t 45 | { 46 | int i_major; ///< Version major 47 | int i_minor; ///< Version minor 48 | int i_revision; ///< Version revision 49 | unsigned char extra;///< Version extra 50 | char* psz_url; ///< Download URL 51 | char* psz_desc; ///< Release description 52 | }; 53 | 54 | #endif /* UPDATE_CHECK */ 55 | 56 | typedef struct update_release_t update_release_t; 57 | 58 | #define update_New( a ) __update_New( VLC_OBJECT( a ) ) 59 | 60 | VLC_EXPORT( update_t *, __update_New, ( vlc_object_t * ) ); 61 | VLC_EXPORT( void, update_Delete, ( update_t * ) ); 62 | VLC_EXPORT( void, update_Check, ( update_t *, void (*callback)( void*, bool ), void * ) ); 63 | VLC_EXPORT( bool, update_NeedUpgrade, ( update_t * ) ); 64 | VLC_EXPORT( void, update_Download, ( update_t *, const char* ) ); 65 | VLC_EXPORT( update_release_t*, update_GetRelease, ( update_t * ) ); 66 | VLC_EXPORT( void, update_WaitDownload, ( update_t * ) ); 67 | 68 | /** 69 | * @} 70 | */ 71 | 72 | #endif /* _VLC_UPDATE_H */ 73 | -------------------------------------------------------------------------------- /Classes/CoverFlowView.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import "CoverFlowView.h" 3 | 4 | @implementation CoverFlowView 5 | @synthesize label; 6 | @synthesize phimg; 7 | @synthesize host; 8 | @synthesize cfLayer; 9 | 10 | - (CoverFlowView *) initWithFrame: (CGRect) aRect andCount: (int) count 11 | { 12 | self = [super initWithFrame:aRect]; //initialize super class 13 | self.cfLayer = [[UICoverFlowLayer alloc] initWithFrame:[[UIScreen mainScreen] bounds] numberOfCovers:count numberOfPlaceholders:1]; 14 | [[self layer] addSublayer:(CALayer *)self.cfLayer]; 15 | 16 | // Add the placeholder (image stand-in) layer 17 | CGRect phrect = CGRectMake(0.0f, 0.0f, 70.0f, 70.0f); 18 | self.phimg = [[UIImageView alloc] initWithFrame:phrect]; 19 | [self.cfLayer setPlaceholderImage: [self.phimg layer] atPlaceholderIndex:0]; 20 | 21 | // Add its info (label) layer, at the bottom of CoverFLow 22 | self.label = [[UILabel alloc] init]; 23 | [self.label setTextAlignment:UITextAlignmentCenter]; 24 | [self.label setFont:[UIFont boldSystemFontOfSize:20.0f]]; 25 | [self.label setBackgroundColor:[UIColor colorWithRed:0.0f green:0.0f blue:0.0f alpha:0.0f]]; 26 | [self.label setTextColor:[UIColor colorWithRed:1.0f green:1.0f blue:1.0f alpha:0.75f]]; 27 | [self.label setNumberOfLines:2]; 28 | [self.label setLineBreakMode:UILineBreakModeWordWrap]; 29 | 30 | UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation]; 31 | 32 | [self.cfLayer setDisplayedOrientation:orientation animate:YES]; 33 | 34 | [self.cfLayer setInfoLayer:[self.label layer]]; 35 | 36 | return self; 37 | } 38 | 39 | - (void) touchesBegan:(NSSet*)touches withEvent:(UIEvent*)event 40 | { 41 | [self.cfLayer dragFlow:0 atPoint:[[touches anyObject] locationInView:self]]; 42 | } 43 | 44 | - (void) touchesMoved:(NSSet*)touches withEvent:(UIEvent*)event 45 | { 46 | [self.cfLayer dragFlow:1 atPoint:[[touches anyObject] locationInView:self]]; 47 | } 48 | 49 | - (void) touchesEnded:(NSSet*)touches withEvent:(UIEvent*)event 50 | { 51 | if ([[touches anyObject] tapCount] == 2) 52 | { 53 | if (self.host) [self.host doubleTapCallback]; 54 | return; 55 | } 56 | 57 | [self.cfLayer dragFlow:2 atPoint:[[touches anyObject] locationInView:self]]; 58 | } 59 | 60 | - (void) flipSelectedCover 61 | { 62 | [self.cfLayer flipSelectedCover]; 63 | } 64 | 65 | - (BOOL) ignoresMouseEvents 66 | { 67 | return NO; 68 | } 69 | 70 | - (void) tick 71 | { 72 | [self.cfLayer displayTick]; 73 | } 74 | 75 | - (void) dealloc 76 | { 77 | if (self.host) [self.host release]; 78 | [self.label release]; 79 | [self.phimg release]; 80 | [self.cfLayer release]; 81 | [super dealloc]; 82 | } 83 | @end 84 | 85 | -------------------------------------------------------------------------------- /Classes/UICoverFlowLayer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by class-dump 3.1.2. 3 | * 4 | * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2007 by Steve Nygard. 5 | */ 6 | 7 | // #import "CALayer.h" 8 | 9 | @interface UICoverFlowLayer : NSObject // CALayer 10 | { 11 | void *_private; 12 | } 13 | 14 | - (id)initWithFrame:(struct CGRect)fp8 numberOfCovers:(unsigned int)fp24 numberOfPlaceholders:(unsigned int)fp28; 15 | - (unsigned int)numberOfCovers; 16 | - (unsigned int)numberOfPlaceholders; 17 | - (void)dealloc; 18 | - (void)setDelegate:(id)fp8; 19 | - (void)setPlaceholderImage:(void *)fp8 atPlaceholderIndex:(unsigned int)fp12; 20 | - (void)setPlaceholderIndicesForCovers:(unsigned int *)fp8; 21 | - (void)_prefetch:(unsigned int)fp8 atIndex:(unsigned int)fp12; 22 | - (void)_requestBatch; 23 | - (void)_requestImageAtIndex:(int)fp8 quality:(unsigned int)fp12; 24 | - (void)_requestImageAtIndex:(int)fp8; 25 | - (void)_notifySelectionDidChange; 26 | - (void)transitionIn:(float)fp8; 27 | - (void)transitionOut:(float)fp8; 28 | - (void)transition:(unsigned int)fp8 withCoverFrame:(struct CGRect)fp12; 29 | - (void)transitionIn:(float)fp8 fromFrame:(struct CGRect)fp12; 30 | - (void)transitionOut:(float)fp8 toFrame:(struct CGRect)fp12; 31 | - (void)setDisplayedOrientation:(int)fp8 animate:(BOOL)fp12; 32 | - (void)setInfoLayer:(id)fp8; 33 | - (void)setImage:(void *)fp8 atIndex:(unsigned int)fp12 type:(unsigned int)fp16; 34 | - (void)setImage:(void *)fp8 atIndex:(unsigned int)fp12 type:(unsigned int)fp16 imageSubRect:(struct CGRect)fp20; 35 | - (void)setImage:(void *)fp8 atIndex:(unsigned int)fp12; 36 | - (unsigned int)indexOfSelectedCover; 37 | - (unsigned int)_coverAtScreenPosition:(struct CGPoint)fp8; 38 | - (void)_recycleLayer:(int)fp8 to:(int)fp12; 39 | - (void)_setNewSelectedIndex:(int)fp8; 40 | - (void)_updateTick; 41 | - (void)displayTick; 42 | - (void)dragFlow:(unsigned int)fp8 atPoint:(struct CGPoint)fp12; 43 | - (void)selectCoverAtIndex:(unsigned int)fp8; 44 | - (void)selectCoverAtOffset:(int)fp8; 45 | - (unsigned int)coverIndexAtPosition:(float)fp8; 46 | - (void)_setupFlippedCoverLayer:(id)fp8; 47 | - (void)flipSelectedCover; 48 | - (int)benchmarkTick; 49 | - (void)benchmarkHeartbeatLongScrub; 50 | - (void)benchmarkHeartbeatShortScrub; 51 | - (void)benchmarkHeartbeatScrubAndWait; 52 | - (void)benchmarkTightLoop; 53 | - (void)benchmarkTightLoopScrub; 54 | - (BOOL)benchmarkLoadScrub; 55 | - (BOOL)benchmarkImageManager:(void *)fp8; 56 | - (void)benchmarkSetEnv; 57 | - (void)benchmarkMode:(int)fp8; 58 | - (void)benchmarkTickMode:(int)fp8; 59 | - (void)benchmarkImageMode:(int)fp8; 60 | - (void)benchmarkPerformanceLog:(BOOL)fp8; 61 | - (void)benchmarkTightLoopTime:(unsigned int)fp8; 62 | - (void)benchmarkLongScrubSpeed:(float)fp8; 63 | - (void)benchmarkSkipImageLoad:(BOOL)fp8; 64 | 65 | @end 66 | 67 | -------------------------------------------------------------------------------- /include/vlc_codec_synchro.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * vlc_codec_synchro.h: frame-dropping structures 3 | ***************************************************************************** 4 | * Copyright (C) 1999-2005 the VideoLAN team 5 | * $Id$ 6 | * 7 | * Authors: Christophe Massiot 8 | * Jean-Marc Dressler 9 | * Stéphane Borel 10 | * 11 | * This program is free software; you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation; either version 2 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License 22 | * along with this program; if not, write to the Free Software 23 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. 24 | *****************************************************************************/ 25 | 26 | /***************************************************************************** 27 | * decoder_synchro_t : timers for the video synchro 28 | *****************************************************************************/ 29 | /* Read the discussion on top of decoder_synchro.c for more information. */ 30 | /* Pictures types */ 31 | #define I_CODING_TYPE 1 32 | #define P_CODING_TYPE 2 33 | #define B_CODING_TYPE 3 34 | #define D_CODING_TYPE 4 /* MPEG-1 ONLY */ 35 | /* other values are reserved */ 36 | 37 | /***************************************************************************** 38 | * Prototypes 39 | *****************************************************************************/ 40 | VLC_EXPORT( decoder_synchro_t *, decoder_SynchroInit, ( decoder_t *, int ) LIBVLC_USED ); 41 | VLC_EXPORT( void, decoder_SynchroRelease, ( decoder_synchro_t * ) ); 42 | VLC_EXPORT( void, decoder_SynchroReset, ( decoder_synchro_t * ) ); 43 | VLC_EXPORT( bool, decoder_SynchroChoose, ( decoder_synchro_t *, int, int, bool ) ); 44 | VLC_EXPORT( void, decoder_SynchroTrash, ( decoder_synchro_t * ) ); 45 | VLC_EXPORT( void, decoder_SynchroDecode, ( decoder_synchro_t * ) ); 46 | VLC_EXPORT( void, decoder_SynchroEnd, ( decoder_synchro_t *, int, bool ) ); 47 | VLC_EXPORT( mtime_t, decoder_SynchroDate, ( decoder_synchro_t * ) LIBVLC_USED ); 48 | VLC_EXPORT( void, decoder_SynchroNewPicture, ( decoder_synchro_t *, int, int, mtime_t, mtime_t, bool ) ); 49 | 50 | -------------------------------------------------------------------------------- /include/vlc_window.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * vlc_window.h: Embedded video output window 3 | ***************************************************************************** 4 | * Copyright (C) 2008 Rémi Denis-Courmont 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. 19 | *****************************************************************************/ 20 | 21 | #ifndef LIBVLCCORE_WINDOW_H 22 | # define LIBVLCCORE_WINDOW_H 1 23 | 24 | /** 25 | * \file 26 | * This file defines functions and structures for output windows 27 | */ 28 | 29 | # include 30 | 31 | typedef struct vout_window_t vout_window_t; 32 | typedef struct vout_window_sys_t vout_window_sys_t; 33 | 34 | struct vout_window_t 35 | { 36 | VLC_COMMON_MEMBERS 37 | 38 | module_t *module; 39 | vout_thread_t *vout; 40 | union 41 | { 42 | void *hwnd; /* Win32 window handle */ 43 | uint32_t xid; /* X11 window ID */ 44 | } handle; 45 | vout_window_sys_t *p_sys; /* window provider private data */ 46 | 47 | unsigned width; /* pixels width */ 48 | unsigned height; /* pixels height */ 49 | int pos_x; /* horizontal position hint */ 50 | int pos_y; /* vertical position hint */ 51 | 52 | int (*control) (struct vout_window_t *, int, va_list); 53 | }; 54 | 55 | VLC_EXPORT( vout_window_t *, vout_RequestWindow, ( vout_thread_t *, const char *, int *, int *, unsigned int *, unsigned int * ) ); 56 | VLC_EXPORT( void, vout_ReleaseWindow, ( vout_window_t * ) ); 57 | VLC_EXPORT( int, vout_ControlWindow, ( vout_window_t *, int, va_list ) ); 58 | 59 | static inline vout_window_t * 60 | vout_RequestXWindow (vout_thread_t *vout, 61 | int *x, int *y, unsigned *w, unsigned *h) 62 | { 63 | return vout_RequestWindow (vout, "xwindow", x, y, w, h); 64 | } 65 | 66 | static inline vout_window_t * 67 | vout_RequestHWND (vout_thread_t *vout, 68 | int *x, int *y, unsigned *w, unsigned *h) 69 | { 70 | return vout_RequestWindow (vout, "hwnd", x, y, w, h); 71 | } 72 | 73 | #endif /* !LIBVLCCORE_WINDOW_H */ 74 | -------------------------------------------------------------------------------- /include/vlc_md5.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * vlc_md5.h: MD5 hash 3 | ***************************************************************************** 4 | * Copyright (C) 2004-2005 the VideoLAN team 5 | * $Id$ 6 | * 7 | * Authors: Jon Lech Johansen 8 | * Sam Hocevar 9 | * 10 | * This program is free software; you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License as published by 12 | * the Free Software Foundation; either version 2 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU General Public License 21 | * along with this program; if not, write to the Free Software 22 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. 23 | *****************************************************************************/ 24 | 25 | #ifndef VLC_MD5_H 26 | # define VLC_MD5_H 27 | 28 | /** 29 | * \file 30 | * This file defines functions and structures for handling md5 checksums 31 | */ 32 | 33 | /***************************************************************************** 34 | * md5_s: MD5 message structure 35 | ***************************************************************************** 36 | * This structure stores the static information needed to compute an MD5 37 | * hash. It has an extra data buffer to allow non-aligned writes. 38 | *****************************************************************************/ 39 | struct md5_s 40 | { 41 | uint64_t i_bits; /* Total written bits */ 42 | uint32_t p_digest[4]; /* The MD5 digest */ 43 | uint32_t p_data[16]; /* Buffer to cache non-aligned writes */ 44 | }; 45 | 46 | VLC_EXPORT(void, InitMD5, ( struct md5_s * ) ); 47 | VLC_EXPORT(void, AddMD5, ( struct md5_s *, const void *, size_t ) ); 48 | VLC_EXPORT(void, EndMD5, ( struct md5_s * ) ); 49 | 50 | /** 51 | * Returns a char representation of the md5 hash, as shown by UNIX md5 or 52 | * md5sum tools. 53 | */ 54 | static inline char * psz_md5_hash( struct md5_s *md5_s ) 55 | { 56 | char *psz = malloc( 33 ); /* md5 string is 32 bytes + NULL character */ 57 | if( !psz ) return NULL; 58 | 59 | int i; 60 | for ( i = 0; i < 4; i++ ) 61 | { 62 | sprintf( &psz[8*i], "%02x%02x%02x%02x", 63 | md5_s->p_digest[i] & 0xff, 64 | ( md5_s->p_digest[i] >> 8 ) & 0xff, 65 | ( md5_s->p_digest[i] >> 16 ) & 0xff, 66 | md5_s->p_digest[i] >> 24 67 | ); 68 | } 69 | psz[32] = '\0'; 70 | 71 | return psz; 72 | } 73 | 74 | #endif 75 | -------------------------------------------------------------------------------- /Classes/SettingPlayerCell.m: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | File: SettingPlayerCell.m 4 | Abstract: UITableView utility cell that holds a UIView. 5 | 6 | */ 7 | 8 | #import "SettingPlayerCell.h" 9 | #import "Constants.h" 10 | 11 | #define kCellHeight 25.0 12 | 13 | // cell identifier for this custom cell 14 | NSString *kDisplayCell_ID = @"SettingPlayerCell_ID"; 15 | 16 | @implementation SettingPlayerCell 17 | 18 | @synthesize nameLabel; 19 | @synthesize view; 20 | 21 | - (id)initWithFrame:(CGRect)aRect reuseIdentifier:(NSString *)identifier 22 | { 23 | if (self = [super initWithFrame:aRect reuseIdentifier:identifier]) 24 | { 25 | // turn off selection use 26 | self.selectionStyle = UITableViewCellSelectionStyleNone; 27 | 28 | nameLabel = [[UILabel alloc] initWithFrame:aRect]; 29 | nameLabel.backgroundColor = [UIColor clearColor]; 30 | nameLabel.opaque = NO; 31 | nameLabel.textColor = [UIColor blackColor]; 32 | nameLabel.highlightedTextColor = [UIColor blackColor]; 33 | nameLabel.font = [UIFont boldSystemFontOfSize:14]; 34 | [self.contentView addSubview:nameLabel]; 35 | } 36 | return self; 37 | } 38 | 39 | - (void)setView:(UIView *)inView 40 | { 41 | if (view) 42 | [view removeFromSuperview]; 43 | view = inView; 44 | [self.view retain]; 45 | [self.contentView addSubview:inView]; 46 | 47 | [self layoutSubviews]; 48 | } 49 | 50 | - (void)layoutSubviews 51 | { 52 | [super layoutSubviews]; 53 | CGRect contentRect = [self.contentView bounds]; 54 | 55 | // In this example we will never be editing, but this illustrates the appropriate pattern 56 | CGRect frame = CGRectMake(contentRect.origin.x + kCellLeftOffset, kCellTopOffset, contentRect.size.width, kCellHeight); 57 | nameLabel.frame = frame; 58 | 59 | if ([view isKindOfClass:[UIPageControl class]]) 60 | { 61 | // special case UIPageControl since its width changes after its creation 62 | CGRect frame = self.view.frame; 63 | frame.size.width = kPageControlWidth; 64 | self.view.frame = frame; 65 | } 66 | 67 | CGRect uiFrame = CGRectMake(contentRect.size.width - self.view.bounds.size.width - kCellLeftOffset, 68 | round((contentRect.size.height - self.view.bounds.size.height) / 2.0), 69 | self.view.bounds.size.width, 70 | self.view.bounds.size.height); 71 | 72 | if ([view isKindOfClass:[UISegmentedControl class]]) { 73 | //UISegmentedControl: shift to center 74 | uiFrame.origin.x += round((kSegmentedControlWidth - kSwitchButtonWidth) / 2.0); // to find the width difference, so as to shift half of the difference 75 | } 76 | 77 | view.frame = uiFrame; 78 | } 79 | 80 | - (void)dealloc 81 | { 82 | [nameLabel dealloc]; 83 | [view dealloc]; 84 | 85 | [super dealloc]; 86 | } 87 | 88 | - (void)setSelected:(BOOL)selected animated:(BOOL)animated 89 | { 90 | [super setSelected:selected animated:animated]; 91 | 92 | // when the selected state changes, set the highlighted state of the lables accordingly 93 | nameLabel.highlighted = selected; 94 | } 95 | 96 | @end 97 | -------------------------------------------------------------------------------- /include/vlc_tls.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * tls.c: Transport Layer Security API 3 | ***************************************************************************** 4 | * Copyright (C) 2004-2007 the VideoLAN team 5 | * $Id$ 6 | * 7 | * Authors: Rémi Denis-Courmont 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation; either version 2 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program; if not, write to the Free Software 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. 22 | *****************************************************************************/ 23 | 24 | #ifndef VLC_TLS_H 25 | # define VLC_TLS_H 26 | 27 | /** 28 | * \file 29 | * This file defines Transport Layer Security API (TLS) in vlc 30 | */ 31 | 32 | # include 33 | 34 | typedef struct tls_server_sys_t tls_server_sys_t; 35 | 36 | struct tls_server_t 37 | { 38 | VLC_COMMON_MEMBERS 39 | 40 | module_t *p_module; 41 | tls_server_sys_t *p_sys; 42 | 43 | int (*pf_add_CA) ( tls_server_t *, const char * ); 44 | int (*pf_add_CRL) ( tls_server_t *, const char * ); 45 | 46 | tls_session_t * (*pf_open) ( tls_server_t * ); 47 | void (*pf_close) ( tls_server_t *, tls_session_t * ); 48 | }; 49 | 50 | typedef struct tls_session_sys_t tls_session_sys_t; 51 | 52 | struct tls_session_t 53 | { 54 | VLC_COMMON_MEMBERS 55 | 56 | module_t *p_module; 57 | tls_session_sys_t *p_sys; 58 | 59 | struct virtual_socket_t sock; 60 | void (*pf_set_fd) ( tls_session_t *, int ); 61 | int (*pf_handshake) ( tls_session_t * ); 62 | }; 63 | 64 | 65 | tls_server_t *tls_ServerCreate (vlc_object_t *, const char *, const char *); 66 | void tls_ServerDelete (tls_server_t *); 67 | int tls_ServerAddCA (tls_server_t *srv, const char *path); 68 | int tls_ServerAddCRL (tls_server_t *srv, const char *path); 69 | 70 | tls_session_t *tls_ServerSessionPrepare (tls_server_t *); 71 | int tls_ServerSessionHandshake (tls_session_t *, int fd); 72 | int tls_SessionContinueHandshake (tls_session_t *); 73 | void tls_ServerSessionClose (tls_session_t *); 74 | 75 | VLC_EXPORT( tls_session_t *, tls_ClientCreate, ( vlc_object_t *, int, const char * ) ); 76 | VLC_EXPORT( void, tls_ClientDelete, ( tls_session_t * ) ); 77 | 78 | /* NOTE: It is assumed that a->sock.p_sys = a */ 79 | # define tls_Send( a, b, c ) (((tls_session_t *)a)->sock.pf_send (a, b, c )) 80 | 81 | # define tls_Recv( a, b, c ) (((tls_session_t *)a)->sock.pf_recv (a, b, c )) 82 | 83 | #endif 84 | -------------------------------------------------------------------------------- /include/vlc_vod.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * vlc_vod.h: interface for VoD server modules 3 | ***************************************************************************** 4 | * Copyright (C) 2000, 2001 the VideoLAN team 5 | * $Id$ 6 | * 7 | * Author: Gildas Bazin 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation; either version 2 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program; if not, write to the Free Software 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. 22 | *****************************************************************************/ 23 | 24 | #ifndef VLC_VOD_H 25 | #define VLC_VOD_H 1 26 | 27 | /** 28 | * \file 29 | * This file defines an interface for VOD server modules in vlc 30 | */ 31 | 32 | /** 33 | * \defgroup server Video On Demand (VOD) 34 | * Video On Demand (VOD) functionality is provided from VLM. 35 | * @{ 36 | */ 37 | 38 | struct vod_t 39 | { 40 | VLC_COMMON_MEMBERS 41 | 42 | /* Module properties */ 43 | module_t *p_module; 44 | vod_sys_t *p_sys; 45 | 46 | vod_media_t * (*pf_media_new) ( vod_t *, const char *, input_item_t * ); 47 | void (*pf_media_del) ( vod_t *, vod_media_t * ); 48 | int (*pf_media_add_es)( vod_t *, vod_media_t *, es_format_t * ); 49 | void (*pf_media_del_es)( vod_t *, vod_media_t *, es_format_t * ); 50 | 51 | /* Owner properties */ 52 | int (*pf_media_control) ( void *, vod_media_t *, const char *, int, va_list ); 53 | void *p_data; 54 | }; 55 | 56 | static inline int vod_MediaControl( vod_t *p_vod, vod_media_t *p_media, 57 | const char *psz_id, int i_query, ... ) 58 | { 59 | va_list args; 60 | int i_result; 61 | 62 | if( !p_vod->pf_media_control ) return VLC_EGENERIC; 63 | 64 | va_start( args, i_query ); 65 | i_result = p_vod->pf_media_control( p_vod->p_data, p_media, psz_id, 66 | i_query, args ); 67 | va_end( args ); 68 | return i_result; 69 | } 70 | 71 | enum vod_query_e 72 | { 73 | VOD_MEDIA_PLAY, /* arg1= char * res= */ 74 | VOD_MEDIA_PAUSE, /* arg1= res= */ 75 | VOD_MEDIA_STOP, /* arg1= res=can fail */ 76 | VOD_MEDIA_SEEK, /* arg1= double res= */ 77 | VOD_MEDIA_REWIND, /* arg1= double res= */ 78 | VOD_MEDIA_FORWARD, /* arg1= double res= */ 79 | }; 80 | 81 | /**}*/ 82 | 83 | #endif 84 | -------------------------------------------------------------------------------- /Classes/SettingServerCell.m: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | File: SettingServerCell.m 4 | Abstract: 5 | Custom table cell used in the main view's table. Capable of displaying in two 6 | modes - a "type:name" mode for existing 7 | data and a "prompt" mode when used as a placeholder for data creation. 8 | 9 | */ 10 | 11 | #import "SettingServerCell.h" 12 | 13 | @implementation SettingServerCell 14 | 15 | //@synthesize type, 16 | @synthesize name, prompt, promptMode; 17 | 18 | - (id)initWithFrame:(CGRect)frame reuseIdentifier:(NSString *)reuseIdentifier { 19 | if (self = [super initWithFrame:frame reuseIdentifier:reuseIdentifier]) { 20 | // Initialize the labels, their fonts, colors, alignment, and background color. 21 | name = [[UILabel alloc] initWithFrame:CGRectZero]; 22 | name.font = [UIFont boldSystemFontOfSize:14]; 23 | name.backgroundColor = [UIColor clearColor]; 24 | prompt = [[UILabel alloc] initWithFrame:CGRectZero]; 25 | prompt.font = [UIFont boldSystemFontOfSize:12]; 26 | prompt.textColor = [UIColor darkGrayColor]; 27 | prompt.backgroundColor = [UIColor clearColor]; 28 | 29 | // Add the labels to the content view of the cell. 30 | 31 | // Important: although UITableViewCell inherits from UIView, you should add subviews to its content view 32 | // rather than directly to the cell so that they will be positioned appropriately as the cell transitions 33 | // into and out of editing mode. 34 | 35 | [self.contentView addSubview:name]; 36 | [self.contentView addSubview:prompt]; 37 | // self.autoresizesSubviews = YES; 38 | } 39 | return self; 40 | } 41 | 42 | - (void)dealloc { 43 | [name dealloc]; 44 | [prompt dealloc]; 45 | [super dealloc]; 46 | } 47 | 48 | // Setting the prompt mode to YES hides the type/name labels and shows the prompt label. 49 | - (void)setPromptMode:(BOOL)flag { 50 | if (flag) { 51 | name.hidden = YES; 52 | prompt.hidden = NO; 53 | } else { 54 | name.hidden = NO; 55 | prompt.hidden = YES; 56 | } 57 | } 58 | 59 | - (void)layoutSubviews { 60 | [super layoutSubviews]; 61 | // Start with a rect that is inset from the content view by 10 pixels on all sides. 62 | CGRect baseRect = CGRectInset(self.contentView.bounds, 10, 10); 63 | CGRect rect = baseRect; 64 | rect.origin.x += 15; 65 | // Position each label with a modified version of the base rect. 66 | prompt.frame = rect; 67 | rect.origin.x += 20; 68 | rect.size.width = baseRect.size.width - 40; 69 | name.frame = rect; 70 | } 71 | 72 | // Update the text color of each label when entering and exiting selected mode. 73 | - (void)setSelected:(BOOL)selected animated:(BOOL)animated { 74 | [super setSelected:selected animated:animated]; 75 | if (selected) { 76 | name.textColor = [UIColor whiteColor]; 77 | prompt.textColor = [UIColor whiteColor]; 78 | } else { 79 | name.textColor = [UIColor blackColor]; 80 | prompt.textColor = [UIColor darkGrayColor]; 81 | } 82 | } 83 | 84 | @end 85 | -------------------------------------------------------------------------------- /include/vlc_modules.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * modules.h : Module descriptor and load functions 3 | ***************************************************************************** 4 | * Copyright (C) 2001 the VideoLAN team 5 | * $Id$ 6 | * 7 | * Authors: Samuel Hocevar 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation; either version 2 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program; if not, write to the Free Software 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. 22 | *****************************************************************************/ 23 | 24 | /** 25 | * \file 26 | * This file defines functions for modules in vlc 27 | */ 28 | 29 | /***************************************************************************** 30 | * Exported functions. 31 | *****************************************************************************/ 32 | 33 | #define module_need(a,b,c,d) __module_need(VLC_OBJECT(a),b,c,d) 34 | VLC_EXPORT( module_t *, __module_need, ( vlc_object_t *, const char *, const char *, bool ) ); 35 | #define module_unneed(a,b) __module_unneed(VLC_OBJECT(a),b) 36 | VLC_EXPORT( void, __module_unneed, ( vlc_object_t *, module_t * ) ); 37 | VLC_EXPORT( bool, module_exists, (const char *) ); 38 | VLC_EXPORT( module_t *, module_find, (const char *) ); 39 | 40 | VLC_EXPORT( module_config_t *, module_config_get, ( const module_t *, unsigned * ) ); 41 | VLC_EXPORT( void, module_config_free, ( module_config_t * ) ); 42 | 43 | VLC_EXPORT( module_t *, module_hold, (module_t *module) ); 44 | VLC_EXPORT( void, module_release, (module_t *module) ); 45 | VLC_EXPORT( void, module_list_free, (module_t **) ); 46 | VLC_EXPORT( module_t **, module_list_get, (size_t *n) ); 47 | 48 | VLC_EXPORT( bool, module_provides, ( const module_t *m, const char *cap ) ); 49 | VLC_EXPORT( const char *, module_get_object, ( const module_t *m ) ); 50 | VLC_EXPORT( const char *, module_get_name, ( const module_t *m, bool long_name ) ); 51 | #define module_GetLongName( m ) module_get_name( m, true ) 52 | VLC_EXPORT( const char *, module_get_help, ( const module_t *m ) ); 53 | VLC_EXPORT( const char *, module_get_capability, ( const module_t *m ) ); 54 | VLC_EXPORT( int, module_get_score, ( const module_t *m ) ); 55 | 56 | static inline module_t *module_get_main (void) 57 | { 58 | return module_find ("main"); 59 | } 60 | #define module_get_main(a) module_get_main() 61 | 62 | static inline bool module_is_main( const module_t * p_module ) 63 | { 64 | return !strcmp( module_get_object( p_module ), "main" ); 65 | } 66 | -------------------------------------------------------------------------------- /include/vlc_xml.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * xml.h: XML abstraction layer 3 | ***************************************************************************** 4 | * Copyright (C) 2004 the VideoLAN team 5 | * $Id$ 6 | * 7 | * Author: Gildas Bazin 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation; either version 2 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program; if not, write to the Free Software 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. 22 | *****************************************************************************/ 23 | 24 | #ifndef VLC_XML_H 25 | #define VLC_XML_H 26 | 27 | /** 28 | * \file 29 | * This file defines functions and structures to handle xml tags in vlc 30 | * 31 | */ 32 | 33 | # ifdef __cplusplus 34 | extern "C" { 35 | # endif 36 | 37 | struct xml_t 38 | { 39 | VLC_COMMON_MEMBERS 40 | 41 | /* Module properties */ 42 | module_t *p_module; 43 | xml_sys_t *p_sys; 44 | 45 | xml_reader_t * (*pf_reader_create) ( xml_t *, stream_t * ); 46 | void (*pf_reader_delete) ( xml_reader_t * ); 47 | 48 | void (*pf_catalog_load) ( xml_t *, const char * ); 49 | void (*pf_catalog_add) ( xml_t *, const char *, const char *, 50 | const char * ); 51 | }; 52 | 53 | #define xml_Create( a ) __xml_Create( VLC_OBJECT(a) ) 54 | VLC_EXPORT( xml_t *, __xml_Create, ( vlc_object_t * ) ); 55 | VLC_EXPORT( void, xml_Delete, ( xml_t * ) ); 56 | 57 | #define xml_ReaderCreate( a, b ) a->pf_reader_create( a, b ) 58 | #define xml_ReaderDelete( a, b ) a->pf_reader_delete( b ) 59 | #define xml_CatalogLoad( a, b ) a->pf_catalog_load( a, b ) 60 | #define xml_CatalogAdd( a, b, c, d ) a->pf_catalog_add( a, b, c, d ) 61 | 62 | struct xml_reader_t 63 | { 64 | xml_t *p_xml; 65 | xml_reader_sys_t *p_sys; 66 | 67 | int (*pf_read) ( xml_reader_t * ); 68 | int (*pf_node_type) ( xml_reader_t * ); 69 | char * (*pf_name) ( xml_reader_t * ); 70 | char * (*pf_value) ( xml_reader_t * ); 71 | int (*pf_next_attr) ( xml_reader_t * ); 72 | 73 | int (*pf_use_dtd) ( xml_reader_t *, bool ); 74 | }; 75 | 76 | #define xml_ReaderRead( a ) a->pf_read( a ) 77 | #define xml_ReaderNodeType( a ) a->pf_node_type( a ) 78 | #define xml_ReaderName( a ) a->pf_name( a ) 79 | #define xml_ReaderValue( a ) a->pf_value( a ) 80 | #define xml_ReaderNextAttr( a ) a->pf_next_attr( a ) 81 | #define xml_ReaderUseDTD( a, b ) a->pf_use_dtd( a, b ) 82 | 83 | #define XML_READER_NONE 0 84 | #define XML_READER_STARTELEM 1 85 | #define XML_READER_ENDELEM 2 86 | #define XML_READER_TEXT 3 87 | 88 | # ifdef __cplusplus 89 | } 90 | # endif 91 | 92 | #endif 93 | -------------------------------------------------------------------------------- /Classes/NowPlayingViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // NowPlayingViewController.m 3 | // VideoStreaming 4 | // 5 | // Created by ZodTTD & Derek Tse on 09年4月11日. 6 | // Copyright 2009 ZodTTD (Spookysoft LLC) & HKUST. All rights reserved. 7 | // 8 | // 9 | #import "VideoStreamingAppDelegate.h" 10 | #import "BookmarksViewController.h" 11 | #import "RootViewController.h" 12 | #import "NowPlayingViewController.h" 13 | #import "VLCScreen.h" 14 | #import 15 | 16 | @implementation NowPlayingViewController 17 | 18 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { 19 | if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) { 20 | 21 | self.navigationItem.title = @"Now Playing"; 22 | self.navigationItem.hidesBackButton = YES; 23 | 24 | UIBarButtonItem *addBookmarkButton = [[[UIBarButtonItem alloc] 25 | initWithTitle:@"Add bookmark" 26 | style:UIBarButtonItemStyleBordered 27 | target:self action:@selector(addBookmark)] autorelease]; 28 | 29 | self.navigationItem.rightBarButtonItem = addBookmarkButton; 30 | 31 | self.view.opaque = YES; 32 | self.view.clearsContextBeforeDrawing = YES; 33 | 34 | screenView = [ [VLCScreen alloc] initWithFrame: CGRectMake(0, 0, 320, 240) ]; 35 | [self.view addSubview: screenView]; 36 | 37 | altAds = [[AltAds alloc] initWithFrame:CGRectMake(0.0f, 480.0f - 55.0f - 40.0f, 320.0f, 55.0f) andWindow:nil]; 38 | [self.view addSubview:altAds]; 39 | } 40 | return self; 41 | } 42 | 43 | /* 44 | - (void)awakeFromNib { 45 | 46 | } 47 | */ 48 | 49 | /* 50 | Implement loadView if you want to create a view hierarchy programmatically 51 | - (void)loadView { 52 | } 53 | */ 54 | 55 | /* 56 | If you need to do additional setup after loading the view, override viewDidLoad. 57 | - (void)viewDidLoad { 58 | } 59 | */ 60 | 61 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 62 | // Return YES for supported orientations 63 | return (interfaceOrientation == UIInterfaceOrientationPortrait); 64 | } 65 | 66 | 67 | - (void)didReceiveMemoryWarning { 68 | [super didReceiveMemoryWarning]; // Releases the view if it doesn't have a superview 69 | // Release anything that's not essential, such as cached data 70 | } 71 | 72 | 73 | - (void)dealloc { 74 | [screenView release]; 75 | [altAds release]; 76 | [super dealloc]; 77 | } 78 | 79 | - (void)volumeChanged:(id)sender 80 | { 81 | //media_volume = (float)volumeSlider.value; 82 | } 83 | 84 | - (void)seekChanged:(id)sender 85 | { 86 | media_seek = (float)seekSlider.value / 100.0f; 87 | } 88 | 89 | - (void)setCurrentlyPlaying:(NSString*) str 90 | { 91 | [labelStation setText:str]; 92 | } 93 | 94 | - (void)settingsClicked:(id)sender 95 | { 96 | //[SOApp.delegate switchToSettings]; 97 | } 98 | 99 | - (void)backClicked:(id)sender 100 | { 101 | [self.view removeFromSuperview]; 102 | } 103 | 104 | - (void)addBookmark:(id)sender 105 | { 106 | if(strlen(media_file) > 0) 107 | { 108 | [appDelegate.rootViewController.bookmarksViewController addBookmarkWithPath:[NSString stringWithCString:media_file]]; 109 | } 110 | } 111 | 112 | @end 113 | -------------------------------------------------------------------------------- /Classes/XMLParser.m: -------------------------------------------------------------------------------- 1 | // 2 | // XMLParser.m 3 | // VideoStreaming 4 | // 5 | // Created by ZodTTD & Derek Tse on 08年10月18日. 6 | // Copyright 2008 HKUST. All rights reserved. 7 | // 8 | 9 | #import "XMLParser.h" 10 | 11 | static NSUInteger parsedVideoNodeCounter; 12 | 13 | @implementation XMLParser 14 | 15 | @synthesize currentVideoNode = _currentVideoNode, currentServer, videoNodes; 16 | 17 | - (void)parserDidStartDocument:(NSXMLParser *)parser 18 | { 19 | parsedVideoNodeCounter = 0; 20 | } 21 | 22 | - (NSMutableArray*)parseXMLFileAtURL:(NSString *)serverURL xmlPath:(NSString *)path parseError:(NSError **)error 23 | { 24 | currentServer = serverURL; 25 | 26 | NSURL *theURL = [NSURL URLWithString:[[@"http://" stringByAppendingString: serverURL] 27 | stringByAppendingString:path]]; 28 | 29 | videoNodes = [NSMutableArray array]; 30 | NSXMLParser *parser = [[NSClassFromString(@"NSXMLParser") alloc] initWithContentsOfURL:theURL]; 31 | // Set self as the delegate of the parser so that it will receive the parser delegate methods callbacks. 32 | [parser setDelegate:self]; 33 | // Depending on the XML document you're parsing, you may want to enable these features of NSXMLParser. 34 | [parser setShouldProcessNamespaces:NO]; 35 | [parser setShouldReportNamespacePrefixes:NO]; 36 | [parser setShouldResolveExternalEntities:NO]; 37 | 38 | [parser parse]; 39 | 40 | NSError *parseError = [parser parserError]; 41 | if (parseError && error) { 42 | *error = parseError; 43 | } 44 | 45 | [parser release]; 46 | [parseError release]; 47 | 48 | return videoNodes; 49 | } 50 | 51 | - (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName attributes:(NSDictionary *)attributeDict 52 | { 53 | if (qName) { 54 | elementName = qName; 55 | } 56 | 57 | if ([elementName isEqualToString:@"Video"]) { 58 | 59 | parsedVideoNodeCounter++; 60 | [self.currentVideoNode release]; 61 | self.currentVideoNode = [[VideoNode alloc] init]; 62 | [self.videoNodes addObject:self.currentVideoNode]; 63 | return; 64 | } 65 | 66 | if ([elementName isEqualToString:@"title"]) { 67 | self.currentVideoNode.title = [attributeDict valueForKey: @"value"]; 68 | self.currentVideoNode.serverPath = currentServer; 69 | } else if ([elementName isEqualToString:@"performer"]) { 70 | self.currentVideoNode.performer = [attributeDict valueForKey: @"value"]; 71 | } else if ([elementName isEqualToString:@"seriesName"]) { 72 | self.currentVideoNode.seriesName = [attributeDict valueForKey: @"value"]; 73 | } else if ([elementName isEqualToString:@"videoPath"]) { 74 | self.currentVideoNode.videoPath = [attributeDict valueForKey: @"value"]; 75 | } else if ([elementName isEqualToString:@"imagePath"]) { 76 | self.currentVideoNode.imagePath = [attributeDict valueForKey: @"value"]; 77 | } else if ([elementName isEqualToString:@"cellImagePath"]) { 78 | self.currentVideoNode.cellImagePath = [attributeDict valueForKey: @"value"]; 79 | } 80 | } 81 | 82 | - (void) dealloc 83 | { 84 | //[videoNodes release]; 85 | [currentServer release]; 86 | [self.currentVideoNode release]; 87 | [super dealloc]; 88 | } 89 | @end 90 | -------------------------------------------------------------------------------- /Classes/TableEditorViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // TableEditorViewController.m 3 | // VideoStreaming 4 | // 5 | // Created by ZodTTD & Derek Tse on 09年4月5日. 6 | // Copyright 2009 ZodTTD (Spookysoft LLC) & HKUST. All rights reserved. 7 | // 8 | 9 | #import "TableEditorViewController.h" 10 | 11 | @interface TableEditorViewController(private) 12 | BOOL isNewItem; 13 | NSMutableArray *editingArray; 14 | NSInteger editingItemIndex; 15 | 16 | -(void) cancel; 17 | -(void) save; 18 | @end 19 | 20 | 21 | @implementation TableEditorViewController 22 | 23 | @synthesize editTextField; 24 | 25 | // The designated initializer. Override to perform setup that is required before the view is loaded. 26 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { 27 | if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) { 28 | self.navigationItem.leftBarButtonItem = [[[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(cancel)] autorelease]; 29 | self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemSave target:self action: @selector(save)] autorelease]; 30 | } 31 | return self; 32 | } 33 | 34 | /* 35 | // Implement loadView to create a view hierarchy programmatically, without using a nib. 36 | - (void)loadView { 37 | } 38 | */ 39 | 40 | // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. 41 | - (void)viewDidLoad { 42 | [super viewDidLoad]; 43 | [self.editTextField setKeyboardType:UIKeyboardTypeURL]; 44 | [self.editTextField becomeFirstResponder]; 45 | } 46 | 47 | /* 48 | // Override to allow orientations other than the default portrait orientation. 49 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 50 | // Return YES for supported orientations 51 | return (interfaceOrientation == UIInterfaceOrientationPortrait); 52 | } 53 | */ 54 | 55 | - (void)didReceiveMemoryWarning { 56 | [super didReceiveMemoryWarning]; // Releases the view if it doesn't have a superview 57 | // Release anything that's not essential, such as cached data 58 | } 59 | 60 | 61 | - (void)dealloc { 62 | [editingArray release]; 63 | [editTextField release]; 64 | [super dealloc]; 65 | } 66 | 67 | 68 | #pragma mark private methods 69 | -(void) save 70 | { 71 | if([editTextField.text length] == 0) return; 72 | 73 | if(isNewItem) 74 | { 75 | [editingArray addObject:self.editTextField.text]; 76 | } 77 | else { 78 | [editingArray replaceObjectAtIndex:editingItemIndex withObject:self.editTextField.text]; 79 | } 80 | 81 | [self.navigationController popViewControllerAnimated:YES]; 82 | } 83 | 84 | -(void) cancel 85 | { 86 | [self.navigationController popViewControllerAnimated:YES]; 87 | } 88 | 89 | #pragma mark public methods 90 | 91 | -(void) addNewItemInArray:(NSMutableArray*) array{ 92 | self.editTextField.text = @""; 93 | isNewItem = YES; 94 | editingArray = array; 95 | } 96 | 97 | -(void) editItemAtIndex:(NSInteger) index OfArray:(NSMutableArray*) array 98 | { 99 | isNewItem = NO; 100 | editingArray = array; 101 | editingItemIndex = index; 102 | self.editTextField.text = (NSString*)[array objectAtIndex:index]; 103 | } 104 | 105 | @end 106 | -------------------------------------------------------------------------------- /include/vlc_image.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * vlc_image.h : wrapper for image reading/writing facilities 3 | ***************************************************************************** 4 | * Copyright (C) 2004 the VideoLAN team 5 | * $Id$ 6 | * 7 | * Authors: Gildas Bazin 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation; either version 2 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program; if not, write to the Free Software 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. 22 | *****************************************************************************/ 23 | 24 | #ifndef VLC_IMAGE_H 25 | #define VLC_IMAGE_H 1 26 | 27 | /** 28 | * \file 29 | * This file defines functions and structures for image conversions in vlc 30 | */ 31 | 32 | #include 33 | 34 | # ifdef __cplusplus 35 | extern "C" { 36 | # endif 37 | 38 | struct image_handler_t 39 | { 40 | picture_t * (*pf_read) ( image_handler_t *, block_t *, 41 | video_format_t *, video_format_t * ); 42 | picture_t * (*pf_read_url) ( image_handler_t *, const char *, 43 | video_format_t *, video_format_t * ); 44 | block_t * (*pf_write) ( image_handler_t *, picture_t *, 45 | video_format_t *, video_format_t * ); 46 | int (*pf_write_url) ( image_handler_t *, picture_t *, 47 | video_format_t *, video_format_t *, 48 | const char * ); 49 | 50 | picture_t * (*pf_convert) ( image_handler_t *, picture_t *, 51 | video_format_t *, video_format_t * ); 52 | picture_t * (*pf_filter) ( image_handler_t *, picture_t *, 53 | video_format_t *, const char * ); 54 | 55 | /* Private properties */ 56 | vlc_object_t *p_parent; 57 | decoder_t *p_dec; 58 | encoder_t *p_enc; 59 | filter_t *p_filter; 60 | }; 61 | 62 | VLC_EXPORT( image_handler_t *, __image_HandlerCreate, ( vlc_object_t * ) ); 63 | #define image_HandlerCreate( a ) __image_HandlerCreate( VLC_OBJECT(a) ) 64 | VLC_EXPORT( void, image_HandlerDelete, ( image_handler_t * ) ); 65 | 66 | #define image_Read( a, b, c, d ) a->pf_read( a, b, c, d ) 67 | #define image_ReadUrl( a, b, c, d ) a->pf_read_url( a, b, c, d ) 68 | #define image_Write( a, b, c, d ) a->pf_write( a, b, c, d ) 69 | #define image_WriteUrl( a, b, c, d, e ) a->pf_write_url( a, b, c, d, e ) 70 | #define image_Convert( a, b, c, d ) a->pf_convert( a, b, c, d ) 71 | #define image_Filter( a, b, c, d ) a->pf_filter( a, b, c, d ) 72 | 73 | VLC_EXPORT( vlc_fourcc_t, image_Type2Fourcc, ( const char *psz_name ) ); 74 | VLC_EXPORT( vlc_fourcc_t, image_Ext2Fourcc, ( const char *psz_name ) ); 75 | VLC_EXPORT( vlc_fourcc_t, image_Mime2Fourcc, ( const char *psz_mime ) ); 76 | 77 | # ifdef __cplusplus 78 | } 79 | # endif 80 | 81 | #endif /* _VLC_IMAGE_H */ 82 | -------------------------------------------------------------------------------- /include/vlc_gcrypt.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * vlc_gcrypt.h: VLC thread support for gcrypt 3 | ***************************************************************************** 4 | * Copyright (C) 2004-2008 Rémi Denis-Courmont 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. 19 | *****************************************************************************/ 20 | 21 | /** 22 | * \file 23 | * This file implements gcrypt support functions in vlc 24 | */ 25 | 26 | #ifdef LIBVLC_USE_PTHREAD 27 | /** 28 | * If possible, use gcrypt-provided thread implementation. This is so that 29 | * other non-VLC components (inside the process) can also use gcrypt safely. 30 | */ 31 | GCRY_THREAD_OPTION_PTHREAD_IMPL; 32 | # define gcry_threads_vlc gcry_threads_pthread 33 | #else 34 | 35 | /** 36 | * gcrypt thread option VLC implementation 37 | */ 38 | 39 | static int gcry_vlc_mutex_init( void **p_sys ) 40 | { 41 | int i_val; 42 | vlc_mutex_t *p_lock = (vlc_mutex_t *)malloc( sizeof( vlc_mutex_t ) ); 43 | 44 | if( p_lock == NULL) 45 | return ENOMEM; 46 | 47 | i_val = vlc_mutex_init( p_lock ); 48 | if( i_val ) 49 | free( p_lock ); 50 | else 51 | *p_sys = p_lock; 52 | return i_val; 53 | } 54 | 55 | static int gcry_vlc_mutex_destroy( void **p_sys ) 56 | { 57 | vlc_mutex_t *p_lock = (vlc_mutex_t *)*p_sys; 58 | vlc_mutex_destroy( p_lock ); 59 | free( p_lock ); 60 | return VLC_SUCCESS; 61 | } 62 | 63 | static int gcry_vlc_mutex_lock( void **p_sys ) 64 | { 65 | vlc_mutex_lock( (vlc_mutex_t *)*p_sys ); 66 | return VLC_SUCCESS; 67 | } 68 | 69 | static int gcry_vlc_mutex_unlock( void **lock ) 70 | { 71 | vlc_mutex_unlock( (vlc_mutex_t *)*lock ); 72 | return VLC_SUCCESS; 73 | } 74 | 75 | static const struct gcry_thread_cbs gcry_threads_vlc = 76 | { 77 | GCRY_THREAD_OPTION_USER, 78 | NULL, 79 | gcry_vlc_mutex_init, 80 | gcry_vlc_mutex_destroy, 81 | gcry_vlc_mutex_lock, 82 | gcry_vlc_mutex_unlock 83 | }; 84 | #endif 85 | 86 | /** 87 | * Initializes gcrypt with proper locking. 88 | */ 89 | static inline void vlc_gcrypt_init (void) 90 | { 91 | /* This would need a process-wide static mutex with all libraries linking 92 | * to a given instance of libgcrypt. We cannot do this as we have different 93 | * plugins linking with gcrypt, and some underlying libraries may use it 94 | * behind our back. Only way is to always link gcrypt statically (ouch!) or 95 | * have upstream gcrypt provide one shared object per threading system. */ 96 | static vlc_mutex_t lock = VLC_STATIC_MUTEX; 97 | static bool done = false; 98 | 99 | vlc_mutex_lock (&lock); 100 | if (!done) 101 | { 102 | gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_vlc); 103 | done = true; 104 | } 105 | vlc_mutex_unlock (&lock); 106 | } 107 | -------------------------------------------------------------------------------- /include/vlc_services_discovery.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * vlc_services_discovery.h : Services Discover functions 3 | ***************************************************************************** 4 | * Copyright (C) 1999-2004 the VideoLAN team 5 | * $Id$ 6 | * 7 | * Authors: Pierre d'Herbemont 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation; either version 2 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program; if not, write to the Free Software 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. 22 | *****************************************************************************/ 23 | 24 | #ifndef VLC_SERVICES_DISCOVERY_H_ 25 | #define VLC_SERVICES_DISCOVERY_H_ 26 | 27 | /** 28 | * \file 29 | * This file functions and structures for service discovery in vlc 30 | */ 31 | 32 | # ifdef __cplusplus 33 | extern "C" { 34 | # endif 35 | 36 | /* 37 | * @{ 38 | */ 39 | 40 | #include 41 | #include 42 | 43 | struct services_discovery_t 44 | { 45 | VLC_COMMON_MEMBERS 46 | module_t * p_module; 47 | 48 | vlc_event_manager_t event_manager; /* Accessed through Setters for non class function */ 49 | 50 | services_discovery_sys_t *p_sys; 51 | }; 52 | 53 | /*********************************************************************** 54 | * Service Discovery 55 | ***********************************************************************/ 56 | 57 | /* Get the services discovery modules names to use in Create(), in a null 58 | * terminated string array. Array and string must be freed after use. */ 59 | VLC_EXPORT( char **, vlc_sd_GetNames, ( char ***pppsz_longnames ) ); 60 | 61 | /* Creation of a service_discovery object */ 62 | VLC_EXPORT( services_discovery_t *, vlc_sd_Create, ( vlc_object_t * ) ); 63 | VLC_EXPORT( bool, vlc_sd_Start, ( services_discovery_t *, const char * ) ); 64 | VLC_EXPORT( void, vlc_sd_Stop, ( services_discovery_t * ) ); 65 | 66 | static inline void vlc_sd_Destroy( services_discovery_t *p_sd ) 67 | { 68 | vlc_object_release( VLC_OBJECT(p_sd) ); 69 | } 70 | 71 | static inline void vlc_sd_StopAndDestroy( services_discovery_t * p_this ) 72 | { 73 | vlc_sd_Stop( p_this ); 74 | vlc_sd_Destroy( p_this ); 75 | } 76 | 77 | /* Read info from discovery object */ 78 | VLC_EXPORT( char *, services_discovery_GetLocalizedName, ( services_discovery_t * p_this ) ); 79 | 80 | /* Receive event notification (preferred way to get new items) */ 81 | VLC_EXPORT( vlc_event_manager_t *, services_discovery_EventManager, ( services_discovery_t * p_this ) ); 82 | 83 | /* Used by services_discovery to post update about their items */ 84 | /* About the psz_category, it is a legacy way to add info to the item, 85 | * for more options, directly set the (meta) data on the input item */ 86 | VLC_EXPORT( void, services_discovery_AddItem, ( services_discovery_t * p_this, input_item_t * p_item, const char * psz_category ) ); 87 | VLC_EXPORT( void, services_discovery_RemoveItem, ( services_discovery_t * p_this, input_item_t * p_item ) ); 88 | 89 | /** @} */ 90 | # ifdef __cplusplus 91 | } 92 | # endif 93 | 94 | #endif 95 | -------------------------------------------------------------------------------- /Classes/VideoDetailFlippedView.m: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | File: VideoDetailFlippedView.m 4 | Abstract: Displays the Atomic Element information with a link to Wikipedia. 5 | 6 | */ 7 | 8 | #import "VideoDetailView.h" 9 | #import "VideoNode.h" 10 | //#import "AtomicElement.h" 11 | //#import "PeriodicElements.h" 12 | #import "VideoDetailFlippedView.h" 13 | #import 14 | 15 | 16 | @implementation VideoDetailFlippedView 17 | 18 | - (id)initWithFrame:(CGRect)frame { 19 | if (self = [super initWithFrame:frame]) 20 | { 21 | [self setAutoresizesSubviews:YES]; 22 | 23 | // set the background color of the view to clear 24 | self.backgroundColor=[UIColor clearColor]; 25 | } 26 | return self; 27 | } 28 | 29 | - (void)drawRect:(CGRect)rect { 30 | 31 | // get the background image for the state of the element 32 | // position it appropriately and draw the image 33 | UIImage *backgroundImage = [UIImage imageNamed:@"Liquid.png"]; 34 | CGRect elementSymbolRectangle = CGRectMake(0,0, [backgroundImage size].width, [backgroundImage size].height); 35 | [backgroundImage drawInRect:elementSymbolRectangle]; 36 | 37 | // all the text is drawn in white 38 | //Sets the color of subsequent stroke and fill operations to the color that the receiver represents. 39 | [[UIColor whiteColor] set]; 40 | 41 | // draw the Title 42 | UIFont *font = ([video.title length] < 15) ? [UIFont boldSystemFontOfSize:36]: 43 | [UIFont boldSystemFontOfSize:30]; 44 | CGSize stringSize = [video.title sizeWithFont:font]; 45 | CGPoint point = CGPointMake((self.bounds.size.width-stringSize.width)/2,50); 46 | [video.title drawAtPoint:point withFont:font]; 47 | 48 | float verticalStartingPoint=95; 49 | 50 | // draw the Performer(s) 51 | font = [UIFont boldSystemFontOfSize:14]; 52 | NSString *performerString=[NSString stringWithFormat:@"Performer(s): %@",video.performer]; 53 | stringSize = [performerString sizeWithFont:font]; 54 | point = CGPointMake((self.bounds.size.width-stringSize.width)/2,verticalStartingPoint); 55 | [performerString drawAtPoint:point withFont:font]; 56 | 57 | // draw the Video Path 58 | font = ([video.videoPath length] < 26) ? [UIFont boldSystemFontOfSize:14]: 59 | [UIFont boldSystemFontOfSize:13]; 60 | NSString *videoPathString=[NSString stringWithFormat:@"Video: %@",[video.videoPath lastPathComponent]]; 61 | stringSize = [videoPathString sizeWithFont:font]; 62 | point = CGPointMake((self.bounds.size.width-stringSize.width)/2,verticalStartingPoint+20); 63 | [videoPathString drawAtPoint:point withFont:font]; 64 | 65 | // draw the Image Path 66 | font = ([video.imagePath length] < 26) ? [UIFont boldSystemFontOfSize:14]: 67 | [UIFont boldSystemFontOfSize:13]; 68 | NSString *imagePathString=[NSString stringWithFormat:@"Image: %@",[video.imagePath lastPathComponent]]; 69 | stringSize = [imagePathString sizeWithFont:font]; 70 | point = CGPointMake((self.bounds.size.width-stringSize.width)/2,verticalStartingPoint+40); 71 | [imagePathString drawAtPoint:point withFont:font]; 72 | 73 | // draw the Server 74 | font = [UIFont boldSystemFontOfSize:14]; 75 | NSString *serverString=[NSString stringWithFormat:@"Server: %@",video.serverPath]; 76 | stringSize = [serverString sizeWithFont:font]; 77 | point = CGPointMake((self.bounds.size.width-stringSize.width)/2,verticalStartingPoint+60); 78 | [serverString drawAtPoint:point withFont:font]; 79 | 80 | // draw the Series Name 81 | font = [UIFont boldSystemFontOfSize:24]; 82 | NSString *seriesNameString = video.seriesName; 83 | stringSize = [seriesNameString sizeWithFont:font]; 84 | point = CGPointMake((self.bounds.size.width-stringSize.width)/2,verticalStartingPoint+100); 85 | [seriesNameString drawAtPoint:point withFont:font]; 86 | 87 | } 88 | 89 | - (void)dealloc { 90 | [super dealloc]; 91 | } 92 | 93 | @end 94 | -------------------------------------------------------------------------------- /Classes/SettingPlayerController.m: -------------------------------------------------------------------------------- 1 | // 2 | // SettingPlayerController.m 3 | // Categorize the Player Functions 4 | // 5 | // Created by nanotang on 4/11/09. 6 | // Copyright 2009 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "SettingPlayerController.h" 10 | #import "SettingViewController.h" 11 | #import "Constants.h" 12 | 13 | @implementation SettingViewController (SettingPlayerController) 14 | 15 | - (void)create_UIControls 16 | { 17 | NSArray *segmentTextContent = [NSArray arrayWithObjects: @"0", @"1", @"2", nil]; 18 | CGRect frame = CGRectMake(0.0, 0.0, kSwitchButtonWidth, kSwitchButtonHeight); 19 | switchCtl1 = [[UISwitch alloc] initWithFrame:frame]; 20 | switchCtl2 = [[UISwitch alloc] initWithFrame:frame]; 21 | switchCtl3 = [[UISwitch alloc] initWithFrame:frame]; 22 | segmentedControl = [[UISegmentedControl alloc] initWithItems:segmentTextContent]; 23 | 24 | frame = CGRectMake(-10.0, 0.0, kSegmentedControlWidth, kSegmentedControlHeight); 25 | segmentedControl.frame = frame; 26 | 27 | [switchCtl1 addTarget:self action:@selector(switchActionforSwitch1:) forControlEvents:UIControlEventValueChanged]; 28 | [switchCtl2 addTarget:self action:@selector(switchActionforSwitch2:) forControlEvents:UIControlEventValueChanged]; 29 | [switchCtl3 addTarget:self action:@selector(switchActionforSwitch3:) forControlEvents:UIControlEventValueChanged]; 30 | [segmentedControl addTarget:self action:@selector(segmentAction:) forControlEvents:UIControlEventValueChanged]; 31 | 32 | // in case the parent view draws with a custom color or gradient, use a transparent color 33 | switchCtl1.backgroundColor = [UIColor clearColor]; 34 | switchCtl2.backgroundColor = [UIColor clearColor]; 35 | switchCtl3.backgroundColor = [UIColor clearColor]; 36 | segmentedControl.segmentedControlStyle = UISegmentedControlStyleBar; 37 | 38 | } 39 | 40 | -(NSDictionary *) getDictionaryItem:(NSString *) name 41 | { 42 | NSDictionary *section = [data objectAtIndex:kPlayerSection]; 43 | if (section) { 44 | NSDictionary *content = [section valueForKey:@"content"]; 45 | if (content) { 46 | return [content valueForKey:name]; 47 | } 48 | } 49 | return nil; 50 | } 51 | 52 | - (void)switchActionforSwitch1:(id)sender 53 | { 54 | NSInteger index = [sender isOn]; 55 | 56 | NSNumber *numberFromIndex = [NSNumber numberWithInteger:index]; 57 | 58 | NSDictionary *item = [self getDictionaryItem:@"opt_ffmpegskipframe"]; 59 | 60 | if (item) { 61 | [item setValue:[numberFromIndex stringValue] forKey:@"value"]; 62 | } 63 | [self writeToUserPlist]; 64 | } 65 | 66 | - (void)switchActionforSwitch2:(id)sender 67 | { 68 | NSInteger index = [sender isOn]; 69 | 70 | NSNumber *numberFromIndex = [NSNumber numberWithInteger:index]; 71 | 72 | NSDictionary *item = [self getDictionaryItem:@"opt_noaudio"]; 73 | 74 | if (item) { 75 | [item setValue:[numberFromIndex stringValue] forKey:@"value"]; 76 | } 77 | [self writeToUserPlist]; 78 | } 79 | 80 | - (void)switchActionforSwitch3:(id)sender 81 | { 82 | NSInteger index = [sender isOn]; 83 | 84 | NSNumber *numberFromIndex = [NSNumber numberWithInteger:index]; 85 | 86 | NSDictionary *item = [self getDictionaryItem:@"opt_nodroplateframes"]; 87 | 88 | if (item) { 89 | [item setValue:[numberFromIndex stringValue] forKey:@"value"]; 90 | } 91 | [self writeToUserPlist]; 92 | } 93 | 94 | - (void)segmentAction:(id)sender 95 | { 96 | NSInteger index =[sender selectedSegmentIndex]; 97 | 98 | NSNumber *numberFromIndex = [NSNumber numberWithInteger:index]; 99 | 100 | NSDictionary *item = [self getDictionaryItem:@"opt_ffmpeglowres"]; 101 | 102 | if (item) { 103 | [item setValue:[numberFromIndex stringValue] forKey:@"value"]; 104 | } 105 | [self writeToUserPlist]; 106 | } 107 | 108 | 109 | @end 110 | -------------------------------------------------------------------------------- /include/vlc/libvlc_media_library.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * libvlc.h: libvlc external API 3 | ***************************************************************************** 4 | * Copyright (C) 1998-2009 the VideoLAN team 5 | * $Id: d2192bc788e8bce7b33a2f1f05826b5e95d21676 $ 6 | * 7 | * Authors: Clément Stenac 8 | * Jean-Paul Saman 9 | * Pierre d'Herbemont 10 | * 11 | * This program is free software; you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation; either version 2 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License 22 | * along with this program; if not, write to the Free Software 23 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. 24 | *****************************************************************************/ 25 | 26 | /** 27 | * \file 28 | * This file defines libvlc_media_library external API 29 | */ 30 | 31 | #ifndef VLC_LIBVLC_MEDIA_LIBRARY_H 32 | #define VLC_LIBVLC_MEDIA_LIBRARY_H 1 33 | 34 | /***************************************************************************** 35 | * Media Library 36 | *****************************************************************************/ 37 | /** \defgroup libvlc_media_library libvlc_media_library 38 | * \ingroup libvlc 39 | * LibVLC Media Library 40 | * @{ 41 | */ 42 | 43 | typedef struct libvlc_media_library_t libvlc_media_library_t; 44 | 45 | VLC_PUBLIC_API libvlc_media_library_t * 46 | libvlc_media_library_new( libvlc_instance_t * p_inst, 47 | libvlc_exception_t * p_e ); 48 | 49 | /** 50 | * Release media library object. This functions decrements the 51 | * reference count of the media library object. If it reaches 0, 52 | * then the object will be released. 53 | * 54 | * \param p_mlib media library object 55 | */ 56 | VLC_PUBLIC_API void 57 | libvlc_media_library_release( libvlc_media_library_t * p_mlib ); 58 | 59 | /** 60 | * Retain a reference to a media library object. This function will 61 | * increment the reference counting for this object. Use 62 | * libvlc_media_library_release() to decrement the reference count. 63 | * 64 | * \param p_mlib media library object 65 | */ 66 | VLC_PUBLIC_API void 67 | libvlc_media_library_retain( libvlc_media_library_t * p_mlib ); 68 | 69 | /** 70 | * Load media library. 71 | * 72 | * \param p_mlib media library object 73 | * \param p_e an initialized exception object. 74 | */ 75 | VLC_PUBLIC_API void 76 | libvlc_media_library_load( libvlc_media_library_t * p_mlib, 77 | libvlc_exception_t * p_e ); 78 | 79 | /** 80 | * Save media library. 81 | * 82 | * \param p_mlib media library object 83 | * \param p_e an initialized exception object. 84 | */ 85 | VLC_PUBLIC_API void 86 | libvlc_media_library_save( libvlc_media_library_t * p_mlib, 87 | libvlc_exception_t * p_e ); 88 | 89 | /** 90 | * Get media library subitems. 91 | * 92 | * \param p_mlib media library object 93 | * \param p_e an initialized exception object. 94 | * \return media list subitems 95 | */ 96 | VLC_PUBLIC_API libvlc_media_list_t * 97 | libvlc_media_library_media_list( libvlc_media_library_t * p_mlib, 98 | libvlc_exception_t * p_e ); 99 | 100 | 101 | /** @} */ 102 | 103 | #endif /* VLC_LIBVLC_MEDIA_LIBRARY_H */ 104 | -------------------------------------------------------------------------------- /include/vlc/libvlc_media_discoverer.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * libvlc.h: libvlc external API 3 | ***************************************************************************** 4 | * Copyright (C) 1998-2009 the VideoLAN team 5 | * $Id: dabf51a3bb1f2075e0a799a53a588fc58b6405fb $ 6 | * 7 | * Authors: Clément Stenac 8 | * Jean-Paul Saman 9 | * Pierre d'Herbemont 10 | * 11 | * This program is free software; you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation; either version 2 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License 22 | * along with this program; if not, write to the Free Software 23 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. 24 | *****************************************************************************/ 25 | 26 | /** 27 | * \file 28 | * This file defines libvlc_media_discoverer external API 29 | */ 30 | 31 | #ifndef VLC_LIBVLC_MEDIA_DISCOVERER_H 32 | #define VLC_LIBVLC_MEDIA_DISCOVERER_H 1 33 | 34 | /***************************************************************************** 35 | * Services/Media Discovery 36 | *****************************************************************************/ 37 | /** \defgroup libvlc_media_discoverer libvlc_media_discoverer 38 | * \ingroup libvlc 39 | * LibVLC Media Discoverer 40 | * @{ 41 | */ 42 | 43 | typedef struct libvlc_media_discoverer_t libvlc_media_discoverer_t; 44 | 45 | /** 46 | * Discover media service by name. 47 | * 48 | * \param p_inst libvlc instance 49 | * \param psz_name service name 50 | * \param p_e an initialized exception object 51 | * \return media discover object 52 | */ 53 | VLC_PUBLIC_API libvlc_media_discoverer_t * 54 | libvlc_media_discoverer_new_from_name( libvlc_instance_t * p_inst, 55 | const char * psz_name, 56 | libvlc_exception_t * p_e ); 57 | 58 | /** 59 | * Release media discover object. If the reference count reaches 0, then 60 | * the object will be released. 61 | * 62 | * \param p_mdis media service discover object 63 | */ 64 | VLC_PUBLIC_API void libvlc_media_discoverer_release( libvlc_media_discoverer_t * p_mdis ); 65 | 66 | /** 67 | * Get media service discover object its localized name. 68 | * 69 | * \param media discover object 70 | * \return localized name 71 | */ 72 | VLC_PUBLIC_API char * libvlc_media_discoverer_localized_name( libvlc_media_discoverer_t * p_mdis ); 73 | 74 | /** 75 | * Get media service discover media list. 76 | * 77 | * \param p_mdis media service discover object 78 | * \return list of media items 79 | */ 80 | VLC_PUBLIC_API libvlc_media_list_t * libvlc_media_discoverer_media_list( libvlc_media_discoverer_t * p_mdis ); 81 | 82 | /** 83 | * Get event manager from media service discover object. 84 | * 85 | * \param p_mdis media service discover object 86 | * \return event manager object. 87 | */ 88 | VLC_PUBLIC_API libvlc_event_manager_t * 89 | libvlc_media_discoverer_event_manager( libvlc_media_discoverer_t * p_mdis ); 90 | 91 | /** 92 | * Query if media service discover object is running. 93 | * 94 | * \param p_mdis media service discover object 95 | * \return true if running, false if not 96 | */ 97 | VLC_PUBLIC_API int 98 | libvlc_media_discoverer_is_running( libvlc_media_discoverer_t * p_mdis ); 99 | 100 | /**@} */ 101 | 102 | #endif /* */ 103 | -------------------------------------------------------------------------------- /include/vlc_epg.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * vlc_epg.h: Electronic Program Guide 3 | ***************************************************************************** 4 | * Copyright (C) 2007 the VideoLAN team 5 | * $Id$ 6 | * 7 | * Authors: Laurent Aimar 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation; either version 2 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program; if not, write to the Free Software 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. 22 | *****************************************************************************/ 23 | 24 | #ifndef VLC_EPG_H 25 | #define VLC_EPG_H 1 26 | 27 | /** 28 | * \file 29 | * This file defines functions and structures for storing dvb epg information 30 | */ 31 | 32 | typedef struct 33 | { 34 | int64_t i_start; /* Interpreted as a value return by time() */ 35 | int i_duration; /* Duration of the event in second */ 36 | 37 | char *psz_name; 38 | char *psz_short_description; 39 | char *psz_description; 40 | 41 | } vlc_epg_event_t; 42 | 43 | typedef struct 44 | { 45 | char *psz_name; 46 | vlc_epg_event_t *p_current; /* Can be null or should be the same than one of pp_event entry */ 47 | 48 | int i_event; 49 | vlc_epg_event_t **pp_event; 50 | } vlc_epg_t; 51 | 52 | static inline void vlc_epg_Init( vlc_epg_t *p_epg, const char *psz_name ) 53 | { 54 | p_epg->psz_name = psz_name ? strdup( psz_name ) : NULL; 55 | p_epg->p_current = NULL; 56 | TAB_INIT( p_epg->i_event, p_epg->pp_event ); 57 | } 58 | 59 | static inline void vlc_epg_Clean( vlc_epg_t *p_epg ) 60 | { 61 | int i; 62 | for( i = 0; i < p_epg->i_event; i++ ) 63 | { 64 | vlc_epg_event_t *p_evt = p_epg->pp_event[i]; 65 | free( p_evt->psz_name ); 66 | free( p_evt->psz_short_description ); 67 | free( p_evt->psz_description ); 68 | free( p_evt ); 69 | } 70 | TAB_CLEAN( p_epg->i_event, p_epg->pp_event ); 71 | free( p_epg->psz_name ); 72 | } 73 | 74 | static inline void vlc_epg_AddEvent( vlc_epg_t *p_epg, int64_t i_start, int i_duration, 75 | const char *psz_name, const char *psz_short_description, const char *psz_description ) 76 | { 77 | vlc_epg_event_t *p_evt = (vlc_epg_event_t*)malloc( sizeof(vlc_epg_event_t) ); 78 | if( !p_evt ) 79 | return; 80 | p_evt->i_start = i_start; 81 | p_evt->i_duration = i_duration; 82 | p_evt->psz_name = psz_name ? strdup( psz_name ) : NULL; 83 | p_evt->psz_short_description = psz_short_description ? strdup( psz_short_description ) : NULL; 84 | p_evt->psz_description = psz_description ? strdup( psz_description ) : NULL; 85 | TAB_APPEND_CPP( vlc_epg_event_t, p_epg->i_event, p_epg->pp_event, p_evt ); 86 | } 87 | 88 | LIBVLC_USED 89 | static inline vlc_epg_t *vlc_epg_New( const char *psz_name ) 90 | { 91 | vlc_epg_t *p_epg = (vlc_epg_t*)malloc( sizeof(vlc_epg_t) ); 92 | if( p_epg ) 93 | vlc_epg_Init( p_epg, psz_name ); 94 | return p_epg; 95 | } 96 | 97 | static inline void vlc_epg_Delete( vlc_epg_t *p_epg ) 98 | { 99 | vlc_epg_Clean( p_epg ); 100 | free( p_epg ); 101 | } 102 | 103 | static inline void vlc_epg_SetCurrent( vlc_epg_t *p_epg, int64_t i_start ) 104 | { 105 | int i; 106 | p_epg->p_current = NULL; 107 | if( i_start < 0 ) 108 | return; 109 | 110 | for( i = 0; i < p_epg->i_event; i++ ) 111 | { 112 | if( p_epg->pp_event[i]->i_start == i_start ) 113 | { 114 | p_epg->p_current = p_epg->pp_event[i]; 115 | break; 116 | } 117 | } 118 | } 119 | 120 | #endif 121 | 122 | -------------------------------------------------------------------------------- /include/vlc_pgpkey.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * vlc_pgpkey.h: VideoLAN PGP Public Key used to sign releases 3 | ***************************************************************************** 4 | * Copyright © 2008 the VideoLAN team 5 | * $Id: c199a90370a8013a145e032f95da7c9b67bf57a5 $ 6 | * 7 | * Authors: Rafaël Carré 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation; either release 2 of the License, or 12 | * (at your option) any later release. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program; if not, write to the Free Software 21 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. 22 | *****************************************************************************/ 23 | 24 | /* We trust this public key, and by extension, also keys signed by it. */ 25 | 26 | /* 27 | * VideoLAN Release Signing Key (2009) 28 | * expirates on 2010-01-01 29 | */ 30 | 31 | static uint8_t videolan_public_key_longid[8] = { 32 | 0xDA, 0x51, 0x31, 0x79, 0x57, 0x88, 0x08, 0x7D 33 | }; 34 | 35 | /* gpg --export --armor ""|sed -e s/^/\"/ -e s/\$/\\\\n\"/ */ 36 | static uint8_t videolan_public_key[] = { 37 | "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" 38 | "Version: GnuPG v2.0.11 (GNU/Linux)\n" 39 | "\n" 40 | "mQGiBElzTLkRBACkdfcMqJ5dJx+u1+dj7w4vjsJUNpJjdcw12wnixBGT+gfKC66p\n" 41 | "Iqk9XCjTPbzi82hrP7/1fTgzdbj+i2iIlfPJgrkrw9whpV1UXWQB6pLWASy6bnpL\n" 42 | "x+igFmHcmz7wTnbvLvONayHT9D2DjFmVlIy+j0A/oZIxo/v36FqI8qXaRwCg+gzp\n" 43 | "5pbXrAnR0WIl57ChCvqt7G8D/AsVh754hiUfubLosOH54j4AZT3GE70/a58qvYv8\n" 44 | "Lkkj7lfGH3fhDMFqLlG6DrQxvzn56UMFQ+BHu8OS1nVWs7cLsTx0r7mvURuiahJM\n" 45 | "wFitZ+oZ+n5VIWGkoNfIXQuu6CMKm+6pvh5GyqLoZlfGt6wXvXRbvgv6Z07tKMjX\n" 46 | "L0RbA/9GrS+9x7eZ+KfonqHYWmxCzjll8QQIF+uR+TffYxB6eifFEMKGlffjTxCj\n" 47 | "1i1umGzWRCARUxrLniHhHfob+vXT/bCfzU+lZPl3quHfJTWbWkAB+eKl20vm3YJR\n" 48 | "/e5R0ftZ6C2JjyHVPU6cZYvqqQupXo8R9xIeEzwls2FJ11dmfbQjVmlkZW9MQU4g\n" 49 | "UmVsZWFzZSBTaWduaW5nIEtleSAoMjAwOSmIZgQTEQIAJgUCSXNMuQIbAwUJAdqc\n" 50 | "AAYLCQgHAwIEFQIIAwQWAgMBAh4BAheAAAoJENpRMXlXiAh9LAEAoKAaav5HW26z\n" 51 | "kuLe+cuvqCz8u/faAKCjf+gRr+F/JSTIekqAjBcZgpIsP4hGBBARAgAGBQJJc07j\n" 52 | "AAoJEP0hvDusPgh53psAnRowIxGJYKoPyrYoWiUr0skcSVHNAJ9UVhMElR7bUTQH\n" 53 | "m/oy0gfnfLFFD4hGBBARAgAGBQJJc1D0AAoJEIsIUjHQODU31BIAnjyJBqxAXVby\n" 54 | "QR5yj5nm35A8k2aTAJ4ovCmGablUx3Z9vJYCh/+RhvRvtrkEDQRJc0y5EBAA6z0U\n" 55 | "siB5abYyTJxZ4ERO+2POY9xnPZmBlb5zn5/9A12gOS3ayF6QpnS8tNgE4WzSXzD8\n" 56 | "sA6/ZyX4O1W+NiL1Uu9BYjncS0+H4UWfYf0p/DpvAReMv3HD8y1SYkV7WducrohA\n" 57 | "6fPehuwvnnl1vNlD47GQwmwIsUcBTsBlUX4K7VwkNx0pvdQt2uYXPj3nYyQjNVPL\n" 58 | "Kqe1cHn+vULB6UebTbBsmkE8PfcJxFYTZyrsKWr8Kw5KI+XbagLxub0MxDN1cWYu\n" 59 | "y4EmrhGI/mAh4oSCmSAv1qihb//lW3p0IvSJ3K7AW8wjTM21uQOFFwGirdZrtJTZ\n" 60 | "0FBJl3aHoQOzhUHq0q/vOxsX/8JFcrVgonyiac+OMd4HufqjUbcqe1vxqvQOH+Dl\n" 61 | "L4vyu5CCOn7F8hILvqF7JMq67t8lTyzx3my3L8WuJLynj7JAWGmLRzNn8CmR67Ma\n" 62 | "JQO9TMLYEISKMkl9VAmbNRJsUCFYSVLeUQq0DmRHjl8Vj7ss13OdbaPyEEBAOQQZ\n" 63 | "wIyKx5HXfH5xrQ4ADJQnfTJhSNfgkCOITzV7qizzYf3+lPJfk+pCw5bzCTcJXGwj\n" 64 | "oncZIdYedOAFb0cwRT0RiQu9o2kpi180v0EUE5ZBnDN9JlRjNPjvGAWcPeZZXmJt\n" 65 | "RHBZQkqXjobys24lekwIl9awR5CbREFfuAEU308AAwUQAMvuOASDKuW6frOH0gr8\n" 66 | "aWtufqz5GWaiwvn7/0LXYQujN/wIno8QJT8c5Ym6DOLZ2YtYg2uS0RnA4y3JDYeR\n" 67 | "VDjuX4MFFQGiq/2pF1SGLi5KqmnqJ/IgrvStxBTpR1dvdTOJCwQkUO4a5Xo0mjK/\n" 68 | "N4Uxbxik/DFy5ajpzjDQbyTX/xsjO0przUO7u9GZpnYyB+ElMlrNAl+0+5Kc44p/\n" 69 | "mf2oajuOmqLlaGt8yLOS/XKOzPUe2ZDWAj+Eru0lue5xTAlIbl6H343FUbh3PwCB\n" 70 | "mUI8fEQQRS+0wwPLVU7f2xCXvg363XCxNsS52mez5wk0WRrx2qVMB1kLNM2yAjLP\n" 71 | "Y/uzYB0JSOVSgU6mydp9MUgSLBdP+fRR7NHmb2K5ua0L58rc91iCdU/HcVGk27ia\n" 72 | "4jnyGGWBtCxgSQy1fiJXszfU7W5C3hHq99Zd6jUktg3N/WaQTNX2U6P2bZmgunVf\n" 73 | "s0YNNS/K8x6uDzte3WGFJ9as9ZFp/KN7oj4fG1hYPNPCMINZcUSZlKnWq2wjMpVV\n" 74 | "AH8p0/QqXOZ2r5sCpsuUeQDfheXKsdSkakSivOiAfomGxJ8sioFIIcNjIQmxRedB\n" 75 | "7vxW/ebRilQxrEtkxOJmNwcncfBUvWFwckZuRhSV+h1ztgnilfVxhrTqDFHAhJya\n" 76 | "5PIvCH44uLnRlIuNtG2uWuANiE8EGBECAA8FAklzTLkCGwwFCQHanAAACgkQ2lEx\n" 77 | "eVeICH0X8QCdHFCmxQRlJZf9cbUSSzu1wyDqAw4AoL726vv4WrxM6P+QkSgLbNNA\n" 78 | "NUNV\n" 79 | "=qT28\n" 80 | "-----END PGP PUBLIC KEY BLOCK-----\n" 81 | }; 82 | -------------------------------------------------------------------------------- /include/vlc_dialog.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * vlc_dialog.h: user interaction dialogs 3 | ***************************************************************************** 4 | * Copyright (C) 2009 Rémi Denis-Courmont 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. 19 | *****************************************************************************/ 20 | 21 | #ifndef VLC_DIALOG_H_ 22 | #define VLC_DIALOG_H_ 23 | # include 24 | 25 | /** 26 | * \file vlc_dialog.h 27 | * User interaction dialog APIs 28 | */ 29 | 30 | /** 31 | * A fatal error dialog. 32 | * No response expected from the user. 33 | */ 34 | typedef struct dialog_fatal_t 35 | { 36 | const char *title; 37 | const char *message; 38 | } dialog_fatal_t; 39 | 40 | VLC_EXPORT( void, dialog_VFatal, (vlc_object_t *, bool, const char *, const char *, va_list) ); 41 | 42 | static inline LIBVLC_FORMAT(3, 4) 43 | void dialog_Fatal (vlc_object_t *obj, const char *title, const char *fmt, ...) 44 | { 45 | va_list ap; 46 | 47 | va_start (ap, fmt); 48 | dialog_VFatal(obj, false, title, fmt, ap); 49 | va_end (ap); 50 | } 51 | #define dialog_Fatal(o, t, ...) \ 52 | dialog_Fatal(VLC_OBJECT(o), t, __VA_ARGS__) 53 | 54 | static inline LIBVLC_FORMAT(3, 4) 55 | void dialog_FatalWait (vlc_object_t *obj, const char *title, 56 | const char *fmt, ...){ 57 | va_list ap; 58 | 59 | va_start (ap, fmt); 60 | dialog_VFatal(obj, true, title, fmt, ap); 61 | va_end (ap); 62 | } 63 | #define dialog_FatalWait(o, t, ...) \ 64 | dialog_FatalWait(VLC_OBJECT(o), t, __VA_ARGS__) 65 | 66 | /** 67 | * A login dialog. 68 | */ 69 | typedef struct dialog_login_t 70 | { 71 | const char *title; 72 | const char *message; 73 | char **username; 74 | char **password; 75 | } dialog_login_t; 76 | 77 | VLC_EXPORT( void, dialog_Login, (vlc_object_t *, char **, char **, const char *, const char *, ...) ) LIBVLC_FORMAT (5, 6); 78 | #define dialog_Login(o, u, p, t, ...) \ 79 | dialog_Login(VLC_OBJECT(o), u, p, t, __VA_ARGS__) 80 | 81 | /** 82 | * A question dialog. 83 | */ 84 | typedef struct dialog_question_t 85 | { 86 | const char *title; 87 | const char *message; 88 | const char *yes; 89 | const char *no; 90 | const char *cancel; 91 | int answer; 92 | } dialog_question_t; 93 | 94 | VLC_EXPORT( int, dialog_Question, (vlc_object_t *, const char *, const char *, const char *, const char *, const char *) ); 95 | #define dialog_Question(o, t, m, y, n, c) \ 96 | dialog_Question(VLC_OBJECT(o), t, m, y, n, c) 97 | 98 | typedef struct dialog_progress_bar_t 99 | { /* Request-time parameters */ 100 | const char *title; 101 | const char *message; 102 | const char *cancel; 103 | /* Permanent parameters */ 104 | vlc_mutex_t lock; 105 | void (*pf_update) (void *, const char *, float); 106 | bool (*pf_check) (void *); 107 | void (*pf_destroy) (void *); 108 | void *p_sys; 109 | } dialog_progress_bar_t; 110 | 111 | VLC_EXPORT( dialog_progress_bar_t *, dialog_ProgressCreate, (vlc_object_t *, const char *, const char *, const char *) ); 112 | #define dialog_ProgressCreate(o, t, m, c) \ 113 | dialog_ProgressCreate(VLC_OBJECT(o), t, m, c) 114 | VLC_EXPORT( void, dialog_ProgressDestroy, (dialog_progress_bar_t *) ); 115 | VLC_EXPORT( void, dialog_ProgressSet, (dialog_progress_bar_t *, const char *, float) ); 116 | VLC_EXPORT( bool, dialog_ProgressCancelled, (dialog_progress_bar_t *) ); 117 | 118 | VLC_EXPORT( int, dialog_Register, (vlc_object_t *) ); 119 | VLC_EXPORT( int, dialog_Unregister, (vlc_object_t *) ); 120 | #define dialog_Register(o) dialog_Register(VLC_OBJECT(o)) 121 | #define dialog_Unregister(o) dialog_Unregister(VLC_OBJECT(o)) 122 | 123 | #endif 124 | -------------------------------------------------------------------------------- /include/vlc/libvlc_structures.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * libvlc.h: libvlc_* new external API structures 3 | ***************************************************************************** 4 | * Copyright (C) 1998-2008 the VideoLAN team 5 | * $Id $ 6 | * 7 | * Authors: Filippo Carone 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation; either version 2 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program; if not, write to the Free Software 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. 22 | *****************************************************************************/ 23 | 24 | #ifndef LIBVLC_STRUCTURES_H 25 | #define LIBVLC_STRUCTURES_H 1 26 | 27 | /** 28 | * \file 29 | * This file defines libvlc_* new external API structures 30 | */ 31 | 32 | #include 33 | 34 | # ifdef __cplusplus 35 | extern "C" { 36 | # endif 37 | 38 | /** This structure is opaque. It represents a libvlc instance */ 39 | typedef struct libvlc_instance_t libvlc_instance_t; 40 | 41 | /***************************************************************************** 42 | * Exceptions 43 | *****************************************************************************/ 44 | 45 | /** \defgroup libvlc_exception libvlc_exception 46 | * \ingroup libvlc_core 47 | * LibVLC Exceptions handling 48 | * @{ 49 | */ 50 | 51 | typedef struct libvlc_exception_t 52 | { 53 | int b_raised; 54 | int i_code; 55 | char *psz_message; 56 | } libvlc_exception_t; 57 | 58 | /**@} */ 59 | 60 | /***************************************************************************** 61 | * Time 62 | *****************************************************************************/ 63 | /** \defgroup libvlc_time libvlc_time 64 | * \ingroup libvlc_core 65 | * LibVLC Time support in libvlc 66 | * @{ 67 | */ 68 | 69 | typedef int64_t libvlc_time_t; 70 | 71 | /**@} */ 72 | 73 | /***************************************************************************** 74 | * Media Descriptor 75 | *****************************************************************************/ 76 | /** \defgroup libvlc_media libvlc_media 77 | * \ingroup libvlc 78 | * LibVLC Media Descriptor handling 79 | * @{ 80 | */ 81 | 82 | 83 | /**@} */ 84 | 85 | 86 | /***************************************************************************** 87 | * Playlist 88 | *****************************************************************************/ 89 | /** \defgroup libvlc_playlist libvlc_playlist (Deprecated) 90 | * \ingroup libvlc 91 | * LibVLC Playlist handling (Deprecated) 92 | * @deprecated Use media_list 93 | * @{ 94 | */ 95 | 96 | typedef struct libvlc_playlist_item_t 97 | { 98 | int i_id; 99 | char * psz_uri; 100 | char * psz_name; 101 | 102 | } libvlc_playlist_item_t; 103 | 104 | /**@} */ 105 | 106 | 107 | /***************************************************************************** 108 | * Message log handling 109 | *****************************************************************************/ 110 | 111 | /** \defgroup libvlc_log libvlc_log 112 | * \ingroup libvlc_core 113 | * LibVLC Message Logging 114 | * @{ 115 | */ 116 | 117 | /** This structure is opaque. It represents a libvlc log instance */ 118 | typedef struct libvlc_log_t libvlc_log_t; 119 | 120 | /** This structure is opaque. It represents a libvlc log iterator */ 121 | typedef struct libvlc_log_iterator_t libvlc_log_iterator_t; 122 | 123 | typedef struct libvlc_log_message_t 124 | { 125 | unsigned sizeof_msg; /* sizeof() of message structure, must be filled in by user */ 126 | int i_severity; /* 0=INFO, 1=ERR, 2=WARN, 3=DBG */ 127 | const char *psz_type; /* module type */ 128 | const char *psz_name; /* module name */ 129 | const char *psz_header; /* optional header */ 130 | const char *psz_message; /* message */ 131 | } libvlc_log_message_t; 132 | 133 | /**@} */ 134 | 135 | # ifdef __cplusplus 136 | } 137 | # endif 138 | 139 | #endif 140 | -------------------------------------------------------------------------------- /include/vlc/mediacontrol_structures.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * mediacontrol_structures.h: global header for mediacontrol 3 | ***************************************************************************** 4 | * Copyright (C) 2005-2008 the VideoLAN team 5 | * $Id$ 6 | * 7 | * Authors: Olivier Aubert 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation; either version 2 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program; if not, write to the Free Software 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. 22 | *****************************************************************************/ 23 | 24 | /** 25 | * \file 26 | * This file defines libvlc mediacontrol_* data structures 27 | */ 28 | 29 | /** 30 | * \defgroup mediacontrol_structures MediaControl Structures 31 | * Data structures used in the MediaControl API. 32 | * 33 | * @{ 34 | */ 35 | 36 | #ifndef VLC_CONTROL_STRUCTURES_H 37 | #define VLC_CONTROL_STRUCTURES_H 1 38 | 39 | # ifdef __cplusplus 40 | extern "C" { 41 | # endif 42 | 43 | #include 44 | 45 | /** 46 | * A position may have different origins: 47 | * - absolute counts from the movie start 48 | * - relative counts from the current position 49 | * - modulo counts from the current position and wraps at the end of the movie 50 | */ 51 | typedef enum { 52 | mediacontrol_AbsolutePosition, 53 | mediacontrol_RelativePosition, 54 | mediacontrol_ModuloPosition 55 | } mediacontrol_PositionOrigin; 56 | 57 | /** 58 | * Units available in mediacontrol Positions 59 | * - ByteCount number of bytes 60 | * - SampleCount number of frames 61 | * - MediaTime time in milliseconds 62 | */ 63 | typedef enum { 64 | mediacontrol_ByteCount, 65 | mediacontrol_SampleCount, 66 | mediacontrol_MediaTime 67 | } mediacontrol_PositionKey; 68 | 69 | /** 70 | * Possible player status 71 | * Note the order of these enums must match exactly the order of 72 | * libvlc_state_t and input_state_e enums. 73 | */ 74 | typedef enum { 75 | mediacontrol_UndefinedStatus=0, mediacontrol_InitStatus, 76 | mediacontrol_BufferingStatus, mediacontrol_PlayingStatus, 77 | mediacontrol_PauseStatus, mediacontrol_StopStatus, 78 | mediacontrol_EndStatus, mediacontrol_ErrorStatus, 79 | } mediacontrol_PlayerStatus; 80 | 81 | /** 82 | * MediaControl Position 83 | */ 84 | typedef struct { 85 | mediacontrol_PositionOrigin origin; 86 | mediacontrol_PositionKey key; 87 | int64_t value; 88 | } mediacontrol_Position; 89 | 90 | /** 91 | * RGBPicture structure 92 | * This generic structure holds a picture in an encoding specified by type. 93 | */ 94 | typedef struct { 95 | int width; 96 | int height; 97 | uint32_t type; 98 | int64_t date; 99 | int size; 100 | char *data; 101 | } mediacontrol_RGBPicture; 102 | 103 | /** 104 | * Playlist sequence 105 | * A simple list of strings. 106 | */ 107 | typedef struct { 108 | int size; 109 | char **data; 110 | } mediacontrol_PlaylistSeq; 111 | 112 | typedef struct { 113 | int code; 114 | char *message; 115 | } mediacontrol_Exception; 116 | 117 | /** 118 | * Exception codes 119 | */ 120 | #define mediacontrol_PositionKeyNotSupported 1 121 | #define mediacontrol_PositionOriginNotSupported 2 122 | #define mediacontrol_InvalidPosition 3 123 | #define mediacontrol_PlaylistException 4 124 | #define mediacontrol_InternalException 5 125 | 126 | /** 127 | * Stream information 128 | * This structure allows to quickly get various informations about the stream. 129 | */ 130 | typedef struct { 131 | mediacontrol_PlayerStatus streamstatus; 132 | char *url; /* The URL of the current media stream */ 133 | int64_t position; /* actual location in the stream (in ms) */ 134 | int64_t length; /* total length of the stream (in ms) */ 135 | } mediacontrol_StreamInformation; 136 | 137 | 138 | # ifdef __cplusplus 139 | } 140 | # endif 141 | 142 | #endif 143 | 144 | /** @} */ 145 | -------------------------------------------------------------------------------- /Classes/VLCScreen.m: -------------------------------------------------------------------------------- 1 | // 2 | // VLCScreen.m 3 | // VideoStreaming 4 | // 5 | // Created by ZodTTD & Derek Tse on 09年4月12日. 6 | // Copyright 2009 ZodTTD (Spookysoft LLC) & HKUST. All rights reserved. 7 | // 8 | 9 | #import "VLCScreen.h" 10 | #import 11 | #import 12 | #import 13 | #import 14 | 15 | unsigned short VideoBuffer[320*240]; 16 | unsigned short* VideoBaseAddress = NULL; 17 | int iphone_exit = 0; 18 | 19 | @implementation VLCScreen 20 | - (id)initWithFrame:(CGRect)frame { 21 | if ((self = [super initWithFrame:frame])!=nil) { 22 | self.opaque = YES; 23 | self.clearsContextBeforeDrawing = YES; 24 | [[self layer] setMinificationFilter: 0]; 25 | [[self layer] setMagnificationFilter:0]; 26 | 27 | CFMutableDictionaryRef dict; 28 | int w = 320; //rect.size.width; 29 | int h = 240; //rect.size.height; 30 | 31 | int pitch = w * 4, allocSize = 4 * w * h; 32 | char *pixelFormat = "ARGB"; 33 | 34 | dict = CFDictionaryCreateMutable(kCFAllocatorDefault, 0, 35 | &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); 36 | CFDictionarySetValue(dict, kCoreSurfaceBufferGlobal, kCFBooleanTrue); 37 | CFDictionarySetValue(dict, kCoreSurfaceBufferMemoryRegion, 38 | @"IOSurfaceMemoryRegion"); 39 | CFDictionarySetValue(dict, kCoreSurfaceBufferPitch, 40 | CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &pitch)); 41 | CFDictionarySetValue(dict, kCoreSurfaceBufferWidth, 42 | CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &w)); 43 | CFDictionarySetValue(dict, kCoreSurfaceBufferHeight, 44 | CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &h)); 45 | CFDictionarySetValue(dict, kCoreSurfaceBufferPixelFormat, 46 | CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, pixelFormat)); 47 | CFDictionarySetValue(dict, kCoreSurfaceBufferAllocSize, 48 | CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &allocSize)); 49 | 50 | _screenSurface = CoreSurfaceBufferCreate(dict); 51 | CoreSurfaceBufferLock(_screenSurface, 3); 52 | 53 | //CALayer* screenLayer = [CALayer layer]; 54 | screenLayer = [[CALayer layer] retain]; 55 | screenLayer.frame = CGRectMake(0.0f, 0.0f, 320.0f, 238.0f); 56 | [screenLayer setOpaque: YES]; 57 | [screenLayer setMinificationFilter: 0]; 58 | [screenLayer setMagnificationFilter: 0]; 59 | screenLayer.contents = (id)_screenSurface; 60 | [[self layer] addSublayer:screenLayer]; 61 | 62 | CoreSurfaceBufferUnlock(_screenSurface); 63 | 64 | VideoBaseAddress = (unsigned short*)CoreSurfaceBufferGetBaseAddress(_screenSurface); 65 | 66 | [NSThread detachNewThreadSelector:@selector(updateScreen) toTarget:self withObject:nil]; 67 | /* 68 | timer = [NSTimer scheduledTimerWithTimeInterval:(1.0f / 30.0f) 69 | target:self 70 | selector:@selector(setNeedsDisplay) 71 | userInfo:nil 72 | repeats:YES]; 73 | */ 74 | } 75 | 76 | return self; 77 | } 78 | 79 | - (void)updateScreen 80 | { 81 | NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; 82 | while(!iphone_exit) 83 | { 84 | [self performSelectorOnMainThread:@selector(setNeedsDisplay) withObject:nil waitUntilDone:NO]; 85 | usleep(100000); 86 | //sched_yield(); 87 | } 88 | [pool release]; 89 | } 90 | 91 | - (void)dealloc 92 | { 93 | //[timer invalidate]; 94 | //[ screenLayer release ]; 95 | [ super dealloc ]; 96 | } 97 | 98 | - (CoreSurfaceBufferRef)getSurface 99 | { 100 | return _screenSurface; 101 | } 102 | 103 | - (void)drawRect:(CGRect)rect 104 | { 105 | #if 0 106 | unsigned char* videobuffer = set_iphone_video_buffer(NULL); 107 | if(videobuffer == NULL) 108 | { 109 | return; 110 | } 111 | CGContextRef ctx = UIGraphicsGetCurrentContext(); 112 | 113 | CGImageRef renderImage = CGImageCreate( 114 | 320, 115 | 240, 116 | 8, 117 | 32, 118 | 320 * 4, 119 | CGColorSpaceCreateDeviceRGB(), 120 | kCGBitmapByteOrder32Host | kCGImageAlphaNoneSkipFirst, 121 | CGDataProviderCreateWithData( NULL, videobuffer, 320*240*4, NULL ), 122 | NULL, 123 | 0, 124 | kCGRenderingIntentDefault 125 | ); 126 | 127 | CGContextScaleCTM(ctx, 1.0f, -1.0f); 128 | CGContextTranslateCTM(ctx, 0.0f, -240.0f); 129 | 130 | CGContextDrawImage( UIGraphicsGetCurrentContext(), CGRectMake(0, 0, 320, 240), renderImage ); 131 | 132 | CFRelease(renderImage); 133 | #else 134 | 135 | #endif 136 | } 137 | 138 | @end 139 | -------------------------------------------------------------------------------- /include/vlc_objects.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * vlc_objects.h: vlc_object_t definition and manipulation methods 3 | ***************************************************************************** 4 | * Copyright (C) 2002-2008 the VideoLAN team 5 | * $Id$ 6 | * 7 | * Authors: Samuel Hocevar 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation; either version 2 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program; if not, write to the Free Software 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. 22 | *****************************************************************************/ 23 | 24 | /** 25 | * \file 26 | * This file defines the vlc_object_t structure and object types. 27 | */ 28 | 29 | /** 30 | * \defgroup vlc_object Objects 31 | * @{ 32 | */ 33 | 34 | /* Object types */ 35 | #define VLC_OBJECT_INPUT (-7) 36 | #define VLC_OBJECT_DECODER (-8) 37 | #define VLC_OBJECT_VOUT (-9) 38 | #define VLC_OBJECT_AOUT (-10) 39 | /* Please add new object types below -34 */ 40 | /* Please do not add new object types anyway */ 41 | #define VLC_OBJECT_GENERIC (-666) 42 | 43 | /* Object search mode */ 44 | #define FIND_PARENT 0x0001 45 | #define FIND_CHILD 0x0002 46 | #define FIND_ANYWHERE 0x0003 47 | 48 | #define FIND_STRICT 0x0010 49 | 50 | /* Object flags */ 51 | #define OBJECT_FLAGS_NODBG 0x0001 52 | #define OBJECT_FLAGS_QUIET 0x0002 53 | #define OBJECT_FLAGS_NOINTERACT 0x0004 54 | 55 | /* Types */ 56 | typedef void (*vlc_destructor_t)(struct vlc_object_t *); 57 | 58 | /***************************************************************************** 59 | * The vlc_object_t type. Yes, it's that simple :-) 60 | *****************************************************************************/ 61 | /** The main vlc_object_t structure */ 62 | struct vlc_object_t 63 | { 64 | VLC_COMMON_MEMBERS 65 | }; 66 | 67 | /***************************************************************************** 68 | * Prototypes 69 | *****************************************************************************/ 70 | VLC_EXPORT( void *, __vlc_object_create, ( vlc_object_t *, int ) ); 71 | VLC_EXPORT( void, __vlc_object_set_destructor, ( vlc_object_t *, vlc_destructor_t ) ); 72 | VLC_EXPORT( void, __vlc_object_attach, ( vlc_object_t *, vlc_object_t * ) ); 73 | VLC_EXPORT( void, __vlc_object_detach, ( vlc_object_t * ) ); 74 | #if defined (__GNUC__) && !defined __cplusplus 75 | __attribute__((deprecated)) 76 | #endif 77 | VLC_EXPORT( void *, __vlc_object_find, ( vlc_object_t *, int, int ) ); 78 | VLC_EXPORT( vlc_object_t *, vlc_object_find_name, ( vlc_object_t *, const char *, int ) ); 79 | VLC_EXPORT( void *, __vlc_object_hold, ( vlc_object_t * ) ); 80 | VLC_EXPORT( void, __vlc_object_release, ( vlc_object_t * ) ); 81 | VLC_EXPORT( vlc_list_t *, __vlc_list_children, ( vlc_object_t * ) ); 82 | VLC_EXPORT( void, vlc_list_release, ( vlc_list_t * ) ); 83 | 84 | /*}@*/ 85 | 86 | #define vlc_object_create(a,b) \ 87 | __vlc_object_create( VLC_OBJECT(a), b ) 88 | 89 | #define vlc_object_set_destructor(a,b) \ 90 | __vlc_object_set_destructor( VLC_OBJECT(a), b ) 91 | 92 | #define vlc_object_detach(a) \ 93 | __vlc_object_detach( VLC_OBJECT(a) ) 94 | 95 | #define vlc_object_attach(a,b) \ 96 | __vlc_object_attach( VLC_OBJECT(a), VLC_OBJECT(b) ) 97 | 98 | #define vlc_object_find(a,b,c) \ 99 | __vlc_object_find( VLC_OBJECT(a),b,c) 100 | 101 | #define vlc_object_find_name(a,b,c) \ 102 | vlc_object_find_name( VLC_OBJECT(a),b,c) 103 | 104 | #define vlc_object_hold(a) \ 105 | __vlc_object_hold( VLC_OBJECT(a) ) 106 | 107 | #define vlc_object_release(a) \ 108 | __vlc_object_release( VLC_OBJECT(a) ) 109 | 110 | #define vlc_list_children(a) \ 111 | __vlc_list_children( VLC_OBJECT(a) ) 112 | 113 | /* Objects and threading */ 114 | VLC_EXPORT( void, __vlc_object_kill, ( vlc_object_t * ) ); 115 | #define vlc_object_kill(a) \ 116 | __vlc_object_kill( VLC_OBJECT(a) ) 117 | 118 | static inline bool vlc_object_alive (const vlc_object_t *obj) 119 | { 120 | barrier (); 121 | return !obj->b_die; 122 | } 123 | 124 | #define vlc_object_alive(a) vlc_object_alive( VLC_OBJECT(a) ) 125 | -------------------------------------------------------------------------------- /include/vlc_charset.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * charset.h: Unicode UTF-8 wrappers function 3 | ***************************************************************************** 4 | * Copyright (C) 2003-2005 the VideoLAN team 5 | * Copyright © 2005-2006 Rémi Denis-Courmont 6 | * $Id$ 7 | * 8 | * Author: Rémi Denis-Courmont 9 | * 10 | * This program is free software; you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License as published by 12 | * the Free Software Foundation; either version 2 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU General Public License 21 | * along with this program; if not, write to the Free Software 22 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. 23 | *****************************************************************************/ 24 | 25 | #ifndef VLC_CHARSET_H 26 | #define VLC_CHARSET_H 1 27 | 28 | /** 29 | * \file 30 | * This files handles locale conversions in vlc 31 | */ 32 | 33 | #include 34 | #include 35 | #include 36 | 37 | VLC_EXPORT( void, LocaleFree, ( const char * ) ); 38 | VLC_EXPORT( char *, FromLocale, ( const char * ) LIBVLC_USED ); 39 | VLC_EXPORT( char *, FromLocaleDup, ( const char * ) LIBVLC_USED ); 40 | VLC_EXPORT( char *, ToLocale, ( const char * ) LIBVLC_USED ); 41 | VLC_EXPORT( char *, ToLocaleDup, ( const char * ) LIBVLC_USED ); 42 | 43 | /* TODO: move all of this to "vlc_fs.h" or something like that */ 44 | VLC_EXPORT( int, utf8_open, ( const char *filename, int flags, mode_t mode ) LIBVLC_USED ); 45 | VLC_EXPORT( FILE *, utf8_fopen, ( const char *filename, const char *mode ) LIBVLC_USED ); 46 | VLC_EXPORT( DIR *, utf8_opendir, ( const char *dirname ) LIBVLC_USED ); 47 | VLC_EXPORT( char *, utf8_readdir, ( DIR *dir ) LIBVLC_USED ); 48 | VLC_EXPORT( int, utf8_loaddir, ( DIR *dir, char ***namelist, int (*select)( const char * ), int (*compar)( const char **, const char ** ) ) ); 49 | VLC_EXPORT( int, utf8_scandir, ( const char *dirname, char ***namelist, int (*select)( const char * ), int (*compar)( const char **, const char ** ) ) ); 50 | VLC_EXPORT( int, utf8_mkdir, ( const char *filename, mode_t mode ) ); 51 | VLC_EXPORT( int, utf8_unlink, ( const char *filename ) ); 52 | int utf8_rename( const char *, const char * ); 53 | 54 | #if defined( WIN32 ) && !defined( UNDER_CE ) 55 | # define stat _stati64 56 | #endif 57 | 58 | VLC_EXPORT( int, utf8_stat, ( const char *filename, struct stat *buf ) ); 59 | VLC_EXPORT( int, utf8_lstat, ( const char *filename, struct stat *buf ) ); 60 | 61 | VLC_EXPORT( int, utf8_vfprintf, ( FILE *stream, const char *fmt, va_list ap ) ); 62 | VLC_EXPORT( int, utf8_fprintf, ( FILE *, const char *, ... ) LIBVLC_FORMAT( 2, 3 ) ); 63 | 64 | VLC_EXPORT( int, utf8_mkstemp, ( char * ) ); 65 | 66 | VLC_EXPORT( char *, EnsureUTF8, ( char * ) ); 67 | VLC_EXPORT( const char *, IsUTF8, ( const char * ) LIBVLC_USED ); 68 | 69 | #ifdef WIN32 70 | LIBVLC_USED 71 | static inline char *FromWide (const wchar_t *wide) 72 | { 73 | size_t len = WideCharToMultiByte (CP_UTF8, 0, wide, -1, NULL, 0, NULL, NULL); 74 | if (len == 0) 75 | return NULL; 76 | 77 | char *out = (char *)malloc (len); 78 | 79 | if (out) 80 | WideCharToMultiByte (CP_UTF8, 0, wide, -1, out, len, NULL, NULL); 81 | return out; 82 | } 83 | #endif 84 | 85 | /** 86 | * Converts a nul-terminated string from ISO-8859-1 to UTF-8. 87 | */ 88 | static inline char *FromLatin1 (const char *latin) 89 | { 90 | char *str = (char *)malloc (2 * strlen (latin) + 1), *utf8 = str; 91 | unsigned char c; 92 | 93 | if (str == NULL) 94 | return NULL; 95 | 96 | while ((c = *(latin++)) != '\0') 97 | { 98 | if (c >= 0x80) 99 | { 100 | *(utf8++) = 0xC0 | (c >> 6); 101 | *(utf8++) = 0x80 | (c & 0x3F); 102 | } 103 | else 104 | *(utf8++) = c; 105 | } 106 | *(utf8++) = '\0'; 107 | 108 | utf8 = (char *)realloc (str, utf8 - str); 109 | return utf8 ? utf8 : str; 110 | } 111 | 112 | VLC_EXPORT( const char *, GetFallbackEncoding, ( void ) LIBVLC_USED ); 113 | 114 | VLC_EXPORT( double, us_strtod, ( const char *, char ** ) LIBVLC_USED ); 115 | VLC_EXPORT( float, us_strtof, ( const char *, char ** ) LIBVLC_USED ); 116 | VLC_EXPORT( double, us_atof, ( const char * ) LIBVLC_USED ); 117 | VLC_EXPORT( int, us_asprintf, ( char **, const char *, ... ) LIBVLC_USED ); 118 | 119 | #endif 120 | -------------------------------------------------------------------------------- /include/vlc_fixups.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * fixups.h: portability fixups included from config.h 3 | ***************************************************************************** 4 | * Copyright © 1998-2008 the VideoLAN project 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. 19 | *****************************************************************************/ 20 | 21 | /** 22 | * \file 23 | * This file is a collection of portability fixes 24 | */ 25 | 26 | #ifndef LIBVLC_FIXUPS_H 27 | # define LIBVLC_FIXUPS_H 1 28 | 29 | #if !defined (HAVE_GMTIME_R) || !defined (HAVE_LOCALTIME_R) 30 | # include /* time_t */ 31 | #endif 32 | 33 | #ifndef HAVE_LLDIV 34 | typedef struct 35 | { 36 | long long quot; /* Quotient. */ 37 | long long rem; /* Remainder. */ 38 | } lldiv_t; 39 | #endif 40 | 41 | #ifndef HAVE_REWIND 42 | # include /* FILE */ 43 | #endif 44 | 45 | #if !defined (HAVE_STRLCPY) || \ 46 | !defined (HAVE_STRNDUP) || \ 47 | !defined (HAVE_STRNLEN) || \ 48 | !defined (HAVE_GETCWD) 49 | # include /* size_t */ 50 | #endif 51 | 52 | #ifndef HAVE_VASPRINTF 53 | # include /* va_list */ 54 | #endif 55 | 56 | #ifdef __cplusplus 57 | extern "C" { 58 | #endif 59 | 60 | #ifndef HAVE_STRDUP 61 | char *strdup (const char *); 62 | #endif 63 | 64 | #ifndef HAVE_VASPRINTF 65 | int vasprintf (char **, const char *, va_list); 66 | #endif 67 | 68 | #ifndef HAVE_ASPRINTF 69 | int asprintf (char **, const char *, ...); 70 | #endif 71 | 72 | #ifndef HAVE_STRNLEN 73 | size_t strnlen (const char *, size_t); 74 | #endif 75 | 76 | #ifndef HAVE_STRNDUP 77 | char *strndup (const char *, size_t); 78 | #endif 79 | 80 | #ifndef HAVE_STRLCPY 81 | size_t strlcpy (char *, const char *, size_t); 82 | #endif 83 | 84 | #ifndef HAVE_STRTOF 85 | float strtof (const char *, char **); 86 | #endif 87 | 88 | #ifndef HAVE_ATOF 89 | double atof (const char *); 90 | #endif 91 | 92 | #ifndef HAVE_STRTOLL 93 | long long int strtoll (const char *, char **, int); 94 | #endif 95 | 96 | #ifndef HAVE_STRSEP 97 | char *strsep (char **, const char *); 98 | #endif 99 | 100 | #ifndef HAVE_ATOLL 101 | long long atoll (const char *); 102 | #endif 103 | 104 | #ifndef HAVE_LLDIV 105 | lldiv_t lldiv (long long, long long); 106 | #endif 107 | 108 | #ifndef HAVE_STRCASECMP 109 | int strcasecmp (const char *, const char *); 110 | #endif 111 | 112 | #ifndef HAVE_STRNCASECMP 113 | int strncasecmp (const char *, const char *, size_t); 114 | #endif 115 | 116 | #ifndef HAVE_STRCASESTR 117 | char *strcasestr (const char *, const char *); 118 | #endif 119 | 120 | #ifndef HAVE_GMTIME_R 121 | struct tm *gmtime_r (const time_t *, struct tm *); 122 | #endif 123 | 124 | #ifndef HAVE_LOCALTIME_R 125 | struct tm *localtime_r (const time_t *, struct tm *); 126 | #endif 127 | 128 | #ifndef HAVE_REWIND 129 | void rewind (FILE *); 130 | #endif 131 | 132 | #ifndef HAVE_GETCWD 133 | char *getcwd (char *buf, size_t size); 134 | #endif 135 | 136 | #ifdef __cplusplus 137 | } /* extern "C" */ 138 | #endif 139 | 140 | #ifndef HAVE_GETENV 141 | static inline char *getenv (const char *name) 142 | { 143 | (void)name; 144 | return NULL; 145 | } 146 | #endif 147 | 148 | /* Alignment of critical static data structures */ 149 | #ifdef ATTRIBUTE_ALIGNED_MAX 150 | # define ATTR_ALIGN(align) __attribute__ ((__aligned__ ((ATTRIBUTE_ALIGNED_MAX < align) ? ATTRIBUTE_ALIGNED_MAX : align))) 151 | #else 152 | # define ATTR_ALIGN(align) 153 | #endif 154 | 155 | #ifndef HAVE_USELOCALE 156 | typedef void *locale_t; 157 | # define newlocale( a, b, c ) ((locale_t)0) 158 | # define uselocale( a ) ((locale_t)0) 159 | # define freelocale( a ) (void)0 160 | #endif 161 | 162 | #ifdef WIN32 163 | # include 164 | # define opendir Use_utf8_opendir_or_vlc_wopendir_instead! 165 | # define readdir Use_utf8_readdir_or_vlc_wreaddir_instead! 166 | # define closedir vlc_wclosedir 167 | #endif 168 | 169 | /* libintl support */ 170 | #define _(str) vlc_gettext (str) 171 | #define N_(str) gettext_noop (str) 172 | #define gettext_noop(str) (str) 173 | 174 | #ifndef HAVE_SWAB 175 | void swab (const void *, void *, ssize_t); 176 | #endif 177 | 178 | #endif /* !LIBVLC_FIXUPS_H */ 179 | -------------------------------------------------------------------------------- /Classes/SettingEditViewController.m: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | File: EditingViewController.m 4 | Abstract: 5 | View controller for editing the content of a specific item. 6 | 7 | */ 8 | 9 | #import "SettingEditViewController.h" 10 | #import "SettingEditCell.h" 11 | 12 | #import "VideoStreamingAppDelegate.h" 13 | #import "RootViewController.h" 14 | #import "SettingViewController.h" 15 | 16 | @interface SettingEditViewController(Private) 17 | -(void) myKeyboardWillShow:(NSNotification*)aNotification; 18 | @end 19 | 20 | @implementation SettingEditViewController 21 | 22 | @synthesize editingItem, editingItemCopy, editingContent, sectionName, tableView, headerView; 23 | 24 | // When we set the editing item, we also make a copy in case edits are made and then canceled - then we can 25 | // restore from the copy. 26 | - (void)setEditingItem:(NSMutableDictionary *)anItem { 27 | [editingItem release]; 28 | editingItem = [anItem retain]; 29 | self.editingItemCopy = editingItem; 30 | } 31 | 32 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 33 | // Return YES for supported orientations. 34 | return (interfaceOrientation == UIInterfaceOrientationPortrait); 35 | } 36 | 37 | - (void)dealloc { 38 | [editingItem release]; 39 | [editingItemCopy release]; 40 | [nameField release]; 41 | [editingContent release]; 42 | [sectionName release]; 43 | tableView.delegate =nil; 44 | tableView.dataSource = nil; 45 | [tableView release]; 46 | [headerView release]; 47 | [super dealloc]; 48 | } 49 | 50 | - (IBAction)cancel:(id)sender { 51 | // cancel edits, restore all values from the copy 52 | newItem = NO; 53 | [editingItem setValuesForKeysWithDictionary:editingItemCopy]; 54 | [self.navigationController popViewControllerAnimated:YES]; 55 | } 56 | 57 | - (IBAction)save:(id)sender { 58 | // save edits to the editing item and add new item to the content. 59 | if([nameCell.textField.text length] == 0) return; 60 | 61 | [editingItem setValue:nameCell.textField.text forKey:@"Name"]; 62 | if (newItem) { 63 | [editingContent addObject:editingItem]; 64 | newItem = NO; 65 | } 66 | [self.navigationController popViewControllerAnimated:YES]; 67 | } 68 | 69 | - (void)viewDidLoad { 70 | // use an empty view to position the cells in the vertical center of the portion of the view not covered by 71 | // the keyboard 72 | self.headerView = [[[UIView alloc] initWithFrame:CGRectMake(0, 0, 5, 100)] autorelease]; 73 | } 74 | 75 | - (void)viewWillAppear:(BOOL)animated { 76 | self.title = [NSString stringWithFormat:@"Editing %@", sectionName]; 77 | // If the editing item is nil, that indicates a new item should be created 78 | if (editingItem == nil) { 79 | self.editingItem = [NSMutableDictionary dictionaryWithObjectsAndKeys:@"", @"Name", nil]; 80 | // rather than immediately add the new item to the content array, set a flag. When the user saves, add the 81 | // item then; if the user cancels, no action is needed. 82 | newItem = YES; 83 | } 84 | [tableView reloadData]; 85 | if (!nameCell) { 86 | nameCell = [[SettingEditCell alloc] initWithFrame:CGRectZero reuseIdentifier:@"NameCell"]; 87 | } 88 | nameCell.textField.placeholder = sectionName; 89 | nameCell.textField.text = [editingItem valueForKey:@"Name"]; 90 | nameCell.textField.keyboardType = UIKeyboardTypeURL; 91 | // Starts editing in the name field and shows the keyboard 92 | [nameCell.textField becomeFirstResponder]; 93 | } 94 | 95 | - (void)viewWillDisappear:(BOOL)animated { 96 | // hides the keyboard 97 | [nameCell.textField resignFirstResponder]; 98 | } 99 | 100 | - (NSIndexPath *)tableView:(UITableView *)aTableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath { 101 | //NSLog(indexPath.section); 102 | if (indexPath.section == 1) { 103 | [editingItem setValue:nameCell.textField.text forKey:@"Name"]; 104 | } 105 | return indexPath; 106 | } 107 | 108 | - (void)tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 109 | [aTableView deselectRowAtIndexPath:indexPath animated:YES]; 110 | } 111 | 112 | // Have an accessory view for the second section only 113 | - (UITableViewCellAccessoryType)tableView:(UITableView *)aTableView accessoryTypeForRowWithIndexPath:(NSIndexPath *)indexPath { 114 | return (indexPath.section == 0) ? UITableViewCellAccessoryNone : UITableViewCellAccessoryDisclosureIndicator; 115 | } 116 | 117 | // Make the header height in the first section 45 pixels 118 | - (CGFloat)tableView:(UITableView *)aTableView heightForHeaderInSection:(NSInteger)section { 119 | return (section == 0) ? 45.0 : 10.0; 120 | } 121 | 122 | // Show a header for only the first section 123 | - (UIView *)tableView:(UITableView *)aTableView viewForHeaderInSection:(NSInteger)section { 124 | return (section == 0) ? headerView : nil; 125 | } 126 | 127 | - (UITableViewCell *)tableView:(UITableView *)aTableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 128 | //return (indexPath.section == 0) ? nameCell : typeCell; 129 | return nameCell; 130 | } 131 | 132 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)aTableView { 133 | return 1; 134 | } 135 | 136 | - (NSInteger)tableView:(UITableView *)aTableView numberOfRowsInSection:(NSInteger)section { 137 | return 1; 138 | } 139 | 140 | @end 141 | -------------------------------------------------------------------------------- /include/vlc_bits.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * bits.h : Bit handling helpers 3 | ***************************************************************************** 4 | * Copyright (C) 2003 the VideoLAN team 5 | * $Id$ 6 | * 7 | * Authors: Laurent Aimar 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation; either version 2 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program; if not, write to the Free Software 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. 22 | *****************************************************************************/ 23 | 24 | #ifndef VLC_BITS_H 25 | #define VLC_BITS_H 1 26 | 27 | /** 28 | * \file 29 | * This file defines functions, structures for handling streams of bits in vlc 30 | */ 31 | 32 | typedef struct bs_s 33 | { 34 | uint8_t *p_start; 35 | uint8_t *p; 36 | uint8_t *p_end; 37 | 38 | int i_left; /* i_count number of available bits */ 39 | } bs_t; 40 | 41 | static inline void bs_init( bs_t *s, void *p_data, int i_data ) 42 | { 43 | s->p_start = p_data; 44 | s->p = p_data; 45 | s->p_end = s->p + i_data; 46 | s->i_left = 8; 47 | } 48 | 49 | static inline int bs_pos( bs_t *s ) 50 | { 51 | return( 8 * ( s->p - s->p_start ) + 8 - s->i_left ); 52 | } 53 | 54 | static inline int bs_eof( bs_t *s ) 55 | { 56 | return( s->p >= s->p_end ? 1: 0 ); 57 | } 58 | 59 | static inline uint32_t bs_read( bs_t *s, int i_count ) 60 | { 61 | static const uint32_t i_mask[33] = 62 | { 0x00, 63 | 0x01, 0x03, 0x07, 0x0f, 64 | 0x1f, 0x3f, 0x7f, 0xff, 65 | 0x1ff, 0x3ff, 0x7ff, 0xfff, 66 | 0x1fff, 0x3fff, 0x7fff, 0xffff, 67 | 0x1ffff, 0x3ffff, 0x7ffff, 0xfffff, 68 | 0x1fffff, 0x3fffff, 0x7fffff, 0xffffff, 69 | 0x1ffffff, 0x3ffffff, 0x7ffffff, 0xfffffff, 70 | 0x1fffffff,0x3fffffff,0x7fffffff,0xffffffff}; 71 | int i_shr; 72 | uint32_t i_result = 0; 73 | 74 | while( i_count > 0 ) 75 | { 76 | if( s->p >= s->p_end ) 77 | { 78 | break; 79 | } 80 | 81 | if( ( i_shr = s->i_left - i_count ) >= 0 ) 82 | { 83 | /* more in the buffer than requested */ 84 | i_result |= ( *s->p >> i_shr )&i_mask[i_count]; 85 | s->i_left -= i_count; 86 | if( s->i_left == 0 ) 87 | { 88 | s->p++; 89 | s->i_left = 8; 90 | } 91 | return( i_result ); 92 | } 93 | else 94 | { 95 | /* less in the buffer than requested */ 96 | i_result |= (*s->p&i_mask[s->i_left]) << -i_shr; 97 | i_count -= s->i_left; 98 | s->p++; 99 | s->i_left = 8; 100 | } 101 | } 102 | 103 | return( i_result ); 104 | } 105 | 106 | static inline uint32_t bs_read1( bs_t *s ) 107 | { 108 | if( s->p < s->p_end ) 109 | { 110 | unsigned int i_result; 111 | 112 | s->i_left--; 113 | i_result = ( *s->p >> s->i_left )&0x01; 114 | if( s->i_left == 0 ) 115 | { 116 | s->p++; 117 | s->i_left = 8; 118 | } 119 | return i_result; 120 | } 121 | 122 | return 0; 123 | } 124 | 125 | static inline uint32_t bs_show( bs_t *s, int i_count ) 126 | { 127 | bs_t s_tmp = *s; 128 | return bs_read( &s_tmp, i_count ); 129 | } 130 | 131 | static inline void bs_skip( bs_t *s, int i_count ) 132 | { 133 | s->i_left -= i_count; 134 | 135 | if( s->i_left <= 0 ) 136 | { 137 | const int i_bytes = ( -s->i_left + 8 ) / 8; 138 | 139 | s->p += i_bytes; 140 | s->i_left += 8 * i_bytes; 141 | } 142 | } 143 | 144 | static inline void bs_write( bs_t *s, int i_count, uint32_t i_bits ) 145 | { 146 | while( i_count > 0 ) 147 | { 148 | if( s->p >= s->p_end ) 149 | { 150 | break; 151 | } 152 | 153 | i_count--; 154 | 155 | if( ( i_bits >> i_count )&0x01 ) 156 | { 157 | *s->p |= 1 << ( s->i_left - 1 ); 158 | } 159 | else 160 | { 161 | *s->p &= ~( 1 << ( s->i_left - 1 ) ); 162 | } 163 | s->i_left--; 164 | if( s->i_left == 0 ) 165 | { 166 | s->p++; 167 | s->i_left = 8; 168 | } 169 | } 170 | } 171 | 172 | static inline void bs_align( bs_t *s ) 173 | { 174 | if( s->i_left != 8 ) 175 | { 176 | s->i_left = 8; 177 | s->p++; 178 | } 179 | } 180 | 181 | static inline void bs_align_0( bs_t *s ) 182 | { 183 | if( s->i_left != 8 ) 184 | { 185 | bs_write( s, s->i_left, 0 ); 186 | } 187 | } 188 | 189 | static inline void bs_align_1( bs_t *s ) 190 | { 191 | while( s->i_left != 8 ) 192 | { 193 | bs_write( s, 1, 1 ); 194 | } 195 | } 196 | 197 | #endif 198 | -------------------------------------------------------------------------------- /include/vlc_es_out.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * vlc_es_out.h: es_out (demuxer output) descriptor, queries and methods 3 | ***************************************************************************** 4 | * Copyright (C) 1999-2004 the VideoLAN team 5 | * $Id$ 6 | * 7 | * Authors: Laurent Aimar 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation; either version 2 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program; if not, write to the Free Software 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. 22 | *****************************************************************************/ 23 | 24 | #ifndef VLC_ES_OUT_H 25 | #define VLC_ES_OUT_H 1 26 | 27 | /** 28 | * \file 29 | * This file defines functions and structures for handling es_out in stream output 30 | */ 31 | 32 | /** 33 | * \defgroup es out Es Out 34 | * @{ 35 | */ 36 | 37 | enum es_out_mode_e 38 | { 39 | ES_OUT_MODE_NONE, /* don't select anything */ 40 | ES_OUT_MODE_ALL, /* eg for stream output */ 41 | ES_OUT_MODE_AUTO, /* best audio/video or for input follow audio-track, sub-track */ 42 | ES_OUT_MODE_PARTIAL /* select programs given after --programs */ 43 | }; 44 | 45 | enum es_out_query_e 46 | { 47 | /* set ES selected for the es category (audio/video/spu) */ 48 | ES_OUT_SET_ES, /* arg1= es_out_id_t* */ 49 | ES_OUT_RESTART_ES, /* arg1= es_out_id_t* */ 50 | 51 | /* set 'default' tag on ES (copied across from container) */ 52 | ES_OUT_SET_ES_DEFAULT, /* arg1= es_out_id_t* */ 53 | 54 | /* force selection/unselection of the ES (bypass current mode) */ 55 | ES_OUT_SET_ES_STATE,/* arg1= es_out_id_t* arg2=bool */ 56 | ES_OUT_GET_ES_STATE,/* arg1= es_out_id_t* arg2=bool* */ 57 | 58 | /* */ 59 | ES_OUT_SET_GROUP, /* arg1= int */ 60 | 61 | /* PCR handling, DTS/PTS will be automatically computed using thoses PCR 62 | * XXX: SET_PCR(_GROUP) are in charge of the pace control. They will wait 63 | * to slow down the demuxer so that it reads at the right speed. 64 | * XXX: if you want PREROLL just call ES_OUT_SET_NEXT_DISPLAY_TIME and send 65 | * as you would normally do. 66 | */ 67 | ES_OUT_SET_PCR, /* arg1=int64_t i_pcr(microsecond!) (using default group 0)*/ 68 | ES_OUT_SET_GROUP_PCR, /* arg1= int i_group, arg2=int64_t i_pcr(microsecond!)*/ 69 | ES_OUT_RESET_PCR, /* no arg */ 70 | 71 | /* Try not to use this one as it is a bit hacky */ 72 | ES_OUT_SET_ES_FMT, /* arg1= es_out_id_t* arg2=es_format_t* */ 73 | 74 | /* Allow preroll of data (data with dts/pts < i_pts for all ES will be decoded but not displayed */ 75 | ES_OUT_SET_NEXT_DISPLAY_TIME, /* arg1=int64_t i_pts(microsecond) */ 76 | /* Set meta data for group (dynamic) */ 77 | ES_OUT_SET_GROUP_META, /* arg1=int i_group arg2=vlc_meta_t */ 78 | /* Set epg for group (dynamic) */ 79 | ES_OUT_SET_GROUP_EPG, /* arg1=int i_group arg2=vlc_epg_t */ 80 | /* */ 81 | ES_OUT_DEL_GROUP, /* arg1=int i_group */ 82 | 83 | /* Set scrambled state for one es */ 84 | ES_OUT_SET_ES_SCRAMBLED_STATE, /* arg1=int i_group arg2=es_out_id_t* */ 85 | 86 | /* Stop any buffering being done, and ask if es_out has no more data to 87 | * play. 88 | * It will not block and so MUST be used carrefully. The only good reason 89 | * is for interactive playback (like for DVD menu). 90 | * XXX You SHALL call ES_OUT_RESET_PCR before any other es_out_Control/Send calls. */ 91 | ES_OUT_GET_EMPTY, /* arg1=bool* res=cannot fail */ 92 | 93 | /* First value usable for private control */ 94 | ES_OUT_PRIVATE_START = 0x10000, 95 | }; 96 | 97 | struct es_out_t 98 | { 99 | es_out_id_t *(*pf_add) ( es_out_t *, const es_format_t * ); 100 | int (*pf_send) ( es_out_t *, es_out_id_t *, block_t * ); 101 | void (*pf_del) ( es_out_t *, es_out_id_t * ); 102 | int (*pf_control)( es_out_t *, int i_query, va_list ); 103 | void (*pf_destroy)( es_out_t * ); 104 | 105 | bool b_sout; 106 | 107 | es_out_sys_t *p_sys; 108 | }; 109 | 110 | LIBVLC_USED 111 | static inline es_out_id_t * es_out_Add( es_out_t *out, const es_format_t *fmt ) 112 | { 113 | return out->pf_add( out, fmt ); 114 | } 115 | 116 | static inline void es_out_Del( es_out_t *out, es_out_id_t *id ) 117 | { 118 | out->pf_del( out, id ); 119 | } 120 | 121 | static inline int es_out_Send( es_out_t *out, es_out_id_t *id, 122 | block_t *p_block ) 123 | { 124 | return out->pf_send( out, id, p_block ); 125 | } 126 | 127 | static inline int es_out_vaControl( es_out_t *out, int i_query, va_list args ) 128 | { 129 | return out->pf_control( out, i_query, args ); 130 | } 131 | 132 | static inline int es_out_Control( es_out_t *out, int i_query, ... ) 133 | { 134 | va_list args; 135 | int i_result; 136 | 137 | va_start( args, i_query ); 138 | i_result = es_out_vaControl( out, i_query, args ); 139 | va_end( args ); 140 | return i_result; 141 | } 142 | 143 | static inline void es_out_Delete( es_out_t *p_out ) 144 | { 145 | p_out->pf_destroy( p_out ); 146 | } 147 | 148 | /** 149 | * @} 150 | */ 151 | 152 | #endif 153 | -------------------------------------------------------------------------------- /include/vlc_httpd.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * vlc_httpd.h: builtin HTTP/RTSP server. 3 | ***************************************************************************** 4 | * Copyright (C) 2004-2006 the VideoLAN team 5 | * $Id$ 6 | * 7 | * Authors: Laurent Aimar 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation; either version 2 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program; if not, write to the Free Software 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. 22 | *****************************************************************************/ 23 | 24 | #ifndef VLC_HTTPD_H 25 | #define VLC_HTTPD_H 1 26 | 27 | /** 28 | * \file 29 | * This file defines functions, structures, enums and macros for httpd functionality in vlc. 30 | */ 31 | 32 | enum 33 | { 34 | HTTPD_MSG_NONE, 35 | 36 | /* answer */ 37 | HTTPD_MSG_ANSWER, 38 | 39 | /* channel communication */ 40 | HTTPD_MSG_CHANNEL, 41 | 42 | /* http request */ 43 | HTTPD_MSG_GET, 44 | HTTPD_MSG_HEAD, 45 | HTTPD_MSG_POST, 46 | 47 | /* rtsp request */ 48 | HTTPD_MSG_OPTIONS, 49 | HTTPD_MSG_DESCRIBE, 50 | HTTPD_MSG_SETUP, 51 | HTTPD_MSG_PLAY, 52 | HTTPD_MSG_PAUSE, 53 | HTTPD_MSG_GETPARAMETER, 54 | HTTPD_MSG_TEARDOWN, 55 | 56 | /* just to track the count of MSG */ 57 | HTTPD_MSG_MAX 58 | }; 59 | 60 | enum 61 | { 62 | HTTPD_PROTO_NONE, 63 | HTTPD_PROTO_HTTP, /* HTTP/1.x */ 64 | HTTPD_PROTO_RTSP, /* RTSP/1.x */ 65 | HTTPD_PROTO_HTTP0, /* HTTP/0.x */ 66 | }; 67 | 68 | struct httpd_message_t 69 | { 70 | httpd_client_t *cl; /* NULL if not throught a connection e vlc internal */ 71 | 72 | uint8_t i_type; 73 | uint8_t i_proto; 74 | uint8_t i_version; 75 | 76 | /* for an answer */ 77 | int i_status; 78 | 79 | /* for a query */ 80 | char *psz_url; 81 | /* FIXME find a clean way to handle GET(psz_args) 82 | and POST(body) through the same code */ 83 | uint8_t *psz_args; 84 | 85 | /* for rtp over rtsp */ 86 | int i_channel; 87 | 88 | /* options */ 89 | int i_name; 90 | char **name; 91 | int i_value; 92 | char **value; 93 | 94 | /* body */ 95 | int64_t i_body_offset; 96 | int i_body; 97 | uint8_t *p_body; 98 | 99 | }; 100 | 101 | /* create a new host */ 102 | VLC_EXPORT( httpd_host_t *, httpd_HostNew, ( vlc_object_t *, const char *psz_host, int i_port ) ); 103 | VLC_EXPORT( httpd_host_t *, httpd_TLSHostNew, ( vlc_object_t *, const char *, int, const char *, const char *, const char *, const char * ) ); 104 | 105 | /* delete a host */ 106 | VLC_EXPORT( void, httpd_HostDelete, ( httpd_host_t * ) ); 107 | 108 | /* register a new url */ 109 | VLC_EXPORT( httpd_url_t *, httpd_UrlNew, ( httpd_host_t *, const char *psz_url, const char *psz_user, const char *psz_password, const vlc_acl_t *p_acl ) ); 110 | VLC_EXPORT( httpd_url_t *, httpd_UrlNewUnique, ( httpd_host_t *, const char *psz_url, const char *psz_user, const char *psz_password, const vlc_acl_t *p_acl ) ); 111 | /* register callback on a url */ 112 | VLC_EXPORT( int, httpd_UrlCatch, ( httpd_url_t *, int i_msg, httpd_callback_t, httpd_callback_sys_t * ) ); 113 | /* delete an url */ 114 | VLC_EXPORT( void, httpd_UrlDelete, ( httpd_url_t * ) ); 115 | 116 | /* Default client mode is FILE, use these to change it */ 117 | VLC_EXPORT( void, httpd_ClientModeStream, ( httpd_client_t *cl ) ); 118 | VLC_EXPORT( void, httpd_ClientModeBidir, ( httpd_client_t *cl ) ); 119 | VLC_EXPORT( char*, httpd_ClientIP, ( const httpd_client_t *cl, char *psz_ip ) ); 120 | VLC_EXPORT( char*, httpd_ServerIP, ( const httpd_client_t *cl, char *psz_ip ) ); 121 | 122 | /* High level */ 123 | 124 | VLC_EXPORT( httpd_file_t *, httpd_FileNew, ( httpd_host_t *, const char *psz_url, const char *psz_mime, const char *psz_user, const char *psz_password, const vlc_acl_t *p_acl, httpd_file_callback_t pf_fill, httpd_file_sys_t * ) ); 125 | VLC_EXPORT( httpd_file_sys_t *, httpd_FileDelete, ( httpd_file_t * ) ); 126 | 127 | 128 | VLC_EXPORT( httpd_handler_t *, httpd_HandlerNew, ( httpd_host_t *, const char *psz_url, const char *psz_user, const char *psz_password, const vlc_acl_t *p_acl, httpd_handler_callback_t pf_fill, httpd_handler_sys_t * ) ); 129 | VLC_EXPORT( httpd_handler_sys_t *, httpd_HandlerDelete, ( httpd_handler_t * ) ); 130 | 131 | 132 | VLC_EXPORT( httpd_redirect_t *, httpd_RedirectNew, ( httpd_host_t *, const char *psz_url_dst, const char *psz_url_src ) ); 133 | VLC_EXPORT( void, httpd_RedirectDelete, ( httpd_redirect_t * ) ); 134 | 135 | 136 | VLC_EXPORT( httpd_stream_t *, httpd_StreamNew, ( httpd_host_t *, const char *psz_url, const char *psz_mime, const char *psz_user, const char *psz_password, const vlc_acl_t *p_acl ) ); 137 | VLC_EXPORT( void, httpd_StreamDelete, ( httpd_stream_t * ) ); 138 | VLC_EXPORT( int, httpd_StreamHeader, ( httpd_stream_t *, uint8_t *p_data, int i_data ) ); 139 | VLC_EXPORT( int, httpd_StreamSend, ( httpd_stream_t *, uint8_t *p_data, int i_data ) ); 140 | 141 | 142 | /* Msg functions facilities */ 143 | VLC_EXPORT( void, httpd_MsgAdd, ( httpd_message_t *, const char *psz_name, const char *psz_value, ... ) LIBVLC_FORMAT( 3, 4 ) ); 144 | /* return "" if not found. The string is not allocated */ 145 | VLC_EXPORT( const char *, httpd_MsgGet, ( const httpd_message_t *, const char *psz_name ) ); 146 | 147 | #endif /* _VLC_HTTPD_H */ 148 | -------------------------------------------------------------------------------- /include/vlc_mtime.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * vlc_mtime.h: high resolution time management functions 3 | ***************************************************************************** 4 | * This header provides portable high precision time management functions, 5 | * which should be the only ones used in other segments of the program, since 6 | * functions like gettimeofday() and ftime() are not always supported. 7 | * Most functions are declared as inline or as macros since they are only 8 | * interfaces to system calls and have to be called frequently. 9 | * 'm' stands for 'micro', since maximum resolution is the microsecond. 10 | * Functions prototyped are implemented in interface/mtime.c. 11 | ***************************************************************************** 12 | * Copyright (C) 1996, 1997, 1998, 1999, 2000 the VideoLAN team 13 | * $Id$ 14 | * 15 | * Authors: Vincent Seguin 16 | * 17 | * This program is free software; you can redistribute it and/or modify 18 | * it under the terms of the GNU General Public License as published by 19 | * the Free Software Foundation; either version 2 of the License, or 20 | * (at your option) any later version. 21 | * 22 | * This program is distributed in the hope that it will be useful, 23 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 25 | * GNU General Public License for more details. 26 | * 27 | * You should have received a copy of the GNU General Public License 28 | * along with this program; if not, write to the Free Software 29 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. 30 | *****************************************************************************/ 31 | 32 | #ifndef __VLC_MTIME_H 33 | # define __VLC_MTIME_H 1 34 | 35 | /***************************************************************************** 36 | * LAST_MDATE: date which will never happen 37 | ***************************************************************************** 38 | * This date can be used as a 'never' date, to mark missing events in a function 39 | * supposed to return a date, such as nothing to display in a function 40 | * returning the date of the first image to be displayed. It can be used in 41 | * comparaison with other values: all existing dates will be earlier. 42 | *****************************************************************************/ 43 | #define LAST_MDATE ((mtime_t)((uint64_t)(-1)/2)) 44 | 45 | /***************************************************************************** 46 | * MSTRTIME_MAX_SIZE: maximum possible size of mstrtime 47 | ***************************************************************************** 48 | * This values is the maximal possible size of the string returned by the 49 | * mstrtime() function, including '-' and the final '\0'. It should be used to 50 | * allocate the buffer. 51 | *****************************************************************************/ 52 | #define MSTRTIME_MAX_SIZE 22 53 | 54 | /* Well, Duh? But it does clue us in that we are converting from 55 | millisecond quantity to a second quantity or vice versa. 56 | */ 57 | #define MILLISECONDS_PER_SEC 1000 58 | 59 | #define msecstotimestr(psz_buffer, msecs) \ 60 | secstotimestr( psz_buffer, (msecs / (int) MILLISECONDS_PER_SEC) ) 61 | 62 | /***************************************************************************** 63 | * Prototypes 64 | *****************************************************************************/ 65 | VLC_EXPORT( char *, mstrtime, ( char *psz_buffer, mtime_t date ) ); 66 | VLC_EXPORT( mtime_t, mdate, ( void ) ); 67 | VLC_EXPORT( void, mwait, ( mtime_t date ) ); 68 | VLC_EXPORT( void, msleep, ( mtime_t delay ) ); 69 | VLC_EXPORT( char *, secstotimestr, ( char *psz_buffer, int secs ) ); 70 | 71 | #if defined (__GNUC__) && defined (__linux__) 72 | # define VLC_HARD_MIN_SLEEP 1000 /* Linux has 100, 250, 300 or 1000Hz */ 73 | # define VLC_SOFT_MIN_SLEEP 9000000 74 | 75 | static 76 | __attribute__((unused)) 77 | __attribute__((noinline)) 78 | __attribute__((error("sorry, cannot sleep for such short a time"))) 79 | mtime_t impossible_delay( mtime_t delay ) 80 | { 81 | (void) delay; 82 | return VLC_HARD_MIN_SLEEP; 83 | } 84 | 85 | static 86 | __attribute__((unused)) 87 | __attribute__((noinline)) 88 | __attribute__((warning("use proper event handling instead of short delay"))) 89 | mtime_t harmful_delay( mtime_t delay ) 90 | { 91 | return delay; 92 | } 93 | 94 | # define check_delay( d ) \ 95 | ((__builtin_constant_p(d < VLC_HARD_MIN_SLEEP) \ 96 | && (d < VLC_HARD_MIN_SLEEP)) \ 97 | ? impossible_delay(d) \ 98 | : ((__builtin_constant_p(d < VLC_SOFT_MIN_SLEEP) \ 99 | && (d < VLC_SOFT_MIN_SLEEP)) \ 100 | ? harmful_delay(d) \ 101 | : d)) 102 | 103 | static 104 | __attribute__((unused)) 105 | __attribute__((noinline)) 106 | __attribute__((error("deadlines can not be constant"))) 107 | mtime_t impossible_deadline( mtime_t deadline ) 108 | { 109 | return deadline; 110 | } 111 | 112 | # define check_deadline( d ) \ 113 | (__builtin_constant_p(d) ? impossible_deadline(d) : d) 114 | #else 115 | # define check_delay(d) (d) 116 | # define check_deadline(d) (d) 117 | #endif 118 | 119 | #define msleep(d) msleep(check_delay(d)) 120 | #define mwait(d) mwait(check_deadline(d)) 121 | 122 | /***************************************************************************** 123 | * date_t: date incrementation without long-term rounding errors 124 | *****************************************************************************/ 125 | struct date_t 126 | { 127 | mtime_t date; 128 | uint32_t i_divider_num; 129 | uint32_t i_divider_den; 130 | uint32_t i_remainder; 131 | }; 132 | 133 | VLC_EXPORT( void, date_Init, ( date_t *, uint32_t, uint32_t ) ); 134 | VLC_EXPORT( void, date_Change, ( date_t *, uint32_t, uint32_t ) ); 135 | VLC_EXPORT( void, date_Set, ( date_t *, mtime_t ) ); 136 | VLC_EXPORT( mtime_t, date_Get, ( const date_t * ) ); 137 | VLC_EXPORT( void, date_Move, ( date_t *, mtime_t ) ); 138 | VLC_EXPORT( mtime_t, date_Increment, ( date_t *, uint32_t ) ); 139 | VLC_EXPORT( mtime_t, date_Decrement, ( date_t *, uint32_t ) ); 140 | VLC_EXPORT( uint64_t, NTPtime64, ( void ) ); 141 | #endif /* !__VLC_MTIME_ */ 142 | -------------------------------------------------------------------------------- /include/vlc/libvlc_media_list_player.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * libvlc_media_list.h: libvlc_media_list API 3 | ***************************************************************************** 4 | * Copyright (C) 1998-2008 the VideoLAN team 5 | * $Id: d2f21515cd2cce6f46075c396cf16bef35a66374 $ 6 | * 7 | * Authors: Pierre d'Herbemont 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation; either version 2 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program; if not, write to the Free Software 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. 22 | *****************************************************************************/ 23 | 24 | #ifndef LIBVLC_MEDIA_LIST_PLAYER_H 25 | #define LIBVLC_MEDIA_LIST_PLAYER_H 1 26 | 27 | /** 28 | * \file 29 | * This file defines libvlc_media_list_player API 30 | */ 31 | 32 | # ifdef __cplusplus 33 | extern "C" { 34 | # endif 35 | 36 | /***************************************************************************** 37 | * Media List Player 38 | *****************************************************************************/ 39 | /** \defgroup libvlc_media_list_player libvlc_media_list_player 40 | * \ingroup libvlc 41 | * LibVLC Media List Player, play a media_list. You can see that as a media 42 | * instance subclass 43 | * @{ 44 | */ 45 | 46 | typedef struct libvlc_media_list_player_t libvlc_media_list_player_t; 47 | 48 | /** 49 | * Create new media_list_player. 50 | * 51 | * \param p_instance libvlc instance 52 | * \param p_e initialized exception instance 53 | * \return media list player instance 54 | */ 55 | VLC_PUBLIC_API libvlc_media_list_player_t * 56 | libvlc_media_list_player_new( libvlc_instance_t * p_instance, 57 | libvlc_exception_t * p_e ); 58 | 59 | /** 60 | * Release media_list_player. 61 | * 62 | * \param p_mlp media list player instance 63 | */ 64 | VLC_PUBLIC_API void 65 | libvlc_media_list_player_release( libvlc_media_list_player_t * p_mlp ); 66 | 67 | /** 68 | * Replace media player in media_list_player with this instance. 69 | * 70 | * \param p_mlp media list player instance 71 | * \param p_mi media player instance 72 | * \param p_e initialized exception instance 73 | */ 74 | VLC_PUBLIC_API void 75 | libvlc_media_list_player_set_media_player( 76 | libvlc_media_list_player_t * p_mlp, 77 | libvlc_media_player_t * p_mi, 78 | libvlc_exception_t * p_e ); 79 | 80 | VLC_PUBLIC_API void 81 | libvlc_media_list_player_set_media_list( 82 | libvlc_media_list_player_t * p_mlp, 83 | libvlc_media_list_t * p_mlist, 84 | libvlc_exception_t * p_e ); 85 | 86 | /** 87 | * Play media list 88 | * 89 | * \param p_mlp media list player instance 90 | * \param p_e initialized exception instance 91 | */ 92 | VLC_PUBLIC_API void 93 | libvlc_media_list_player_play( libvlc_media_list_player_t * p_mlp, 94 | libvlc_exception_t * p_e ); 95 | 96 | /** 97 | * Pause media list 98 | * 99 | * \param p_mlp media list player instance 100 | * \param p_e initialized exception instance 101 | */ 102 | VLC_PUBLIC_API void 103 | libvlc_media_list_player_pause( libvlc_media_list_player_t * p_mlp, 104 | libvlc_exception_t * p_e ); 105 | 106 | /** 107 | * Is media list playing? 108 | * 109 | * \param p_mlp media list player instance 110 | * \param p_e initialized exception instance 111 | * \return true for playing and false for not playing 112 | */ 113 | VLC_PUBLIC_API int 114 | libvlc_media_list_player_is_playing( libvlc_media_list_player_t * p_mlp, 115 | libvlc_exception_t * p_e ); 116 | 117 | /** 118 | * Get current libvlc_state of media list player 119 | * 120 | * \param p_mlp media list player instance 121 | * \param p_e initialized exception instance 122 | * \return libvlc_state_t for media list player 123 | */ 124 | VLC_PUBLIC_API libvlc_state_t 125 | libvlc_media_list_player_get_state( libvlc_media_list_player_t * p_mlp, 126 | libvlc_exception_t * p_e ); 127 | 128 | /** 129 | * Play media list item at position index 130 | * 131 | * \param p_mlp media list player instance 132 | * \param i_index index in media list to play 133 | * \param p_e initialized exception instance 134 | */ 135 | VLC_PUBLIC_API void 136 | libvlc_media_list_player_play_item_at_index( 137 | libvlc_media_list_player_t * p_mlp, 138 | int i_index, 139 | libvlc_exception_t * p_e ); 140 | 141 | VLC_PUBLIC_API void 142 | libvlc_media_list_player_play_item( 143 | libvlc_media_list_player_t * p_mlp, 144 | libvlc_media_t * p_md, 145 | libvlc_exception_t * p_e ); 146 | 147 | /** 148 | * Stop playing media list 149 | * 150 | * \param p_mlp media list player instance 151 | * \param p_e initialized exception instance 152 | */ 153 | VLC_PUBLIC_API void 154 | libvlc_media_list_player_stop( libvlc_media_list_player_t * p_mlp, 155 | libvlc_exception_t * p_e ); 156 | 157 | /** 158 | * Play next item from media list 159 | * 160 | * \param p_mlp media list player instance 161 | * \param p_e initialized exception instance 162 | */ 163 | VLC_PUBLIC_API void 164 | libvlc_media_list_player_next( libvlc_media_list_player_t * p_mlp, 165 | libvlc_exception_t * p_e ); 166 | 167 | /* NOTE: shouldn't there also be a libvlc_media_list_player_prev() */ 168 | 169 | /** @} media_list_player */ 170 | 171 | # ifdef __cplusplus 172 | } 173 | # endif 174 | 175 | #endif /* LIBVLC_MEDIA_LIST_PLAYER_H */ 176 | -------------------------------------------------------------------------------- /Classes/RootViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // RootViewController.m 3 | // VideoStreaming 4 | // 5 | // Created by ZodTTD & Derek Tse on 08年9月25日. 6 | // Copyright HKUST 2008. All rights reserved. 7 | // 8 | #import 9 | #import "VideoStreamingAppDelegate.h" 10 | #import "RootViewController.h" 11 | #import "LocalViewController.h" 12 | #import "VideoListViewController.h" 13 | #import "CoverViewController.h" 14 | #import "CoverFlowView.h" 15 | #import "SettingViewController.h" 16 | #import "BookmarksViewController.h" 17 | #import "RecentsViewController.h" 18 | #import "PanVViewController.h" 19 | #import "VideoDetailViewController.h" 20 | #import "NowPlayingViewController.h" 21 | 22 | @implementation RootViewController 23 | 24 | @synthesize localViewController; 25 | @synthesize videoListViewController; 26 | @synthesize settingViewController; 27 | @synthesize bookmarksViewController; 28 | @synthesize recentsViewController; 29 | @synthesize panVViewController; 30 | @synthesize nowPlayingViewController; 31 | #pragma mark View delegate methods; 32 | 33 | -(id) init 34 | { 35 | if(self = [super init]) 36 | { 37 | [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleBlackOpaque; 38 | 39 | // initialize controllers 40 | self.localViewController = [[[LocalViewController alloc] initWithNibName:@"LocalView" bundle:nil] autorelease]; 41 | self.videoListViewController = [[[VideoListViewController alloc] initWithNibName:@"VideoListView" bundle:nil] autorelease]; 42 | self.bookmarksViewController = [[[BookmarksViewController alloc] initWithNibName:@"BookmarksView" bundle:nil] autorelease]; 43 | self.recentsViewController = [[[RecentsViewController alloc] initWithNibName:@"RecentsView" bundle:nil] autorelease]; 44 | self.panVViewController = [[[PanVViewController alloc] init] autorelease]; 45 | self.settingViewController = [[[SettingViewController alloc] initWithNibName:@"SettingsView"bundle:nil] autorelease]; 46 | self.nowPlayingViewController = [[[NowPlayingViewController alloc] initWithNibName:@"NowPlaying" bundle:nil] autorelease]; 47 | 48 | NSMutableArray *localViewControllersArray = [[NSMutableArray alloc] initWithCapacity:6]; 49 | 50 | UINavigationController *localNavigationController = [[UINavigationController alloc] initWithRootViewController:self.localViewController]; 51 | localNavigationController.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"Local" image:[UIImage imageNamed:@"local_tabbar_ico.png"] tag:1]; 52 | localNavigationController.navigationBar.barStyle = UIBarStyleBlackOpaque; 53 | [localViewControllersArray addObject:localNavigationController]; 54 | [localNavigationController release]; 55 | 56 | //localNavigationController = [[UINavigationController alloc] initWithRootViewController:self.videoListViewController]; 57 | //localNavigationController.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"Servers" image:[UIImage imageNamed:@"server_tabbar_ico.png"] tag:2]; 58 | //localNavigationController.navigationBar.barStyle = UIBarStyleBlackOpaque; 59 | //[localViewControllersArray addObject:localNavigationController]; 60 | //[localNavigationController release]; 61 | 62 | //panVViewController.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"PanV" image:[UIImage imageNamed:@"panv_tabbar_ico.png"] tag:3]; 63 | //[localViewControllersArray addObject:panVViewController]; 64 | 65 | localNavigationController = [[UINavigationController alloc] initWithRootViewController:self.bookmarksViewController]; 66 | localNavigationController.tabBarItem = [[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemBookmarks tag:4]; 67 | localNavigationController.navigationBar.barStyle = UIBarStyleBlackOpaque; 68 | [localViewControllersArray addObject:localNavigationController]; 69 | [localNavigationController release]; 70 | 71 | localNavigationController = [[UINavigationController alloc] initWithRootViewController:self.recentsViewController]; 72 | localNavigationController.tabBarItem = [[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemRecents tag:5]; 73 | localNavigationController.navigationBar.barStyle = UIBarStyleBlackOpaque; 74 | [localViewControllersArray addObject:localNavigationController]; 75 | [localNavigationController release]; 76 | 77 | localNavigationController = [[UINavigationController alloc] initWithRootViewController:self.settingViewController]; 78 | localNavigationController.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"Settings" image:[UIImage imageNamed:@"setting_tabbar_ico.png"] tag:6]; 79 | localNavigationController.navigationBar.barStyle = UIBarStyleBlackOpaque; 80 | [localViewControllersArray addObject:localNavigationController]; 81 | [localNavigationController release]; 82 | 83 | self.viewControllers = localViewControllersArray; 84 | self.moreNavigationController.navigationBar.barStyle = UIBarStyleBlackOpaque; 85 | 86 | [localViewControllersArray release]; 87 | 88 | self.moreNavigationController.navigationController.navigationBar.barStyle = UIBarStyleBlackOpaque; 89 | 90 | } 91 | return self; 92 | } 93 | 94 | -(void)tabBar:(UITabBar *)tabBar willBeginCustomizingItems:(NSArray *)items 95 | { 96 | UINavigationBar *nav = (UINavigationBar *) [[(UIView *) [self.view.subviews objectAtIndex:1] subviews] objectAtIndex:0]; 97 | [nav setBarStyle:UIBarStyleBlackOpaque]; 98 | 99 | } 100 | 101 | - (void)viewDidLoad { 102 | [super viewDidLoad]; 103 | } 104 | 105 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 106 | if ([videoListViewController.videoDetailViewController.view superview] || 107 | [settingViewController.view superview] || 108 | [panVViewController.view superview]) 109 | return NO; 110 | 111 | return YES; 112 | } 113 | 114 | - (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { 115 | 116 | } 117 | 118 | - (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation { 119 | 120 | } 121 | 122 | - (void)didReceiveMemoryWarning { 123 | [super didReceiveMemoryWarning]; // Releases the view if it doesn't have a superview 124 | // Release anything that's not essential, such as cached data 125 | } 126 | 127 | - (void)dealloc { 128 | [localViewController release]; 129 | [settingViewController release]; 130 | [videoListViewController release]; 131 | [bookmarksViewController release]; 132 | [panVViewController release]; 133 | [recentsViewController release]; 134 | [nowPlayingViewController release]; 135 | [super dealloc]; 136 | } 137 | 138 | @end 139 | --------------------------------------------------------------------------------