[vlc-commits] library/media types: expose VLCInputItem

Felix Paul Kühne git at videolan.org
Fri Jul 5 15:45:52 CEST 2019


vlc | branch: master | Felix Paul Kühne <felix at feepk.net> | Fri Jul  5 15:21:01 2019 +0200| [e9972af72702963fcb58018002e9a33bd582a687] | committer: Felix Paul Kühne

library/media types: expose VLCInputItem

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e9972af72702963fcb58018002e9a33bd582a687
---

 modules/gui/macosx/library/VLCLibraryDataTypes.h |  2 ++
 modules/gui/macosx/library/VLCLibraryDataTypes.m | 12 ++++++++++++
 2 files changed, 14 insertions(+)

diff --git a/modules/gui/macosx/library/VLCLibraryDataTypes.h b/modules/gui/macosx/library/VLCLibraryDataTypes.h
index aa27b7133d..f496d60dd9 100644
--- a/modules/gui/macosx/library/VLCLibraryDataTypes.h
+++ b/modules/gui/macosx/library/VLCLibraryDataTypes.h
@@ -26,6 +26,7 @@
 NS_ASSUME_NONNULL_BEGIN
 
 @class VLCMediaLibraryMediaItem;
+ at class VLCInputItem;
 
 extern const CGFloat VLCMediaLibrary4KWidth;
 extern const CGFloat VLCMediaLibrary4KHeight;
@@ -150,6 +151,7 @@ extern const long long int VLCMediaLibraryMediaItemDurationDenominator;
 @property (readonly) int64_t libraryID;
 @property (readonly) vlc_ml_media_type_t mediaType;
 @property (readonly) vlc_ml_media_subtype_t mediaSubType;
+ at property (readonly) VLCInputItem *inputItem;
 
 @property (readonly) NSArray <VLCMediaLibraryFile *> *files;
 @property (readonly) NSArray <VLCMediaLibraryTrack *> *tracks;
diff --git a/modules/gui/macosx/library/VLCLibraryDataTypes.m b/modules/gui/macosx/library/VLCLibraryDataTypes.m
index 91f83363dd..a347ac9606 100644
--- a/modules/gui/macosx/library/VLCLibraryDataTypes.m
+++ b/modules/gui/macosx/library/VLCLibraryDataTypes.m
@@ -24,6 +24,7 @@
 
 #import "main/VLCMain.h"
 #import "extensions/NSString+Helpers.h"
+#import "library/VLCInputItem.h"
 
 #import <vlc_url.h>
 
@@ -303,6 +304,17 @@ const long long int VLCMediaLibraryMediaItemDurationDenominator = 1000;
             NSStringFromClass([self class]), _title, _libraryID, _mediaType, _smallArtworkMRL];
 }
 
+- (VLCInputItem *)inputItem
+{
+    input_item_t *p_inputItem = vlc_ml_get_input_item(_p_mediaLibrary, _libraryID);
+    VLCInputItem *inputItem = nil;
+    if (p_inputItem) {
+        inputItem = [[VLCInputItem alloc] initWithInputItem:p_inputItem];
+    }
+    input_item_Release(p_inputItem);
+    return inputItem;
+}
+
 #pragma mark - preference setters / getters
 
 - (int)setIntegerPreference:(int)value forKey:(enum vlc_ml_playback_pref)key



More information about the vlc-commits mailing list