Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-gpu
Commits
173b89e2
Commit
173b89e2
authored
Dec 19, 2007
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MacOSX/Framework/VLCMedia.m: Implement mediaAsNodeWithName:.
parent
af1e3b56
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
3 deletions
+38
-3
extras/MacOSX/Framework/Headers/Public/VLCMedia.h
extras/MacOSX/Framework/Headers/Public/VLCMedia.h
+3
-0
extras/MacOSX/Framework/Sources/VLCMedia.m
extras/MacOSX/Framework/Sources/VLCMedia.m
+35
-3
No files found.
extras/MacOSX/Framework/Headers/Public/VLCMedia.h
View file @
173b89e2
...
...
@@ -122,6 +122,8 @@ extern NSString *VLCMediaMetaChanged; //< Notification message for when t
*/
+
(
id
)
mediaWithURL
:(
NSURL
*
)
anURL
;
+
(
id
)
mediaWithPath
:(
NSString
*
)
aPath
;
+
(
id
)
mediaAsNodeWithName
:(
NSString
*
)
aName
;
/* Initializers */
/**
...
...
@@ -132,6 +134,7 @@ extern NSString *VLCMediaMetaChanged; //< Notification message for when t
* \return A new VLCMedia object, only if there were no errors.
*/
-
(
id
)
initWithPath
:(
NSString
*
)
aPath
;
-
(
id
)
initAsNodeWithName
:(
NSString
*
)
aName
;
/**
* Returns an NSComparisonResult value that indicates the lexical ordering of
...
...
extras/MacOSX/Framework/Sources/VLCMedia.m
View file @
173b89e2
...
...
@@ -102,12 +102,43 @@ static void HandleMediaDurationChanged(const libvlc_event_t *event, void *self)
@implementation
VLCMedia
+
(
id
)
mediaWithPath
:(
NSString
*
)
aPath
;
{
return
[[[
VLCMedia
alloc
]
initWithPath
:
(
id
)
aPath
]
autorelease
];
return
[[[
VLCMedia
alloc
]
initWithPath
:
aPath
]
autorelease
];
}
+
(
id
)
mediaWithURL
:(
NSURL
*
)
aURL
;
{
return
[[[
VLCMedia
alloc
]
initWithPath
:(
id
)[
aURL
path
]]
autorelease
];
return
[[[
VLCMedia
alloc
]
initWithPath
:[
aURL
path
]]
autorelease
];
}
+
(
id
)
mediaAsNodeWithName
:(
NSString
*
)
aName
;
{
return
[[[
VLCMedia
alloc
]
initAsNodeWithName
:
aName
]
autorelease
];
}
-
(
id
)
initAsNodeWithName
:(
NSString
*
)
aName
{
if
(
self
=
[
super
init
])
{
libvlc_exception_t
ex
;
libvlc_exception_init
(
&
ex
);
p_md
=
libvlc_media_descriptor_new_as_node
(
[
VLCLibrary
sharedInstance
],
[
aName
UTF8String
],
&
ex
);
quit_on_exception
(
&
ex
);
url
=
[
aName
copy
];
delegate
=
nil
;
metaDictionary
=
[[
NSMutableDictionary
alloc
]
initWithCapacity
:
3
];
// This value is set whenever the demuxer figures out what the length is.
// TODO: Easy way to tell the length of the movie without having to instiate the demuxer. Maybe cached info?
length
=
nil
;
[
self
initInternalMediaDescriptor
];
}
return
self
;
}
-
(
id
)
initWithPath
:(
NSString
*
)
aPath
...
...
@@ -172,7 +203,7 @@ static void HandleMediaDurationChanged(const libvlc_event_t *event, void *self)
-
(
NSString
*
)
description
{
NSString
*
result
=
[
metaDictionary
objectForKey
:
VLCMetaInformationTitle
];
return
(
result
?
result
:
url
)
;
return
[
NSString
stringWithFormat
:
@"<%@ %p> %@"
,
[
self
className
],
self
,
(
result
?
result
:
url
)]
;
}
-
(
NSComparisonResult
)
compare
:(
VLCMedia
*
)
media
...
...
@@ -366,6 +397,7 @@ static void HandleMediaDurationChanged(const libvlc_event_t *event, void *self)
quit_on_exception
(
&
ex
);
libvlc_media_list_t
*
p_mlist
=
libvlc_media_descriptor_subitems
(
p_md
,
NULL
);
if
(
!
p_mlist
)
subitems
=
nil
;
else
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment