]> git.sesse.net Git - vlc/blobdiff - include/vlc_es.h
l10n: Initial Catalan (Valencian) translation
[vlc] / include / vlc_es.h
index bc0cbc0bf2a51b500c6a4f9b52a17ce99d234757..5790d2343b22322d1f5e4965697dbc3d5a0e378c 100644 (file)
@@ -25,6 +25,7 @@
 #define VLC_ES_H 1
 
 #include <vlc_fourcc.h>
+#include <vlc_text_style.h>
 
 /**
  * \file
  * \see video_format_t
  * \see subs_format_t
  */
+#define VIDEO_PALETTE_COLORS_MAX 256
+
 struct video_palette_t
 {
-    int i_entries;      /**< to keep the compatibility with ffmpeg's palette */
-    uint8_t palette[256][4];                   /**< 4-byte RGBA/YUVA palette */
+    int i_entries;      /**< to keep the compatibility with libavcodec's palette */
+    uint8_t palette[VIDEO_PALETTE_COLORS_MAX][4];  /**< 4-byte RGBA/YUVA palette */
 };
 
 /**
@@ -71,7 +74,7 @@ struct audio_format_t
 
     /* Describes the channels configuration of the samples (ie. number of
      * channels which are available in the buffer, and positions). */
-    uint32_t     i_physical_channels;
+    uint16_t     i_physical_channels;
 
     /* Describes from which original channels, before downmixing, the
      * buffer is derived. */
@@ -123,10 +126,12 @@ struct audio_format_t
 #define AOUT_CHANS_6_0    (AOUT_CHANS_4_0   | AOUT_CHANS_MIDDLE)
 #define AOUT_CHANS_7_0    (AOUT_CHANS_6_0   | AOUT_CHAN_CENTER)
 #define AOUT_CHANS_7_1    (AOUT_CHANS_5_1   | AOUT_CHANS_MIDDLE)
+#define AOUT_CHANS_8_1    (AOUT_CHANS_7_1   | AOUT_CHAN_REARCENTER)
 
 #define AOUT_CHANS_4_0_MIDDLE (AOUT_CHANS_FRONT | AOUT_CHANS_MIDDLE)
 #define AOUT_CHANS_4_CENTER_REAR (AOUT_CHANS_FRONT | AOUT_CHANS_CENTER)
 #define AOUT_CHANS_5_0_MIDDLE (AOUT_CHANS_4_0_MIDDLE | AOUT_CHAN_CENTER)
+#define AOUT_CHANS_6_1_MIDDLE (AOUT_CHANS_5_0_MIDDLE | AOUT_CHAN_REARCENTER | AOUT_CHAN_LFE)
 
 /* Values available for original channels only */
 #define AOUT_CHAN_DOLBYSTEREO       0x10000
@@ -151,6 +156,8 @@ typedef enum video_orientation_t
     ORIENT_RIGHT_BOTTOM, /**< Anti-transposed */
 
     ORIENT_NORMAL      = ORIENT_TOP_LEFT,
+    ORIENT_TRANSPOSED  = ORIENT_LEFT_TOP,
+    ORIENT_ANTI_TRANSPOSED = ORIENT_RIGHT_BOTTOM,
     ORIENT_HFLIPPED    = ORIENT_TOP_RIGHT,
     ORIENT_VFLIPPED    = ORIENT_BOTTOM_LEFT,
     ORIENT_ROTATED_180 = ORIENT_BOTTOM_RIGHT,
@@ -172,6 +179,18 @@ typedef enum video_orientation_t
 /** Applies horizontal flip to an orientation */
 #define ORIENT_ROTATE_180(orient) ((orient) ^ 3)
 
+typedef enum video_transform_t
+{
+    TRANSFORM_IDENTITY       = ORIENT_NORMAL,
+    TRANSFORM_HFLIP          = ORIENT_HFLIPPED,
+    TRANSFORM_VFLIP          = ORIENT_VFLIPPED,
+    TRANSFORM_R180           = ORIENT_ROTATED_180,
+    TRANSFORM_R270           = ORIENT_ROTATED_270,
+    TRANSFORM_R90            = ORIENT_ROTATED_90,
+    TRANSFORM_TRANSPOSE      = ORIENT_TRANSPOSED,
+    TRANSFORM_ANTI_TRANSPOSE = ORIENT_ANTI_TRANSPOSED
+} video_transform_t;
+
 /**
  * video format description
  */
@@ -248,7 +267,9 @@ static inline void video_format_Clean( video_format_t *p_src )
  * It will fill up a video_format_t using the given arguments.
  * Note that the video_format_t must already be initialized.
  */
-VLC_API void video_format_Setup( video_format_t *, vlc_fourcc_t i_chroma, int i_width, int i_height, int i_sar_num, int i_sar_den );
+VLC_API void video_format_Setup( video_format_t *, vlc_fourcc_t i_chroma,
+    int i_width, int i_height, int i_visible_width, int i_visible_height,
+    int i_sar_num, int i_sar_den );
 
 /**
  * It will copy the crop properties from a video_format_t to another.
@@ -260,6 +281,28 @@ VLC_API void video_format_CopyCrop( video_format_t *, const video_format_t * );
  */
 VLC_API void video_format_ScaleCropAr( video_format_t *, const video_format_t * );
 
+/**
+ * This function "normalizes" the formats orientation, by switching the a/r according to the orientation,
+ * producing a format whose orientation is ORIENT_NORMAL. It makes a shallow copy (pallette is not alloc'ed).
+ */
+VLC_API void video_format_ApplyRotation(video_format_t *restrict out, const video_format_t *restrict in);
+
+/**
+ * This function applies the transform operation to fmt.
+ */
+VLC_API void video_format_TransformBy(video_format_t *fmt, video_transform_t transform);
+
+/**
+ * This function applies the transforms necessary to fmt so that the resulting fmt
+ * has the dst_orientation.
+ */
+VLC_API void video_format_TransformTo(video_format_t *fmt, video_orientation_t dst_orientation);
+
+/**
+ * Returns the operation required to transform src into dst.
+ */
+VLC_API video_transform_t video_format_GetTransform(video_orientation_t src, video_orientation_t dst);
+
 /**
  * This function will check if the first video format is similar
  * to the second one.
@@ -271,6 +314,18 @@ VLC_API bool video_format_IsSimilar( const video_format_t *, const video_format_
  */
 VLC_API void video_format_Print( vlc_object_t *, const char *, const video_format_t * );
 
+
+static inline video_transform_t transform_Inverse( video_transform_t transform )
+{
+    switch ( transform ) {
+        case TRANSFORM_R90:
+            return TRANSFORM_R270;
+        case TRANSFORM_R270:
+            return TRANSFORM_R90;
+        default:
+            return transform;
+    }
+}
 /**
  * subtitles format description
  */
@@ -304,6 +359,8 @@ struct subs_format_t
         int i_magazine;
         int i_page;
     } teletext;
+
+    text_style_t *p_style; /* Default styles to use */
 };
 
 /**
@@ -318,6 +375,10 @@ typedef struct extra_languages_t
 /**
  * ES format definition
  */
+#define ES_PRIORITY_NOT_SELECTABLE  -2
+#define ES_PRIORITY_NOT_DEFAULTABLE -1
+#define ES_PRIORITY_SELECTABLE_MIN   0
+#define ES_PRIORITY_MIN ES_PRIORITY_NOT_SELECTABLE
 struct es_format_t
 {
     int             i_cat;              /**< ES category @see es_format_category_e */
@@ -361,11 +422,12 @@ struct es_format_t
 enum es_format_category_e
 {
     UNKNOWN_ES = 0x00,
-    VIDEO_ES   = 0x01,
-    AUDIO_ES   = 0x02,
-    SPU_ES     = 0x03,
-    NAV_ES     = 0x04,
+    VIDEO_ES,
+    AUDIO_ES,
+    SPU_ES,
+    NAV_ES,
 };
+#define ES_CATEGORY_COUNT (NAV_ES + 1)
 
 /**
  * This function will fill all RGB shift from RGB masks.