mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 02:10:48 +00:00
Update code to read NSData, add implementation of open/close in VideoSourceSink.m
This commit is contained in:
parent
a4e417b683
commit
90bbe8d1bf
5 changed files with 13 additions and 5 deletions
|
@ -38,6 +38,8 @@
|
|||
|
||||
@protocol GSVideoSink <NSObject>
|
||||
|
||||
+ (BOOL) canInitWithData: (NSData *)d;
|
||||
|
||||
/**
|
||||
* Opens the device for output, called by [NSMovie-play].
|
||||
*/
|
||||
|
|
|
@ -152,7 +152,7 @@ static inline void _loadNSMoviePlugIns (void)
|
|||
{
|
||||
if ([pluginClass canInitWithData: movieData])
|
||||
{
|
||||
_source = [[pluginClass alloc] init];
|
||||
_source = [[pluginClass alloc] initWithData: movieData];
|
||||
}
|
||||
}
|
||||
END_FOR_IN(__videoSourcePlugIns);
|
||||
|
|
|
@ -25,7 +25,7 @@ VideoOutput_OBJC_FILES = VideoOutputSink.m
|
|||
VideoFile_PRINCIPAL_CLASS = VideoFileSource
|
||||
VideoOutput_PRINCIPAL_CLASS = VidioOutputSink
|
||||
|
||||
VideoFile_BUNDLE_LIBS =
|
||||
VideoOutput_BUNDLE_LIBS =
|
||||
VideoFile_BUNDLE_LIBS = -lavformat -lavcodec
|
||||
VideoOutput_BUNDLE_LIBS = -lavformat -lavcodec
|
||||
|
||||
include $(GNUSTEP_MAKEFILES)/bundle.make
|
||||
|
|
|
@ -82,8 +82,8 @@
|
|||
return nil;
|
||||
}
|
||||
|
||||
_data = data;
|
||||
RETAIN(_data);
|
||||
ASSIGN(_data, data);
|
||||
// NSLog(@"data = %@", _data);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
|
|
@ -75,6 +75,11 @@
|
|||
|
||||
@implementation VideoOutputSink
|
||||
|
||||
+ (BOOL) canInitWithData: (NSData *)data
|
||||
{
|
||||
return YES; // for now just say yes...
|
||||
}
|
||||
|
||||
- (void) display: (unsigned char *) buf
|
||||
wrap: (int) wrap
|
||||
xsize: (int) xsize
|
||||
|
@ -90,6 +95,7 @@
|
|||
fwrite(buf + i * wrap, 1, xsize, f);
|
||||
fclose(f);
|
||||
*/
|
||||
NSLog(@"Playing...");
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue