Browse Source

VLCMedia: Add orientation and projection

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
Soomin Lee 8 years ago
parent
commit
3650f183bd
2 changed files with 42 additions and 0 deletions
  1. 37 0
      Headers/Public/VLCMedia.h
  2. 5 0
      Sources/VLCMedia.m

+ 37 - 0
Headers/Public/VLCMedia.h

@@ -8,6 +8,7 @@
  *
  * Authors: Pierre d'Herbemont <pdherbemont # videolan.org>
  *          Felix Paul Kühne <fkuehne # videolan.org>
+ *          Soomin Lee <TheHungryBu # gmail.com>
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU Lesser General Public License as published by
@@ -167,6 +168,29 @@ typedef NS_ENUM(NSInteger, VLCMediaState) {
 - (instancetype)initAsNodeWithName:(NSString *)aName;
 
 /**
+ * list of possible media orientation.
+ */
+typedef NS_ENUM(NSUInteger, VLCMediaOrientation) {
+	VLCMediaOrientationTopLeft,
+	VLCMediaOrientationTopRight,
+	VLCMediaOrientationBottomLeft,
+	VLCMediaOrientationBottomRight,
+	VLCMediaOrientationLeftTop,
+	VLCMediaOrientationLeftBottom,
+	VLCMediaOrientationRightTop,
+	VLCMediaOrientationRightBottom
+};
+
+/**
+ * list of possible media projection.
+ */
+typedef NS_ENUM(NSUInteger, VLCMediaProjection) {
+	VLCMediaProjectionRectangular,
+	VLCMediaProjectionEquiRectangular,
+	VLCMediaProjectionCubemapLayoutStandard = 0x100
+};
+
+/**
  * list of possible media types that could be returned by "mediaType"
  */
 typedef NS_ENUM(NSUInteger, VLCMediaType) {
@@ -361,6 +385,17 @@ extern NSString *const VLCMediaTracksInformationVideoHeight;
 extern NSString *const VLCMediaTracksInformationVideoWidth;
 
 /**
+ * video track orientation
+ * \note returns the orientation as NSNumber
+ */
+extern NSString *const VLCMediaTracksInformationVideoOrientation;
+/**
+ * video track projection
+ * \note the projection as NSNumber
+ */
+extern NSString *const VLCMediaTracksInformationVideoProjection;
+
+/**
  * source aspect ratio
  * \note returns the source aspect ratio as NSNumber
  */
@@ -427,6 +462,8 @@ extern NSString *const VLCMediaTracksInformationTypeUnknown;
  *
  * \see VLCMediaTracksInformationVideoHeight
  * \see VLCMediaTracksInformationVideoWidth
+ * \see VLCMediaTracksInformationVideoOrientation
+ * \see VLCMediaTracksInformationVideoProjection
  *
  * \see VLCMediaTracksInformationSourceAspectRatio
  * \see VLCMediaTracksInformationSourceAspectDenominator

+ 5 - 0
Sources/VLCMedia.m

@@ -8,6 +8,7 @@
  *
  * Authors: Pierre d'Herbemont <pdherbemont # videolan.org>
  *          Felix Paul Kühne <fkuehne # videolan.org>
+ *          Soomin Lee <TheHungryBu # gmail.com>
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU Lesser General Public License as published by
@@ -638,6 +639,8 @@ NSString *const VLCMediaTracksInformationAudioRate           = @"rate";
 
 NSString *const VLCMediaTracksInformationVideoHeight = @"height"; // NSNumber
 NSString *const VLCMediaTracksInformationVideoWidth  = @"width";  // NSNumber
+NSString *const VLCMediaTracksInformationVideoOrientation = @"orientation"; // NSNumber
+NSString *const VLCMediaTracksInformationVideoProjection = @"projection";   // NSNumber
 
 NSString *const VLCMediaTracksInformationSourceAspectRatio        = @"sar_num"; // NSNumber
 NSString *const VLCMediaTracksInformationSourceAspectDenominator  = @"sar_den";  // NSNumber
@@ -682,6 +685,8 @@ NSString *const VLCMediaTracksInformationTextEncoding = @"encoding"; // NSString
                 type = VLCMediaTracksInformationTypeVideo;
                 dictionary[VLCMediaTracksInformationVideoWidth] = @(tracksInfo[i]->video->i_width);
                 dictionary[VLCMediaTracksInformationVideoHeight] = @(tracksInfo[i]->video->i_height);
+                dictionary[VLCMediaTracksInformationVideoOrientation] = @(tracksInfo[i]->video->i_orientation);
+                dictionary[VLCMediaTracksInformationVideoProjection] = @(tracksInfo[i]->video->i_projection);
                 dictionary[VLCMediaTracksInformationSourceAspectRatio] = @(tracksInfo[i]->video->i_sar_num);
                 dictionary[VLCMediaTracksInformationSourceAspectDenominator] = @(tracksInfo[i]->video->i_sar_den);
                 dictionary[VLCMediaTracksInformationFrameRate] = @(tracksInfo[i]->video->i_frame_rate_num);