Commit 251c4c88 authored by Felix Paul Kühne's avatar Felix Paul Kühne

macosx/framework: fixed MPEG2 exporting, updated iPod video profile (requires...

macosx/framework: fixed MPEG2 exporting, updated iPod video profile (requires contribs with mp4a encoder) and added a method to stop all this
parent d352575a
...@@ -42,4 +42,5 @@ ...@@ -42,4 +42,5 @@
@property (readonly) BOOL isComplete; @property (readonly) BOOL isComplete;
- (void)startStreaming; - (void)startStreaming;
- (void)stopStreaming;
@end @end
...@@ -354,6 +354,7 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self) ...@@ -354,6 +354,7 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self)
{ {
libvlc_media_t * p_md; libvlc_media_t * p_md;
p_md = libvlc_media_duplicate( [media libVLCMediaDescriptor] ); p_md = libvlc_media_duplicate( [media libVLCMediaDescriptor] );
for( NSString * key in [options allKeys] ) for( NSString * key in [options allKeys] )
{ {
libvlc_media_add_option(p_md, [[NSString stringWithFormat:@"%@=#%@", key, [options objectForKey:key]] UTF8String]); libvlc_media_add_option(p_md, [[NSString stringWithFormat:@"%@=#%@", key, [options objectForKey:key]] UTF8String]);
......
...@@ -70,19 +70,20 @@ ...@@ -70,19 +70,20 @@
return [self streamOutputWithOptionDictionary:[NSDictionary dictionaryWithObjectsAndKeys: return [self streamOutputWithOptionDictionary:[NSDictionary dictionaryWithObjectsAndKeys:
[NSDictionary dictionaryWithObjectsAndKeys: [NSDictionary dictionaryWithObjectsAndKeys:
@"h264", @"videoCodec", @"h264", @"videoCodec",
@"1024", @"videoBitrate", @"1024", @"videoBitrate", // max by Apple: 1.5 mbps
@"mp4a", @"audioCodec", @"mp4a", @"audioCodec",
@"192", @"audioBitrate", @"128", @"audioBitrate", // max by Apple: 160 kbps
@"2", @"channels", @"2", @"channels",
@"320", @"width", @"640", @"width", // max by Apple: do.
@"240", @"canvasHeight", @"480", @"canvasHeight", // max by Apple: do.
@"Yes", @"audio-sync", @"Yes", @"audio-sync",
nil nil
], @"transcodingOptions", ], @"transcodingOptions",
[NSDictionary dictionaryWithObjectsAndKeys: [NSDictionary dictionaryWithObjectsAndKeys:
@"mp4", @"muxer", @"mp4", @"muxer",
@"file", @"access", @"file", @"access",
[[filePath copy] autorelease], @"destination", nil [[filePath copy] autorelease], @"destination",
nil
], @"outputOptions", ], @"outputOptions",
nil nil
] ]
...@@ -128,13 +129,13 @@ ...@@ -128,13 +129,13 @@
[NSDictionary dictionaryWithObjectsAndKeys: [NSDictionary dictionaryWithObjectsAndKeys:
@"mp2v", @"videoCodec", @"mp2v", @"videoCodec",
@"1024", @"videoBitrate", @"1024", @"videoBitrate",
@"mp2a", @"audioCodec", @"mpga", @"audioCodec",
@"128", @"audioBitrate", @"128", @"audioBitrate",
@"Yes", @"audio-sync", @"Yes", @"audio-sync",
nil nil
], @"transcodingOptions", ], @"transcodingOptions",
[NSDictionary dictionaryWithObjectsAndKeys: [NSDictionary dictionaryWithObjectsAndKeys:
@"mpeg", @"muxer", @"ps", @"muxer",
@"file", @"access", @"file", @"access",
[[filePath copy] autorelease], @"destination", nil [[filePath copy] autorelease], @"destination", nil
], @"outputOptions", ], @"outputOptions",
......
...@@ -57,20 +57,25 @@ ...@@ -57,20 +57,25 @@
} }
- (void)startStreaming; - (void)startStreaming
{ {
self.isComplete = NO; self.isComplete = NO;
[self play]; [self play];
} }
- (BOOL)play; - (void)stopStreaming
{
self.isComplete = YES;
[super stop];
}
- (BOOL)play
{ {
NSString * libvlcArgs; NSString * libvlcArgs;
if( self.drawable ) if( self.drawable )
libvlcArgs = [NSString stringWithFormat:@"duplicate{dst=display,dst=\"%@\"}",[streamOutput representedLibVLCOptions]]; libvlcArgs = [NSString stringWithFormat:@"duplicate{dst=display,dst=\"%@\"}",[streamOutput representedLibVLCOptions]];
else else
libvlcArgs = [streamOutput representedLibVLCOptions]; libvlcArgs = [streamOutput representedLibVLCOptions];
if( libvlcArgs ) if( libvlcArgs )
{ {
[super setMedia: [VLCMedia mediaWithMedia:originalMedia andLibVLCOptions: [super setMedia: [VLCMedia mediaWithMedia:originalMedia andLibVLCOptions:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment