| ARX 1.0 The next-generation open source augmented reality toolkit.

Loading...
Searching...
No Matches
MovieVideo.h
Go to the documentation of this file.
1/*
2 * MovieVideo.h
3 * artoolkitX
4 *
5 * This file is part of artoolkitX.
6 *
7 * artoolkitX is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU Lesser General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * artoolkitX 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 Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public License
18 * along with artoolkitX. If not, see <http://www.gnu.org/licenses/>.
19 *
20 * As a special exception, the copyright holders of this library give you
21 * permission to link this library with independent modules to produce an
22 * executable, regardless of the license terms of these independent modules, and to
23 * copy and distribute the resulting executable under terms of your choice,
24 * provided that you also meet, for each linked independent module, the terms and
25 * conditions of the license of that module. An independent module is a module
26 * which is neither derived from nor based on this library. If you modify this
27 * library, you may extend this exception to your version of the library, but you
28 * are not obligated to do so. If you do not wish to do so, delete this exception
29 * statement from your version.
30 *
31 * Copyright 2018 Realmax, Inc.
32 * Copyright 2015 Daqri, LLC.
33 * Copyright 2010-2015 ARToolworks, Inc.
34 *
35 * Author(s): Philip Lamb
36 *
37 */
38
39#import <AVFoundation/AVFoundation.h>
40
41#import <ARX/AR/config.h> // AR_PIXEL_FORMAT
42
43// Notifications.
44 extern NSString *const MovieVideoMediaLoadedNofication;
45 extern NSString *const MovieVideoPlaybackEndedNofication;
46
47@interface MovieVideo : NSObject
48
49//
50// Options for configuration string 'conf'.
51//
52// -width=w Set width of buffer pointed to by bufDataPtr to w. Default is actual width of video.
53// -height=h Set height of buffer pointed to by bufDataPtr to h. Default is actual height of video.
54// -pixelformat=pppp Format for pixels pointed to by bufDataPtr. pppp is either 4 character type, or unsigned 32-bit integer, corresponding to appropriate AVFoundation type. Default is 'BGRA'. Another common format is '420v'.
55// -[no]fliph If -fliph, flips incoming video frames horizontally. Default is -nofliph.
56// -[no]flipv If -flipv, flips incoming video frames vertically. Default is -noflipv.
57// -[no]loop If -loop, video will loop back to beginning when end is reached. Default is -noloop.
58// -[no]fill If -fill, video will be proportionally resized from the centre to fill the buffer. If -nofill, video will be fitted inside buffer, and may be letter-boxed or pillar-boxed. Default is -nofill.
59// -[no]1to1 If -1to1, video will be shown inside buffer at original side (may be cropped or displayed with a border). Default is -no1to1.
60// -[no]stretch If -stretch, video will be stretched to fill the buffer. Default is -nostretch.
61// -[no]mute If -mute, any audio in the movie file will be ignored. Default is -nomute.
62// -[no]singlebuffer If -singlebuffer, video frames will be single buffered (may produce tearing). Default is -nosinglebuffer.
63// -[no]pause If -pause, video will be paused when first loaded. Default is -nopause.
64// -[no]alpha Hint that the video contains an alpha channel. Default is -noalpha.
65// -transparent=hhhhhh Transparent colour, expressed as an RGB hex triplet (e.g. ff0000 for red).
66// -chromakey=min,max Perform chroma-keying on video. Chroma values must be expressed as minimum and maximum hue angles 'min' and 'max' in range [0-360), separated by a comma.
67//
68
69
70-(id) initWithURL:(NSURL *)url config:(char *)conf;
71-(bool) start;
72-(unsigned char *)getFrame;
73-(void) stop;
74
75@property(nonatomic, getter=isPaused) BOOL paused;
76@property(nonatomic, readonly, getter=isLoaded) BOOL loaded;
77@property(readonly) NSInteger contentWidth;
78@property(readonly) NSInteger contentHeight;
79@property(nonatomic, readonly) AR_PIXEL_FORMAT ARPixelFormat;
80@property(readonly) OSType pixFormat;
81@property(readonly) size_t bufWidth;
82@property(readonly) size_t bufHeight;
83@property(readonly) size_t bufRowBytes;
84@property(nonatomic, readonly) unsigned char *bufDataPtr;
85
86@property(nonatomic, readonly) BOOL transparent;
87-(BOOL) transparencyByTransparentRGBA:(uint32_t *)rgba;
88-(void) setTransparencyByTransparent:(BOOL)on RGBA:(uint32_t)rgba;
89-(BOOL) transparencyByChromaKeyHueMinAngle:(float *)hueMinAngle hueMaxAngle:(float *)hueMaxAngle;
90-(void) setTransparencyByChromaKey:(BOOL)on hueMinAngle:(float)hueMinAngle hueMaxAngle:(float)hueMaxAngle;
91
92@end
MovieVideoPlaybackEndedNofication
NSString *const MovieVideoPlaybackEndedNofication
MovieVideoMediaLoadedNofication
NSString *const MovieVideoMediaLoadedNofication
MovieVideo
Definition: MovieVideo.h:48
MovieVideo::contentHeight
NSInteger contentHeight
Definition: MovieVideo.h:78
MovieVideo::ARPixelFormat
AR_PIXEL_FORMAT ARPixelFormat
Definition: MovieVideo.h:79
MovieVideo::bufWidth
size_t bufWidth
Definition: MovieVideo.h:81
-[MovieVideo getFrame]
unsigned char * getFrame()
-[MovieVideo stop]
void stop()
MovieVideo::transparent
BOOL transparent
Definition: MovieVideo.h:86
MovieVideo::bufHeight
size_t bufHeight
Definition: MovieVideo.h:82
MovieVideo::paused
BOOL paused
Definition: MovieVideo.h:75
MovieVideo::bufDataPtr
unsigned char * bufDataPtr
Definition: MovieVideo.h:84
-[MovieVideo start]
bool start()
MovieVideo::contentWidth
NSInteger contentWidth
Definition: MovieVideo.h:77
MovieVideo::pixFormat
OSType pixFormat
Definition: MovieVideo.h:80
MovieVideo::loaded
BOOL loaded
Definition: MovieVideo.h:76
MovieVideo::bufRowBytes
size_t bufRowBytes
Definition: MovieVideo.h:83