[vlc-commits] player: fix crash caused by use after free

2019-06-21 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
 | Wed Jun 19 21:34:56 2019 +0200| 
[b0637a0769533a714714f4496d5beadb947ffeaa] | committer: Thomas Guillem

player: fix crash caused by use after free

Signed-off-by: Thomas Guillem 

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

 src/input/player.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/input/player.c b/src/input/player.c
index b37fd8aa2e..a038ae67d6 100644
--- a/src/input/player.c
+++ b/src/input/player.c
@@ -3326,7 +3326,8 @@ vlc_player_VoutOSDCallback(vlc_object_t *this, const char 
*var,
 newval.psz_string : var_GetString(vout, "deinterlace-mode");
 vouts_osd_Message(, 1, _("Deinterlace %s (%s)"),
   on == 1 ? _("On") : _("Off"), mode);
-free(mode);
+if (!varmode)
+free(mode);
 }
 
 else if (strcmp(var, "sub-margin") == 0)

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] player: restart main vout on video splitter change

2019-03-11 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
 | Wed Nov 21 11:49:14 2018 +0100| 
[f8361390286829efd8e848cc974f724ef4aafc6d] | committer: Thomas Guillem

player: restart main vout on video splitter change

The vout can't handle live "video-splitter" change for now.
To work-around this issue, this function will set this variable on the
main vout and restart it through the input control.

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

 include/vlc_player.h | 10 +-
 src/input/player.c   | 26 --
 src/libvlccore.sym   |  1 +
 3 files changed, 34 insertions(+), 3 deletions(-)

diff --git a/include/vlc_player.h b/include/vlc_player.h
index 07d1680e37..ddd52f4609 100644
--- a/include/vlc_player.h
+++ b/include/vlc_player.h
@@ -332,7 +332,6 @@ enum vlc_player_subtitle_sync
  */
 enum vlc_vout_filter_type
 {
-VLC_VOUT_FILTER_VIDEO_SPLITTER,
 VLC_VOUT_FILTER_VIDEO_FILTER,
 VLC_VOUT_FILTER_SUB_SOURCE,
 VLC_VOUT_FILTER_SUB_FILTER,
@@ -2447,6 +2446,15 @@ VLC_API void
 vlc_player_SetPauseOnCork(vlc_player_t *player, bool enabled);
 
 /**
+ * Set a video splitter to the main vout
+ *
+ * @param player locked instance
+ * @param splitter a video splitter name or NULL
+ */
+VLC_API void
+vlc_player_SetVideoSplitter(vlc_player_t *player, const char *splitter);
+
+/**
  * Get the audio output
  *
  * @warning The returned pointer must be released with aout_Release().
diff --git a/src/input/player.c b/src/input/player.c
index 34a39eec9a..310156d254 100644
--- a/src/input/player.c
+++ b/src/input/player.c
@@ -3353,6 +3353,30 @@ vlc_player_vout_TriggerOption(vlc_player_t *player, 
const char *option)
 }
 
 void
+vlc_player_SetVideoSplitter(vlc_player_t *player, const char *splitter)
+{
+if (config_GetType("video-splitter") == 0)
+return;
+struct vlc_player_input *input = vlc_player_get_input_locked(player);
+if (!input)
+return;
+
+vout_thread_t *vout = vlc_player_vout_Hold(player);
+var_SetString(vout, "video-splitter", splitter);
+vout_Release(vout);
+
+/* FIXME vout cannot handle live video splitter change, restart the main
+ * vout manually by restarting the first video es */
+struct vlc_player_track *track;
+vlc_vector_foreach(track, >video_track_vector)
+if (track->selected)
+{
+vlc_player_RestartTrack(player, track->es_id);
+break;
+}
+}
+
+void
 vlc_player_vout_SetFullscreen(vlc_player_t *player, bool enabled)
 {
 vlc_player_vout_SetVar(player, "fullscreen", VLC_VAR_BOOL,
@@ -3379,8 +3403,6 @@ vlc_vout_filter_type_to_varname(enum vlc_vout_filter_type 
type)
 {
 switch (type)
 {
-case VLC_VOUT_FILTER_VIDEO_SPLITTER:
-return config_GetType("video-splitter") ? "video-splitter" : NULL;
 case VLC_VOUT_FILTER_VIDEO_FILTER:
 return "video-filter";
 case VLC_VOUT_FILTER_SUB_SOURCE:
diff --git a/src/libvlccore.sym b/src/libvlccore.sym
index 18b67c4c41..f88e9c102b 100644
--- a/src/libvlccore.sym
+++ b/src/libvlccore.sym
@@ -904,6 +904,7 @@ vlc_player_SetSubtitleTextScale
 vlc_player_SetTeletextEnabled
 vlc_player_SetTeletextTransparency
 vlc_player_SetTrackCategoryEnabled
+vlc_player_SetVideoSplitter
 vlc_player_Start
 vlc_player_Stop
 vlc_player_title_list_GetAt

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] hotkeys: fix mouse wheel down event

2019-03-04 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
 | Tue Nov 13 12:09:03 2018 +0100| 
[4b584f2cc3879e7b6c39d92fe08d2527a223bea4] | committer: Thomas Guillem

hotkeys: fix mouse wheel down event

Signed-off-by: Thomas Guillem 

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

 modules/control/hotkeys.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/modules/control/hotkeys.c b/modules/control/hotkeys.c
index 325501f3d1..4f211a0f64 100644
--- a/modules/control/hotkeys.c
+++ b/modules/control/hotkeys.c
@@ -200,8 +200,10 @@ static int ButtonEvent( vlc_object_t *p_this, char const 
*psz_var,
 
 for (int i = MOUSE_BUTTON_WHEEL_UP; i <= MOUSE_BUTTON_WHEEL_RIGHT; i++)
 if (pressed & (1 << i))
-var_SetInteger(vlc_object_instance(p_intf), "key-pressed",
-   i - MOUSE_BUTTON_WHEEL_UP + KEY_MOUSEWHEELUP);
+{
+int keycode = KEY_MOUSEWHEEL_FROM_BUTTON(i);
+var_SetInteger(vlc_object_instance(p_intf), "key-pressed", 
keycode);
+}
 
 return VLC_SUCCESS;
 }

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] actions: add wheel button to keycode helper

2019-03-04 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
 | Wed Nov 28 11:32:11 2018 +0100| 
[fc94ba0af460a5f37a8536a6e18613167ce727a7] | committer: Thomas Guillem

actions: add wheel button to keycode helper

Signed-off-by: Thomas Guillem 

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

 include/vlc_actions.h | 4 
 1 file changed, 4 insertions(+)

diff --git a/include/vlc_actions.h b/include/vlc_actions.h
index c7c533bd7b..428a34944d 100644
--- a/include/vlc_actions.h
+++ b/include/vlc_actions.h
@@ -23,6 +23,8 @@
 #ifndef VLC_ACTIONS_H
 #define VLC_ACTIONS_H 1
 
+# include 
+
 /* Called from src/libvlc.c */
 int
 libvlc_InternalActionsInit(libvlc_int_t *p_libvlc);
@@ -112,6 +114,8 @@ libvlc_InternalActionsClean(libvlc_int_t *p_libvlc);
 #define KEY_MOUSEWHEELDOWN   0x00F1
 #define KEY_MOUSEWHEELLEFT   0x00F2
 #define KEY_MOUSEWHEELRIGHT  0x00F3
+#define KEY_MOUSEWHEEL_FROM_BUTTON(button) \
+(KEY_MOUSEWHEELUP | ((button - MOUSE_BUTTON_WHEEL_UP) << 16))
 
 VLC_API char *vlc_keycode2str(uint_fast32_t i_key, bool locale) VLC_USED;
 VLC_API uint_fast32_t vlc_str2keycode(const char *str) VLC_USED;

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] playlist: fix crash on clear

2018-11-27 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
 | Mon Nov 19 17:41:11 2018 +0100| 
[eda5eeb32204dafb03388964bb003e112c8606a3] | committer: Thomas Guillem

playlist: fix crash on clear

The playlist registers the on_media_changed callback on the player,
which accesses the items vector if the current index is not -1, since
this vector is cleared just before, it crashes. Moving the call to
ClearItems after setting the current media, and so after the callback,
fixes that.

Signed-off-by: Thomas Guillem 

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

 src/playlist/content.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/playlist/content.c b/src/playlist/content.c
index 86de05ccf9..7c8fca044c 100644
--- a/src/playlist/content.c
+++ b/src/playlist/content.c
@@ -204,10 +204,10 @@ vlc_playlist_Clear(vlc_playlist_t *playlist)
 {
 vlc_playlist_AssertLocked(playlist);
 
-vlc_playlist_ClearItems(playlist);
 int ret = vlc_player_SetCurrentMedia(playlist->player, NULL);
 VLC_UNUSED(ret); /* what could we do? */
 
+vlc_playlist_ClearItems(playlist);
 vlc_playlist_ItemsReset(playlist);
 }
 

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] player: osd: add missing calls

2018-11-27 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
 | Wed Nov 21 15:46:58 2018 +0100| 
[8dd18039755b439ae89106ce10c5bd2e7da969b7] | committer: Thomas Guillem

player: osd: add missing calls

Signed-off-by: Thomas Guillem 

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

 src/input/player.c | 32 +---
 1 file changed, 21 insertions(+), 11 deletions(-)

diff --git a/src/input/player.c b/src/input/player.c
index 60f62c3e3a..02890bb522 100644
--- a/src/input/player.c
+++ b/src/input/player.c
@@ -1731,16 +1731,20 @@ void
 vlc_player_SelectNextTitle(vlc_player_t *player)
 {
 struct vlc_player_input *input = vlc_player_get_input_locked(player);
-if (input)
-input_ControlPush(input->thread, INPUT_CONTROL_SET_TITLE_NEXT, NULL);
+if (!input)
+return;
+input_ControlPush(input->thread, INPUT_CONTROL_SET_TITLE_NEXT, NULL);
+vlc_player_vout_OSDMessage(player, NULL, _("Next title"));
 }
 
 void
 vlc_player_SelectPrevTitle(vlc_player_t *player)
 {
 struct vlc_player_input *input = vlc_player_get_input_locked(player);
-if (input)
-input_ControlPush(input->thread, INPUT_CONTROL_SET_TITLE_PREV, NULL);
+if (!input)
+return;
+input_ControlPush(input->thread, INPUT_CONTROL_SET_TITLE_PREV, NULL);
+vlc_player_vout_OSDMessage(player, NULL, _("Previous title"));
 }
 
 ssize_t
@@ -1757,25 +1761,31 @@ void
 vlc_player_SelectChapterIdx(vlc_player_t *player, size_t index)
 {
 struct vlc_player_input *input = vlc_player_get_input_locked(player);
-if (input)
-input_ControlPushHelper(input->thread, INPUT_CONTROL_SET_SEEKPOINT,
-&(vlc_value_t){ .i_int = index });
+if (!input)
+return;
+input_ControlPushHelper(input->thread, INPUT_CONTROL_SET_SEEKPOINT,
+&(vlc_value_t){ .i_int = index });
+vlc_player_vout_OSDMessage(player, NULL, _("Chapter %ld"), index);
 }
 
 void
 vlc_player_SelectNextChapter(vlc_player_t *player)
 {
 struct vlc_player_input *input = vlc_player_get_input_locked(player);
-if (input)
-input_ControlPush(input->thread, INPUT_CONTROL_SET_SEEKPOINT_NEXT, 
NULL);
+if (!input)
+return;
+input_ControlPush(input->thread, INPUT_CONTROL_SET_SEEKPOINT_NEXT, NULL);
+vlc_player_vout_OSDMessage(player, NULL, _("Next chapter"));
 }
 
 void
 vlc_player_SelectPrevChapter(vlc_player_t *player)
 {
 struct vlc_player_input *input = vlc_player_get_input_locked(player);
-if (input)
-input_ControlPush(input->thread, INPUT_CONTROL_SET_SEEKPOINT_PREV, 
NULL);
+if (!input)
+return;
+input_ControlPush(input->thread, INPUT_CONTROL_SET_SEEKPOINT_PREV, NULL);
+vlc_player_vout_OSDMessage(player, NULL, _("Previous chapter"));
 }
 
 static void

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] player: add helper to toggle mute

2018-11-27 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
 | Mon Nov 19 19:10:25 2018 +0100| 
[ae3d4eed7096c15e02d6a0375fa0ecbff520a61e] | committer: Thomas Guillem

player: add helper to toggle mute

Signed-off-by: Thomas Guillem 

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

 include/vlc_player.h | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/include/vlc_player.h b/include/vlc_player.h
index a460cbda22..ca59634e3d 100644
--- a/include/vlc_player.h
+++ b/include/vlc_player.h
@@ -2560,6 +2560,16 @@ VLC_API int
 vlc_player_aout_Mute(vlc_player_t *player, bool mute);
 
 /**
+ * Helper to toggle the mute state
+ */
+static inline int
+vlc_player_aout_ToggleMute(vlc_player_t *player)
+{
+return vlc_player_aout_Mute(player,
+!vlc_player_aout_IsMuted(player));
+}
+
+/**
  * Enable or disable an audio filter
  *
  * @see aout_EnableFilter()

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] player: fix crash on playlist clear

2018-11-27 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
 | Mon Nov 19 19:10:53 2018 +0100| 
[deb281bc4c5300b74db5a6e670771b43728e4b39] | committer: Thomas Guillem

player: fix crash on playlist clear

When clearing an empty playlist, no media has ever been set.

Signed-off-by: Thomas Guillem 

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

 src/input/player.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/input/player.c b/src/input/player.c
index 2014db8bf3..82b74f2aaa 100644
--- a/src/input/player.c
+++ b/src/input/player.c
@@ -2074,13 +2074,15 @@ vlc_player_SetCurrentMedia(vlc_player_t *player, 
input_item_t *media)
 player->releasing_media = false;
 player->has_next_media = true;
 }
-else
+else if (player->media)
 {
 /* The current media will be set to NULL once the current input is
  * stopped */
 player->releasing_media = true;
 player->has_next_media = false;
 }
+else
+return VLC_SUCCESS;
 
 if (player->input)
 {

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] player: osd: fix zoom

2018-11-27 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
 | Wed Nov 21 15:46:18 2018 +0100| 
[cba1a3e9c0364dfff3586e2863aaa46c21c6957e] | committer: Thomas Guillem

player: osd: fix zoom

Signed-off-by: Thomas Guillem 

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

 src/input/player.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/input/player.c b/src/input/player.c
index 82b74f2aaa..60f62c3e3a 100644
--- a/src/input/player.c
+++ b/src/input/player.c
@@ -3301,11 +3301,10 @@ vlc_player_VoutOSDCallback(vlc_object_t *this, const 
char *var,
 vouts_osd_Message(, 1, _("Zooming reset"));
 else
 {
-char const *fmt = _("Zoom: x%f");
 bool found =  vout_osd_PrintVariableText(vout, var, VLC_VAR_FLOAT,
- newval, fmt);
+ newval, _("Zoom mode: 
%s"));
 if (!found)
-vouts_osd_Message(, 1, fmt, newval.f_float);
+vouts_osd_Message(, 1, _("Zoom: x%f"), newval.f_float);
 }
 }
 

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] player: add missing vars

2018-11-27 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
 | Wed Nov 21 12:09:48 2018 +0100| 
[5e9d8953d34077a1feea13ca0dd6fab5a49845c0] | committer: Thomas Guillem

player: add missing vars

These variables are created only to speed-up var_Inherit from the
input_thread_t or other childs.

Signed-off-by: Thomas Guillem 

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

 src/input/player.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/input/player.c b/src/input/player.c
index 02890bb522..59d2fdb774 100644
--- a/src/input/player.c
+++ b/src/input/player.c
@@ -3525,6 +3525,7 @@ vlc_player_New(vlc_object_t *parent,
 VAR_CREATE("rate", VLC_VAR_FLOAT | VLC_VAR_DOINHERIT);
 VAR_CREATE("sub-fps", VLC_VAR_FLOAT | VLC_VAR_DOINHERIT);
 VAR_CREATE("sub-text-scale", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT);
+VAR_CREATE("demux-filter", VLC_VAR_STRING | VLC_VAR_DOINHERIT);
 
 /* vout variables */
 VAR_CREATE("video-splitter", VLC_VAR_STRING | VLC_VAR_DOINHERIT);
@@ -3536,10 +3537,12 @@ vlc_player_New(vlc_object_t *parent,
 VAR_CREATE("video-wallpaper", VLC_VAR_BOOL | VLC_VAR_DOINHERIT);
 
 /* aout variables */
+VAR_CREATE("audio-filter", VLC_VAR_STRING | VLC_VAR_DOINHERIT);
 VAR_CREATE("mute", VLC_VAR_BOOL);
 VAR_CREATE("corks", VLC_VAR_INTEGER);
 
 /* es_out variables */
+VAR_CREATE("sout", VLC_VAR_STRING | VLC_VAR_DOINHERIT);
 VAR_CREATE("video", VLC_VAR_BOOL | VLC_VAR_DOINHERIT);
 VAR_CREATE("sout-video", VLC_VAR_BOOL | VLC_VAR_DOINHERIT);
 VAR_CREATE("audio", VLC_VAR_BOOL | VLC_VAR_DOINHERIT);

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] player: add helper to toggle subtitles

2018-11-27 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
 | Mon Nov 19 19:10:05 2018 +0100| 
[631c32341e08ed317c9eca1d89183af7b3853bb2] | committer: Thomas Guillem

player: add helper to toggle subtitles

Signed-off-by: Thomas Guillem 

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

 include/vlc_player.h | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/include/vlc_player.h b/include/vlc_player.h
index ca59634e3d..78d78d29d3 100644
--- a/include/vlc_player.h
+++ b/include/vlc_player.h
@@ -1891,6 +1891,16 @@ vlc_player_IsSubtitleEnabled(vlc_player_t *player)
 }
 
 /**
+ * Helper to toggle subtitles
+ */
+static inline void
+vlc_player_ToggleSubtitle(vlc_player_t *player)
+{
+bool enabled = !vlc_player_IsSubtitleEnabled(player);
+return vlc_player_SetSubtitleEnabled(player, enabled);
+}
+
+/**
  * Get the number of programs
  *
  * @warning The returned size becomes invalid when the player is unlocked.

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] core: playlist: add OSD support

2018-11-15 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
 | Tue Nov 13 16:28:24 2018 +0100| 
[3db1fc281bc45a1996877db447ead3a045c2f31d] | committer: Thomas Guillem

core: playlist: add OSD support

Using the player OSD.

Signed-off-by: Thomas Guillem 

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

 src/playlist/control.c | 31 +++
 src/playlist/player.h  |  7 +++
 2 files changed, 38 insertions(+)

diff --git a/src/playlist/control.c b/src/playlist/control.c
index 99c975bf64..b84fa6f2e1 100644
--- a/src/playlist/control.c
+++ b/src/playlist/control.c
@@ -27,6 +27,7 @@
 #include "item.h"
 #include "notify.h"
 #include "playlist.h"
+#include "player.h"
 
 static void
 vlc_playlist_PlaybackOrderChanged(vlc_playlist_t *playlist)
@@ -53,6 +54,19 @@ vlc_playlist_PlaybackOrderChanged(vlc_playlist_t *playlist)
 
 vlc_playlist_Notify(playlist, on_playback_order_changed, playlist->order);
 vlc_playlist_state_NotifyChanges(playlist, );
+
+char const *state_text = NULL;
+switch (playlist->order)
+{
+case VLC_PLAYLIST_PLAYBACK_ORDER_NORMAL:
+state_text = N_("Off");
+break;
+case VLC_PLAYLIST_PLAYBACK_ORDER_RANDOM:
+state_text = N_("On");
+break;
+}
+vlc_playlist_PlayerOSDMessage(playlist,
+  _("Random: %s"), vlc_gettext(state_text));
 }
 
 static void
@@ -72,6 +86,21 @@ vlc_playlist_PlaybackRepeatChanged(vlc_playlist_t *playlist)
 
 vlc_playlist_Notify(playlist, on_playback_repeat_changed, 
playlist->repeat);
 vlc_playlist_state_NotifyChanges(playlist, );
+
+char const *mode = NULL;
+switch (playlist->repeat)
+{
+case VLC_PLAYLIST_PLAYBACK_REPEAT_NONE:
+mode = N_("Off");
+break;
+case VLC_PLAYLIST_PLAYBACK_REPEAT_ALL:
+mode = N_("All");
+break;
+case VLC_PLAYLIST_PLAYBACK_REPEAT_CURRENT:
+mode = N_("One");
+break;
+}
+vlc_playlist_PlayerOSDMessage(playlist, _("Loop: %s"), vlc_gettext(mode));
 }
 
 enum vlc_playlist_playback_repeat
@@ -335,6 +364,7 @@ vlc_playlist_Prev(vlc_playlist_t *playlist)
 }
 
 vlc_playlist_SetCurrentIndex(playlist, index);
+vlc_playlist_PlayerOSDMessage(playlist, _("Previous"));
 return VLC_SUCCESS;
 }
 
@@ -362,6 +392,7 @@ vlc_playlist_Next(vlc_playlist_t *playlist)
 }
 
 vlc_playlist_SetCurrentIndex(playlist, index);
+vlc_playlist_PlayerOSDMessage(playlist, _("Next"));
 return VLC_SUCCESS;
 }
 
diff --git a/src/playlist/player.h b/src/playlist/player.h
index f6f54b792d..2566890315 100644
--- a/src/playlist/player.h
+++ b/src/playlist/player.h
@@ -31,4 +31,11 @@ vlc_playlist_PlayerInit(vlc_playlist_t *playlist, 
vlc_object_t *parent);
 void
 vlc_playlist_PlayerDestroy(vlc_playlist_t *playlist);
 
+#ifdef TEST_PLAYLIST
+#define vlc_playlist_PlayerOSDMessage(playlist, fmt...)
+#else
+#define vlc_playlist_PlayerOSDMessage(playlist, fmt...) \
+vlc_player_vout_OSDMessage(playlist->player, fmt)
+#endif
+
 #endif

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] core: vout: add vout_OSDMessageVA

2018-11-15 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
 | Mon Nov  5 11:19:11 2018 +0100| 
[72f780603bd27490b9ea992ea73ed92bb13dbe5b] | committer: Thomas Guillem

core: vout: add vout_OSDMessageVA

Signed-off-by: Thomas Guillem 

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

 include/vlc_vout_osd.h| 12 +++-
 src/libvlccore.sym|  2 +-
 src/video_output/video_text.c |  8 ++--
 3 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/include/vlc_vout_osd.h b/include/vlc_vout_osd.h
index a97b068f85..e8228a1866 100644
--- a/include/vlc_vout_osd.h
+++ b/include/vlc_vout_osd.h
@@ -71,10 +71,20 @@ VLC_API void vout_OSDText( vout_thread_t *vout, int 
channel, int position, vlc_t
  * \param vout The vout on which the message will be displayed
  * \param channel Subpicture channel
  * \param format printf style formatting
+ * \param args format argument list
  *
  * Provided for convenience.
  */
-VLC_API void vout_OSDMessage( vout_thread_t *, int, const char *, ... ) 
VLC_FORMAT( 3, 4 );
+VLC_API void vout_OSDMessageVa(vout_thread_t *, int, const char *, va_list);
+
+static inline void
+vout_OSDMessage(vout_thread_t *vout, int channel, const char *format, ...)
+{
+va_list args;
+va_start(args, format);
+vout_OSDMessageVa(vout, channel, format, args);
+va_end(args);
+}
 
 /**
  * Display a slider on the video output.
diff --git a/src/libvlccore.sym b/src/libvlccore.sym
index 6c89bc65c0..4beb6c0e02 100644
--- a/src/libvlccore.sym
+++ b/src/libvlccore.sym
@@ -737,7 +737,7 @@ vout_RegisterSubpictureChannel
 vout_FlushSubpictureChannel
 vout_GetSnapshot
 vout_OSDIcon
-vout_OSDMessage
+vout_OSDMessageVa
 vout_OSDEpg
 vout_OSDSlider
 vout_OSDText
diff --git a/src/video_output/video_text.c b/src/video_output/video_text.c
index 10de062aa8..19aff57b4f 100644
--- a/src/video_output/video_text.c
+++ b/src/video_output/video_text.c
@@ -144,11 +144,9 @@ void vout_OSDText(vout_thread_t *vout, int channel,
 vout_PutSubpicture(vout, subpic);
 }
 
-void vout_OSDMessage(vout_thread_t *vout, int channel, const char *format, ...)
+void vout_OSDMessageVa(vout_thread_t *vout, int channel,
+   const char *format, va_list args)
 {
-va_list args;
-va_start(args, format);
-
 char *string;
 if (vasprintf(, format, args) != -1) {
 vout_OSDText(vout, channel,
@@ -156,6 +154,4 @@ void vout_OSDMessage(vout_thread_t *vout, int channel, 
const char *format, ...)
  string);
 free(string);
 }
-va_end(args);
 }
-

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] core: vout: add predefined osd slider channels

2018-11-15 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
 | Wed Nov  7 16:50:31 2018 +0100| 
[82260d0153054a87da5969b3701c8f3554b65b2e] | committer: Thomas Guillem

core: vout: add predefined osd slider channels

Signed-off-by: Thomas Guillem 

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

 include/vlc_vout.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/vlc_vout.h b/include/vlc_vout.h
index 0a4e07f85d..a82459b6c8 100644
--- a/include/vlc_vout.h
+++ b/include/vlc_vout.h
@@ -106,6 +106,8 @@ VLC_API void vout_PutPicture( vout_thread_t *, picture_t * 
);
 /* Subpictures channels ID */
 #define VOUT_SPU_CHANNEL_INVALID  (-1) /* Always fails in comparison */
 #define VOUT_SPU_CHANNEL_OSD1 /* OSD channel is automatically 
cleared */
+#define VOUT_SPU_CHANNEL_OSD_HSLIDER2
+#define VOUT_SPU_CHANNEL_OSD_VSLIDER3
 #define VOUT_SPU_CHANNEL_AVAIL_FIRST8 /* Registerable channels from this 
offset */
 
 /* */

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] core: playlist: add OSD support

2018-11-15 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
 | Tue Nov 13 16:28:24 2018 +0100| 
[fab20590f76eb88bc36571020c1b1a75d18d8469] | committer: Thomas Guillem

core: playlist: add OSD support

Using the player OSD.

Signed-off-by: Thomas Guillem 

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

 src/playlist/control.c | 31 +++
 src/playlist/player.h  |  7 +++
 2 files changed, 38 insertions(+)

diff --git a/src/playlist/control.c b/src/playlist/control.c
index 99c975bf64..b84fa6f2e1 100644
--- a/src/playlist/control.c
+++ b/src/playlist/control.c
@@ -27,6 +27,7 @@
 #include "item.h"
 #include "notify.h"
 #include "playlist.h"
+#include "player.h"
 
 static void
 vlc_playlist_PlaybackOrderChanged(vlc_playlist_t *playlist)
@@ -53,6 +54,19 @@ vlc_playlist_PlaybackOrderChanged(vlc_playlist_t *playlist)
 
 vlc_playlist_Notify(playlist, on_playback_order_changed, playlist->order);
 vlc_playlist_state_NotifyChanges(playlist, );
+
+char const *state_text = NULL;
+switch (playlist->order)
+{
+case VLC_PLAYLIST_PLAYBACK_ORDER_NORMAL:
+state_text = N_("Off");
+break;
+case VLC_PLAYLIST_PLAYBACK_ORDER_RANDOM:
+state_text = N_("On");
+break;
+}
+vlc_playlist_PlayerOSDMessage(playlist,
+  _("Random: %s"), vlc_gettext(state_text));
 }
 
 static void
@@ -72,6 +86,21 @@ vlc_playlist_PlaybackRepeatChanged(vlc_playlist_t *playlist)
 
 vlc_playlist_Notify(playlist, on_playback_repeat_changed, 
playlist->repeat);
 vlc_playlist_state_NotifyChanges(playlist, );
+
+char const *mode = NULL;
+switch (playlist->repeat)
+{
+case VLC_PLAYLIST_PLAYBACK_REPEAT_NONE:
+mode = N_("Off");
+break;
+case VLC_PLAYLIST_PLAYBACK_REPEAT_ALL:
+mode = N_("All");
+break;
+case VLC_PLAYLIST_PLAYBACK_REPEAT_CURRENT:
+mode = N_("One");
+break;
+}
+vlc_playlist_PlayerOSDMessage(playlist, _("Loop: %s"), vlc_gettext(mode));
 }
 
 enum vlc_playlist_playback_repeat
@@ -335,6 +364,7 @@ vlc_playlist_Prev(vlc_playlist_t *playlist)
 }
 
 vlc_playlist_SetCurrentIndex(playlist, index);
+vlc_playlist_PlayerOSDMessage(playlist, _("Previous"));
 return VLC_SUCCESS;
 }
 
@@ -362,6 +392,7 @@ vlc_playlist_Next(vlc_playlist_t *playlist)
 }
 
 vlc_playlist_SetCurrentIndex(playlist, index);
+vlc_playlist_PlayerOSDMessage(playlist, _("Next"));
 return VLC_SUCCESS;
 }
 
diff --git a/src/playlist/player.h b/src/playlist/player.h
index f6f54b792d..2566890315 100644
--- a/src/playlist/player.h
+++ b/src/playlist/player.h
@@ -31,4 +31,11 @@ vlc_playlist_PlayerInit(vlc_playlist_t *playlist, 
vlc_object_t *parent);
 void
 vlc_playlist_PlayerDestroy(vlc_playlist_t *playlist);
 
+#ifdef TEST_PLAYLIST
+#define vlc_playlist_PlayerOSDMessage(playlist, fmt...)
+#else
+#define vlc_playlist_PlayerOSDMessage(playlist, fmt...) \
+vlc_player_vout_OSDMessage(playlist->player, fmt)
+#endif
+
 #endif

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] core: vout: add predefined osd slider channels

2018-11-15 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
 | Wed Nov  7 16:50:31 2018 +0100| 
[2b332d7c0971ef617f97d8147ff5898abd9ef253] | committer: Thomas Guillem

core: vout: add predefined osd slider channels

Signed-off-by: Thomas Guillem 

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

 include/vlc_vout.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/vlc_vout.h b/include/vlc_vout.h
index 0a4e07f85d..a82459b6c8 100644
--- a/include/vlc_vout.h
+++ b/include/vlc_vout.h
@@ -106,6 +106,8 @@ VLC_API void vout_PutPicture( vout_thread_t *, picture_t * 
);
 /* Subpictures channels ID */
 #define VOUT_SPU_CHANNEL_INVALID  (-1) /* Always fails in comparison */
 #define VOUT_SPU_CHANNEL_OSD1 /* OSD channel is automatically 
cleared */
+#define VOUT_SPU_CHANNEL_OSD_HSLIDER2
+#define VOUT_SPU_CHANNEL_OSD_VSLIDER3
 #define VOUT_SPU_CHANNEL_AVAIL_FIRST8 /* Registerable channels from this 
offset */
 
 /* */

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] core: vout: add vout_OSDMessageVA

2018-11-15 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
 | Mon Nov  5 11:19:11 2018 +0100| 
[bed6635bbe76d0aaea00355e3693ab34f12d1907] | committer: Thomas Guillem

core: vout: add vout_OSDMessageVA

Signed-off-by: Thomas Guillem 

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

 include/vlc_vout_osd.h| 12 +++-
 src/libvlccore.sym|  2 +-
 src/video_output/video_text.c |  8 ++--
 3 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/include/vlc_vout_osd.h b/include/vlc_vout_osd.h
index a97b068f85..e8228a1866 100644
--- a/include/vlc_vout_osd.h
+++ b/include/vlc_vout_osd.h
@@ -71,10 +71,20 @@ VLC_API void vout_OSDText( vout_thread_t *vout, int 
channel, int position, vlc_t
  * \param vout The vout on which the message will be displayed
  * \param channel Subpicture channel
  * \param format printf style formatting
+ * \param args format argument list
  *
  * Provided for convenience.
  */
-VLC_API void vout_OSDMessage( vout_thread_t *, int, const char *, ... ) 
VLC_FORMAT( 3, 4 );
+VLC_API void vout_OSDMessageVa(vout_thread_t *, int, const char *, va_list);
+
+static inline void
+vout_OSDMessage(vout_thread_t *vout, int channel, const char *format, ...)
+{
+va_list args;
+va_start(args, format);
+vout_OSDMessageVa(vout, channel, format, args);
+va_end(args);
+}
 
 /**
  * Display a slider on the video output.
diff --git a/src/libvlccore.sym b/src/libvlccore.sym
index 6c89bc65c0..4beb6c0e02 100644
--- a/src/libvlccore.sym
+++ b/src/libvlccore.sym
@@ -737,7 +737,7 @@ vout_RegisterSubpictureChannel
 vout_FlushSubpictureChannel
 vout_GetSnapshot
 vout_OSDIcon
-vout_OSDMessage
+vout_OSDMessageVa
 vout_OSDEpg
 vout_OSDSlider
 vout_OSDText
diff --git a/src/video_output/video_text.c b/src/video_output/video_text.c
index 10de062aa8..19aff57b4f 100644
--- a/src/video_output/video_text.c
+++ b/src/video_output/video_text.c
@@ -144,11 +144,9 @@ void vout_OSDText(vout_thread_t *vout, int channel,
 vout_PutSubpicture(vout, subpic);
 }
 
-void vout_OSDMessage(vout_thread_t *vout, int channel, const char *format, ...)
+void vout_OSDMessageVa(vout_thread_t *vout, int channel,
+   const char *format, va_list args)
 {
-va_list args;
-va_start(args, format);
-
 char *string;
 if (vasprintf(, format, args) != -1) {
 vout_OSDText(vout, channel,
@@ -156,6 +154,4 @@ void vout_OSDMessage(vout_thread_t *vout, int channel, 
const char *format, ...)
  string);
 free(string);
 }
-va_end(args);
 }
-

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] vlc_fixups: fix struct if_nameindex definition

2018-10-23 Thread Victorien Le Couviour--Tuffet
vlc/vlc-3.0 | branch: master | Victorien Le Couviour--Tuffet 
 | Wed Sep 12 11:03:42 2018 +0200| 
[f844c78b272a8e7d4087aa972c9ff7767200c67c] | committer: Thomas Guillem

vlc_fixups: fix struct if_nameindex definition

Fixes android ndk17 build
(cherry picked from commit 0481899b5d17a18d33491f554a8957b63727d864)
Signed-off-by: Thomas Guillem 

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

 configure.ac | 1 +
 include/vlc_fixups.h | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/configure.ac b/configure.ac
index 54c270df37..007a2def19 100644
--- a/configure.ac
+++ b/configure.ac
@@ -682,6 +682,7 @@ AC_LINK_IFELSE([
 char dst[[sizeof(struct in_addr)]];
 inet_pton(AF_INET, "127.0.0.1", dst);
 ])],[AC_DEFINE([HAVE_INET_PTON],[1],[Define to 1 if you have inet_pton 
function])],[AC_LIBOBJ([inet_pton])])
+AC_CHECK_TYPES([struct if_nameindex],,,[#include ])
 AC_CHECK_FUNCS([if_nameindex if_nametoindex])
 VLC_RESTORE_FLAGS
 AC_SUBST(SOCKET_LIBS)
diff --git a/include/vlc_fixups.h b/include/vlc_fixups.h
index 3003a154f6..286ff12ca6 100644
--- a/include/vlc_fixups.h
+++ b/include/vlc_fixups.h
@@ -412,11 +412,13 @@ int poll (struct pollfd *, unsigned, int);
 
 #ifndef HAVE_IF_NAMEINDEX
 #include 
+# ifndef HAVE_STRUCT_IF_NAMEINDEX
 struct if_nameindex
 {
 unsigned if_index;
 char*if_name;
 };
+# endif
 # ifndef HAVE_IF_NAMETOINDEX
 #  define if_nametoindex(name)   atoi(name)
 # endif

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] vfilter: yadif deint: disable SIMD on android

2018-10-23 Thread Victorien Le Couviour--Tuffet
vlc/vlc-3.0 | branch: master | Victorien Le Couviour--Tuffet 
 | Mon Sep 17 11:32:03 2018 +0200| 
[522bd3b65fedaa32df30ad0bea86b718eb62716c] | committer: Thomas Guillem

vfilter: yadif deint: disable SIMD on android

Fixes android NDK 17 x86 build: clang fails to compile assembly code
saying it requires more registers than available.
(cherry picked from commit 812fdcb264e7fee25daab689e1b9904c2677d40f)
Signed-off-by: Thomas Guillem 

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

 modules/video_filter/deinterlace/algo_yadif.c | 13 -
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/modules/video_filter/deinterlace/algo_yadif.c 
b/modules/video_filter/deinterlace/algo_yadif.c
index d94e45dbb5..a89d240b83 100644
--- a/modules/video_filter/deinterlace/algo_yadif.c
+++ b/modules/video_filter/deinterlace/algo_yadif.c
@@ -113,20 +113,23 @@ int RenderYadif( filter_t *p_filter, picture_t *p_dst, 
picture_t *p_src,
 void (*filter)(uint8_t *dst, uint8_t *prev, uint8_t *cur, uint8_t 
*next,
int w, int prefs, int mrefs, int parity, int mode);
 
-#if defined(HAVE_YADIF_SSSE3)
+/* android clang build for x86 fails as not enough registers are available */
+#if !defined(__ANDROID__)
+# if defined(HAVE_YADIF_SSSE3)
 if( vlc_CPU_SSSE3() )
 filter = yadif_filter_line_ssse3;
 else
-#endif
-#if defined(HAVE_YADIF_SSE2)
+# endif
+# if defined(HAVE_YADIF_SSE2)
 if( vlc_CPU_SSE2() )
 filter = yadif_filter_line_sse2;
 else
-#endif
-#if defined(HAVE_YADIF_MMX)
+# endif
+# if defined(HAVE_YADIF_MMX)
 if( vlc_CPU_MMX() )
 filter = yadif_filter_line_mmx;
 else
+# endif
 #endif
 filter = yadif_filter_line_c;
 

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] contrib: live555: fix undeclared off64_t functions

2018-10-23 Thread Victorien Le Couviour--Tuffet
vlc/vlc-3.0 | branch: master | Victorien Le Couviour--Tuffet 
 | Mon Sep 17 08:27:25 2018 +0200| 
[6674ee75f1bf75a6702c0437d431055ea7b0e45f] | committer: Thomas Guillem

contrib: live555: fix undeclared off64_t functions

Fixes android NDK 17 build:
ftello and fseeko are available from API level 24.
(cherry picked from commit 1aaff3b9609f5545bf44903ca23ef0c3be2421b1)
Signed-off-by: Thomas Guillem 

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

 contrib/src/live555/file-offset-bits-64.patch | 22 ++
 contrib/src/live555/rules.mak |  2 ++
 2 files changed, 24 insertions(+)

diff --git a/contrib/src/live555/file-offset-bits-64.patch 
b/contrib/src/live555/file-offset-bits-64.patch
new file mode 100644
index 00..7231c8892d
--- /dev/null
+++ b/contrib/src/live555/file-offset-bits-64.patch
@@ -0,0 +1,22 @@
+diff --git a/liveMedia/InputFile.cpp b/liveMedia/InputFile.cpp
+index 57bd262..fe1a73b 100644
+--- a/liveMedia/InputFile.cpp
 b/liveMedia/InputFile.cpp
+@@ -78,7 +78,7 @@ int64_t SeekFile64(FILE *fid, int64_t offset, int whence) {
+ #if (defined(__WIN32__) || defined(_WIN32)) && !defined(_WIN32_WCE)
+   return _lseeki64(_fileno(fid), offset, whence) == (int64_t)-1 ? -1 : 0;
+ #else
+-#if defined(_WIN32_WCE)
++#if defined(_WIN32_WCE) || (defined(__ANDROID__) && __ANDROID_API__ < 24)
+   return fseek(fid, (long)(offset), whence);
+ #else
+   return fseeko(fid, (off_t)(offset), whence);
+@@ -94,7 +94,7 @@ int64_t TellFile64(FILE *fid) {
+ #if (defined(__WIN32__) || defined(_WIN32)) && !defined(_WIN32_WCE)
+   return _telli64(_fileno(fid));
+ #else
+-#if defined(_WIN32_WCE)
++#if defined(_WIN32_WCE) || (defined(__ANDROID__) && __ANDROID_API__ < 24)
+   return ftell(fid);
+ #else
+   return ftello(fid);
diff --git a/contrib/src/live555/rules.mak b/contrib/src/live555/rules.mak
index a9cecd80a3..9b275ec33b 100644
--- a/contrib/src/live555/rules.mak
+++ b/contrib/src/live555/rules.mak
@@ -80,6 +80,8 @@ ifdef HAVE_ANDROID
 ifneq ($(LEGACY_NDK), 1)
# Always access in_addr.s_addr field
$(APPLY) $(SRC)/live555/in_addr-s_addr-field.patch
+   # Don't use unavailable off64_t functions
+   $(APPLY) $(SRC)/live555/file-offset-bits-64.patch
 endif
 endif
 

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] contrib: aom: fix cpu detection

2018-10-23 Thread Victorien Le Couviour--Tuffet
vlc/vlc-3.0 | branch: master | Victorien Le Couviour--Tuffet 
 | Tue Sep 18 17:36:56 2018 +0200| 
[de7dac813f891737b9332ec3894eb0bef66372ca] | committer: Thomas Guillem

contrib: aom: fix cpu detection

Fixes android NDK 17 build

(cherry picked from commit ea1c82c6588e81a4e877924746f5660143693e84)
Signed-off-by: Thomas Guillem 

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

 contrib/src/aom/rules.mak | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/contrib/src/aom/rules.mak b/contrib/src/aom/rules.mak
index 53d94f3d21..2cedf05749 100644
--- a/contrib/src/aom/rules.mak
+++ b/contrib/src/aom/rules.mak
@@ -71,6 +71,16 @@ AOM_CONF += -DAOM_TARGET_CPU=armv7
 endif
 endif
 
+# Force cpu detection
+ifdef HAVE_ANDROID
+ifeq ($(ARCH),arm)
+AOM_CONF += -DAOM_TARGET_CPU=armv7
+endif
+ifeq ($(ARCH),aarch64)
+AOM_CONF += -DAOM_TARGET_CPU=arm64
+endif
+endif
+
 # libaom doesn't allow in-tree builds
 .aom: aom toolchain.cmake
cd $< && mkdir -p aom_build

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] contrib: aom: fix cpufeatures support

2018-10-23 Thread Victorien Le Couviour--Tuffet
vlc/vlc-3.0 | branch: master | Victorien Le Couviour--Tuffet 
 | Wed Sep 19 16:15:06 2018 +0200| 
[6971f258b7c4d588a6ef5f39ffb8f47f6025e6b3] | committer: Thomas Guillem

contrib: aom: fix cpufeatures support

Fixes android NDK 17 build

(cherry picked from commit 530b1c0e76aad02b5c60e2fbe457578aed795ec9)
Signed-off-by: Thomas Guillem 

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

 contrib/src/aom/aom-android-cpufeatures.patch | 27 +++
 contrib/src/aom/rules.mak |  4 
 2 files changed, 31 insertions(+)

diff --git a/contrib/src/aom/aom-android-cpufeatures.patch 
b/contrib/src/aom/aom-android-cpufeatures.patch
new file mode 100644
index 00..82339c2e23
--- /dev/null
+++ b/contrib/src/aom/aom-android-cpufeatures.patch
@@ -0,0 +1,27 @@
+diff --git a/aom_ports/aom_ports.cmake b/aom_ports/aom_ports.cmake
+index 6272fc0..2d795f8 100644
+--- a/aom_ports/aom_ports.cmake
 b/aom_ports/aom_ports.cmake
+@@ -30,7 +30,8 @@ list(APPEND AOM_PORTS_ASM_X86 
"${AOM_ROOT}/aom_ports/emms.asm")
+ list(APPEND AOM_PORTS_INCLUDES_X86 
"${AOM_ROOT}/aom_ports/x86_abi_support.asm")
+ 
+ list(APPEND AOM_PORTS_SOURCES_ARM "${AOM_ROOT}/aom_ports/arm.h"
+-"${AOM_ROOT}/aom_ports/arm_cpudetect.c")
++"${AOM_ROOT}/aom_ports/arm_cpudetect.c"
++"${AOM_ROOT}/aom_ports/cpu-features.c")
+ 
+ list(APPEND AOM_PORTS_SOURCES_PPC "${AOM_ROOT}/aom_ports/ppc.h"
+ "${AOM_ROOT}/aom_ports/ppc_cpudetect.c")
+diff --git a/aom_ports/arm_cpudetect.c b/aom_ports/arm_cpudetect.c
+index 70efee9..86efb8e 100644
+--- a/aom_ports/arm_cpudetect.c
 b/aom_ports/arm_cpudetect.c
+@@ -88,7 +88,7 @@ int arm_cpu_caps(void) {
+ }
+ 
+ #elif defined(__ANDROID__) /* end _MSC_VER */
+-#include 
++#include "cpu-features.h"
+ 
+ int arm_cpu_caps(void) {
+   int flags;
diff --git a/contrib/src/aom/rules.mak b/contrib/src/aom/rules.mak
index 2cedf05749..a13a7632ac 100644
--- a/contrib/src/aom/rules.mak
+++ b/contrib/src/aom/rules.mak
@@ -25,8 +25,12 @@ ifdef HAVE_WINSTORE
 endif
 ifdef HAVE_ANDROID
$(APPLY) $(SRC)/aom/aom-android-pthreads.patch
+   $(APPLY) $(SRC)/aom/aom-android-cpufeatures.patch
 endif
$(MOVE)
+ifdef HAVE_ANDROID
+   cp $(ANDROID_NDK)/sources/android/cpufeatures/cpu-features.c 
$(ANDROID_NDK)/sources/android/cpufeatures/cpu-features.h aom/aom_ports/
+endif
 
 DEPS_aom =
 

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] contrib: live555: fix in_addr.s_addr field access

2018-10-23 Thread Victorien Le Couviour--Tuffet
vlc/vlc-3.0 | branch: master | Victorien Le Couviour--Tuffet 
 | Tue Sep 11 12:43:26 2018 +0200| 
[23258645c6d4c1b78bca9e52607fb2e85542e0ce] | committer: Thomas Guillem

contrib: live555: fix in_addr.s_addr field access

Fixes android NDK 17 build
(cherry picked from commit 9b8b7bc47993c1f245c535b90b613380e39fb138)
Signed-off-by: Thomas Guillem 

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

 contrib/src/live555/in_addr-s_addr-field.patch | 42 ++
 contrib/src/live555/rules.mak  |  6 
 2 files changed, 48 insertions(+)

diff --git a/contrib/src/live555/in_addr-s_addr-field.patch 
b/contrib/src/live555/in_addr-s_addr-field.patch
new file mode 100644
index 00..d4ff3a9381
--- /dev/null
+++ b/contrib/src/live555/in_addr-s_addr-field.patch
@@ -0,0 +1,42 @@
+diff --git a/groupsock/GroupsockHelper.cpp b/groupsock/GroupsockHelper.cpp
+index 0ba2aa5..c675275 100644
+--- a/groupsock/GroupsockHelper.cpp
 b/groupsock/GroupsockHelper.cpp
+@@ -515,15 +515,9 @@ Boolean socketJoinGroupSSM(UsageEnvironment& env, int 
socket,
+   if (!IsMulticastAddress(groupAddress)) return True; // ignore this case
+ 
+   struct ip_mreq_source imr;
+-#ifdef __ANDROID__
+-imr.imr_multiaddr = groupAddress;
+-imr.imr_sourceaddr = sourceFilterAddr;
+-imr.imr_interface = ReceivingInterfaceAddr;
+-#else
+-imr.imr_multiaddr.s_addr = groupAddress;
+-imr.imr_sourceaddr.s_addr = sourceFilterAddr;
+-imr.imr_interface.s_addr = ReceivingInterfaceAddr;
+-#endif
++  imr.imr_multiaddr.s_addr = groupAddress;
++  imr.imr_sourceaddr.s_addr = sourceFilterAddr;
++  imr.imr_interface.s_addr = ReceivingInterfaceAddr;
+   if (setsockopt(socket, IPPROTO_IP, IP_ADD_SOURCE_MEMBERSHIP,
+(const char*), sizeof (struct ip_mreq_source)) < 0) {
+ socketErr(env, "setsockopt(IP_ADD_SOURCE_MEMBERSHIP) error: ");
+@@ -541,15 +535,9 @@ Boolean socketLeaveGroupSSM(UsageEnvironment& /*env*/, 
int socket,
+   if (!IsMulticastAddress(groupAddress)) return True; // ignore this case
+ 
+   struct ip_mreq_source imr;
+-#ifdef __ANDROID__
+-imr.imr_multiaddr = groupAddress;
+-imr.imr_sourceaddr = sourceFilterAddr;
+-imr.imr_interface = ReceivingInterfaceAddr;
+-#else
+-imr.imr_multiaddr.s_addr = groupAddress;
+-imr.imr_sourceaddr.s_addr = sourceFilterAddr;
+-imr.imr_interface.s_addr = ReceivingInterfaceAddr;
+-#endif
++  imr.imr_multiaddr.s_addr = groupAddress;
++  imr.imr_sourceaddr.s_addr = sourceFilterAddr;
++  imr.imr_interface.s_addr = ReceivingInterfaceAddr;
+   if (setsockopt(socket, IPPROTO_IP, IP_DROP_SOURCE_MEMBERSHIP,
+(const char*), sizeof (struct ip_mreq_source)) < 0) {
+ return False;
diff --git a/contrib/src/live555/rules.mak b/contrib/src/live555/rules.mak
index b77d96ce73..a9cecd80a3 100644
--- a/contrib/src/live555/rules.mak
+++ b/contrib/src/live555/rules.mak
@@ -76,6 +76,12 @@ endif
$(APPLY) $(SRC)/live555/add-pkgconfig-file.patch
# Expose Server:
$(APPLY) $(SRC)/live555/expose_server_string.patch
+ifdef HAVE_ANDROID
+ifneq ($(LEGACY_NDK), 1)
+   # Always access in_addr.s_addr field
+   $(APPLY) $(SRC)/live555/in_addr-s_addr-field.patch
+endif
+endif
 
mv live.$(LIVE555_VERSION) $@ && touch $@
 

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] vout: gl: always include gl2ext.h after gl2.h

2018-10-23 Thread Victorien Le Couviour--Tuffet
vlc/vlc-3.0 | branch: master | Victorien Le Couviour--Tuffet 
 | Tue Sep 11 19:17:35 2018 +0200| 
[436a1043ee4f078b22de7f7117fed84e8d6578a4] | committer: Thomas Guillem

vout: gl: always include gl2ext.h after gl2.h

Fixes android ndk17 build
(cherry picked from commit b0d41f45f8006ba80578b51071c09dc81cdca1e2)
Signed-off-by: Thomas Guillem 

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

 modules/video_output/opengl/converter.h | 1 +
 modules/video_output/opengl/converter_android.c | 1 -
 modules/video_output/opengl/converter_vaapi.c   | 4 
 3 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/modules/video_output/opengl/converter.h 
b/modules/video_output/opengl/converter.h
index 02b2f11bd4..c4b898f583 100644
--- a/modules/video_output/opengl/converter.h
+++ b/modules/video_output/opengl/converter.h
@@ -43,6 +43,7 @@
 #else /* !defined (__APPLE__) */
 # if defined (USE_OPENGL_ES2)
 #  include 
+#  include 
 # else
 #  ifdef _WIN32
 #   include 
diff --git a/modules/video_output/opengl/converter_android.c 
b/modules/video_output/opengl/converter_android.c
index 6eb21a4633..ea60b92c42 100644
--- a/modules/video_output/opengl/converter_android.c
+++ b/modules/video_output/opengl/converter_android.c
@@ -26,7 +26,6 @@
 # error this file must be built from android
 #endif
 
-#include 
 #include "converter.h"
 #include "../android/display.h"
 #include "../android/utils.h"
diff --git a/modules/video_output/opengl/converter_vaapi.c 
b/modules/video_output/opengl/converter_vaapi.c
index 635819d9f9..8b2d2acbfc 100644
--- a/modules/video_output/opengl/converter_vaapi.c
+++ b/modules/video_output/opengl/converter_vaapi.c
@@ -47,10 +47,6 @@
 # include 
 #endif
 
-#if defined(USE_OPENGL_ES2)
-#   include 
-#endif
-
 struct priv
 {
 struct vlc_vaapi_instance *vainst;

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] contrib: aom: fix lib pthread linkage

2018-10-23 Thread Victorien Le Couviour--Tuffet
vlc/vlc-3.0 | branch: master | Victorien Le Couviour--Tuffet 
 | Tue Sep 18 14:42:07 2018 +0200| 
[5303c5d4b14f32b0902920fd9126bb5b54157dc8] | committer: Thomas Guillem

contrib: aom: fix lib pthread linkage

Fixes android NDK 17 build

(cherry picked from commit 65be347f2fc40f08037bbdcc6726aea21e01abf7)
Signed-off-by: Thomas Guillem 

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

 contrib/src/aom/aom-android-pthreads.patch | 19 +++
 contrib/src/aom/rules.mak  |  3 +++
 2 files changed, 22 insertions(+)

diff --git a/contrib/src/aom/aom-android-pthreads.patch 
b/contrib/src/aom/aom-android-pthreads.patch
new file mode 100644
index 00..8b414772e6
--- /dev/null
+++ b/contrib/src/aom/aom-android-pthreads.patch
@@ -0,0 +1,19 @@
+diff --git a/build/cmake/pkg_config.cmake b/build/cmake/pkg_config.cmake
+index 64e2021..1cab2a3 100644
+--- a/build/cmake/pkg_config.cmake
 b/build/cmake/pkg_config.cmake
+@@ -47,12 +47,6 @@ file(APPEND "${pkgconfig_file}"
+ file(APPEND "${pkgconfig_file}" "Version: ${package_version}\n")
+ file(APPEND "${pkgconfig_file}" "Requires:\n")
+ file(APPEND "${pkgconfig_file}" "Conflicts:\n")
+-if(CONFIG_MULTITHREAD AND HAVE_PTHREAD_H)
+-  file(APPEND "${pkgconfig_file}"
+-  "Libs: -L\${prefix}/lib -l${pkg_name} -lm -lpthread\n")
+-  file(APPEND "${pkgconfig_file}" "Libs.private: -lm -lpthread\n")
+-else()
+-  file(APPEND "${pkgconfig_file}" "Libs: -L\${prefix}/lib -l${pkg_name} 
-lm\n")
+-  file(APPEND "${pkgconfig_file}" "Libs.private: -lm\n")
+-endif()
++file(APPEND "${pkgconfig_file}" "Libs: -L\${prefix}/lib -l${pkg_name} -lm\n")
++file(APPEND "${pkgconfig_file}" "Libs.private: -lm\n")
+ file(APPEND "${pkgconfig_file}" "Cflags: -I\${prefix}/include\n")
diff --git a/contrib/src/aom/rules.mak b/contrib/src/aom/rules.mak
index d5c18b52d9..53d94f3d21 100644
--- a/contrib/src/aom/rules.mak
+++ b/contrib/src/aom/rules.mak
@@ -23,6 +23,9 @@ aom: aom-$(AOM_VERSION).tar.gz .sum-aom
 ifdef HAVE_WINSTORE
$(APPLY) $(SRC)/aom/aom-pthreads-win32.patch
 endif
+ifdef HAVE_ANDROID
+   $(APPLY) $(SRC)/aom/aom-android-pthreads.patch
+endif
$(MOVE)
 
 DEPS_aom =

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] contrib: vpx: fix broken text reloc

2018-10-23 Thread Victorien Le Couviour--Tuffet
vlc/vlc-3.0 | branch: master | Victorien Le Couviour--Tuffet 
 | Mon Sep 17 23:43:58 2018 +0200| 
[fdf70f485bdca2cefd47b572166af84257ca0ea4] | committer: Thomas Guillem

contrib: vpx: fix broken text reloc

Fixes android NDK 17 build
(cherry picked from commit 8e2f1a8c8ef6877b25a43612fcd81bfb8646f1f0)
Signed-off-by: Thomas Guillem 

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

 contrib/src/vpx/rules.mak | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/contrib/src/vpx/rules.mak b/contrib/src/vpx/rules.mak
index c42ce4964e..02a28dd992 100644
--- a/contrib/src/vpx/rules.mak
+++ b/contrib/src/vpx/rules.mak
@@ -135,7 +135,7 @@ ifdef HAVE_ANDROID
 # uses that path to look for the compiler (which we already know)
 VPX_CONF += --sdk-path=$(shell dirname $(shell which $(HOST)-clang))
 # broken text relocations
-ifeq ($(ARCH),x86_64)
+ifneq ($(filter i386 x86_64,$(ARCH)),)
 VPX_CONF += --disable-mmx
 endif
 endif

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] compat: add lfind

2018-10-23 Thread Victorien Le Couviour--Tuffet
vlc/vlc-3.0 | branch: master | Victorien Le Couviour--Tuffet 
 | Tue Oct  2 15:42:02 2018 +0200| 
[e3baeee84f4205c3d39c5bace7ab4b9778e590b6] | committer: Thomas Guillem

compat: add lfind

Fixes android build with NDK 17 as lfind is not always available.
(cherry picked from commit cf9bd77c67b844cd188f266d6b2aaacdb45bf60c)
Signed-off-by: Thomas Guillem 

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

 compat/lfind.c   | 19 +++
 configure.ac |  2 +-
 include/vlc_fixups.h |  2 ++
 3 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/compat/lfind.c b/compat/lfind.c
new file mode 100644
index 00..d62b2cfd9b
--- /dev/null
+++ b/compat/lfind.c
@@ -0,0 +1,19 @@
+/*
+ * lfind.c : implement lfind
+ */
+
+#ifdef HAVE_CONFIG_H
+# include 
+#endif
+
+void *lfind(const void *key, const void *base, size_t *nmemb,
+size_t size, int(*cmp)(const void *, const void *))
+{
+for (int i = 0; i < *nmemb; ++i)
+{
+const void *elem = base + i * size;
+if (!cmp(key, elem))
+return elem;
+}
+return NULL;
+}
diff --git a/configure.ac b/configure.ac
index 007a2def19..826b6ba43e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -591,7 +591,7 @@ need_libc=false
 
 dnl Check for usual libc functions
 AC_CHECK_FUNCS([accept4 daemon fcntl flock fstatvfs fork getenv getpwuid_r 
isatty lstat memalign mkostemp mmap newlocale open_memstream openat pipe2 pread 
posix_fadvise posix_madvise posix_memalign setlocale stricmp strnicmp strptime 
uselocale])
-AC_REPLACE_FUNCS([aligned_alloc atof atoll dirfd fdopendir ffsll flockfile 
fsync getdelim getpid lldiv memrchr nrand48 poll recvmsg rewind sendmsg setenv 
strcasecmp strcasestr strdup strlcpy strndup strnlen strnstr strsep strtof 
strtok_r strtoll swab tdestroy tfind timegm timespec_get strverscmp pathconf])
+AC_REPLACE_FUNCS([aligned_alloc atof atoll dirfd fdopendir ffsll flockfile 
fsync getdelim getpid lfind lldiv memrchr nrand48 poll recvmsg rewind sendmsg 
setenv strcasecmp strcasestr strdup strlcpy strndup strnlen strnstr strsep 
strtof strtok_r strtoll swab tdestroy tfind timegm timespec_get strverscmp 
pathconf])
 AC_REPLACE_FUNCS([gettimeofday])
 AC_CHECK_FUNC(fdatasync,,
   [AC_DEFINE(fdatasync, fsync, [Alias fdatasync() to fsync() if missing.])
diff --git a/include/vlc_fixups.h b/include/vlc_fixups.h
index 286ff12ca6..6c0de2854b 100644
--- a/include/vlc_fixups.h
+++ b/include/vlc_fixups.h
@@ -488,6 +488,8 @@ void *tsearch( const void *key, void **rootp, 
int(*cmp)(const void *, const void
 void *tfind( const void *key, const void **rootp, int(*cmp)(const void *, 
const void *) );
 void *tdelete( const void *key, void **rootp, int(*cmp)(const void *, const 
void *) );
 void twalk( const void *root, void(*action)(const void *nodep, VISIT which, 
int depth) );
+void *lfind( const void *key, const void *base, size_t *nmemb,
+ size_t size, int(*cmp)(const void *, const void *) );
 #endif /* HAVE_SEARCH_H */
 #ifndef HAVE_TDESTROY
 void tdestroy( void *root, void (*free_node)(void *nodep) );

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] contrib: vpx: fix toolchain path

2018-10-23 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
 | Wed Sep 19 16:56:34 2018 +0200| 
[026af3da928cb0f985ab6f22754034eb4a5e3100] | committer: Thomas Guillem

contrib: vpx: fix toolchain path

Fixes android NDK 17 build

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

 contrib/src/vpx/libvpx-android-toolchain_path.patch | 21 +
 contrib/src/vpx/rules.mak   |  1 +
 2 files changed, 22 insertions(+)

diff --git a/contrib/src/vpx/libvpx-android-toolchain_path.patch 
b/contrib/src/vpx/libvpx-android-toolchain_path.patch
new file mode 100644
index 00..c6ef44ee9a
--- /dev/null
+++ b/contrib/src/vpx/libvpx-android-toolchain_path.patch
@@ -0,0 +1,21 @@
+diff --git a/build/make/configure.sh b/build/make/configure.sh
+index 2e0b239..8853d18 100644
+--- a/build/make/configure.sh
 b/build/make/configure.sh
+@@ -951,9 +951,14 @@ EOF
+ android*)
+   if [ -n "${sdk_path}" ]; then
+ SDK_PATH=${sdk_path}
++if [ ${tgt_isa} != "arm64" ]; then
++tools_prefix=arm-linux-androideabi-
++else
++tools_prefix=aarch64-linux-android-
++fi
+ COMPILER_LOCATION=`find "${SDK_PATH}" \
+-  -name "arm-linux-androideabi-gcc*" -print -quit`
+-TOOLCHAIN_PATH=${COMPILER_LOCATION%/*}/arm-linux-androideabi-
++  -name "${tools_prefix}gcc*" -print -quit`
++TOOLCHAIN_PATH=${COMPILER_LOCATION%/*}/${tools_prefix}
+ CC=clang
+ CXX=clang++
+ AR=${TOOLCHAIN_PATH}ar
diff --git a/contrib/src/vpx/rules.mak b/contrib/src/vpx/rules.mak
index 3d463b92ee..915d0862ef 100644
--- a/contrib/src/vpx/rules.mak
+++ b/contrib/src/vpx/rules.mak
@@ -20,6 +20,7 @@ libvpx: libvpx-$(VPX_VERSION).tar.gz .sum-vpx
 ifdef HAVE_ANDROID
$(APPLY) $(SRC)/vpx/libvpx-android.patch
$(APPLY) $(SRC)/vpx/libvpx-android-fix_cortex_a8-flag.patch
+   $(APPLY) $(SRC)/vpx/libvpx-android-toolchain_path.patch
 endif
$(APPLY) $(SRC)/vpx/0001-ads2gas-Add-a-noelf-option.patch
$(APPLY) $(SRC)/vpx/0002-configure-Add-an-armv7-win32-gcc-target.patch

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] vout: gl: always include gl2ext.h after gl2.h

2018-10-23 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
 | Tue Sep 11 19:17:35 2018 +0200| 
[b0d41f45f8006ba80578b51071c09dc81cdca1e2] | committer: Thomas Guillem

vout: gl: always include gl2ext.h after gl2.h

Fixes android NDK 17 build

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

 modules/video_output/opengl/converter.h | 1 +
 modules/video_output/opengl/converter_android.c | 1 -
 modules/video_output/opengl/converter_vaapi.c   | 4 
 3 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/modules/video_output/opengl/converter.h 
b/modules/video_output/opengl/converter.h
index 229f2bd20b..e75a733c67 100644
--- a/modules/video_output/opengl/converter.h
+++ b/modules/video_output/opengl/converter.h
@@ -43,6 +43,7 @@
 #else /* !defined (__APPLE__) */
 # if defined (USE_OPENGL_ES2)
 #  include 
+#  include 
 # else
 #  ifdef _WIN32
 #   include 
diff --git a/modules/video_output/opengl/converter_android.c 
b/modules/video_output/opengl/converter_android.c
index 2e89544b24..92ddd291fc 100644
--- a/modules/video_output/opengl/converter_android.c
+++ b/modules/video_output/opengl/converter_android.c
@@ -26,7 +26,6 @@
 # error this file must be built from android
 #endif
 
-#include 
 #include "converter.h"
 #include "../android/display.h"
 #include "../android/utils.h"
diff --git a/modules/video_output/opengl/converter_vaapi.c 
b/modules/video_output/opengl/converter_vaapi.c
index 8ff9af0623..a0dfca329d 100644
--- a/modules/video_output/opengl/converter_vaapi.c
+++ b/modules/video_output/opengl/converter_vaapi.c
@@ -47,10 +47,6 @@
 # include 
 #endif
 
-#if defined(USE_OPENGL_ES2)
-#   include 
-#endif
-
 struct priv
 {
 struct vlc_vaapi_instance *vainst;

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] aout: audiotrack: use new constructor

2018-10-23 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
 | Wed Sep 26 17:14:04 2018 +0200| 
[b7573bd4c2fb72aeff3dd974441d86ecec4000fa] | committer: Thomas Guillem

aout: audiotrack: use new constructor

Fixes deprecated warning
Fixes #20324

Signed-off-by: Thomas Guillem 

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

 modules/audio_output/audiotrack.c | 167 --
 1 file changed, 158 insertions(+), 9 deletions(-)

diff --git a/modules/audio_output/audiotrack.c 
b/modules/audio_output/audiotrack.c
index 7ec6a3642c..92a13326b0 100644
--- a/modules/audio_output/audiotrack.c
+++ b/modules/audio_output/audiotrack.c
@@ -204,6 +204,7 @@ static struct
 struct {
 jclass clazz;
 jmethodID ctor;
+bool has_ctor_21;
 jmethodID release;
 jmethodID getState;
 jmethodID play;
@@ -227,6 +228,12 @@ static struct
 jint WRITE_NON_BLOCKING;
 } AudioTrack;
 struct {
+jclass clazz;
+jmethodID ctor;
+jmethodID build;
+jmethodID setLegacyStreamType;
+} AudioAttributes_Builder;
+struct {
 jint ENCODING_PCM_8BIT;
 jint ENCODING_PCM_16BIT;
 jint ENCODING_PCM_FLOAT;
@@ -258,6 +265,14 @@ static struct
 bool has_CHANNEL_OUT_SIDE;
 } AudioFormat;
 struct {
+jclass clazz;
+jmethodID ctor;
+jmethodID build;
+jmethodID setChannelMask;
+jmethodID setEncoding;
+jmethodID setSampleRate;
+} AudioFormat_Builder;
+struct {
 jint ERROR_DEAD_OBJECT;
 bool has_ERROR_DEAD_OBJECT;
 jint STREAM_MUSIC;
@@ -326,7 +341,11 @@ InitJNIFields( audio_output_t *p_aout, JNIEnv* env )
 jfields.AudioTrack.clazz = (jclass) (*env)->NewGlobalRef( env, clazz );
 CHECK_EXCEPTION( "NewGlobalRef", true );
 
-GET_ID( GetMethodID, AudioTrack.ctor, "", "(III)V", true );
+GET_ID( GetMethodID, AudioTrack.ctor, "",
+
"(Landroid/media/AudioAttributes;Landroid/media/AudioFormat;III)V", false );
+jfields.AudioTrack.has_ctor_21 = jfields.AudioTrack.ctor != NULL;
+if( !jfields.AudioTrack.has_ctor_21 )
+GET_ID( GetMethodID, AudioTrack.ctor, "", "(III)V", true );
 GET_ID( GetMethodID, AudioTrack.release, "release", "()V", true );
 GET_ID( GetMethodID, AudioTrack.getState, "getState", "()I", true );
 GET_ID( GetMethodID, AudioTrack.play, "play", "()V", true );
@@ -366,6 +385,35 @@ InitJNIFields( audio_output_t *p_aout, JNIEnv* env )
 GET_CONST_INT( AudioTrack.ERROR_INVALID_OPERATION,
"ERROR_INVALID_OPERATION", true );
 
+if( jfields.AudioTrack.has_ctor_21 )
+{
+/* AudioAttributes_Builder class init */
+GET_CLASS( "android/media/AudioAttributes$Builder", true );
+jfields.AudioAttributes_Builder.clazz = (jclass) (*env)->NewGlobalRef( 
env, clazz );
+CHECK_EXCEPTION( "NewGlobalRef", true );
+GET_ID( GetMethodID, AudioAttributes_Builder.ctor, "",
+"()V", true );
+GET_ID( GetMethodID, AudioAttributes_Builder.build, "build",
+"()Landroid/media/AudioAttributes;", true );
+GET_ID( GetMethodID, AudioAttributes_Builder.setLegacyStreamType, 
"setLegacyStreamType",
+"(I)Landroid/media/AudioAttributes$Builder;", true );
+
+/* AudioFormat_Builder class init */
+GET_CLASS( "android/media/AudioFormat$Builder", true );
+jfields.AudioFormat_Builder.clazz = (jclass) (*env)->NewGlobalRef( 
env, clazz );
+CHECK_EXCEPTION( "NewGlobalRef", true );
+GET_ID( GetMethodID, AudioFormat_Builder.ctor, "",
+"()V", true );
+GET_ID( GetMethodID, AudioFormat_Builder.build, "build",
+"()Landroid/media/AudioFormat;", true );
+GET_ID( GetMethodID, AudioFormat_Builder.setChannelMask, 
"setChannelMask",
+"(I)Landroid/media/AudioFormat$Builder;", true );
+GET_ID( GetMethodID, AudioFormat_Builder.setEncoding, "setEncoding",
+"(I)Landroid/media/AudioFormat$Builder;", true );
+GET_ID( GetMethodID, AudioFormat_Builder.setSampleRate, 
"setSampleRate",
+"(I)Landroid/media/AudioFormat$Builder;", true );
+}
+
 /* AudioTimestamp class init (if any) */
 if( jfields.AudioTrack.getTimestamp )
 {
@@ -467,7 +515,7 @@ end:
 
 static inline bool
 check_exception( JNIEnv *env, audio_output_t *p_aout,
- const char *method )
+ const char *class, const char *method )
 {
 if( (*env)->

[vlc-commits] vfilter: yadif deint: disable SIMD on android

2018-10-23 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
 | Mon Sep 17 11:32:03 2018 +0200| 
[812fdcb264e7fee25daab689e1b9904c2677d40f] | committer: Thomas Guillem

vfilter: yadif deint: disable SIMD on android

Fixes android NDK 17 x86 build: clang fails to compile assembly code
saying it requires more registers than available.

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

 modules/video_filter/deinterlace/algo_yadif.c | 13 -
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/modules/video_filter/deinterlace/algo_yadif.c 
b/modules/video_filter/deinterlace/algo_yadif.c
index d94e45dbb5..a89d240b83 100644
--- a/modules/video_filter/deinterlace/algo_yadif.c
+++ b/modules/video_filter/deinterlace/algo_yadif.c
@@ -113,20 +113,23 @@ int RenderYadif( filter_t *p_filter, picture_t *p_dst, 
picture_t *p_src,
 void (*filter)(uint8_t *dst, uint8_t *prev, uint8_t *cur, uint8_t 
*next,
int w, int prefs, int mrefs, int parity, int mode);
 
-#if defined(HAVE_YADIF_SSSE3)
+/* android clang build for x86 fails as not enough registers are available */
+#if !defined(__ANDROID__)
+# if defined(HAVE_YADIF_SSSE3)
 if( vlc_CPU_SSSE3() )
 filter = yadif_filter_line_ssse3;
 else
-#endif
-#if defined(HAVE_YADIF_SSE2)
+# endif
+# if defined(HAVE_YADIF_SSE2)
 if( vlc_CPU_SSE2() )
 filter = yadif_filter_line_sse2;
 else
-#endif
-#if defined(HAVE_YADIF_MMX)
+# endif
+# if defined(HAVE_YADIF_MMX)
 if( vlc_CPU_MMX() )
 filter = yadif_filter_line_mmx;
 else
+# endif
 #endif
 filter = yadif_filter_line_c;
 

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] contrib: aom: fix lib pthread linkage

2018-10-23 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
 | Tue Sep 18 14:42:07 2018 +0200| 
[65be347f2fc40f08037bbdcc6726aea21e01abf7] | committer: Thomas Guillem

contrib: aom: fix lib pthread linkage

Fixes android NDK 17 build

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

 contrib/src/aom/aom-android-pthreads.patch | 19 +++
 contrib/src/aom/rules.mak  |  3 +++
 2 files changed, 22 insertions(+)

diff --git a/contrib/src/aom/aom-android-pthreads.patch 
b/contrib/src/aom/aom-android-pthreads.patch
new file mode 100644
index 00..8b414772e6
--- /dev/null
+++ b/contrib/src/aom/aom-android-pthreads.patch
@@ -0,0 +1,19 @@
+diff --git a/build/cmake/pkg_config.cmake b/build/cmake/pkg_config.cmake
+index 64e2021..1cab2a3 100644
+--- a/build/cmake/pkg_config.cmake
 b/build/cmake/pkg_config.cmake
+@@ -47,12 +47,6 @@ file(APPEND "${pkgconfig_file}"
+ file(APPEND "${pkgconfig_file}" "Version: ${package_version}\n")
+ file(APPEND "${pkgconfig_file}" "Requires:\n")
+ file(APPEND "${pkgconfig_file}" "Conflicts:\n")
+-if(CONFIG_MULTITHREAD AND HAVE_PTHREAD_H)
+-  file(APPEND "${pkgconfig_file}"
+-  "Libs: -L\${prefix}/lib -l${pkg_name} -lm -lpthread\n")
+-  file(APPEND "${pkgconfig_file}" "Libs.private: -lm -lpthread\n")
+-else()
+-  file(APPEND "${pkgconfig_file}" "Libs: -L\${prefix}/lib -l${pkg_name} 
-lm\n")
+-  file(APPEND "${pkgconfig_file}" "Libs.private: -lm\n")
+-endif()
++file(APPEND "${pkgconfig_file}" "Libs: -L\${prefix}/lib -l${pkg_name} -lm\n")
++file(APPEND "${pkgconfig_file}" "Libs.private: -lm\n")
+ file(APPEND "${pkgconfig_file}" "Cflags: -I\${prefix}/include\n")
diff --git a/contrib/src/aom/rules.mak b/contrib/src/aom/rules.mak
index f1973dc24f..94e4ad5eaf 100644
--- a/contrib/src/aom/rules.mak
+++ b/contrib/src/aom/rules.mak
@@ -23,6 +23,9 @@ aom: aom-$(AOM_VERSION).tar.gz .sum-aom
 ifdef HAVE_WINSTORE
$(APPLY) $(SRC)/aom/aom-pthreads-win32.patch
 endif
+ifdef HAVE_ANDROID
+   $(APPLY) $(SRC)/aom/aom-android-pthreads.patch
+endif
$(MOVE)
 
 DEPS_aom =

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] contrib: vpx: fix broken text reloc

2018-10-23 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
 | Mon Sep 17 23:43:58 2018 +0200| 
[8e2f1a8c8ef6877b25a43612fcd81bfb8646f1f0] | committer: Thomas Guillem

contrib: vpx: fix broken text reloc

Fixes android NDK 17 build

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

 contrib/src/vpx/rules.mak | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/contrib/src/vpx/rules.mak b/contrib/src/vpx/rules.mak
index 963c25d248..2e296fec38 100644
--- a/contrib/src/vpx/rules.mak
+++ b/contrib/src/vpx/rules.mak
@@ -148,7 +148,7 @@ ifdef HAVE_ANDROID
 # uses that path to look for the compiler (which we already know)
 VPX_CONF += --sdk-path=$(shell dirname $(shell which $(HOST)-clang))
 # broken text relocations
-ifeq ($(ARCH),x86_64)
+ifneq ($(filter i386 x86_64,$(ARCH)),)
 VPX_CONF += --disable-mmx
 endif
 endif

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] contrib: aom: fix cpufeatures support

2018-10-23 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
 | Wed Sep 19 16:15:06 2018 +0200| 
[530b1c0e76aad02b5c60e2fbe457578aed795ec9] | committer: Thomas Guillem

contrib: aom: fix cpufeatures support

Fixes android NDK 17 build

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

 contrib/src/aom/aom-android-cpufeatures.patch | 27 +++
 contrib/src/aom/rules.mak |  4 
 2 files changed, 31 insertions(+)

diff --git a/contrib/src/aom/aom-android-cpufeatures.patch 
b/contrib/src/aom/aom-android-cpufeatures.patch
new file mode 100644
index 00..82339c2e23
--- /dev/null
+++ b/contrib/src/aom/aom-android-cpufeatures.patch
@@ -0,0 +1,27 @@
+diff --git a/aom_ports/aom_ports.cmake b/aom_ports/aom_ports.cmake
+index 6272fc0..2d795f8 100644
+--- a/aom_ports/aom_ports.cmake
 b/aom_ports/aom_ports.cmake
+@@ -30,7 +30,8 @@ list(APPEND AOM_PORTS_ASM_X86 
"${AOM_ROOT}/aom_ports/emms.asm")
+ list(APPEND AOM_PORTS_INCLUDES_X86 
"${AOM_ROOT}/aom_ports/x86_abi_support.asm")
+ 
+ list(APPEND AOM_PORTS_SOURCES_ARM "${AOM_ROOT}/aom_ports/arm.h"
+-"${AOM_ROOT}/aom_ports/arm_cpudetect.c")
++"${AOM_ROOT}/aom_ports/arm_cpudetect.c"
++"${AOM_ROOT}/aom_ports/cpu-features.c")
+ 
+ list(APPEND AOM_PORTS_SOURCES_PPC "${AOM_ROOT}/aom_ports/ppc.h"
+ "${AOM_ROOT}/aom_ports/ppc_cpudetect.c")
+diff --git a/aom_ports/arm_cpudetect.c b/aom_ports/arm_cpudetect.c
+index 70efee9..86efb8e 100644
+--- a/aom_ports/arm_cpudetect.c
 b/aom_ports/arm_cpudetect.c
+@@ -88,7 +88,7 @@ int arm_cpu_caps(void) {
+ }
+ 
+ #elif defined(__ANDROID__) /* end _MSC_VER */
+-#include 
++#include "cpu-features.h"
+ 
+ int arm_cpu_caps(void) {
+   int flags;
diff --git a/contrib/src/aom/rules.mak b/contrib/src/aom/rules.mak
index 40f1522dc3..f243a5aa3e 100644
--- a/contrib/src/aom/rules.mak
+++ b/contrib/src/aom/rules.mak
@@ -25,8 +25,12 @@ ifdef HAVE_WINSTORE
 endif
 ifdef HAVE_ANDROID
$(APPLY) $(SRC)/aom/aom-android-pthreads.patch
+   $(APPLY) $(SRC)/aom/aom-android-cpufeatures.patch
 endif
$(MOVE)
+ifdef HAVE_ANDROID
+   cp $(ANDROID_NDK)/sources/android/cpufeatures/cpu-features.c 
$(ANDROID_NDK)/sources/android/cpufeatures/cpu-features.h aom/aom_ports/
+endif
 
 DEPS_aom =
 ifdef HAVE_WIN32

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] contrib: vpx: remove armv7 only linker flag

2018-10-23 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
 | Wed Sep 19 16:56:19 2018 +0200| 
[6e6ef97b3179133afdbc61b974820ef8203e82e1] | committer: Thomas Guillem

contrib: vpx: remove armv7 only linker flag

Fixes android NDK 17 build:
This flag is already forced by compile-libvlc.sh (vlc-android) for armv7
only, so it can be completly removed from this configure script when
compiling for android platforms.

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

 contrib/src/vpx/libvpx-android-fix_cortex_a8-flag.patch | 15 +++
 contrib/src/vpx/rules.mak   |  1 +
 2 files changed, 16 insertions(+)

diff --git a/contrib/src/vpx/libvpx-android-fix_cortex_a8-flag.patch 
b/contrib/src/vpx/libvpx-android-fix_cortex_a8-flag.patch
new file mode 100644
index 00..3ff5e83588
--- /dev/null
+++ b/contrib/src/vpx/libvpx-android-fix_cortex_a8-flag.patch
@@ -0,0 +1,15 @@
+diff --git a/build/make/configure.sh b/build/make/configure.sh
+index a658544..86db9b9 100644
+--- a/build/make/configure.sh
 b/build/make/configure.sh
+@@ -988,10 +988,6 @@ EOF
+   add_ldflags "--sysroot=${alt_libc}"
+ fi
+ 
+-# linker flag that routes around a CPU bug in some
+-# Cortex-A8 implementations (NDK Dev Guide)
+-add_ldflags "-Wl,--fix-cortex-a8"
+-
+ enable_feature pic
+ soft_enable realtime_only
+ if [ ${tgt_isa} = "armv7" ]; then
diff --git a/contrib/src/vpx/rules.mak b/contrib/src/vpx/rules.mak
index 2e296fec38..3d463b92ee 100644
--- a/contrib/src/vpx/rules.mak
+++ b/contrib/src/vpx/rules.mak
@@ -19,6 +19,7 @@ libvpx: libvpx-$(VPX_VERSION).tar.gz .sum-vpx
$(APPLY) $(SRC)/vpx/libvpx-ios.patch
 ifdef HAVE_ANDROID
$(APPLY) $(SRC)/vpx/libvpx-android.patch
+   $(APPLY) $(SRC)/vpx/libvpx-android-fix_cortex_a8-flag.patch
 endif
$(APPLY) $(SRC)/vpx/0001-ads2gas-Add-a-noelf-option.patch
$(APPLY) $(SRC)/vpx/0002-configure-Add-an-armv7-win32-gcc-target.patch

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] vlc_fixups: fix struct if_nameindex definition

2018-10-23 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
 | Wed Sep 12 11:03:42 2018 +0200| 
[0481899b5d17a18d33491f554a8957b63727d864] | committer: Thomas Guillem

vlc_fixups: fix struct if_nameindex definition

Fixes android ndk17 build

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

 configure.ac | 1 +
 include/vlc_fixups.h | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/configure.ac b/configure.ac
index 054d3d69d4..9066dd7022 100644
--- a/configure.ac
+++ b/configure.ac
@@ -673,6 +673,7 @@ AC_LINK_IFELSE([
 char dst[[sizeof(struct in_addr)]];
 inet_pton(AF_INET, "127.0.0.1", dst);
 ])],[AC_DEFINE([HAVE_INET_PTON],[1],[Define to 1 if you have inet_pton 
function])],[AC_LIBOBJ([inet_pton])])
+AC_CHECK_TYPES([struct if_nameindex],,,[#include ])
 AC_CHECK_FUNCS([if_nameindex])
 VLC_RESTORE_FLAGS
 AC_SUBST([SOCKET_LIBS])
diff --git a/include/vlc_fixups.h b/include/vlc_fixups.h
index 037f67da31..87394fccad 100644
--- a/include/vlc_fixups.h
+++ b/include/vlc_fixups.h
@@ -413,11 +413,13 @@ int poll (struct pollfd *, unsigned, int);
 
 #ifndef HAVE_IF_NAMEINDEX
 #include 
+# ifndef HAVE_STRUCT_IF_NAMEINDEX
 struct if_nameindex
 {
 unsigned if_index;
 char*if_name;
 };
+# endif
 # define if_nameindex() (errno = ENOBUFS, NULL)
 # define if_freenameindex(list) (void)0
 #endif

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] compat: add lfind

2018-10-23 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
 | Tue Oct  2 15:42:02 2018 +0200| 
[cf9bd77c67b844cd188f266d6b2aaacdb45bf60c] | committer: Thomas Guillem

compat: add lfind

Fixes android build with NDK 17 as lfind is not always available.

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

 compat/lfind.c   | 19 +++
 configure.ac |  2 +-
 include/vlc_fixups.h |  2 ++
 3 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/compat/lfind.c b/compat/lfind.c
new file mode 100644
index 00..d62b2cfd9b
--- /dev/null
+++ b/compat/lfind.c
@@ -0,0 +1,19 @@
+/*
+ * lfind.c : implement lfind
+ */
+
+#ifdef HAVE_CONFIG_H
+# include 
+#endif
+
+void *lfind(const void *key, const void *base, size_t *nmemb,
+size_t size, int(*cmp)(const void *, const void *))
+{
+for (int i = 0; i < *nmemb; ++i)
+{
+const void *elem = base + i * size;
+if (!cmp(key, elem))
+return elem;
+}
+return NULL;
+}
diff --git a/configure.ac b/configure.ac
index 9066dd7022..c1abf7dbd2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -581,7 +581,7 @@ need_libc=false
 
 dnl Check for usual libc functions
 AC_CHECK_FUNCS([accept4 daemon fcntl flock fstatvfs fork getenv getpwuid_r 
isatty memalign mkostemp mmap open_memstream newlocale openat pipe2 pread 
posix_fadvise posix_madvise posix_memalign setlocale stricmp strnicmp strptime 
uselocale])
-AC_REPLACE_FUNCS([aligned_alloc atof atoll dirfd fdopendir flockfile fsync 
getdelim getpid lldiv memrchr nrand48 poll recvmsg rewind sendmsg setenv 
strcasecmp strcasestr strdup strlcpy strndup strnlen strnstr strsep strtof 
strtok_r strtoll swab tdestroy tfind timegm timespec_get strverscmp pathconf])
+AC_REPLACE_FUNCS([aligned_alloc atof atoll dirfd fdopendir flockfile fsync 
getdelim getpid lfind lldiv memrchr nrand48 poll recvmsg rewind sendmsg setenv 
strcasecmp strcasestr strdup strlcpy strndup strnlen strnstr strsep strtof 
strtok_r strtoll swab tdestroy tfind timegm timespec_get strverscmp pathconf])
 AC_REPLACE_FUNCS([gettimeofday])
 AC_CHECK_FUNC(fdatasync,,
   [AC_DEFINE(fdatasync, fsync, [Alias fdatasync() to fsync() if missing.])
diff --git a/include/vlc_fixups.h b/include/vlc_fixups.h
index 87394fccad..caf1768f63 100644
--- a/include/vlc_fixups.h
+++ b/include/vlc_fixups.h
@@ -486,6 +486,8 @@ void *tsearch( const void *key, void **rootp, 
int(*cmp)(const void *, const void
 void *tfind( const void *key, const void **rootp, int(*cmp)(const void *, 
const void *) );
 void *tdelete( const void *key, void **rootp, int(*cmp)(const void *, const 
void *) );
 void twalk( const void *root, void(*action)(const void *nodep, VISIT which, 
int depth) );
+void *lfind( const void *key, const void *base, size_t *nmemb,
+ size_t size, int(*cmp)(const void *, const void *) );
 #endif /* HAVE_SEARCH_H */
 #ifndef HAVE_TDESTROY
 void tdestroy( void *root, void (*free_node)(void *nodep) );

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] contrib: live555: fix undeclared off64_t functions

2018-10-23 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
 | Mon Sep 17 08:27:25 2018 +0200| 
[1aaff3b9609f5545bf44903ca23ef0c3be2421b1] | committer: Thomas Guillem

contrib: live555: fix undeclared off64_t functions

Fixes android NDK 17 build:
ftello and fseeko are available from API level 24.

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

 contrib/src/live555/file-offset-bits-64.patch | 22 ++
 contrib/src/live555/rules.mak |  2 ++
 2 files changed, 24 insertions(+)

diff --git a/contrib/src/live555/file-offset-bits-64.patch 
b/contrib/src/live555/file-offset-bits-64.patch
new file mode 100644
index 00..7231c8892d
--- /dev/null
+++ b/contrib/src/live555/file-offset-bits-64.patch
@@ -0,0 +1,22 @@
+diff --git a/liveMedia/InputFile.cpp b/liveMedia/InputFile.cpp
+index 57bd262..fe1a73b 100644
+--- a/liveMedia/InputFile.cpp
 b/liveMedia/InputFile.cpp
+@@ -78,7 +78,7 @@ int64_t SeekFile64(FILE *fid, int64_t offset, int whence) {
+ #if (defined(__WIN32__) || defined(_WIN32)) && !defined(_WIN32_WCE)
+   return _lseeki64(_fileno(fid), offset, whence) == (int64_t)-1 ? -1 : 0;
+ #else
+-#if defined(_WIN32_WCE)
++#if defined(_WIN32_WCE) || (defined(__ANDROID__) && __ANDROID_API__ < 24)
+   return fseek(fid, (long)(offset), whence);
+ #else
+   return fseeko(fid, (off_t)(offset), whence);
+@@ -94,7 +94,7 @@ int64_t TellFile64(FILE *fid) {
+ #if (defined(__WIN32__) || defined(_WIN32)) && !defined(_WIN32_WCE)
+   return _telli64(_fileno(fid));
+ #else
+-#if defined(_WIN32_WCE)
++#if defined(_WIN32_WCE) || (defined(__ANDROID__) && __ANDROID_API__ < 24)
+   return ftell(fid);
+ #else
+   return ftello(fid);
diff --git a/contrib/src/live555/rules.mak b/contrib/src/live555/rules.mak
index 6796535e64..9f6a997517 100644
--- a/contrib/src/live555/rules.mak
+++ b/contrib/src/live555/rules.mak
@@ -82,6 +82,8 @@ endif
 ifdef HAVE_ANDROID
# Fix in_addr.s_addr field access
$(APPLY) $(SRC)/live555/in_addr-s_addr-field.patch
+   # Don't use unavailable off64_t functions
+   $(APPLY) $(SRC)/live555/file-offset-bits-64.patch
 endif
 
mv live.$(LIVE555_VERSION) $@ && touch $@

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] contrib: aom: fix cpu detection

2018-10-23 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
 | Tue Sep 18 17:36:56 2018 +0200| 
[ea1c82c6588e81a4e877924746f5660143693e84] | committer: Thomas Guillem

contrib: aom: fix cpu detection

Fixes android NDK 17 build

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

 contrib/src/aom/rules.mak | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/contrib/src/aom/rules.mak b/contrib/src/aom/rules.mak
index 94e4ad5eaf..40f1522dc3 100644
--- a/contrib/src/aom/rules.mak
+++ b/contrib/src/aom/rules.mak
@@ -77,6 +77,16 @@ AOM_CONF += -DAOM_TARGET_CPU=armv7
 endif
 endif
 
+# Force cpu detection
+ifdef HAVE_ANDROID
+ifeq ($(ARCH),arm)
+AOM_CONF += -DAOM_TARGET_CPU=armv7
+endif
+ifeq ($(ARCH),aarch64)
+AOM_CONF += -DAOM_TARGET_CPU=arm64
+endif
+endif
+
 # libaom doesn't allow in-tree builds
 .aom: aom toolchain.cmake
cd $< && mkdir -p aom_build

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] contrib: live555: fix in_addr.s_addr field access

2018-10-23 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
 | Tue Sep 11 12:43:26 2018 +0200| 
[9b8b7bc47993c1f245c535b90b613380e39fb138] | committer: Thomas Guillem

contrib: live555: fix in_addr.s_addr field access

Fixes android NDK 17 build

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

 contrib/src/live555/in_addr-s_addr-field.patch | 42 ++
 contrib/src/live555/rules.mak  |  4 +++
 2 files changed, 46 insertions(+)

diff --git a/contrib/src/live555/in_addr-s_addr-field.patch 
b/contrib/src/live555/in_addr-s_addr-field.patch
new file mode 100644
index 00..d4ff3a9381
--- /dev/null
+++ b/contrib/src/live555/in_addr-s_addr-field.patch
@@ -0,0 +1,42 @@
+diff --git a/groupsock/GroupsockHelper.cpp b/groupsock/GroupsockHelper.cpp
+index 0ba2aa5..c675275 100644
+--- a/groupsock/GroupsockHelper.cpp
 b/groupsock/GroupsockHelper.cpp
+@@ -515,15 +515,9 @@ Boolean socketJoinGroupSSM(UsageEnvironment& env, int 
socket,
+   if (!IsMulticastAddress(groupAddress)) return True; // ignore this case
+ 
+   struct ip_mreq_source imr;
+-#ifdef __ANDROID__
+-imr.imr_multiaddr = groupAddress;
+-imr.imr_sourceaddr = sourceFilterAddr;
+-imr.imr_interface = ReceivingInterfaceAddr;
+-#else
+-imr.imr_multiaddr.s_addr = groupAddress;
+-imr.imr_sourceaddr.s_addr = sourceFilterAddr;
+-imr.imr_interface.s_addr = ReceivingInterfaceAddr;
+-#endif
++  imr.imr_multiaddr.s_addr = groupAddress;
++  imr.imr_sourceaddr.s_addr = sourceFilterAddr;
++  imr.imr_interface.s_addr = ReceivingInterfaceAddr;
+   if (setsockopt(socket, IPPROTO_IP, IP_ADD_SOURCE_MEMBERSHIP,
+(const char*), sizeof (struct ip_mreq_source)) < 0) {
+ socketErr(env, "setsockopt(IP_ADD_SOURCE_MEMBERSHIP) error: ");
+@@ -541,15 +535,9 @@ Boolean socketLeaveGroupSSM(UsageEnvironment& /*env*/, 
int socket,
+   if (!IsMulticastAddress(groupAddress)) return True; // ignore this case
+ 
+   struct ip_mreq_source imr;
+-#ifdef __ANDROID__
+-imr.imr_multiaddr = groupAddress;
+-imr.imr_sourceaddr = sourceFilterAddr;
+-imr.imr_interface = ReceivingInterfaceAddr;
+-#else
+-imr.imr_multiaddr.s_addr = groupAddress;
+-imr.imr_sourceaddr.s_addr = sourceFilterAddr;
+-imr.imr_interface.s_addr = ReceivingInterfaceAddr;
+-#endif
++  imr.imr_multiaddr.s_addr = groupAddress;
++  imr.imr_sourceaddr.s_addr = sourceFilterAddr;
++  imr.imr_interface.s_addr = ReceivingInterfaceAddr;
+   if (setsockopt(socket, IPPROTO_IP, IP_DROP_SOURCE_MEMBERSHIP,
+(const char*), sizeof (struct ip_mreq_source)) < 0) {
+ return False;
diff --git a/contrib/src/live555/rules.mak b/contrib/src/live555/rules.mak
index fa1868bb15..6796535e64 100644
--- a/contrib/src/live555/rules.mak
+++ b/contrib/src/live555/rules.mak
@@ -79,6 +79,10 @@ endif
$(APPLY) $(SRC)/live555/expose_server_string.patch
# Fix creating static libs on mingw
$(APPLY) $(SRC)/live555/mingw-static-libs.patch
+ifdef HAVE_ANDROID
+   # Fix in_addr.s_addr field access
+   $(APPLY) $(SRC)/live555/in_addr-s_addr-field.patch
+endif
 
mv live.$(LIVE555_VERSION) $@ && touch $@
 

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] gl: add converter_vdpau

2017-08-31 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
<victorien.lecouviour.tuf...@gmail.com> | Thu Jul 20 12:37:37 2017 +0200| 
[9f6cb2d381c944ee7fe877e485359ea44e0a0f46] | committer: Thomas Guillem

gl: add converter_vdpau

Signed-off-by: Thomas Guillem <tho...@gllm.fr>

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

 modules/MODULES_LIST  |   1 +
 modules/hw/vdpau/vlc_vdpau.h  |   1 +
 modules/video_output/Makefile.am  |   9 +
 modules/video_output/opengl/converter_vdpau.c | 249 ++
 po/POTFILES.in|   1 +
 5 files changed, 261 insertions(+)

diff --git a/modules/MODULES_LIST b/modules/MODULES_LIST
index 2f1656d930..698118fe5e 100644
--- a/modules/MODULES_LIST
+++ b/modules/MODULES_LIST
@@ -167,6 +167,7 @@ $Id$
  * glconv_vaapi_drm: VA-API OpenGL hardware converter for DRM
  * glconv_vaapi_wl: VA-API OpenGL hardware converter for Wayland
  * glconv_vaapi_x11: VA-API OpenGL hardware converter for X11
+ * glconv_vdpau: VDPAU OpenGL surface converter
  * gles2: OpenGL ES2 video output using the generic OpenGL provider
  * glspectrum: 3D OpenGL spectrum visualization
  * glwin32: a opengl provider using DirectX OpenGL
diff --git a/modules/hw/vdpau/vlc_vdpau.h b/modules/hw/vdpau/vlc_vdpau.h
index af62bddcc1..01289ffbae 100644
--- a/modules/hw/vdpau/vlc_vdpau.h
+++ b/modules/hw/vdpau/vlc_vdpau.h
@@ -261,6 +261,7 @@ struct picture_sys_t
 VdpOutputSurface surface;
 VdpDevice device;
 vdp_t *vdp;
+void *gl_nv_surface;
 };
 
 typedef struct vlc_vdp_video_frame
diff --git a/modules/video_output/Makefile.am b/modules/video_output/Makefile.am
index 004bc51952..50fa534499 100644
--- a/modules/video_output/Makefile.am
+++ b/modules/video_output/Makefile.am
@@ -76,6 +76,11 @@ libglconv_vaapi_drm_plugin_la_CFLAGS = $(AM_CFLAGS) 
-DHAVE_VA_DRM
 libglconv_vaapi_drm_plugin_la_LIBADD = $(LIBVA_LIBS) $(LIBVA_EGL_LIBS) \
$(LIBVA_DRM_LIBS)
 
+libglconv_vdpau_plugin_la_SOURCES = video_output/opengl/converter_vdpau.c \
+   video_output/opengl/converter.h hw/vdpau/vlc_vdpau.h
+libglconv_vdpau_plugin_la_CFLAGS = $(AM_CFLAGS) $(VDPAU_CFLAGS)
+libglconv_vdpau_plugin_la_LIBADD = $(LIBDL) libvlc_vdpau.la $(X_LIBS) 
$(X_PRE_LIBS) -lX11
+
 if HAVE_GL
 vout_LTLIBRARIES += libgl_plugin.la
 if HAVE_EGL
@@ -95,6 +100,10 @@ vout_LTLIBRARIES += libglconv_vaapi_drm_plugin.la
 endif
 endif
 endif # HAVE_EGL
+
+if HAVE_VDPAU
+vout_LTLIBRARIES += libglconv_vdpau_plugin.la
+endif
 endif # HAVE_GL
 
 ### XCB ###
diff --git a/modules/video_output/opengl/converter_vdpau.c 
b/modules/video_output/opengl/converter_vdpau.c
new file mode 100644
index 00..6b3467c37e
--- /dev/null
+++ b/modules/video_output/opengl/converter_vdpau.c
@@ -0,0 +1,249 @@
+/*
+ * converter_vdpau.c: OpenGL VDPAU opaque converter
+ *
+ * Copyright (C) 2017 VLC authors, VideoLAN and VideoLabs
+ *
+ * Author: Victorien Le Couviour--Tuffet 
<victorien.lecouviour.tuf...@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
+ * the Free Software Foundation; either version 2.1 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#include "../../hw/vdpau/vlc_vdpau.h"
+#include "internal.h"
+
+#define INTEROP_CALL(fct, ...) \
+_##fct(__VA_ARGS__); \
+{ \
+GLenum ret = tc->vt->GetError(); \
+if (ret != GL_NO_ERROR) \
+{ \
+msg_Err(tc->gl, #fct " failed: 0x%x\n", ret); \
+return VLC_EGENERIC; \
+} \
+}
+
+struct  priv
+{
+vdp_t *vdp;
+VdpDevice vdp_device;
+};
+
+static PFNGLVDPAUINITNVPROC _glVDPAUInitNV;
+static PFNGLVDPAUFININVPROC _glVDPAUFiniNV;
+static PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC
_glVDPAURegisterOutputSurfaceNV;
+static PFNGLVDPAUISSURFACENVPROC_glVDPAUIsSurfaceNV;
+static PFNGLVDPAUUNREGISTERSURFACENVPROC   

[vlc-commits] glwin32: correct vertical alignment

2017-08-07 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
<victorien.lecouviour.tuf...@gmail.com> | Fri Aug  4 19:41:12 2017 +0200| 
[e8011ba7c74f8ba6f6a06012843a60b3eea965a8] | committer: Jean-Baptiste Kempf

glwin32: correct vertical alignment

Signed-off-by: Jean-Baptiste Kempf <j...@videolan.org>

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

 modules/video_output/win32/common.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/modules/video_output/win32/common.c 
b/modules/video_output/win32/common.c
index 3617f7a9dc..59e3411cb6 100644
--- a/modules/video_output/win32/common.c
+++ b/modules/video_output/win32/common.c
@@ -194,6 +194,14 @@ void UpdateRects(vout_display_t *vd,
 place_cfg.display.width = rect.right;
 place_cfg.display.height = rect.bottom;
 
+#if (defined(MODULE_NAME_IS_glwin32))
+/* Reverse vertical alignment as the GL tex are Y inverted */
+if (place_cfg.align.vertical == VOUT_DISPLAY_ALIGN_TOP)
+place_cfg.align.vertical = VOUT_DISPLAY_ALIGN_BOTTOM;
+else if (place_cfg.align.vertical == VOUT_DISPLAY_ALIGN_BOTTOM)
+place_cfg.align.vertical = VOUT_DISPLAY_ALIGN_TOP;
+#endif
+
 vout_display_place_t place;
 vout_display_PlacePicture(, source, _cfg, false);
 

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] caopengllayer: correct vertical alignment

2017-08-07 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
<victorien.lecouviour.tuf...@gmail.com> | Fri Aug  4 19:41:11 2017 +0200| 
[94574a225588f931aa6181c3328d3b9cd4f5ef40] | committer: Jean-Baptiste Kempf

caopengllayer: correct vertical alignment

Signed-off-by: Jean-Baptiste Kempf <j...@videolan.org>

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

 modules/video_output/caopengllayer.m | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/modules/video_output/caopengllayer.m 
b/modules/video_output/caopengllayer.m
index c16687c1a0..90b41f517e 100644
--- a/modules/video_output/caopengllayer.m
+++ b/modules/video_output/caopengllayer.m
@@ -348,6 +348,12 @@ static int Control (vout_display_t *vd, int query, va_list 
ap)
 cfg_tmp.display.width = bounds.size.width;
 cfg_tmp.display.height = bounds.size.height;
 
+/* Reverse vertical alignment as the GL tex are Y inverted */
+if (cfg_tmp.align.vertical == VOUT_DISPLAY_ALIGN_TOP)
+cfg_tmp.align.vertical = VOUT_DISPLAY_ALIGN_BOTTOM;
+else if (cfg_tmp.align.vertical == VOUT_DISPLAY_ALIGN_BOTTOM)
+cfg_tmp.align.vertical = VOUT_DISPLAY_ALIGN_TOP;
+
 vout_display_place_t place;
 vout_display_PlacePicture (, >source, _tmp, false);
 if (OpenglLock(sys->gl))

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] opengl: correct vertical alignment

2017-08-07 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
<victorien.lecouviour.tuf...@gmail.com> | Fri Aug  4 19:41:09 2017 +0200| 
[d6d8374d641a298e7db214ab8ac8956d102f553a] | committer: Jean-Baptiste Kempf

opengl: correct vertical alignment

The GL textures are Y inverted, so we must reverse the vertical alignment.

Signed-off-by: Jean-Baptiste Kempf <j...@videolan.org>

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

 modules/video_output/opengl/display.c | 10 --
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/modules/video_output/opengl/display.c 
b/modules/video_output/opengl/display.c
index 2288987469..d12d6ca71a 100644
--- a/modules/video_output/opengl/display.c
+++ b/modules/video_output/opengl/display.c
@@ -213,11 +213,17 @@ static int Control (vout_display_t *vd, int query, 
va_list ap)
   case VOUT_DISPLAY_CHANGE_DISPLAY_FILLED:
   case VOUT_DISPLAY_CHANGE_ZOOM:
   {
-const vout_display_cfg_t *c = va_arg (ap, const vout_display_cfg_t *);
+vout_display_cfg_t c = *va_arg (ap, const vout_display_cfg_t *);
 const video_format_t *src = >source;
 vout_display_place_t place;
 
-vout_display_PlacePicture (, src, c, false);
+/* Reverse vertical alignment as the GL tex are Y inverted */
+if (c.align.vertical == VOUT_DISPLAY_ALIGN_TOP)
+c.align.vertical = VOUT_DISPLAY_ALIGN_BOTTOM;
+else if (c.align.vertical == VOUT_DISPLAY_ALIGN_BOTTOM)
+c.align.vertical = VOUT_DISPLAY_ALIGN_TOP;
+
+vout_display_PlacePicture (, src, , false);
 vlc_gl_Resize (sys->gl, place.width, place.height);
 if (vlc_gl_MakeCurrent (sys->gl) != VLC_SUCCESS)
 return VLC_EGENERIC;

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx: macosx-gl-display: correct vertical alignment

2017-08-07 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
<victorien.lecouviour.tuf...@gmail.com> | Fri Aug  4 19:41:10 2017 +0200| 
[c09f48224da32954b06e3f0ff7f10b35749154b5] | committer: Jean-Baptiste Kempf

macosx: macosx-gl-display: correct vertical alignment

The GL textures are Y inverted, so we must reverse the vertical alignment.

Signed-off-by: Jean-Baptiste Kempf <j...@videolan.org>

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

 modules/video_output/macosx.m | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/modules/video_output/macosx.m b/modules/video_output/macosx.m
index cc24a2ed4e..dd132fef20 100644
--- a/modules/video_output/macosx.m
+++ b/modules/video_output/macosx.m
@@ -391,6 +391,12 @@ static int Control (vout_display_t *vd, int query, va_list 
ap)
 cfg_tmp.display.width = bounds.size.width;
 cfg_tmp.display.height = bounds.size.height;
 
+/* Reverse vertical alignment as the GL tex are Y inverted */
+if (cfg_tmp.align.vertical == VOUT_DISPLAY_ALIGN_TOP)
+cfg_tmp.align.vertical = VOUT_DISPLAY_ALIGN_BOTTOM;
+else if (cfg_tmp.align.vertical == VOUT_DISPLAY_ALIGN_BOTTOM)
+cfg_tmp.align.vertical = VOUT_DISPLAY_ALIGN_TOP;
+
 vout_display_place_t place;
 vout_display_PlacePicture (, >source, _tmp, 
false);
 @synchronized (sys->glView) {

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] fourcc: fix non zero terminated fallback array

2017-08-06 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
<victorien.lecouviour.tuf...@gmail.com> | Fri Aug  4 19:41:01 2017 +0200| 
[8c1b062c57249d6259af0fdd710c995832fed3b7] | committer: Jean-Baptiste Kempf

fourcc: fix non zero terminated fallback array

Signed-off-by: Jean-Baptiste Kempf <j...@videolan.org>

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

 src/misc/fourcc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/misc/fourcc.c b/src/misc/fourcc.c
index 59ed71469b..076117f355 100644
--- a/src/misc/fourcc.c
+++ b/src/misc/fourcc.c
@@ -378,7 +378,7 @@ static const vlc_fourcc_t p_CVPX_VIDEO_I420_fallback[] = {
 };
 
 static const vlc_fourcc_t p_VAAPI_420_fallback[] = {
-VLC_CODEC_VAAPI_420, VLC_CODEC_I420,
+VLC_CODEC_VAAPI_420, VLC_CODEC_I420, 0,
 };
 
 static const vlc_fourcc_t p_I440_fallback[] = {

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] splitter: wall: fix incorrect sizes

2017-08-06 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
<victorien.lecouviour.tuf...@gmail.com> | Fri Aug  4 19:40:58 2017 +0200| 
[dcc1b6e26eed4716271d62139fdd7389b58d21d3] | committer: Jean-Baptiste Kempf

splitter: wall: fix incorrect sizes

The computations must not be done on the buffer size but on the video one.
Otherwise, we might end up with the sum of all output sizes bigger than the
video itself, which results in a green strip at the bottom of the lowest
outputs, and potentially incorrect display for all of them (with bad width).

Signed-off-by: Jean-Baptiste Kempf <j...@videolan.org>

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

 modules/video_splitter/wall.c | 28 ++--
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/modules/video_splitter/wall.c b/modules/video_splitter/wall.c
index e234ca3622..ca19eac4dc 100644
--- a/modules/video_splitter/wall.c
+++ b/modules/video_splitter/wall.c
@@ -191,10 +191,10 @@ static int Open( vlc_object_t *p_this )
 i_aspect = 4 * VOUT_ASPECT_FACTOR / 3;
 
 /* Compute placements/size of the windows */
-const unsigned w1 = ( p_splitter->fmt.i_width / p_sys->i_col ) & ~1;
+const unsigned w1 = ( p_splitter->fmt.i_visible_width / p_sys->i_col ) & 
~1;
 const unsigned h1 = ( w1 * VOUT_ASPECT_FACTOR / i_aspect ) & ~1;
 
-const unsigned h2 = ( p_splitter->fmt.i_height / p_sys->i_row ) & ~1;
+const unsigned h2 = ( p_splitter->fmt.i_visible_height / p_sys->i_row ) & 
~1;
 const unsigned w2 = ( h2 * i_aspect / VOUT_ASPECT_FACTOR ) & ~1;
 
 unsigned i_target_width;
@@ -204,23 +204,23 @@ static int Open( vlc_object_t *p_this )
 bool b_vstart_rounded;
 bool b_hstart_rounded;
 
-if( h1 * p_sys->i_row < p_splitter->fmt.i_height )
+if( h1 * p_sys->i_row < p_splitter->fmt.i_visible_height )
 {
 i_target_width = w2;
 i_target_height = h2;
 
 i_vstart = 0;
 b_vstart_rounded = false;
-i_vend = p_splitter->fmt.i_height;
+i_vend = p_splitter->fmt.i_visible_height;
 
 unsigned i_tmp = i_target_width * p_sys->i_col;
 while( i_tmp < p_splitter->fmt.i_width )
 i_tmp += p_sys->i_col;
 
-i_hstart = (( i_tmp - p_splitter->fmt.i_width ) / 2)&~1;
-b_hstart_rounded  = ( ( i_tmp - p_splitter->fmt.i_width ) % 2 ) ||
-( ( ( i_tmp - p_splitter->fmt.i_width ) / 2 ) & 1 );
-i_hend = i_hstart + p_splitter->fmt.i_width;
+i_hstart = (( i_tmp - p_splitter->fmt.i_visible_width ) / 2)&~1;
+b_hstart_rounded  = ( ( i_tmp - p_splitter->fmt.i_visible_width ) % 2 
) ||
+( ( ( i_tmp - p_splitter->fmt.i_visible_width ) / 2 ) & 1 );
+i_hend = i_hstart + p_splitter->fmt.i_visible_width;
 }
 else
 {
@@ -229,16 +229,16 @@ static int Open( vlc_object_t *p_this )
 
 i_hstart = 0;
 b_hstart_rounded = false;
-i_hend = p_splitter->fmt.i_width;
+i_hend = p_splitter->fmt.i_visible_width;
 
 unsigned i_tmp = i_target_height * p_sys->i_row;
-while( i_tmp < p_splitter->fmt.i_height )
+while( i_tmp < p_splitter->fmt.i_visible_height )
 i_tmp += p_sys->i_row;
 
-i_vstart = ( ( i_tmp - p_splitter->fmt.i_height ) / 2 ) & ~1;
-b_vstart_rounded  = ( ( i_tmp - p_splitter->fmt.i_height ) % 2 ) ||
-( ( ( i_tmp - p_splitter->fmt.i_height ) / 2 ) & 1 );
-i_vend = i_vstart + p_splitter->fmt.i_height;
+i_vstart = ( ( i_tmp - p_splitter->fmt.i_visible_height ) / 2 ) & ~1;
+b_vstart_rounded  = ( ( i_tmp - p_splitter->fmt.i_visible_height ) % 2 
) ||
+( ( ( i_tmp - p_splitter->fmt.i_visible_height ) / 2 ) & 1 );
+i_vend = i_vstart + p_splitter->fmt.i_visible_height;
 }
 msg_Dbg( p_splitter, "target resolution %dx%d", i_target_width, 
i_target_height );
 msg_Dbg( p_splitter, "target window (%d,%d)-(%d,%d)", 
i_hstart,i_vstart,i_hend,i_vend );

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] splitter: wall: fix windows sizes

2017-08-02 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
<victorien.lecouviour.tuf...@gmail.com> | Wed Aug  2 16:37:14 2017 +0200| 
[723940fbad6877f17dba471396db4067af204d39] | committer: Rémi Denis-Courmont

splitter: wall: fix windows sizes

Signed-off-by: Rémi Denis-Courmont <r...@remlab.net>

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

 modules/video_splitter/wall.c | 111 --
 1 file changed, 10 insertions(+), 101 deletions(-)

diff --git a/modules/video_splitter/wall.c b/modules/video_splitter/wall.c
index e234ca3622..4bc3e378ff 100644
--- a/modules/video_splitter/wall.c
+++ b/modules/video_splitter/wall.c
@@ -191,88 +191,19 @@ static int Open( vlc_object_t *p_this )
 i_aspect = 4 * VOUT_ASPECT_FACTOR / 3;
 
 /* Compute placements/size of the windows */
-const unsigned w1 = ( p_splitter->fmt.i_width / p_sys->i_col ) & ~1;
-const unsigned h1 = ( w1 * VOUT_ASPECT_FACTOR / i_aspect ) & ~1;
-
-const unsigned h2 = ( p_splitter->fmt.i_height / p_sys->i_row ) & ~1;
-const unsigned w2 = ( h2 * i_aspect / VOUT_ASPECT_FACTOR ) & ~1;
-
-unsigned i_target_width;
-unsigned i_target_height;
-unsigned i_hstart, i_hend;
-unsigned i_vstart, i_vend;
-bool b_vstart_rounded;
-bool b_hstart_rounded;
-
-if( h1 * p_sys->i_row < p_splitter->fmt.i_height )
-{
-i_target_width = w2;
-i_target_height = h2;
-
-i_vstart = 0;
-b_vstart_rounded = false;
-i_vend = p_splitter->fmt.i_height;
-
-unsigned i_tmp = i_target_width * p_sys->i_col;
-while( i_tmp < p_splitter->fmt.i_width )
-i_tmp += p_sys->i_col;
-
-i_hstart = (( i_tmp - p_splitter->fmt.i_width ) / 2)&~1;
-b_hstart_rounded  = ( ( i_tmp - p_splitter->fmt.i_width ) % 2 ) ||
-( ( ( i_tmp - p_splitter->fmt.i_width ) / 2 ) & 1 );
-i_hend = i_hstart + p_splitter->fmt.i_width;
-}
-else
-{
-i_target_height = h1;
-i_target_width = w1;
-
-i_hstart = 0;
-b_hstart_rounded = false;
-i_hend = p_splitter->fmt.i_width;
-
-unsigned i_tmp = i_target_height * p_sys->i_row;
-while( i_tmp < p_splitter->fmt.i_height )
-i_tmp += p_sys->i_row;
-
-i_vstart = ( ( i_tmp - p_splitter->fmt.i_height ) / 2 ) & ~1;
-b_vstart_rounded  = ( ( i_tmp - p_splitter->fmt.i_height ) % 2 ) ||
-( ( ( i_tmp - p_splitter->fmt.i_height ) / 2 ) & 1 );
-i_vend = i_vstart + p_splitter->fmt.i_height;
-}
-msg_Dbg( p_splitter, "target resolution %dx%d", i_target_width, 
i_target_height );
-msg_Dbg( p_splitter, "target window (%d,%d)-(%d,%d)", 
i_hstart,i_vstart,i_hend,i_vend );
+unsigned i_width = p_splitter->fmt.i_visible_width / p_sys->i_col;
+unsigned i_height = p_splitter->fmt.i_visible_height / p_sys->i_row;
+msg_Dbg( p_splitter, "target resolution %dx%d", i_width, i_height );
 
 int i_active = 0;
 for( int y = 0, i_top = 0; y < p_sys->i_row; y++ )
 {
 /* */
-int i_height = 0;
 int i_halign = 0;
-if( y * i_target_height >= i_vstart &&
-( y + 1 ) * i_target_height <= i_vend )
-{
-i_height = i_target_height;
-}
-else if( ( y + 1 ) * i_target_height < i_vstart ||
- ( y * i_target_height ) > i_vend )
-{
-i_height = 0;
-}
+if ( y >= ( p_sys->i_row / 2 ) )
+i_halign = VOUT_ALIGN_BOTTOM;
 else
-{
-i_height = ( i_target_height -
- i_vstart%i_target_height );
-if(  y >= ( p_sys->i_row / 2 ) )
-{
-i_halign = VOUT_ALIGN_TOP;
-i_height -= b_vstart_rounded ? 2: 0;
-}
-else
-{
-i_halign = VOUT_ALIGN_BOTTOM;
-}
-}
+i_halign = VOUT_ALIGN_TOP;
 
 /* */
 for( int x = 0, i_left = 0; x < p_sys->i_col; x++ )
@@ -280,35 +211,14 @@ static int Open( vlc_object_t *p_this )
 wall_output_t *p_output = _sys->pp_output[x][y];
 
 /* */
-int i_width;
 int i_valign = 0;
-if( x*i_target_width >= i_hstart &&
-(x+1)*i_target_width <= i_hend )
-{
-i_width = i_target_width;
-}
-else if( ( x + 1 ) * i_target_width < i_hstart ||
- ( x * i_target_width ) > i_hend )
-{
-i_width = 0;
-}
+if( x >= ( p_sys->i_col / 2 ) )
+i_valign = VOUT_ALIGN_RIGHT;
 els

[vlc-commits] splitter: wall: fix aspect ratio

2017-08-02 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
<victorien.lecouviour.tuf...@gmail.com> | Wed Aug  2 16:37:13 2017 +0200| 
[d15bf6d4028e7b935644f3dbbd81fd0f38527890] | committer: Rémi Denis-Courmont

splitter: wall: fix aspect ratio

Signed-off-by: Rémi Denis-Courmont <r...@remlab.net>

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

 modules/video_splitter/wall.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/video_splitter/wall.c b/modules/video_splitter/wall.c
index 3e95f91e15..e234ca3622 100644
--- a/modules/video_splitter/wall.c
+++ b/modules/video_splitter/wall.c
@@ -359,8 +359,8 @@ static int Open( vlc_object_t *p_this )
 p_cfg->fmt.i_width  = p_output->i_width;
 p_cfg->fmt.i_visible_height =
 p_cfg->fmt.i_height = p_output->i_height;
-p_cfg->fmt.i_sar_num= (int64_t)i_aspect * i_target_height;
-p_cfg->fmt.i_sar_den= VOUT_ASPECT_FACTOR * i_target_width;
+p_cfg->fmt.i_sar_num= p_splitter->fmt.i_sar_num;
+p_cfg->fmt.i_sar_den= p_splitter->fmt.i_sar_den;
 p_cfg->window.i_x = p_output->i_left;
 p_cfg->window.i_y = p_output->i_top;
 p_cfg->window.i_align = p_output->i_align;

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx: remove spaces from blank line

2017-08-02 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
<victorien.lecouviour.tuf...@gmail.com> | Wed Aug  2 16:37:11 2017 +0200| 
[b084d34c379b00d569dd314e76a16011e34051d5] | committer: Jean-Baptiste Kempf

macosx: remove spaces from blank line

Signed-off-by: Jean-Baptiste Kempf <j...@videolan.org>

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

 modules/gui/macosx/VLCMainWindow.m | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/gui/macosx/VLCMainWindow.m 
b/modules/gui/macosx/VLCMainWindow.m
index fadf07f662..6f469dcd28 100644
--- a/modules/gui/macosx/VLCMainWindow.m
+++ b/modules/gui/macosx/VLCMainWindow.m
@@ -755,7 +755,7 @@ static const float f_min_window_height = 307.;
 - (void)setVideoplayEnabled
 {
 BOOL b_videoPlayback = [[VLCMain sharedInstance] activeVideoPlayback];
-
+
 if (!b_videoPlayback) {
 if (!self.nonembedded && (!self.nativeFullscreenMode || 
(self.nativeFullscreenMode && !self.fullscreen)) && 
frameBeforePlayback.size.width > 0 && frameBeforePlayback.size.height > 0) {
 

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx: don't handle color primaries

2017-07-27 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
<victorien.lecouviour.tuf...@gmail.com> | Thu Jul 27 12:06:33 2017 +0200| 
[39d9311e4c48edb5617d631136d9d351e7b99216] | committer: Jean-Baptiste Kempf

macosx: don't handle color primaries

The GL shader already does this job.

Signed-off-by: Jean-Baptiste Kempf <j...@videolan.org>

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

 modules/video_output/macosx.m | 87 ---
 1 file changed, 87 deletions(-)

diff --git a/modules/video_output/macosx.m b/modules/video_output/macosx.m
index 3fa35c592d..2770c44305 100644
--- a/modules/video_output/macosx.m
+++ b/modules/video_output/macosx.m
@@ -49,14 +49,6 @@
 #include 
 #include "opengl/vout_helper.h"
 
-#define OSX_EL_CAPITAN (NSAppKitVersionNumber >= 1404)
-
-#if MAC_OS_X_VERSION_MIN_ALLOWED <= MAC_OS_X_VERSION_10_11
-const CFStringRef kCGColorSpaceDCIP3 = CFSTR("kCGColorSpaceDCIP3");
-const CFStringRef kCGColorSpaceITUR_709 = CFSTR("kCGColorSpaceITUR_709");
-const CFStringRef kCGColorSpaceITUR_2020 = CFSTR("kCGColorSpaceITUR_2020");
-#endif
-
 /**
  * Forward declarations
  */
@@ -112,9 +104,6 @@ struct vout_display_sys_t
 VLCOpenGLVideoView *glView;
 id container;
 
-CGColorSpaceRef cgColorSpace;
-NSColorSpace *nsColorSpace;
-
 vout_window_t *embed;
 vlc_gl_t *gl;
 vout_display_opengl_t *vgl;
@@ -176,57 +165,6 @@ static int Open (vlc_object_t *this)
  * main thread, after we are done using it. */
 sys->container = [container retain];
 
-/* support for BT.709 and BT.2020 color spaces was introduced with OS 
X 10.11
- * on older OS versions, we can't show correct colors, so we fallback 
on linear RGB */
-if (OSX_EL_CAPITAN) {
-switch (vd->fmt.primaries) {
-case COLOR_PRIMARIES_BT601_525:
-case COLOR_PRIMARIES_BT601_625:
-{
-msg_Dbg(vd, "Using BT.601 color space");
-sys->cgColorSpace = 
CGColorSpaceCreateWithName(kCGColorSpaceSRGB);
-break;
-}
-case COLOR_PRIMARIES_BT709:
-{
-msg_Dbg(vd, "Using BT.709 color space");
-sys->cgColorSpace = 
CGColorSpaceCreateWithName(kCGColorSpaceITUR_709);
-break;
-}
-case COLOR_PRIMARIES_BT2020:
-{
-msg_Dbg(vd, "Using BT.2020 color space");
-sys->cgColorSpace = 
CGColorSpaceCreateWithName(kCGColorSpaceITUR_2020);
-break;
-}
-case COLOR_PRIMARIES_DCI_P3:
-{
-msg_Dbg(vd, "Using DCI P3 color space");
-sys->cgColorSpace = 
CGColorSpaceCreateWithName(kCGColorSpaceDCIP3);
-break;
-}
-default:
-{
-msg_Dbg(vd, "Guessing color space based on video 
dimensions (%ix%i)", vd->fmt.i_visible_width, vd->fmt.i_visible_height);
-if (vd->fmt.i_visible_height >= 2000 || 
vd->fmt.i_visible_width >= 3800) {
-msg_Dbg(vd, "Using BT.2020 color space");
-sys->cgColorSpace = 
CGColorSpaceCreateWithName(kCGColorSpaceITUR_2020);
-} else if (vd->fmt.i_height > 576) {
-msg_Dbg(vd, "Using BT.709 color space");
-sys->cgColorSpace = 
CGColorSpaceCreateWithName(kCGColorSpaceITUR_709);
-} else {
-msg_Dbg(vd, "SD content, using linear RGB color 
space");
-sys->cgColorSpace = 
CGColorSpaceCreateWithName(kCGColorSpaceSRGB);
-}
-break;
-}
-}
-} else {
-msg_Dbg(vd, "OS does not support BT.709 or BT.2020 color spaces, 
output may vary");
-sys->cgColorSpace = CGColorSpaceCreateWithName(kCGColorSpaceSRGB);
-}
-sys->nsColorSpace = [[NSColorSpace alloc] 
initWithCGColorSpace:sys->cgColorSpace];
-
 /* Get our main view*/
 [VLCOpenGLVideoView performSelectorOnMainThread:@selector(getNewView:)
  withObject:[NSValue 
valueWithPointer:>glView]
@@ -360,12 +298,6 @@ void Close (vlc_object_t *this)
 
 [sys->glView release];
 
-if (sys->cgColorSpace != nil)
-CGColorSpaceRelease(sys->cgColorSpace);
-
-if (sys->nsColorSpace != nil)
-[sys->nsColorSpace release];
-
 if (sys->embed)
 vout_display_DeleteW

[vlc-commits] opengl: converter_cvpx: don't handle color space

2017-07-27 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
<victorien.lecouviour.tuf...@gmail.com> | Thu Jul 27 12:06:34 2017 +0200| 
[e818a9b141d588f0582af2555a3c45065ae84992] | committer: Jean-Baptiste Kempf

opengl: converter_cvpx: don't handle color space

VideoToolbox already handles it.

Signed-off-by: Jean-Baptiste Kempf <j...@videolan.org>

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

 modules/video_output/opengl/converter_cvpx.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/modules/video_output/opengl/converter_cvpx.c 
b/modules/video_output/opengl/converter_cvpx.c
index 7864d3f25b..e388551b2e 100644
--- a/modules/video_output/opengl/converter_cvpx.c
+++ b/modules/video_output/opengl/converter_cvpx.c
@@ -196,7 +196,7 @@ opengl_tex_converter_cvpx_init(opengl_tex_converter_t *tc)
 case VLC_CODEC_CVPX_UYVY:
 fragment_shader =
 opengl_fragment_shader_init(tc, tex_target, VLC_CODEC_UYVY,
-tc->fmt.space);
+COLOR_SPACE_UNDEF);
 tc->texs[0].internal = GL_RGB;
 tc->texs[0].format = GL_RGB_422_APPLE;
 tc->texs[0].type = GL_UNSIGNED_SHORT_8_8_APPLE;
@@ -205,13 +205,13 @@ opengl_tex_converter_cvpx_init(opengl_tex_converter_t *tc)
 {
 fragment_shader =
 opengl_fragment_shader_init(tc, tex_target, VLC_CODEC_NV12,
-tc->fmt.space);
+COLOR_SPACE_UNDEF);
 break;
 }
 case VLC_CODEC_CVPX_I420:
 fragment_shader =
 opengl_fragment_shader_init(tc, tex_target, VLC_CODEC_I420,
-tc->fmt.space);
+COLOR_SPACE_UNDEF);
 break;
 case VLC_CODEC_CVPX_BGRA:
 fragment_shader =

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] caopengllayer: don't handle color primaries

2017-07-27 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
<victorien.lecouviour.tuf...@gmail.com> | Thu Jul 27 12:06:32 2017 +0200| 
[74ea8d15863478196e5676545a84a9933fba339e] | committer: Jean-Baptiste Kempf

caopengllayer: don't handle color primaries

The GL shader already does this job.

Signed-off-by: Jean-Baptiste Kempf <j...@videolan.org>

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

 modules/video_output/caopengllayer.m | 70 
 1 file changed, 70 deletions(-)

diff --git a/modules/video_output/caopengllayer.m 
b/modules/video_output/caopengllayer.m
index 067831e618..a9777c6af9 100644
--- a/modules/video_output/caopengllayer.m
+++ b/modules/video_output/caopengllayer.m
@@ -43,15 +43,8 @@
 
 #include "opengl/vout_helper.h"
 
-#define OSX_EL_CAPITAN_AND_HIGHER (NSAppKitVersionNumber >= 1404)
 #define OSX_SIERRA_AND_HIGHER (NSAppKitVersionNumber >= 1485)
 
-#if MAC_OS_X_VERSION_MIN_ALLOWED <= MAC_OS_X_VERSION_10_11
-const CFStringRef kCGColorSpaceDCIP3 = CFSTR("kCGColorSpaceDCIP3");
-const CFStringRef kCGColorSpaceITUR_709 = CFSTR("kCGColorSpaceITUR_709");
-const CFStringRef kCGColorSpaceITUR_2020 = CFSTR("kCGColorSpaceITUR_2020");
-#endif
-
 /*
  * Vout interface
  */
@@ -99,8 +92,6 @@ struct vout_display_sys_t {
 vout_window_t *embed;
 VLCCAOpenGLLayer *cgLayer;
 
-CGColorSpaceRef cgColorSpace;
-
 vlc_gl_t *gl;
 vout_display_opengl_t *vgl;
 
@@ -215,64 +206,6 @@ static int Open (vlc_object_t *p_this)
 vd->display = PictureDisplay;
 vd->control = Control;
 
-/* handle color space if supported by the OS */
-if ([sys->cgLayer respondsToSelector:@selector(setColorspace:)]) {
-
-/* support for BT.709 and BT.2020 color spaces was introduced with 
OS X 10.11
- * on older OS versions, we can't show correct colors, so we 
fallback on linear RGB */
-if (OSX_EL_CAPITAN_AND_HIGHER) {
-switch (fmt.primaries) {
-case COLOR_PRIMARIES_BT601_525:
-case COLOR_PRIMARIES_BT601_625:
-{
-msg_Dbg(vd, "Using BT.601 color space");
-sys->cgColorSpace = 
CGColorSpaceCreateWithName(kCGColorSpaceSRGB);
-break;
-}
-case COLOR_PRIMARIES_BT709:
-{
-msg_Dbg(vd, "Using BT.709 color space");
-sys->cgColorSpace = 
CGColorSpaceCreateWithName(kCGColorSpaceITUR_709);
-break;
-}
-case COLOR_PRIMARIES_BT2020:
-{
-msg_Dbg(vd, "Using BT.2020 color space");
-sys->cgColorSpace = 
CGColorSpaceCreateWithName(kCGColorSpaceITUR_2020);
-break;
-}
-case COLOR_PRIMARIES_DCI_P3:
-{
-msg_Dbg(vd, "Using DCI P3 color space");
-sys->cgColorSpace = 
CGColorSpaceCreateWithName(kCGColorSpaceDCIP3);
-break;
-}
-default:
-{
-msg_Dbg(vd, "Guessing color space based on video 
dimensions (%ix%i)", fmt.i_visible_width, fmt.i_visible_height);
-if (fmt.i_visible_height >= 2000 || 
fmt.i_visible_width >= 3800) {
-msg_Dbg(vd, "Using BT.2020 color space");
-sys->cgColorSpace = 
CGColorSpaceCreateWithName(kCGColorSpaceITUR_2020);
-} else if (fmt.i_height > 576) {
-msg_Dbg(vd, "Using BT.709 color space");
-sys->cgColorSpace = 
CGColorSpaceCreateWithName(kCGColorSpaceITUR_709);
-} else {
-msg_Dbg(vd, "SD content, using linear RGB color 
space");
-sys->cgColorSpace = 
CGColorSpaceCreateWithName(kCGColorSpaceSRGB);
-}
-break;
-}
-}
-} else {
-msg_Dbg(vd, "OS does not support BT.709 or BT.2020 color 
spaces, output may vary");
-sys->cgColorSpace = 
CGColorSpaceCreateWithName(kCGColorSpaceGenericRGBLinear);
-}
-
-[sys->cgLayer setColorspace: sys->cgColorSpace];
-} else {
-msg_Dbg(vd, "OS does not support cust

[vlc-commits] sd: avahi: change unappropriate msg_Err to msg_Info

2017-07-27 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
<victorien.lecouviour.tuf...@gmail.com> | Tue Jul 25 18:00:38 2017 +0200| 
[9b198401dbf196a8f39deca4536128a9f3e461a2] | committer: Jean-Baptiste Kempf

sd: avahi: change unappropriate msg_Err to msg_Info

Signed-off-by: Jean-Baptiste Kempf <j...@videolan.org>

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

 modules/services_discovery/avahi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/services_discovery/avahi.c 
b/modules/services_discovery/avahi.c
index bf19ad68c4..dbfac40809 100644
--- a/modules/services_discovery/avahi.c
+++ b/modules/services_discovery/avahi.c
@@ -142,8 +142,8 @@ static void resolve_callback(
 AvahiStringList *asl = NULL;
 input_item_t *p_input = NULL;
 
-msg_Err( p_sd, "service '%s' of type '%s' in domain '%s' port %i",
- name, type, domain, port );
+msg_Info( p_sd, "service '%s' of type '%s' in domain '%s' port %i",
+  name, type, domain, port );
 
 avahi_address_snprint(a, (sizeof(a)/sizeof(a[0]))-1, address);
 if( protocol == AVAHI_PROTO_INET6 )

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] caopengllayer: remove spaces from blank lines

2017-07-27 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
<victorien.lecouviour.tuf...@gmail.com> | Thu Jul 27 01:29:59 2017 +0200| 
[2b310f3e9757a5bf09dd99bef0c92465f7307dfb] | committer: Jean-Baptiste Kempf

caopengllayer: remove spaces from blank lines

Signed-off-by: Jean-Baptiste Kempf <j...@videolan.org>

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

 modules/video_output/caopengllayer.m | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/video_output/caopengllayer.m 
b/modules/video_output/caopengllayer.m
index 2a3cca5712..067831e618 100644
--- a/modules/video_output/caopengllayer.m
+++ b/modules/video_output/caopengllayer.m
@@ -287,9 +287,9 @@ static int Open (vlc_object_t *p_this)
 else
 outputSize = [sys->container visibleRect].size;
 vout_display_SendEventDisplaySize(vd, (int)outputSize.width, 
(int)outputSize.height);
-
+
 return VLC_SUCCESS;
-
+
 bailout:
 Close(p_this);
 return VLC_EGENERIC;

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] caopengllayer: fix green output

2017-07-26 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
<victorien.lecouviour.tuf...@gmail.com> | Wed Jul 26 16:14:01 2017 +0200| 
[fdb40afd8ef10669024244489c45d2c335e0c74c] | committer: Jean-Baptiste Kempf

caopengllayer: fix green output

Fixes #18309.

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

 modules/video_output/caopengllayer.m | 58 +++-
 1 file changed, 37 insertions(+), 21 deletions(-)

diff --git a/modules/video_output/caopengllayer.m 
b/modules/video_output/caopengllayer.m
index ed77118f99..dd47cd7b4c 100644
--- a/modules/video_output/caopengllayer.m
+++ b/modules/video_output/caopengllayer.m
@@ -84,6 +84,7 @@ static void OpenglSwap (vlc_gl_t *gl);
 @interface VLCCAOpenGLLayer : CAOpenGLLayer
 
 @property (nonatomic, readwrite) vout_display_t* voutDisplay;
+@property (nonatomic, readwrite) CGLContextObj glContext;
 
 @end
 
@@ -99,8 +100,6 @@ struct vout_display_sys_t {
 
 CGColorSpaceRef cgColorSpace;
 
-CGLContextObj glContext;
-
 vlc_gl_t *gl;
 vout_display_opengl_t *vgl;
 
@@ -109,6 +108,12 @@ struct vout_display_sys_t {
 bool  b_frame_available;
 };
 
+struct gl_sys
+{
+CGLContextObj locked_ctx;
+VLCCAOpenGLLayer *cgLayer;
+};
+
 /*
  * Open: This function allocates and initializes the OpenGL vout method.
  */
@@ -167,7 +172,7 @@ static int Open (vlc_object_t *p_this)
 if (!sys->cgLayer)
 goto bailout;
 
-if (!sys->glContext)
+if (![sys->cgLayer glContext])
 msg_Warn(vd, "we might not have an OpenGL context yet");
 
 /* Initialize common OpenGL video display */
@@ -178,7 +183,12 @@ static int Open (vlc_object_t *p_this)
 sys->gl->releaseCurrent = OpenglUnlock;
 sys->gl->swap = OpenglSwap;
 sys->gl->getProcAddress = OurGetProcAddress;
-sys->gl->sys = sys;
+
+struct gl_sys *glsys = sys->gl->sys = malloc(sizeof(*glsys));
+if (!sys->gl->sys)
+goto bailout;
+glsys->locked_ctx = NULL;
+glsys->cgLayer = sys->cgLayer;
 
 const vlc_fourcc_t *subpicture_chromas;
 video_format_t fmt = vd->fmt;
@@ -308,10 +318,17 @@ static void Close (vlc_object_t *p_this)
 }
 
 if (sys->gl != NULL)
+{
+if (sys->gl->sys != NULL)
+{
+assert(((struct gl_sys *)sys->gl->sys)->locked_ctx == NULL);
+free(sys->gl->sys);
+}
 vlc_object_release(sys->gl);
+}
 
-if (sys->glContext)
-CGLReleaseContext(sys->glContext);
+if ([sys->cgLayer glContext])
+CGLReleaseContext([sys->cgLayer glContext]);
 
 if (sys->cgColorSpace != nil)
 CGColorSpaceRelease(sys->cgColorSpace);
@@ -450,15 +467,18 @@ static int Control (vout_display_t *vd, int query, 
va_list ap)
 
 static int OpenglLock (vlc_gl_t *gl)
 {
-vout_display_sys_t *sys = (vout_display_sys_t *)gl->sys;
+struct gl_sys *sys = gl->sys;
+assert(sys->locked_ctx == NULL);
 
-if(!sys->glContext) {
+CGLContextObj ctx = [sys->cgLayer glContext];
+if(!ctx) {
 return 1;
 }
 
-CGLError err = CGLLockContext(sys->glContext);
+CGLError err = CGLLockContext(ctx);
 if (kCGLNoError == err) {
-CGLSetCurrentContext(sys->glContext);
+sys->locked_ctx = ctx;
+CGLSetCurrentContext(ctx);
 return 0;
 }
 return 1;
@@ -466,13 +486,9 @@ static int OpenglLock (vlc_gl_t *gl)
 
 static void OpenglUnlock (vlc_gl_t *gl)
 {
-vout_display_sys_t *sys = (vout_display_sys_t *)gl->sys;
-
-if (!sys->glContext) {
-return;
-}
-
-CGLUnlockContext(sys->glContext);
+struct gl_sys *sys = gl->sys;
+CGLUnlockContext(sys->locked_ctx);
+sys->locked_ctx = NULL;
 }
 
 static void OpenglSwap (vlc_gl_t *gl)
@@ -561,9 +577,9 @@ static void *OurGetProcAddress (vlc_gl_t *gl, const char 
*name)
 - (CGLContextObj)copyCGLContextForPixelFormat:(CGLPixelFormatObj)pixelFormat
 {
 // Only one opengl context is allowed for the module lifetime
-if(_voutDisplay->sys->glContext) {
-msg_Dbg(_voutDisplay, "Return existing context: %p", 
_voutDisplay->sys->glContext);
-return _voutDisplay->sys->glContext;
+if(_glContext) {
+msg_Dbg(_voutDisplay, "Return existing context: %p", _glContext);
+return _glContext;
 }
 
 CGLContextObj context = [super copyCGLContextForPixelFormat:pixelFormat];
@@ -577,7 +593,7 @@ static void *OurGetProcAddress (vlc_gl_t *gl, const char 
*name)
   );
 
 @synchronized (self) {
-_vou

[vlc-commits] macosx: remove noise filter from GUI

2017-07-26 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
<victorien.lecouviour.tuf...@gmail.com> | Wed Jul 26 14:33:03 2017 +0200| 
[a67ee64077f0dd4df9913a3cc37314868ec99052] | committer: Jean-Baptiste Kempf

macosx: remove noise filter from GUI

This filter has been removed between 1.1.13 and 2.0.0.
Closes #18483.

Signed-off-by: Jean-Baptiste Kempf <j...@videolan.org>

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

 modules/gui/macosx/UI/VideoEffects.xib   | 13 -
 modules/gui/macosx/VLCVideoEffectsWindowController.h |  2 --
 modules/gui/macosx/VLCVideoEffectsWindowController.m |  8 
 3 files changed, 23 deletions(-)

diff --git a/modules/gui/macosx/UI/VideoEffects.xib 
b/modules/gui/macosx/UI/VideoEffects.xib
index a9adf7e4bb..4b5607b219 100644
--- a/modules/gui/macosx/UI/VideoEffects.xib
+++ b/modules/gui/macosx/UI/VideoEffects.xib
@@ -73,7 +73,6 @@
 
 
 
-
 
 
 
@@ -1162,16 +1161,6 @@
 
 
 
-
-
-
-
-
-
-
-
-
-
 
 
 
@@ -1502,7 +1491,6 @@
 
 
 
-
 
 
 
@@ -1515,7 +1503,6 @@
 
 
 
-
 
 
 
diff --git a/modules/gui/macosx/VLCVideoEffectsWindowController.h 
b/modules/gui/macosx/VLCVideoEffectsWindowController.h
index 243fc88a26..f09a5ada2a 100644
--- a/modules/gui/macosx/VLCVideoEffectsWindowController.h
+++ b/modules/gui/macosx/VLCVideoEffectsWindowController.h
@@ -108,7 +108,6 @@
 @property (readwrite, weak) IBOutlet NSTextField *sepiaLabel;
 @property (readwrite, weak) IBOutlet NSTextField *sepiaTextField;
 @property (readwrite, weak) IBOutlet NSStepper *sepiaStepper;
-@property (readwrite, weak) IBOutlet NSButton *noiseCheckbox;
 @property (readwrite, weak) IBOutlet NSButton *gradientCheckbox;
 @property (readwrite, weak) IBOutlet NSTextField *gradientModeLabel;
 @property (readwrite, weak) IBOutlet NSPopUpButton *gradientModePopup;
@@ -205,7 +204,6 @@
 - (IBAction)thresholdModifierChanged:(id)sender;
 - (IBAction)enableSepia:(id)sender;
 - (IBAction)sepiaModifierChanged:(id)sender;
-- (IBAction)enableNoise:(id)sender;
 - (IBAction)enableGradient:(id)sender;
 - (IBAction)gradientModifierChanged:(id)sender;
 - (IBAction)enableExtract:(id)sender;
diff --git a/modules/gui/macosx/VLCVideoEffectsWindowController.m 
b/modules/gui/macosx/VLCVideoEffectsWindowController.m
index 539e2143f5..d9d8b1a04f 100644
--- a/modules/gui/macosx/VLCVideoEffectsWindowController.m
+++ b/modules/gui/macosx/VLCVideoEffectsWindowController.m
@@ -241,7 +241,6 @@
 [_thresholdSimilarityLabel setStringValue:_NS("Similarity")];
 [_sepiaCheckbox setTitle:_NS("Sepia")];
 [_sepiaLabel setStringValue:_NS("Intensity")];
-[_noiseCheckbox setTitle:_NS("Noise")];
 [_gradientCheckbox setTitle:_NS("Gradient")];
 [_gradientModeLabel setStringValue:_NS("Mode")];
 [_gradientModePopup removeAllItems];
@@ -459,7 +458,6 @@
 [_puzzleCheckbox setState: (NSInteger)strstr(psz_vfilters, "puzzle")];
 [_thresholdCheckbox setState: (NSInteger)strstr(psz_vfilters, 
"colorthres")];
 [_sepiaCheckbox setState: (NSInteger)strstr(psz_vfilters, "sepia")];
-[_noiseCheckbox setState: (NSInteger)strstr(psz_vfilters, "noise")];
 [_gradientCheckbox setState: (NSInteger)strstr(psz_vfilters, 
"gradient")];
 [_extractCheckbox setState: (NSInteger)strstr(psz_vfilters, 
"extract")];
 [_invertCheckbox setState: (NSInteger)strstr(psz_vfilters, "invert")];
@@ -481,7 +479,6 @@
 [_puzzleCheckbox setState: N

[vlc-commits] opengl: correct documentation

2017-07-18 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
<victorien.lecouviour.tuf...@gmail.com> | Mon Jul 17 13:21:33 2017 +0200| 
[284713510bcef4d88d4ec04a29379992ed0d088b] | committer: Jean-Baptiste Kempf

opengl: correct documentation

Signed-off-by: Jean-Baptiste Kempf <j...@videolan.org>

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

 modules/video_output/opengl/internal.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/video_output/opengl/internal.h 
b/modules/video_output/opengl/internal.h
index 9d5639a107..3c27d49028 100644
--- a/modules/video_output/opengl/internal.h
+++ b/modules/video_output/opengl/internal.h
@@ -317,8 +317,8 @@ struct opengl_tex_converter_t
  * \param tc OpenGL tex converter
  * \param tex_target GL_TEXTURE_2D or GL_TEXTURE_RECTANGLE
  * \param chroma chroma used to generate the fragment shader
- * \param if not COLOR_SPACE_UNDEF, YUV planes will be converted to RGB
- * according to the color space
+ * \param yuv_space if not COLOR_SPACE_UNDEF, YUV planes will be converted to
+ * RGB according to the color space
  * \return the compiled fragment shader or 0 in case of error
  */
 GLuint

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] hw: coreimage: add filters

2017-07-13 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
<victorien.lecouviour.tuf...@gmail.com> | Thu Jul 13 15:29:13 2017 +0200| 
[3ba7de2ed2de1b57b8b8ab84afe2b0887c4b6e69] | committer: Jean-Baptiste Kempf

hw: coreimage: add filters

adjust / invert / posterize / sepia / sharpen

Signed-off-by: Jean-Baptiste Kempf <j...@videolan.org>

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

 NEWS  |   1 +
 modules/MODULES_LIST  |   1 +
 modules/video_filter/Makefile.am  |  11 +
 modules/video_filter/ci_filters.m | 671 ++
 modules/video_output/macosx.m |   4 +
 5 files changed, 688 insertions(+)

diff --git a/NEWS b/NEWS
index c61a2b2a0d..0046c89fd2 100644
--- a/NEWS
+++ b/NEWS
@@ -181,6 +181,7 @@ Video filter:
  * Added 9-bit and 10-bit support to image adjust filter
  * New edge detection filter uses the Sobel operator to detect edges
  * Hardware accelerated deinterlacing/adjust/sharpen/chroma with VA-API
+ * Hardware accelerated adjust/invert/posterize/sepia/sharpen with CoreImage
 
 Stream Output:
  * Chromecast output module
diff --git a/modules/MODULES_LIST b/modules/MODULES_LIST
index 28b266a2ec..510cc4af36 100644
--- a/modules/MODULES_LIST
+++ b/modules/MODULES_LIST
@@ -78,6 +78,7 @@ $Id$
  * chorus_flanger: Basic chorus/flanger/variable delay audio filter
  * chroma_omx: OMX Development Layer chroma conversions
  * chroma_yuv_neon: ARM NEON video chroma conversion
+ * ci_filters: CoreImage hardware-accelerated 
adjust/invert/posterize/sepia/sharpen filters
  * clone: Clone video filter
  * colorthres:  Theshold color based on similarity to reference color Video 
filter
  * compressor: Dynamic range compressor
diff --git a/modules/video_filter/Makefile.am b/modules/video_filter/Makefile.am
index a46eb3ce89..5c27a8a26d 100644
--- a/modules/video_filter/Makefile.am
+++ b/modules/video_filter/Makefile.am
@@ -107,6 +107,17 @@ video_filter_LTLIBRARIES = \
libpuzzle_plugin.la \
librotate_plugin.la
 
+if HAVE_OSX
+# MacOSX hardware video filters
+libci_filters_plugin_la_SOURCES = video_filter/ci_filters.m codec/vt_utils.c 
codec/vt_utils.h
+libci_filters_plugin_la_CFLAGS = $(AM_CFLAGS)
+libci_filters_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(video_filterdir)' \
+   -Wl,-framework,Foundation -Wl,-framework,CoreGraphics 
-Wl,-framework,CoreImage -Wl,-framework,CoreVideo
+
+video_filter_LTLIBRARIES += \
+   libci_filters_plugin.la
+endif
+
 libdeinterlace_plugin_la_SOURCES = \
video_filter/deinterlace/deinterlace.c 
video_filter/deinterlace/deinterlace.h \
 video_filter/deinterlace/mmx.h \
diff --git a/modules/video_filter/ci_filters.m 
b/modules/video_filter/ci_filters.m
new file mode 100644
index 00..6f39000803
--- /dev/null
+++ b/modules/video_filter/ci_filters.m
@@ -0,0 +1,671 @@
+/*
+ * ci_filters.m: Video filters for MacOSX OpenGL video output
+ *
+ * Copyright © 2017 VLC authors, VideoLAN and VideoLabs
+ *
+ * Author: Victorien Le Couviour--Tuffet 
<victorien.lecouviour.tuf...@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
+ * the Free Software Foundation; either version 2.1 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include "filter_picture.h"
+#include "vt_utils.h"
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+enumfilter_type
+{
+FILTER_NONE = -1,
+FILTER_ADJUST_HUE,
+FILTER_ADJUST_COLOR_CONTROLS,
+FILTER_ADJUST_GAMMA,
+FILTER_INVERT,
+FILTER_POSTERIZE,
+FILTER_SEPIA,
+FILTER_SHARPEN,
+NUM_FILTERS,
+NUM_MAX_EQUIVALENT_VLC_FILTERS = 3
+};
+
+#define NUM_FILTER_PARAM_MAX4
+
+struct  filter_chain
+{
+enum filter_typefilter;
+CIFilter *  ci_filter;
+vlc_atomic_floatci_params[NUM_FILTER_PARAM_MAX];
+struct filter_chain *   next;
+};
+
+struct  ci_filters_ctx
+{
+CVPixel

[vlc-commits] MODULES_LIST: fix alphabetical ordering

2017-07-13 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
<victorien.lecouviour.tuf...@gmail.com> | Thu Jul 13 15:31:30 2017 +0200| 
[6cecbdf4fe3f051d6b7a4b6bc52895dd14710441] | committer: Jean-Baptiste Kempf

MODULES_LIST: fix alphabetical ordering

Signed-off-by: Jean-Baptiste Kempf <j...@videolan.org>

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

 modules/MODULES_LIST | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/MODULES_LIST b/modules/MODULES_LIST
index ec2ed4ba5e..28b266a2ec 100644
--- a/modules/MODULES_LIST
+++ b/modules/MODULES_LIST
@@ -261,8 +261,8 @@ $Id$
  * netsync: synchronizes the clock of remote VLCs with a server for 
synchronous playback
  * nfs: NFS access module using libnfs
  * normvol: a audio filter for volume normalization
- * notify: notifications using libnotify
  * noseek: seek prevention demuxing filter
+ * notify: notifications using libnotify
  * nsc: decoder for Microsoft proprietary NSC descriptors
  * nsspeechsynthesizer: Text to speech subtitles renderer
  * nsv: NullSoft Video demuxer

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] video-chroma: add cvpx to cvpx converter

2017-07-13 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
<victorien.lecouviour.tuf...@gmail.com> | Thu Jul 13 14:39:59 2017 +0200| 
[6627c42510b8584a789076976235672d085c9a02] | committer: Jean-Baptiste Kempf

video-chroma: add cvpx to cvpx converter

Signed-off-by: Jean-Baptiste Kempf <j...@videolan.org>

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

 modules/video_chroma/cvpx.c | 107 +++-
 1 file changed, 105 insertions(+), 2 deletions(-)

diff --git a/modules/video_chroma/cvpx.c b/modules/video_chroma/cvpx.c
index 4da92ae7de..abb5303f9b 100644
--- a/modules/video_chroma/cvpx.c
+++ b/modules/video_chroma/cvpx.c
@@ -4,6 +4,8 @@
  * Copyright (C) 2015-2017 VLC authors, VideoLAN and VideoLabs
  *
  * Authors: Felix Paul Kühne 
+ *  Thomas Guillem <tho...@gllm.fr>
+ *  Victorien Le Couviour--Tuffet 
<victorien.lecouiour.tuf...@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
@@ -36,18 +38,37 @@
 static int Open(vlc_object_t *);
 static void Close(vlc_object_t *);
 
+static int Open_CVPX_to_CVPX(vlc_object_t *);
+static void Close_CVPX_to_CVPX(vlc_object_t *);
+
 vlc_module_begin ()
 set_description("Conversions from/to CoreVideo buffers")
 set_capability("video converter", 10)
 set_callbacks(Open, Close)
+
+add_submodule()
+set_description("Conversions between CoreVideo buffers")
+set_callbacks(Open_CVPX_to_CVPX, Close_CVPX_to_CVPX)
 vlc_module_end ()
 
 struct filter_sys_t
 {
-filter_t *p_sw_filter;
-CVPixelBufferPoolRef pool;
+union
+{
+struct
+{
+filter_t *p_sw_filter;
+CVPixelBufferPoolRef pool;
+};
+
+VTPixelTransferSessionRef vttransfer;
+};
 };
 
+/
+ * CVPX to/from I420 conversion *
+ /
+
 static picture_t *CVPX_TO_I420_Filter(filter_t *p_filter, picture_t *src)
 {
 filter_sys_t *p_sys = p_filter->p_sys;
@@ -211,3 +232,85 @@ error:
 #undef CASE_CVPX_INPUT
 #undef CASE_CVPX_OUTPUT
 }
+
+/***
+ * CVPX to CVPX conversion *
+ ***/
+
+static picture_t *
+Filter(filter_t *filter, picture_t *src)
+{
+CVPixelBufferRef src_cvpx = cvpxpic_get_ref(src);
+assert(src_cvpx);
+
+picture_t *dst = filter_NewPicture(filter);
+if (!dst)
+{
+picture_Release(src);
+return NULL;
+}
+
+CVPixelBufferRef dst_cvpx = cvpxpic_get_ref(dst);
+assert(dst_cvpx);
+
+if (VTPixelTransferSessionTransferImage(filter->p_sys->vttransfer,
+src_cvpx, dst_cvpx) != noErr)
+{
+picture_Release(dst);
+picture_Release(src);
+return NULL;
+}
+
+picture_CopyProperties(dst, src);
+picture_Release(src);
+return dst;
+}
+
+static vlc_fourcc_t const supported_chromas[] = { VLC_CODEC_CVPX_BGRA,
+  VLC_CODEC_CVPX_I420,
+  VLC_CODEC_CVPX_NV12,
+  VLC_CODEC_CVPX_UYVY };
+
+static int
+Open_CVPX_to_CVPX(vlc_object_t *obj)
+{
+filter_t *filter = (filter_t *)obj;
+
+unsigned int i;
+#define CHECK_CHROMA(fourcc) \
+i = 0; \
+while (i < ARRAY_SIZE(supported_chromas) && \
+   fourcc != supported_chromas[i]) \
+++i; \
+if (i == ARRAY_SIZE(supported_chromas)) \
+return VLC_EGENERIC; \
+
+CHECK_CHROMA(filter->fmt_in.video.i_chroma)
+CHECK_CHROMA(filter->fmt_out.video.i_chroma)
+#undef CHECK_CHROMA
+
+filter->p_sys = calloc(1, sizeof(filter_sys_t));
+if (!filter->p_sys)
+return VLC_ENOMEM;
+
+if (VTPixelTransferSessionCreate(NULL, >p_sys->vttransfer)
+!= noErr)
+{
+free(filter->p_sys);
+return VLC_EGENERIC;
+}
+
+filter->pf_video_filter = Filter;
+
+return VLC_SUCCESS;
+}
+
+static void
+Close_CVPX_to_CVPX(vlc_object_t *obj)
+{
+filter_t *filter = (filter_t *)obj;
+
+VTPixelTransferSessionInvalidate(filter->p_sys->vttransfer);
+CFRelease(filter->p_sys->vttransfer);
+free(filter->p_sys);
+}

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx: don't reload default audio profile if already loaded

2017-07-13 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
<victorien.lecouviour.tuf...@gmail.com> | Mon Jul  3 21:51:40 2017 +0200| 
[796facc89f86737843d18707ef904c65bceb3d27] | committer: Jean-Baptiste Kempf

macosx: don't reload default audio profile if already loaded

Signed-off-by: Jean-Baptiste Kempf <j...@videolan.org>

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

 modules/gui/macosx/VLCAudioEffectsWindowController.m | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/modules/gui/macosx/VLCAudioEffectsWindowController.m 
b/modules/gui/macosx/VLCAudioEffectsWindowController.m
index 85518a885f..4b51c69791 100644
--- a/modules/gui/macosx/VLCAudioEffectsWindowController.m
+++ b/modules/gui/macosx/VLCAudioEffectsWindowController.m
@@ -300,7 +300,8 @@
 }
 
 [_profilePopup selectItemAtIndex:[defaults 
integerForKey:@"AudioEffectSelectedProfile"]];
-[self profileSelectorAction:self];
+if (i_old_profile_index || [[NSUserDefaults standardUserDefaults] 
integerForKey:@"AudioEffectSelectedProfile"])
+[self profileSelectorAction:self];
 }
 
 #pragma mark -

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx: save equalizer preset variables into playlist

2017-07-13 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
<victorien.lecouviour.tuf...@gmail.com> | Tue Jul  4 04:04:34 2017 +0200| 
[575249f7827504a256186fd334fcedd9121ab975] | committer: Jean-Baptiste Kempf

macosx: save equalizer preset variables into playlist

Signed-off-by: Jean-Baptiste Kempf <j...@videolan.org>

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

 .../gui/macosx/VLCAudioEffectsWindowController.m   | 24 ++
 1 file changed, 24 insertions(+)

diff --git a/modules/gui/macosx/VLCAudioEffectsWindowController.m 
b/modules/gui/macosx/VLCAudioEffectsWindowController.m
index 6d707eaf49..a036adbcd4 100644
--- a/modules/gui/macosx/VLCAudioEffectsWindowController.m
+++ b/modules/gui/macosx/VLCAudioEffectsWindowController.m
@@ -108,6 +108,14 @@
 return self;
 }
 
+- (NSInteger)getPresetIndexForProfile:(NSInteger)profileIndex
+{
+NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
+NSString *profile = [[defaults objectForKey:@"AudioEffectProfiles"] 
objectAtIndex:profileIndex];
+NSString *presetName = B64DecNSStr([[profile 
componentsSeparatedByString:@";"] firstObject]);
+return [[defaults objectForKey:@"EQNames"] indexOfObject:presetName];
+}
+
 - (void)loadProfile
 {
 intf_thread_t *p_intf = getIntf();
@@ -146,6 +154,8 @@
 playlist_EnableAudioFilter(p_playlist, [[tempArray 
objectAtIndex:x] UTF8String], true);
 }
 
+NSInteger presetIndex = [self getPresetIndexForProfile:selectedProfile];
+
 /* values */
 var_SetFloat(p_playlist, "compressor-rms-peak",[[items objectAtIndex:2] 
floatValue]);
 var_SetFloat(p_playlist, "compressor-attack",[[items objectAtIndex:3] 
floatValue]);
@@ -161,6 +171,9 @@
 var_SetFloat(p_playlist, "spatializer-damp",[[items objectAtIndex:13] 
floatValue]);
 var_SetFloat(p_playlist, "norm-max-level",[[items objectAtIndex:14] 
floatValue]);
 var_SetBool(p_playlist, "equalizer-2pass",(BOOL)[[items objectAtIndex:15] 
intValue]);
+var_SetString(p_playlist, "equalizer-bands", [[[defaults 
objectForKey:@"EQValues"] objectAtIndex:presetIndex] UTF8String]);
+var_SetFloat(p_playlist, "equalizer-preamp", [[[defaults 
objectForKey:@"EQPreampValues"] objectAtIndex:presetIndex] floatValue]);
+var_SetString(p_playlist, "equalizer-preset", [[[defaults 
objectForKey:@"EQNames"] objectAtIndex:presetIndex] UTF8String]);
 
 /* set values on-the-fly if we have an aout */
 if (p_aout) {
@@ -178,6 +191,9 @@
 var_SetFloat(p_aout, "spatializer-damp", [[items objectAtIndex:13] 
floatValue]);
 var_SetFloat(p_aout, "norm-max-level", [[items objectAtIndex:14] 
floatValue]);
 var_SetBool(p_aout, "equalizer-2pass", (BOOL)[[items objectAtIndex:15] 
intValue]);
+var_SetString(p_aout, "equalizer-bands", [[[defaults 
objectForKey:@"EQValues"] objectAtIndex:presetIndex] UTF8String]);
+var_SetFloat(p_aout, "equalizer-preamp", [[[defaults 
objectForKey:@"EQPreampValues"] objectAtIndex:presetIndex] floatValue]);
+var_SetString(p_aout, "equalizer-preset", [[[defaults 
objectForKey:@"EQNames"] objectAtIndex:presetIndex] UTF8String]);
 }
 
 /* update UI */
@@ -557,6 +573,10 @@ static bool GetEqualizerStatus(intf_thread_t 
*p_custom_intf,
 /* Setup sliders */
 var_Create(p_playlist, "equalizer-preset",
VLC_VAR_STRING | VLC_VAR_DOINHERIT);
+var_Create(p_playlist, "equalizer-bands",
+   VLC_VAR_STRING | VLC_VAR_DOINHERIT);
+var_Create(p_playlist, "equalizer-preamp",
+   VLC_VAR_FLOAT | VLC_VAR_DOINHERIT);
 [self updatePresetSelector];
 
 /* Set the the checkboxes */
@@ -628,6 +648,7 @@ static bool GetEqualizerStatus(intf_thread_t *p_custom_intf,
 var_SetString(p_aout, "equalizer-bands", psz_preset_values);
 vlc_object_release(p_aout);
 }
+var_SetString(pl_Get(getIntf()), "equalizer-bands", psz_preset_values);
 }
 
 - (IBAction)equalizerChangePreset:(id)sender
@@ -650,6 +671,8 @@ static bool GetEqualizerStatus(intf_thread_t *p_custom_intf,
 [_equalizerPreampSlider setFloatValue: f_eq_preamp];
 [self setBandSliderValuesForPreset:numberOfChosenPreset];
 
+var_SetString(pl_Get(getIntf()), "equalizer-bands", psz_eq_bands);
+var_SetFloat(pl_Get(getIntf()), "equalizer-preamp", f_eq_preamp);
 var_SetString(pl_Get(getIntf()), "equalizer-preset", psz_eq_preset);
 }
 
@@ -662,6 +685,7 @@ static bool GetEqualizerStatus(intf_thread_t *p_custom_intf,
 var_SetFloat(p_aout, "equalizer-preamp", fPreamp);
 vlc_object_release(p_aout);
 }
+var_SetFloat(pl_Get(getIntf()), "equalizer-preamp", fPreamp);
 }
 
 - (IBAction)equalizerTwoPass:(id)sender

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx: correct adjust's gamma slider binding

2017-07-13 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
<victorien.lecouviour.tuf...@gmail.com> | Fri Jul  7 18:57:59 2017 +0200| 
[53e0b50505370d46e14474e6dceca36a9eb0af7c] | committer: Jean-Baptiste Kempf

macosx: correct adjust's gamma slider binding

Signed-off-by: Jean-Baptiste Kempf <j...@videolan.org>

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

 modules/gui/macosx/UI/VideoEffects.xib | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/gui/macosx/UI/VideoEffects.xib 
b/modules/gui/macosx/UI/VideoEffects.xib
index 639a78b307..a9adf7e4bb 100644
--- a/modules/gui/macosx/UI/VideoEffects.xib
+++ b/modules/gui/macosx/UI/VideoEffects.xib
@@ -28,7 +28,7 @@
 
 
 
-
+
 
 
 
@@ -228,7 +228,7 @@
 
 
 
-
+
 
 
 

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx: don't save default audio profile

2017-07-13 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
<victorien.lecouviour.tuf...@gmail.com> | Mon Jul  3 21:53:48 2017 +0200| 
[e3b9aaa21e72fe0efa6efc2feb00ff9d5fc7e717] | committer: Jean-Baptiste Kempf

macosx: don't save default audio profile

Signed-off-by: Jean-Baptiste Kempf <j...@videolan.org>

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

 modules/gui/macosx/VLCAudioEffectsWindowController.m | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/gui/macosx/VLCAudioEffectsWindowController.m 
b/modules/gui/macosx/VLCAudioEffectsWindowController.m
index 4b51c69791..77aa5430b4 100644
--- a/modules/gui/macosx/VLCAudioEffectsWindowController.m
+++ b/modules/gui/macosx/VLCAudioEffectsWindowController.m
@@ -346,7 +346,7 @@
 
 - (void)saveCurrentProfile
 {
-if (i_old_profile_index == -1)
+if (!i_old_profile_index || i_old_profile_index == -1)
 return;
 
 NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx: save default audio profile as custom when quiting

2017-07-13 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
<victorien.lecouviour.tuf...@gmail.com> | Tue Jul  4 09:08:56 2017 +0200| 
[116e785cac491c23fe8ee6d6631cfc2029fb149f] | committer: Jean-Baptiste Kempf

macosx: save default audio profile as custom when quiting

Signed-off-by: Jean-Baptiste Kempf <j...@videolan.org>

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

 .../gui/macosx/VLCAudioEffectsWindowController.h   |  2 +-
 .../gui/macosx/VLCAudioEffectsWindowController.m   | 76 ++
 modules/gui/macosx/VLCMain.m   |  2 +-
 3 files changed, 78 insertions(+), 2 deletions(-)

diff --git a/modules/gui/macosx/VLCAudioEffectsWindowController.h 
b/modules/gui/macosx/VLCAudioEffectsWindowController.h
index 283b652b3f..ead4d711c4 100644
--- a/modules/gui/macosx/VLCAudioEffectsWindowController.h
+++ b/modules/gui/macosx/VLCAudioEffectsWindowController.h
@@ -116,7 +116,7 @@
 
 - (void)toggleWindow:(id)sender;
 - (void)updateCocoaWindowLevel:(NSInteger)i_level;
-- (void)saveCurrentProfile;
+- (void)saveCurrentProfileAtTerminate;
 
 /* Equalizer */
 - (IBAction)equalizerBandSliderUpdated:(id)sender;
diff --git a/modules/gui/macosx/VLCAudioEffectsWindowController.m 
b/modules/gui/macosx/VLCAudioEffectsWindowController.m
index a036adbcd4..b445961ac6 100644
--- a/modules/gui/macosx/VLCAudioEffectsWindowController.m
+++ b/modules/gui/macosx/VLCAudioEffectsWindowController.m
@@ -378,6 +378,82 @@
 [defaults synchronize];
 }
 
+- (void)saveCurrentProfileAtTerminate
+{
+if (i_old_profile_index)
+return [self saveCurrentProfile];
+
+playlist_t *p_playlist = pl_Get(getIntf());
+NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
+NSString *newPresetString = [NSString 
stringWithCString:var_InheritString(p_playlist, "equalizer-bands") 
encoding:NSASCIIStringEncoding];
+float newPresetPreamp = var_InheritFloat(p_playlist, "equalizer-preamp");
+
+NSInteger defaultPresetIndex = [self getPresetIndexForProfile:0];
+NSString *defaultPresetString = [[defaults objectForKey:@"EQValues"] 
objectAtIndex:defaultPresetIndex];
+float defaultPresetPreamp = [[[defaults objectForKey:@"EQPreampValues"] 
objectAtIndex:defaultPresetIndex] floatValue];
+if ([[self generateProfileString] compare:[[defaults 
objectForKey:@"AudioEffectProfiles"] firstObject]] == NSOrderedSame &&
+[newPresetString compare:defaultPresetString] == NSOrderedSame &&
+newPresetPreamp == defaultPresetPreamp)
+return;
+
+NSMutableArray *workArray;
+int num_custom;
+
+if ([newPresetString compare:defaultPresetString] != NSOrderedSame ||
+newPresetPreamp != defaultPresetPreamp)
+{
+/* preset title */
+NSArray *presetTitles = [defaults 
objectForKey:@"EQTitles"];
+NSString *newPresetTitle;
+
+num_custom = 0;
+do
+newPresetTitle = [@"Custom" stringByAppendingString:[NSString 
stringWithFormat:@"%03i",num_custom++]];
+while ([presetTitles containsObject:newPresetTitle]);
+
+workArray = [[NSMutableArray alloc] initWithArray:[defaults 
objectForKey:@"EQTitles"]];
+[workArray addObject:newPresetTitle];
+[defaults setObject:[NSArray arrayWithArray:workArray] 
forKey:@"EQTitles"];
+
+/* preset name */
+NSString *decomposedStringWithCanonicalMapping = [newPresetTitle 
decomposedStringWithCanonicalMapping];
+workArray = [[NSMutableArray alloc] initWithArray:[defaults 
objectForKey:@"EQNames"]];
+[workArray addObject:decomposedStringWithCanonicalMapping];
+[defaults setObject:[NSArray arrayWithArray:workArray] 
forKey:@"EQNames"];
+var_SetString(p_playlist, "equalizer-preset", 
[decomposedStringWithCanonicalMapping UTF8String]);
+
+/* preset bands */
+workArray = [[NSMutableArray alloc] initWithArray:[defaults 
objectForKey:@"EQValues"]];
+[workArray addObject:newPresetString];
+[defaults setObject:[NSArray arrayWithArray:workArray] 
forKey:@"EQValues"];
+
+/* preset preamp */
+workArray = [[NSMutableArray alloc] initWithArray:[defaults 
objectForKey:@"EQPreampValues"]];
+[workArray addObject:[NSString stringWithFormat:@"%.1f", 
[_equalizerPreampSlider floatValue]]];
+[defaults setObject:[NSArray arrayWithArray:workArray] 
forKey:@"EQPreampValues"];
+}
+
+/* profile string */
+workArray = [[NSMutableArray alloc] initWithArray:[defaults 
objectForKey:@"AudioEffectProfiles"]];
+[workArray addObject:[self generateProfileString]];
+[defaults setObject:[NSArray arrayWithArray:workArray] 
forKey:@"AudioEffectProfiles"];
+
+/* profile name */
+NSA

[vlc-commits] macosx: add apply audio profile at startup checkbox

2017-07-13 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
<victorien.lecouviour.tuf...@gmail.com> | Mon Jul  3 19:13:24 2017 +0200| 
[7555afbfed69aa4698b2ea0404897039b4ccd523] | committer: Jean-Baptiste Kempf

macosx: add apply audio profile at startup checkbox

Signed-off-by: Jean-Baptiste Kempf <j...@videolan.org>

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

 modules/gui/macosx/UI/AudioEffects.xib | 59 +++---
 .../gui/macosx/VLCAudioEffectsWindowController.h   |  2 +
 .../gui/macosx/VLCAudioEffectsWindowController.m   |  7 +++
 3 files changed, 49 insertions(+), 19 deletions(-)

diff --git a/modules/gui/macosx/UI/AudioEffects.xib 
b/modules/gui/macosx/UI/AudioEffects.xib
index 4cd1fe4cb8..057b560808 100644
--- a/modules/gui/macosx/UI/AudioEffects.xib
+++ b/modules/gui/macosx/UI/AudioEffects.xib
@@ -11,6 +11,7 @@
 
 
 
+
 
 
 
@@ -87,7 +88,7 @@
 
 
 
-
+
 
 
 
@@ -1078,23 +1079,6 @@
 
 
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
 
 
 
@@ -1114,21 +1098,58 @@
 
 
 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 
 
 
 
 
 
-
 
 
+
 
 
 
 
 
 
+
+
+
+
+
+
+
+
+
 
 
 
diff --git a/modules/gui/macosx/VLCAudioEffectsWindowController.h 
b/modules/gui/macosx/VLCAudioEffectsWindowController.h
index 356aba6d89..283b652b3f 100644
--- a/modules/gui/macosx/VLCAudioEffectsWindowController.h
+++ b/modules/gui/macosx/VLCAudioEffectsWindowController.h
@@ -32,6 +32,7 @@
 /* generic */
 @property (readwrite, weak) IBOutlet NSTabView *tabView;
 @property (readwrite, weak) IBOutlet NSPopUpButton *profilePopup;
+@property (readwrite, weak) IBOutlet NSButton *applyProfileCheckbox;
 
 /* Equalizer */
 @property (readwrite, weak) IBOutlet NSView *equalizerView;
@@ -111,6 +112,7 @@
 
 /* generic */
 - (IBAction)profileSelectorAction:(id)sender;
+- (IBAction)applyProfileCheckboxChanged:(id)sender;
 
 - (void)toggleWindow:(id)sender;
 - (void)updateCocoaWindowLevel:(NSInteger)i_level;
diff --git a/modules/gui/macosx/VLCAudioEffectsWindowController.m 
b/modules/gui/macosx/VLCAudioEffectsWindowController.m
index 898842fd62..b6aacd7fe9 100644
--- a/modules/gui/macosx/VLCAudioEffectsWindowController.m
+++ b/modules/gui/macosx/VLCAudioEffectsWindowController.m
@@ -101,6 +101,8 @@
 
 - (void)windowDidLoad
 {
+[_applyProfileCheckbox setState:[[NSUserDefaults standardUserDefaults] 
boolForKey:@"AudioEffectApplyProfileOnStartup"]];
+
 /* setup the user's language */
 /* Equalizer */
 [_equalizerEnableCheckbox setTitle:_NS("Enable")];
@@ -448,6 +450,11 @@
 }];
 }
 
+- (IBAction)applyProfileCheckboxChanged:(id)sender
+{
+[[NSUserDefaults standardUserDefaults] setBool:[sender state] 
forKey:@"AudioEffectApplyProfileOnStartup"];
+}
+
 #pragma mark -
 #pragma mark Equalizer
 static bool GetEqualizerStatus(intf_thread_t *p_custom_intf,

___
vlc-commits mailing list
vlc-commits@video

[vlc-commits] macosx: always load default audio profile if apply profile is false

2017-07-13 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
<victorien.lecouviour.tuf...@gmail.com> | Tue Jul  4 04:13:17 2017 +0200| 
[54f91ea19b3ec6d08e9d45976b3d11bd4720a3d1] | committer: Jean-Baptiste Kempf

macosx: always load default audio profile if apply profile is false

It is annoying to load the last selected video profile when the audio effects
window opens if the apply last profile checkbox was not checked.

Signed-off-by: Jean-Baptiste Kempf <j...@videolan.org>

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

 modules/gui/macosx/VLCAudioEffectsWindowController.m | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/modules/gui/macosx/VLCAudioEffectsWindowController.m 
b/modules/gui/macosx/VLCAudioEffectsWindowController.m
index b445961ac6..e337395e2c 100644
--- a/modules/gui/macosx/VLCAudioEffectsWindowController.m
+++ b/modules/gui/macosx/VLCAudioEffectsWindowController.m
@@ -95,7 +95,8 @@
 self.popupPanel = [[VLCPopupPanelController alloc] init];
 self.textfieldPanel = [[VLCTextfieldPanelController alloc] init];
 
-if ([[NSUserDefaults standardUserDefaults] 
boolForKey:@"AudioEffectApplyProfileOnStartup"])
+NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
+if ([defaults boolForKey:@"AudioEffectApplyProfileOnStartup"])
 {
 [self equalizerUpdated];
 [self resetCompressor];
@@ -103,6 +104,8 @@
 [self resetAudioFilters];
 [self loadProfile];
 }
+else
+[defaults setInteger:0 forKey:@"AudioEffectSelectedProfile"];
 }
 
 return self;

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx: don't remove default audio profile

2017-07-13 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
<victorien.lecouviour.tuf...@gmail.com> | Mon Jul  3 21:55:28 2017 +0200| 
[9a5a83fb0fed98c02657ed4601559b1d3696bd34] | committer: Jean-Baptiste Kempf

macosx: don't remove default audio profile

Signed-off-by: Jean-Baptiste Kempf <j...@videolan.org>

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

 modules/gui/macosx/VLCAudioEffectsWindowController.m | 5 +
 1 file changed, 5 insertions(+)

diff --git a/modules/gui/macosx/VLCAudioEffectsWindowController.m 
b/modules/gui/macosx/VLCAudioEffectsWindowController.m
index 77aa5430b4..6d707eaf49 100644
--- a/modules/gui/macosx/VLCAudioEffectsWindowController.m
+++ b/modules/gui/macosx/VLCAudioEffectsWindowController.m
@@ -447,6 +447,11 @@
 return;
 }
 
+if (!selectedIndex) { // TODO: add popup to notify user
+[_profilePopup selectItemAtIndex:[defaults 
integerForKey:@"AudioEffectSelectedProfile"]];
+return;
+}
+
 /* remove selected profile from settings */
 NSMutableArray *workArray = [[NSMutableArray alloc] 
initWithArray:[defaults objectForKey:@"AudioEffectProfiles"]];
 [workArray removeObjectAtIndex:selectedIndex];

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx: remove spaces after bracket

2017-07-13 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
<victorien.lecouviour.tuf...@gmail.com> | Tue Jul  4 09:09:16 2017 +0200| 
[c108350e68f200186a8726beb22a4d1813d7bb50] | committer: Jean-Baptiste Kempf

macosx: remove spaces after bracket

Signed-off-by: Jean-Baptiste Kempf <j...@videolan.org>

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

 modules/gui/macosx/VLCAudioEffectsWindowController.m | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/gui/macosx/VLCAudioEffectsWindowController.m 
b/modules/gui/macosx/VLCAudioEffectsWindowController.m
index aa2cefc432..898842fd62 100644
--- a/modules/gui/macosx/VLCAudioEffectsWindowController.m
+++ b/modules/gui/macosx/VLCAudioEffectsWindowController.m
@@ -512,7 +512,7 @@ static bool GetEqualizerStatus(intf_thread_t *p_custom_intf,
 
 if (currentPresetIndex == NSNotFound)
 currentPresetIndex = [presets count] - 1;
-}
+}
 
 [_equalizerPresetsPopup selectItemAtIndex:currentPresetIndex];
 [self equalizerChangePreset:_equalizerPresetsPopup];

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx: always load default video profile if apply profile is false

2017-07-13 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
<victorien.lecouviour.tuf...@gmail.com> | Mon Jul  3 20:06:01 2017 +0200| 
[a3b07d9b17e4676fe6b10662d6ef107a058102a2] | committer: Jean-Baptiste Kempf

macosx: always load default video profile if apply profile is false

It is annoying to load the last selected video profile when the video effects
window opens if the apply last profile checkbox was not checked.

Signed-off-by: Jean-Baptiste Kempf <j...@videolan.org>

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

 modules/gui/macosx/VLCVideoEffectsWindowController.m | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/modules/gui/macosx/VLCVideoEffectsWindowController.m 
b/modules/gui/macosx/VLCVideoEffectsWindowController.m
index 2ab0316cf9..45f160aa5d 100644
--- a/modules/gui/macosx/VLCVideoEffectsWindowController.m
+++ b/modules/gui/macosx/VLCVideoEffectsWindowController.m
@@ -62,10 +62,13 @@
 self.textfieldPanel = [[VLCTextfieldPanelController alloc] init];
 }
 
-if ([[NSUserDefaults standardUserDefaults] 
boolForKey:@"VideoEffectApplyProfileOnStartup"]) {
+NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
+if ([defaults boolForKey:@"VideoEffectApplyProfileOnStartup"]) {
 [self resetValues];
 [self loadProfile];
 }
+else
+[defaults setInteger:0 forKey:@"VideoEffectSelectedProfile"];
 
 return self;
 }

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx: save default video profile as custom when quiting

2017-07-13 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
<victorien.lecouviour.tuf...@gmail.com> | Mon Jul  3 20:03:56 2017 +0200| 
[488f9ea4c0993fc40e6c3f678b6d53ae0b3ce5a9] | committer: Jean-Baptiste Kempf

macosx: save default video profile as custom when quiting

Signed-off-by: Jean-Baptiste Kempf <j...@videolan.org>

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

 modules/gui/macosx/VLCMain.m   |  2 +-
 .../gui/macosx/VLCVideoEffectsWindowController.h   |  2 +-
 .../gui/macosx/VLCVideoEffectsWindowController.m   | 29 ++
 3 files changed, 31 insertions(+), 2 deletions(-)

diff --git a/modules/gui/macosx/VLCMain.m b/modules/gui/macosx/VLCMain.m
index b6d5cb3992..e815f2c29e 100644
--- a/modules/gui/macosx/VLCMain.m
+++ b/modules/gui/macosx/VLCMain.m
@@ -335,7 +335,7 @@ static VLCMain *sharedInstance = nil;
 playlist_t * p_playlist = pl_Get(p_intf);
 
 /* save current video and audio profiles */
-[[self videoEffectsPanel] saveCurrentProfile];
+[[self videoEffectsPanel] saveCurrentProfileAtTerminate];
 [[self audioEffectsPanel] saveCurrentProfile];
 
 /* Save some interface state in configuration, at module quit */
diff --git a/modules/gui/macosx/VLCVideoEffectsWindowController.h 
b/modules/gui/macosx/VLCVideoEffectsWindowController.h
index 84f68f2b0c..243fc88a26 100644
--- a/modules/gui/macosx/VLCVideoEffectsWindowController.h
+++ b/modules/gui/macosx/VLCVideoEffectsWindowController.h
@@ -169,7 +169,7 @@
 
 /* generic */
 - (void)updateCocoaWindowLevel:(NSInteger)i_level;
-- (void)saveCurrentProfile;
+- (void)saveCurrentProfileAtTerminate;
 
 - (void)toggleWindow:(id)sender;
 - (IBAction)profileSelectorAction:(id)sender;
diff --git a/modules/gui/macosx/VLCVideoEffectsWindowController.m 
b/modules/gui/macosx/VLCVideoEffectsWindowController.m
index b6b3bf955e..2ab0316cf9 100644
--- a/modules/gui/macosx/VLCVideoEffectsWindowController.m
+++ b/modules/gui/macosx/VLCVideoEffectsWindowController.m
@@ -675,6 +675,35 @@
 [defaults synchronize];
 }
 
+- (void)saveCurrentProfileAtTerminate
+{
+if (i_old_profile_index)
+return [self saveCurrentProfile];
+
+NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
+NSString *newProfile = [self generateProfileString];
+if ([newProfile compare:[[defaults objectForKey:@"VideoEffectProfiles"] 
firstObject]] == NSOrderedSame)
+return;
+
+NSMutableArray *workArray = [[NSMutableArray alloc] 
initWithArray:[defaults objectForKey:@"VideoEffectProfiles"]];
+[workArray addObject:newProfile];
+[defaults setObject:[NSArray arrayWithArray:workArray] 
forKey:@"VideoEffectProfiles"];
+
+NSArray *profileNames = [defaults 
objectForKey:@"VideoEffectProfileNames"];
+NSString *newProfileName;
+
+unsigned int num_custom = 0;
+do
+newProfileName = [@"Custom" stringByAppendingString:[NSString 
stringWithFormat:@"%03i",num_custom++]];
+while ([profileNames containsObject:newProfileName]);
+
+workArray = [[NSMutableArray alloc] initWithArray:[defaults 
objectForKey:@"VideoEffectProfileNames"]];
+[workArray addObject:newProfileName];
+[defaults setObject:[NSArray arrayWithArray:workArray] 
forKey:@"VideoEffectProfileNames"];
+
+[defaults synchronize];
+}
+
 - (IBAction)toggleWindow:(id)sender
 {
 if ([self.window isKeyWindow])

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx: don't remove default video profile

2017-07-13 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
<victorien.lecouviour.tuf...@gmail.com> | Sun Jul  2 15:21:00 2017 +0200| 
[2524071d8bdf2ed7544d3c7abbfe5155e8c6408f] | committer: Jean-Baptiste Kempf

macosx: don't remove default video profile

Signed-off-by: Jean-Baptiste Kempf <j...@videolan.org>

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

 modules/gui/macosx/VLCVideoEffectsWindowController.m | 5 +
 1 file changed, 5 insertions(+)

diff --git a/modules/gui/macosx/VLCVideoEffectsWindowController.m 
b/modules/gui/macosx/VLCVideoEffectsWindowController.m
index 2686f745e2..b6b3bf955e 100644
--- a/modules/gui/macosx/VLCVideoEffectsWindowController.m
+++ b/modules/gui/macosx/VLCVideoEffectsWindowController.m
@@ -789,6 +789,11 @@
 return;
 }
 
+if (!selectedIndex) { // TODO: add popup to notify user
+[_profilePopup selectItemAtIndex:[defaults 
integerForKey:@"VideoEffectSelectedProfile"]];
+return;
+}
+
 /* remove selected profile from settings */
 NSMutableArray *workArray = [[NSMutableArray alloc] initWithArray: 
[defaults objectForKey:@"VideoEffectProfiles"]];
 [workArray removeObjectAtIndex:selectedIndex];

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx: load audio profile at startup

2017-07-13 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
<victorien.lecouviour.tuf...@gmail.com> | Mon Jul  3 19:29:09 2017 +0200| 
[8c0b2b994caf823cd2fc2fb88b19f98d695be4e7] | committer: Jean-Baptiste Kempf

macosx: load audio profile at startup

Signed-off-by: Jean-Baptiste Kempf <j...@videolan.org>

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

 .../gui/macosx/VLCAudioEffectsWindowController.m   | 183 +++--
 1 file changed, 98 insertions(+), 85 deletions(-)

diff --git a/modules/gui/macosx/VLCAudioEffectsWindowController.m 
b/modules/gui/macosx/VLCAudioEffectsWindowController.m
index b6aacd7fe9..85518a885f 100644
--- a/modules/gui/macosx/VLCAudioEffectsWindowController.m
+++ b/modules/gui/macosx/VLCAudioEffectsWindowController.m
@@ -94,11 +94,107 @@
 
 self.popupPanel = [[VLCPopupPanelController alloc] init];
 self.textfieldPanel = [[VLCTextfieldPanelController alloc] init];
+
+if ([[NSUserDefaults standardUserDefaults] 
boolForKey:@"AudioEffectApplyProfileOnStartup"])
+{
+[self equalizerUpdated];
+[self resetCompressor];
+[self resetSpatializer];
+[self resetAudioFilters];
+[self loadProfile];
+}
 }
 
 return self;
 }
 
+- (void)loadProfile
+{
+intf_thread_t *p_intf = getIntf();
+NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
+NSInteger selectedProfile = [defaults 
integerForKey:@"AudioEffectSelectedProfile"];
+playlist_t *p_playlist = pl_Get(p_intf);
+
+/* disable existing filters */
+playlist_EnableAudioFilter(p_playlist, "equalizer", false);
+playlist_EnableAudioFilter(p_playlist, "compressor", false);
+playlist_EnableAudioFilter(p_playlist, "spatializer", false);
+playlist_EnableAudioFilter(p_playlist, "compressor", false);
+playlist_EnableAudioFilter(p_playlist, "headphone", false);
+playlist_EnableAudioFilter(p_playlist, "normvol", false);
+playlist_EnableAudioFilter(p_playlist, "karaoke", false);
+
+/* fetch preset */
+NSArray *items = [[[defaults objectForKey:@"AudioEffectProfiles"] 
objectAtIndex:(NSUInteger) selectedProfile] componentsSeparatedByString:@";"];
+
+/* eq preset */
+char const *psz_eq_preset = [B64DecNSStr([items firstObject]) UTF8String];
+audio_output_t *p_aout = getAout();
+if (p_aout)
+var_SetString(p_aout, "equalizer-preset", psz_eq_preset);
+var_SetString(p_playlist, "equalizer-preset", psz_eq_preset);
+
+/* filter handling */
+NSString *tempString = B64DecNSStr([items objectAtIndex:1]);
+NSArray *tempArray;
+NSUInteger count;
+/* enable the new filters */
+if ([tempString length] > 0) {
+tempArray = [tempString componentsSeparatedByString:@":"];
+count = [tempArray count];
+for (NSUInteger x = 0; x < count; x++)
+playlist_EnableAudioFilter(p_playlist, [[tempArray 
objectAtIndex:x] UTF8String], true);
+}
+
+/* values */
+var_SetFloat(p_playlist, "compressor-rms-peak",[[items objectAtIndex:2] 
floatValue]);
+var_SetFloat(p_playlist, "compressor-attack",[[items objectAtIndex:3] 
floatValue]);
+var_SetFloat(p_playlist, "compressor-release",[[items objectAtIndex:4] 
floatValue]);
+var_SetFloat(p_playlist, "compressor-threshold",[[items objectAtIndex:5] 
floatValue]);
+var_SetFloat(p_playlist, "compressor-ratio",[[items objectAtIndex:6] 
floatValue]);
+var_SetFloat(p_playlist, "compressor-knee",[[items objectAtIndex:7] 
floatValue]);
+var_SetFloat(p_playlist, "compressor-makeup-gain",[[items objectAtIndex:8] 
floatValue]);
+var_SetFloat(p_playlist, "spatializer-roomsize",[[items objectAtIndex:9] 
floatValue]);
+var_SetFloat(p_playlist, "spatializer-width",[[items objectAtIndex:10] 
floatValue]);
+var_SetFloat(p_playlist, "spatializer-wet",[[items objectAtIndex:11] 
floatValue]);
+var_SetFloat(p_playlist, "spatializer-dry",[[items objectAtIndex:12] 
floatValue]);
+var_SetFloat(p_playlist, "spatializer-damp",[[items objectAtIndex:13] 
floatValue]);
+var_SetFloat(p_playlist, "norm-max-level",[[items objectAtIndex:14] 
floatValue]);
+var_SetBool(p_playlist, "equalizer-2pass",(BOOL)[[items objectAtIndex:15] 
intValue]);
+
+/* set values on-the-fly if we have an aout */
+if (p_aout) {
+var_SetFloat(p_aout, "compressor-rms-peak", [[items objectAtIndex:2] 
floatValue]);
+var_SetFloat(p_aout, "compressor-attack", [[items objectAtIndex:3] 
floatValue]);
+var_SetFloat(p_aout, "compressor-release", [[items objectAtIndex:4] 
floatValu

[vlc-commits] macosx: remove false warning

2017-07-13 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
<victorien.lecouviour.tuf...@gmail.com> | Sun Jul  2 14:44:55 2017 +0200| 
[850bd9ec7661c03c77d48adf0cbd47db5eb7035c] | committer: Jean-Baptiste Kempf

macosx: remove false warning

Signed-off-by: Jean-Baptiste Kempf <j...@videolan.org>

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

 modules/gui/macosx/VLCVideoEffectsWindowController.m | 6 --
 1 file changed, 6 deletions(-)

diff --git a/modules/gui/macosx/VLCVideoEffectsWindowController.m 
b/modules/gui/macosx/VLCVideoEffectsWindowController.m
index 1fa610283f..b2a274c722 100644
--- a/modules/gui/macosx/VLCVideoEffectsWindowController.m
+++ b/modules/gui/macosx/VLCVideoEffectsWindowController.m
@@ -301,8 +301,6 @@
 [widget setIntValue: val.i_int];
 else if ([widget isKindOfClass: [NSPopUpButton class]])
 [widget selectItemWithTag: val.i_int];
-else
-msg_Warn(p_intf, "Could not find the correct Integer widget");
 }
 else if (i_type == VLC_VAR_FLOAT)
 {
@@ -311,8 +309,6 @@
 [widget setFloatValue: val.f_float];
 [widget setToolTip: [NSString stringWithFormat:@"%0.3f", 
val.f_float]];
 }
-else
-msg_Warn(p_intf, "Could not find the correct Float widget");
 }
 else if (i_type == VLC_VAR_STRING)
 {
@@ -328,8 +324,6 @@
 }
 else if ([widget isKindOfClass: [NSTextField class]])
 [widget setStringValue: toNSStr(val.psz_string)];
-else
-msg_Warn(p_intf, "Could not find the correct String widget");
 free(val.psz_string);
 }
 

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx: always load audio profile equalizer-preset to playlist

2017-07-13 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
<victorien.lecouviour.tuf...@gmail.com> | Wed Jun 28 16:08:56 2017 +0200| 
[bdd3c635095a7b0425b5849c2a676e00c2aeea75] | committer: Jean-Baptiste Kempf

macosx: always load audio profile equalizer-preset to playlist

Signed-off-by: Jean-Baptiste Kempf <j...@videolan.org>

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

 modules/gui/macosx/VLCAudioEffectsWindowController.m | 11 +--
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/modules/gui/macosx/VLCAudioEffectsWindowController.m 
b/modules/gui/macosx/VLCAudioEffectsWindowController.m
index 8ad44f04ce..f062160630 100644
--- a/modules/gui/macosx/VLCAudioEffectsWindowController.m
+++ b/modules/gui/macosx/VLCAudioEffectsWindowController.m
@@ -289,11 +289,11 @@
 NSArray *items = [[[defaults objectForKey:@"AudioEffectProfiles"] 
objectAtIndex:(NSUInteger) selectedProfile] componentsSeparatedByString:@";"];
 
 /* eq preset */
-vlc_object_t *p_object = VLC_OBJECT(getAout());
-if (p_object == NULL)
-p_object = vlc_object_hold(pl_Get(p_intf));
-var_SetString(p_object, "equalizer-preset", [B64DecNSStr([items 
firstObject]) UTF8String]);
-vlc_object_release(p_object);
+char const *psz_eq_preset = [B64DecNSStr([items firstObject]) UTF8String];
+audio_output_t *p_aout = getAout();
+if (p_aout)
+var_SetString(p_aout, "equalizer-preset", psz_eq_preset);
+var_SetString(p_playlist, "equalizer-preset", psz_eq_preset);
 
 /* filter handling */
 NSString *tempString = B64DecNSStr([items objectAtIndex:1]);
@@ -324,7 +324,6 @@
 config_PutInt(p_intf, "equalizer-2pass",[[items objectAtIndex:15] 
intValue]);
 
 /* set values on-the-fly if we have an aout */
-audio_output_t *p_aout = getAout();
 if (p_aout) {
 var_SetFloat(p_aout, "compressor-rms-peak", [[items objectAtIndex:2] 
floatValue]);
 var_SetFloat(p_aout, "compressor-attack", [[items objectAtIndex:3] 
floatValue]);

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx: more verbose msg_Dbg in VLCCoreInteration::setVideoFilter

2017-07-13 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
<victorien.lecouviour.tuf...@gmail.com> | Sun Jul  2 11:01:09 2017 +0200| 
[506d5cdde4ae42f0fb2c51ebcad3dab8c75dec04] | committer: Jean-Baptiste Kempf

macosx: more verbose msg_Dbg in VLCCoreInteration::setVideoFilter

Signed-off-by: Jean-Baptiste Kempf <j...@videolan.org>

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

 modules/gui/macosx/VLCCoreInteraction.m | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/gui/macosx/VLCCoreInteraction.m 
b/modules/gui/macosx/VLCCoreInteraction.m
index d636723241..43ab03a477 100644
--- a/modules/gui/macosx/VLCCoreInteraction.m
+++ b/modules/gui/macosx/VLCCoreInteraction.m
@@ -744,7 +744,7 @@ static int BossCallback(vlc_object_t *p_this, const char 
*psz_var,
 return;
 }
 
-msg_Dbg(p_intf, "will set filter '%s'", psz_name);
+msg_Dbg(p_intf, "will turn filter '%s' %s", psz_name, b_on ? "on" : "off");
 
 psz_string = var_InheritString(p_playlist, psz_filter_type);
 

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx: don't reload default video profile if already loaded

2017-07-13 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
<victorien.lecouviour.tuf...@gmail.com> | Sun Jul  2 15:18:14 2017 +0200| 
[5ce0643344274591e23df22f940fe1c157d35280] | committer: Jean-Baptiste Kempf

macosx: don't reload default video profile if already loaded

Signed-off-by: Jean-Baptiste Kempf <j...@videolan.org>

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

 modules/gui/macosx/VLCVideoEffectsWindowController.m | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/modules/gui/macosx/VLCVideoEffectsWindowController.m 
b/modules/gui/macosx/VLCVideoEffectsWindowController.m
index f4e126158a..fb25640f87 100644
--- a/modules/gui/macosx/VLCVideoEffectsWindowController.m
+++ b/modules/gui/macosx/VLCVideoEffectsWindowController.m
@@ -365,7 +365,8 @@
 }
 
 [_profilePopup selectItemAtIndex:[defaults 
integerForKey:@"VideoEffectSelectedProfile"]];
-[self profileSelectorAction:self];
+if (i_old_profile_index || [defaults 
integerForKey:@"VideoEffectSelectedProfile"])
+[self profileSelectorAction:self];
 }
 
 - (void)setWidgetValue: (id)widget forOption: (char *)psz_option enabled: 
(bool)b_state

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx: load video profile at startup

2017-07-13 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
<victorien.lecouviour.tuf...@gmail.com> | Sun Jul  2 15:14:00 2017 +0200| 
[abdf87453c590c2ca13a32b90e5d2f8a52e4746e] | committer: Jean-Baptiste Kempf

macosx: load video profile at startup

Signed-off-by: Jean-Baptiste Kempf <j...@videolan.org>

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

 .../gui/macosx/VLCVideoEffectsWindowController.m   | 200 +++--
 1 file changed, 104 insertions(+), 96 deletions(-)

diff --git a/modules/gui/macosx/VLCVideoEffectsWindowController.m 
b/modules/gui/macosx/VLCVideoEffectsWindowController.m
index ded3e0c26a..f4e126158a 100644
--- a/modules/gui/macosx/VLCVideoEffectsWindowController.m
+++ b/modules/gui/macosx/VLCVideoEffectsWindowController.m
@@ -62,9 +62,111 @@
 self.textfieldPanel = [[VLCTextfieldPanelController alloc] init];
 }
 
+if ([[NSUserDefaults standardUserDefaults] 
boolForKey:@"VideoEffectApplyProfileOnStartup"]) {
+[self resetValues];
+[self loadProfile];
+}
+
 return self;
 }
 
+- (void)loadProfile
+{
+intf_thread_t *p_intf = getIntf();
+playlist_t *p_playlist = pl_Get(p_intf);
+VLCCoreInteraction *vci_si = [VLCCoreInteraction sharedInstance];
+NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
+NSUInteger profile = [defaults 
integerForKey:@"VideoEffectSelectedProfile"];
+
+/* fetch preset */
+NSArray *items = [[[defaults objectForKey:@"VideoEffectProfiles"] 
objectAtIndex:profile] componentsSeparatedByString:@";"];
+
+// version 1 of profile string has 32 entries
+if ([items count] < 32) {
+msg_Err(p_intf, "Error in parsing profile string");
+return;
+}
+
+/* filter handling */
+NSString *tempString = B64DecNSStr([items firstObject]);
+NSArray *vouts = getVouts();
+
+/* enable the new filters */
+var_SetString(p_playlist, "video-filter", [tempString UTF8String]);
+if (vouts)
+for (NSValue *ptr in vouts) {
+vout_thread_t *p_vout = [ptr pointerValue];
+var_SetString(p_vout, "video-filter", [tempString UTF8String]);
+}
+
+tempString = B64DecNSStr([items objectAtIndex:1]);
+/* enable another round of new filters */
+var_SetString(p_playlist, "sub-source", [tempString UTF8String]);
+if (vouts)
+for (NSValue *ptr in vouts) {
+vout_thread_t *p_vout = [ptr pointerValue];
+var_SetString(p_vout, "sub-source", [tempString UTF8String]);
+vlc_object_release(p_vout);
+}
+
+tempString = B64DecNSStr([items objectAtIndex:2]);
+/* enable another round of new filters */
+char *psz_current_splitter = var_GetString(p_playlist, "video-splitter");
+bool b_filter_changed = ![tempString 
isEqualToString:toNSStr(psz_current_splitter)];
+free(psz_current_splitter);
+
+if (b_filter_changed)
+var_SetString(p_playlist, "video-splitter", [tempString UTF8String]);
+
+/* try to set filter values on-the-fly and store them appropriately */
+// index 3 is deprecated
+[vci_si setVideoFilterProperty: "contrast" forFilter: "adjust" withValue: 
getWidgetFloatValue([items objectAtIndex:4])];
+[vci_si setVideoFilterProperty: "brightness" forFilter: "adjust" 
withValue: getWidgetFloatValue([items objectAtIndex:5])];
+[vci_si setVideoFilterProperty: "saturation" forFilter: "adjust" 
withValue: getWidgetFloatValue([items objectAtIndex:6])];
+[vci_si setVideoFilterProperty: "gamma" forFilter: "adjust" withValue: 
getWidgetFloatValue([items objectAtIndex:7])];
+[vci_si setVideoFilterProperty: "sharpen-sigma" forFilter: "sharpen" 
withValue: getWidgetFloatValue([items objectAtIndex:8])];
+[vci_si setVideoFilterProperty: "gradfun-radius" forFilter: "gradfun" 
withValue: getWidgetIntValue([items objectAtIndex:9])];
+[vci_si setVideoFilterProperty: "grain-variance" forFilter: "grain" 
withValue: getWidgetFloatValue([items objectAtIndex:10])];
+[vci_si setVideoFilterProperty: "transform-type" forFilter: "transform" 
withValue: (vlc_value_t){ .psz_string = (char *)[B64DecNSStr([items 
objectAtIndex:11]) UTF8String] }];
+[vci_si setVideoFilterProperty: "puzzle-rows" forFilter: "puzzle" 
withValue: getWidgetIntValue([items objectAtIndex:12])];
+[vci_si setVideoFilterProperty: "puzzle-cols" forFilter: "puzzle" 
withValue: getWidgetIntValue([items objectAtIndex:13])];
+[vci_si setVideoFilterProperty: "colorthres-color" forFilter: "colorthres" 
withValue: getWidgetIntValue([items objectAtIndex:14])];
+[vci_si setVide

[vlc-commits] macosx: don't save default video profile

2017-07-13 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
<victorien.lecouviour.tuf...@gmail.com> | Sun Jul  2 15:19:26 2017 +0200| 
[d7d74cd85f80b4cf97b5d21a88fb093f31c5da6b] | committer: Jean-Baptiste Kempf

macosx: don't save default video profile

Signed-off-by: Jean-Baptiste Kempf <j...@videolan.org>

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

 modules/gui/macosx/VLCVideoEffectsWindowController.m | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/gui/macosx/VLCVideoEffectsWindowController.m 
b/modules/gui/macosx/VLCVideoEffectsWindowController.m
index fb25640f87..2686f745e2 100644
--- a/modules/gui/macosx/VLCVideoEffectsWindowController.m
+++ b/modules/gui/macosx/VLCVideoEffectsWindowController.m
@@ -659,7 +659,7 @@
 
 - (void)saveCurrentProfile
 {
-if (i_old_profile_index == -1)
+if (!i_old_profile_index || i_old_profile_index == -1)
 return;
 
 NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx: load audio profile filters options to playlist

2017-07-13 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
<victorien.lecouviour.tuf...@gmail.com> | Wed Jun 28 15:21:49 2017 +0200| 
[a33ad4964f42880ca3d997dea7a46c7558a13434] | committer: Jean-Baptiste Kempf

macosx: load audio profile filters options to playlist

Signed-off-by: Jean-Baptiste Kempf <j...@videolan.org>

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

 .../gui/macosx/VLCAudioEffectsWindowController.m   | 28 +++---
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/modules/gui/macosx/VLCAudioEffectsWindowController.m 
b/modules/gui/macosx/VLCAudioEffectsWindowController.m
index f062160630..db73cee85b 100644
--- a/modules/gui/macosx/VLCAudioEffectsWindowController.m
+++ b/modules/gui/macosx/VLCAudioEffectsWindowController.m
@@ -308,20 +308,20 @@
 }
 
 /* values */
-config_PutFloat(p_intf, "compressor-rms-peak",[[items objectAtIndex:2] 
floatValue]);
-config_PutFloat(p_intf, "compressor-attack",[[items objectAtIndex:3] 
floatValue]);
-config_PutFloat(p_intf, "compressor-release",[[items objectAtIndex:4] 
floatValue]);
-config_PutFloat(p_intf, "compressor-threshold",[[items objectAtIndex:5] 
floatValue]);
-config_PutFloat(p_intf, "compressor-ratio",[[items objectAtIndex:6] 
floatValue]);
-config_PutFloat(p_intf, "compressor-knee",[[items objectAtIndex:7] 
floatValue]);
-config_PutFloat(p_intf, "compressor-makeup-gain",[[items objectAtIndex:8] 
floatValue]);
-config_PutFloat(p_intf, "spatializer-roomsize",[[items objectAtIndex:9] 
floatValue]);
-config_PutFloat(p_intf, "spatializer-width",[[items objectAtIndex:10] 
floatValue]);
-config_PutFloat(p_intf, "spatializer-wet",[[items objectAtIndex:11] 
floatValue]);
-config_PutFloat(p_intf, "spatializer-dry",[[items objectAtIndex:12] 
floatValue]);
-config_PutFloat(p_intf, "spatializer-damp",[[items objectAtIndex:13] 
floatValue]);
-config_PutFloat(p_intf, "norm-max-level",[[items objectAtIndex:14] 
floatValue]);
-config_PutInt(p_intf, "equalizer-2pass",[[items objectAtIndex:15] 
intValue]);
+var_SetFloat(p_playlist, "compressor-rms-peak",[[items objectAtIndex:2] 
floatValue]);
+var_SetFloat(p_playlist, "compressor-attack",[[items objectAtIndex:3] 
floatValue]);
+var_SetFloat(p_playlist, "compressor-release",[[items objectAtIndex:4] 
floatValue]);
+var_SetFloat(p_playlist, "compressor-threshold",[[items objectAtIndex:5] 
floatValue]);
+var_SetFloat(p_playlist, "compressor-ratio",[[items objectAtIndex:6] 
floatValue]);
+var_SetFloat(p_playlist, "compressor-knee",[[items objectAtIndex:7] 
floatValue]);
+var_SetFloat(p_playlist, "compressor-makeup-gain",[[items objectAtIndex:8] 
floatValue]);
+var_SetFloat(p_playlist, "spatializer-roomsize",[[items objectAtIndex:9] 
floatValue]);
+var_SetFloat(p_playlist, "spatializer-width",[[items objectAtIndex:10] 
floatValue]);
+var_SetFloat(p_playlist, "spatializer-wet",[[items objectAtIndex:11] 
floatValue]);
+var_SetFloat(p_playlist, "spatializer-dry",[[items objectAtIndex:12] 
floatValue]);
+var_SetFloat(p_playlist, "spatializer-damp",[[items objectAtIndex:13] 
floatValue]);
+var_SetFloat(p_playlist, "norm-max-level",[[items objectAtIndex:14] 
floatValue]);
+var_SetBool(p_playlist, "equalizer-2pass",(BOOL)[[items objectAtIndex:15] 
intValue]);
 
 /* set values on-the-fly if we have an aout */
 if (p_aout) {

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx: don't save audio filters options to config

2017-07-13 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
<victorien.lecouviour.tuf...@gmail.com> | Wed Jun 28 15:34:23 2017 +0200| 
[c927adcdca580157ce684a3a80e19c3c95c94568] | committer: Jean-Baptiste Kempf

macosx: don't save audio filters options to config

Filter option are now only saved to current profile

Signed-off-by: Jean-Baptiste Kempf <j...@videolan.org>

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

 .../gui/macosx/VLCAudioEffectsWindowController.m   | 56 --
 1 file changed, 8 insertions(+), 48 deletions(-)

diff --git a/modules/gui/macosx/VLCAudioEffectsWindowController.m 
b/modules/gui/macosx/VLCAudioEffectsWindowController.m
index db73cee85b..aa2cefc432 100644
--- a/modules/gui/macosx/VLCAudioEffectsWindowController.m
+++ b/modules/gui/macosx/VLCAudioEffectsWindowController.m
@@ -602,14 +602,10 @@ static bool GetEqualizerStatus(intf_thread_t 
*p_custom_intf,
 var_SetString(p_aout, "equalizer-bands", psz_preset_values);
 vlc_object_release(p_aout);
 }
-
-/* save changed to config */
-config_PutPsz(getIntf(), "equalizer-bands", psz_preset_values);
 }
 
 - (IBAction)equalizerChangePreset:(id)sender
 {
-intf_thread_t *p_intf = getIntf();
 NSInteger numberOfChosenPreset = [sender indexOfSelectedItem];
 NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
 
@@ -628,11 +624,7 @@ static bool GetEqualizerStatus(intf_thread_t 
*p_custom_intf,
 [_equalizerPreampSlider setFloatValue: f_eq_preamp];
 [self setBandSliderValuesForPreset:numberOfChosenPreset];
 
-/* save changed to config */
-config_PutPsz(p_intf, "equalizer-bands", psz_eq_bands);
-config_PutFloat(p_intf, "equalizer-preamp", f_eq_preamp);
-config_PutPsz(p_intf, "equalizer-preset", psz_eq_preset);
-var_SetString(pl_Get(p_intf), "equalizer-preset", psz_eq_preset);
+var_SetString(pl_Get(getIntf()), "equalizer-preset", psz_eq_preset);
 }
 
 - (IBAction)equalizerPreAmpSliderUpdated:(id)sender
@@ -644,25 +636,19 @@ static bool GetEqualizerStatus(intf_thread_t 
*p_custom_intf,
 var_SetFloat(p_aout, "equalizer-preamp", fPreamp);
 vlc_object_release(p_aout);
 }
-
-/* save changed to config */
-config_PutFloat(getIntf(), "equalizer-preamp", fPreamp);
 }
 
 - (IBAction)equalizerTwoPass:(id)sender
 {
 bool b_2p = [sender state] ? true : false;
 
-intf_thread_t *p_intf = getIntf();
 audio_output_t *p_aout = getAout();
 if (p_aout) {
 var_SetBool(p_aout, "equalizer-2pass", b_2p);
 vlc_object_release(p_aout);
 }
 
-/* save changed to config */
-config_PutInt(p_intf, "equalizer-2pass", (int)b_2p);
-var_SetBool(pl_Get(p_intf), "equalizer-2pass", b_2p);
+var_SetBool(pl_Get(getIntf()), "equalizer-2pass", b_2p);
 }
 
 - (IBAction)addPresetAction:(id)sender
@@ -698,15 +684,13 @@ static bool GetEqualizerStatus(intf_thread_t 
*p_custom_intf,
 
 /* update VLC internals */
 char const *psz_eq_preset = [decomposedStringWithCanonicalMapping 
UTF8String];
-intf_thread_t *p_intf = getIntf();
 audio_output_t *p_aout = getAout();
 if (p_aout) {
 var_SetString(p_aout, "equalizer-preset", psz_eq_preset);
 vlc_object_release(p_aout);
 }
 
-config_PutPsz(p_intf, "equalizer-preset", psz_eq_preset);
-var_SetString(pl_Get(p_intf), "equalizer-preset", psz_eq_preset);
+var_SetString(pl_Get(getIntf()), "equalizer-preset", psz_eq_preset);
 
 /* update UI */
 [_self updatePresetSelector];
@@ -784,17 +768,7 @@ static bool GetEqualizerStatus(intf_thread_t 
*p_custom_intf,
 
 - (IBAction)resetCompressorValues:(id)sender
 {
-intf_thread_t *p_intf = getIntf();
-playlist_t *p_playlist = pl_Get(p_intf);
-
-config_PutFloat(p_intf, "compressor-rms-peak", 0.00);
-config_PutFloat(p_intf, "compressor-attack", 25.00);
-config_PutFloat(p_intf, "compressor-release", 100.00);
-config_PutFloat(p_intf, "compressor-threshold", -11.00);
-config_PutFloat(p_intf, "compressor-ratio", 8.00);
-config_PutFloat(p_intf, "compressor-knee", 2.50);
-config_PutFloat(p_intf, "compressor-makeup-gain", 7.00);
-
+playlist_t *p_playlist = pl_Get(getIntf());
 var_SetFloat(p_playlist, "compressor-rms-peak", 0.00);
 var_SetFloat(p_playlist, "compressor-attack", 25.00);
 var_SetFloat(p_playlist, "compressor-release", 100.00);
@@ -825,7 +799,6 @@ static bool GetEqualizerStatus(intf_thread_t *p_custom_intf,
 
 - (IBAction)compressorSliderUpdated:(id)sender
 {
-intf_thread_t *p_intf = get

[vlc-commits] macosx: add apply video profile at startup checkbox

2017-07-13 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
<victorien.lecouviour.tuf...@gmail.com> | Sun Jul  2 15:09:00 2017 +0200| 
[4b17325b93606d7ea8efd1ddef8bcfe33d041dfe] | committer: Jean-Baptiste Kempf

macosx: add apply video profile at startup checkbox

Signed-off-by: Jean-Baptiste Kempf <j...@videolan.org>

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

 modules/gui/macosx/UI/VideoEffects.xib   | 14 +-
 modules/gui/macosx/VLCVideoEffectsWindowController.h |  2 ++
 modules/gui/macosx/VLCVideoEffectsWindowController.m |  7 +++
 3 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/modules/gui/macosx/UI/VideoEffects.xib 
b/modules/gui/macosx/UI/VideoEffects.xib
index 1cf02e15f1..639a78b307 100644
--- a/modules/gui/macosx/UI/VideoEffects.xib
+++ b/modules/gui/macosx/UI/VideoEffects.xib
@@ -35,6 +35,7 @@
 
 
 
+
 
 
 
@@ -122,7 +123,7 @@
 
 
 
-
+
 
 
 
@@ -1791,6 +1792,17 @@
 
 
 
+
+
+
+
+
+
+
+
+
+
+
 
 
 
diff --git a/modules/gui/macosx/VLCVideoEffectsWindowController.h 
b/modules/gui/macosx/VLCVideoEffectsWindowController.h
index 114e2d23a2..84f68f2b0c 100644
--- a/modules/gui/macosx/VLCVideoEffectsWindowController.h
+++ b/modules/gui/macosx/VLCVideoEffectsWindowController.h
@@ -31,6 +31,7 @@
 /* generic */
 @property (readwrite, weak) IBOutlet NSTabView *tabView;
 @property (readwrite, weak) IBOutlet NSPopUpButton *profilePopup;
+@property (readwrite, weak) IBOutlet NSButton *applyProfileCheckbox;
 
 /* basic */
 @property (readwrite, weak) IBOutlet NSButton *adjustCheckbox;
@@ -172,6 +173,7 @@
 
 - (void)toggleWindow:(id)sender;
 - (IBAction)profileSelectorAction:(id)sender;
+- (IBAction)applyProfileCheckboxChanged:(id)sender;
 
 /* basic */
 - (IBAction)enableAdjust:(id)sender;
diff --git a/modules/gui/macosx/VLCVideoEffectsWindowController.m 
b/modules/gui/macosx/VLCVideoEffectsWindowController.m
index b2a274c722..ded3e0c26a 100644
--- a/modules/gui/macosx/VLCVideoEffectsWindowController.m
+++ b/modules/gui/macosx/VLCVideoEffectsWindowController.m
@@ -77,6 +77,8 @@
 [[_tabView tabViewItemAtIndex:[_tabView 
indexOfTabViewItemWithIdentifier:@"color"]] setLabel:_NS("Color")];
 [[_tabView tabViewItemAtIndex:[_tabView 
indexOfTabViewItemWithIdentifier:@"misc"]] setLabel:_NS("Miscellaneous")];
 
+[_applyProfileCheckbox setState:[[NSUserDefaults standardUserDefaults] 
boolForKey:@"VideoEffectApplyProfileOnStartup"]];
+
 [self resetProfileSelector];
 
 [_adjustCheckbox setTitle:_NS("Image Adjust")];
@@ -800,6 +802,11 @@
 }];
 }
 
+- (IBAction)applyProfileCheckboxChanged:(id)sender
+{
+[[NSUserDefaults standardUserDefaults] setBool:[sender state] 
forKey:@"VideoEffectApplyProfileOnStartup"];
+}
+
 #pragma mark -
 #pragma mark basic
 - (IBAction)enableAdjust:(id)sender

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx: don't save video filters options to config

2017-07-13 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
<victorien.lecouviour.tuf...@gmail.com> | Mon Jun 26 17:33:51 2017 +0200| 
[732fd11326725d5c487cbdb56cc60ed0b3cb7eff] | committer: Jean-Baptiste Kempf

macosx: don't save video filters options to config

We only save them in current video profile

Signed-off-by: Jean-Baptiste Kempf <j...@videolan.org>

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

 modules/gui/macosx/VLCCoreInteraction.m | 12 
 1 file changed, 12 deletions(-)

diff --git a/modules/gui/macosx/VLCCoreInteraction.m 
b/modules/gui/macosx/VLCCoreInteraction.m
index 7ac339b0ec..d636723241 100644
--- a/modules/gui/macosx/VLCCoreInteraction.m
+++ b/modules/gui/macosx/VLCCoreInteraction.m
@@ -820,25 +820,13 @@ static int BossCallback(vlc_object_t *p_this, const char 
*psz_var,
 
 i_type &= VLC_VAR_CLASS;
 if (i_type == VLC_VAR_BOOL)
-{
 var_SetBool(p_playlist, psz_property, value.b_bool);
-config_PutInt(p_intf, psz_property, (int64_t)value.b_bool);
-}
 else if (i_type == VLC_VAR_INTEGER)
-{
 var_SetInteger(p_playlist, psz_property, value.i_int);
-config_PutInt(p_intf, psz_property, value.i_int);
-}
 else if (i_type == VLC_VAR_FLOAT)
-{
-config_PutFloat(p_intf, psz_property, value.f_float);
 var_SetFloat(p_playlist, psz_property, value.f_float);
-}
 else if (i_type == VLC_VAR_STRING)
-{
-config_PutPsz(p_intf, psz_property, EnsureUTF8(value.psz_string));
 var_SetString(p_playlist, psz_property, EnsureUTF8(value.psz_string));
-}
 else
 {
 msg_Err(p_intf,

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx: save audio profile from playlist

2017-07-13 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
<victorien.lecouviour.tuf...@gmail.com> | Wed Jun 28 14:50:13 2017 +0200| 
[9efba1994f319c3d93877a674e91e2e0ee19] | committer: Jean-Baptiste Kempf

macosx: save audio profile from playlist

Signed-off-by: Jean-Baptiste Kempf <j...@videolan.org>

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

 .../gui/macosx/VLCAudioEffectsWindowController.m   | 43 +-
 1 file changed, 18 insertions(+), 25 deletions(-)

diff --git a/modules/gui/macosx/VLCAudioEffectsWindowController.m 
b/modules/gui/macosx/VLCAudioEffectsWindowController.m
index ced1a12f81..774b58341b 100644
--- a/modules/gui/macosx/VLCAudioEffectsWindowController.m
+++ b/modules/gui/macosx/VLCAudioEffectsWindowController.m
@@ -225,31 +225,24 @@
 
 - (NSString *)generateProfileString
 {
-intf_thread_t *p_intf = getIntf();
-vlc_object_t *p_object = VLC_OBJECT(getAout());
-if (p_object == NULL)
-p_object = vlc_object_hold(pl_Get(p_intf));
-
-NSString *o_str = [NSString 
stringWithFormat:@"%@;%@;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%lli",
-   B64EncAndFree(var_GetNonEmptyString(p_object, 
"equalizer-preset")),
-   B64EncAndFree(config_GetPsz(p_intf, "audio-filter")),
-   config_GetFloat(p_intf, "compressor-rms-peak"),
-   config_GetFloat(p_intf, "compressor-attack"),
-   config_GetFloat(p_intf, "compressor-release"),
-   config_GetFloat(p_intf, "compressor-threshold"),
-   config_GetFloat(p_intf, "compressor-ratio"),
-   config_GetFloat(p_intf, "compressor-knee"),
-   config_GetFloat(p_intf, "compressor-makeup-gain"),
-   config_GetFloat(p_intf, "spatializer-roomsize"),
-   config_GetFloat(p_intf, "spatializer-width"),
-   config_GetFloat(p_intf, "spatializer-wet"),
-   config_GetFloat(p_intf, "spatializer-dry"),
-   config_GetFloat(p_intf, "spatializer-damp"),
-   config_GetFloat(p_intf, "norm-max-level"),
-   config_GetInt(p_intf,"equalizer-2pass")];
-
-vlc_object_release(p_object);
-return o_str;
+playlist_t *p_playlist = pl_Get(getIntf());
+return [NSString 
stringWithFormat:@"%@;%@;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%i",
+ B64EncAndFree(var_GetNonEmptyString(p_playlist, 
"equalizer-preset")),
+ B64EncAndFree(var_InheritString(p_playlist, 
"audio-filter")),
+ var_InheritFloat(p_playlist, "compressor-rms-peak"),
+ var_InheritFloat(p_playlist, "compressor-attack"),
+ var_InheritFloat(p_playlist, "compressor-release"),
+ var_InheritFloat(p_playlist, "compressor-threshold"),
+ var_InheritFloat(p_playlist, "compressor-ratio"),
+ var_InheritFloat(p_playlist, "compressor-knee"),
+ var_InheritFloat(p_playlist, "compressor-makeup-gain"),
+ var_InheritFloat(p_playlist, "spatializer-roomsize"),
+ var_InheritFloat(p_playlist, "spatializer-width"),
+ var_InheritFloat(p_playlist, "spatializer-wet"),
+ var_InheritFloat(p_playlist, "spatializer-dry"),
+ var_InheritFloat(p_playlist, "spatializer-damp"),
+ var_InheritFloat(p_playlist, "norm-max-level"),
+ var_InheritBool(p_playlist,"equalizer-2pass")];
 }
 
 - (void)saveCurrentProfile

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx: save/retrieve audio filters to/from the playlist

2017-07-13 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
<victorien.lecouviour.tuf...@gmail.com> | Wed Jun 28 11:16:47 2017 +0200| 
[4dbf1743cb818e562420f14e0a17403c5ef3d104] | committer: Jean-Baptiste Kempf

macosx: save/retrieve audio filters to/from the playlist

Signed-off-by: Jean-Baptiste Kempf <j...@videolan.org>

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

 .../gui/macosx/VLCAudioEffectsWindowController.m| 21 +
 1 file changed, 5 insertions(+), 16 deletions(-)

diff --git a/modules/gui/macosx/VLCAudioEffectsWindowController.m 
b/modules/gui/macosx/VLCAudioEffectsWindowController.m
index 8947da6fa5..dd132ae72a 100644
--- a/modules/gui/macosx/VLCAudioEffectsWindowController.m
+++ b/modules/gui/macosx/VLCAudioEffectsWindowController.m
@@ -179,17 +179,7 @@
 
 - (void)setAudioFilter: (char *)psz_name on:(BOOL)b_on
 {
-audio_output_t *p_aout = getAout();
-intf_thread_t *p_intf = getIntf();
-playlist_EnableAudioFilter(pl_Get(p_intf), psz_name, b_on);
-
-if (p_aout) {
-char *psz_new = var_GetNonEmptyString(p_aout, "audio-filter");
-config_PutPsz(p_intf, "audio-filter", psz_new);
-free(psz_new);
-
-vlc_object_release(p_aout);
-}
+playlist_EnableAudioFilter(pl_Get(getIntf()), psz_name, b_on);
 }
 
 - (void)resetProfileSelector
@@ -481,7 +471,7 @@ static bool GetEqualizerStatus(intf_thread_t *p_custom_intf,
 if (!p_aout)
 return false;
 
-psz_string = config_GetPsz(p_custom_intf, "audio-filter");
+psz_string = var_InheritString(pl_Get(p_custom_intf), "audio-filter");
 
 if (!psz_string)
 psz_string = var_GetNonEmptyString(p_aout, "audio-filter");
@@ -626,7 +616,6 @@ static bool GetEqualizerStatus(intf_thread_t *p_custom_intf,
 
 /* save changed to config */
 config_PutPsz(getIntf(), "equalizer-bands", [[self generatePresetString] 
UTF8String]);
-
 }
 
 - (IBAction)equalizerChangePreset:(id)sender
@@ -769,7 +758,7 @@ static bool GetEqualizerStatus(intf_thread_t *p_custom_intf,
 intf_thread_t *p_intf = getIntf();
 BOOL bEnable_compressor = NO;
 char *psz_afilters;
-psz_afilters = config_GetPsz(p_intf, "audio-filter");
+psz_afilters = var_InheritString(pl_Get(p_intf), "audio-filter");
 if (psz_afilters) {
 bEnable_compressor = strstr(psz_afilters, "compressor") != NULL;
 [_compressorEnableCheckbox setState: (NSInteger)strstr(psz_afilters, 
"compressor") ];
@@ -874,7 +863,7 @@ static bool GetEqualizerStatus(intf_thread_t *p_custom_intf,
 intf_thread_t *p_intf = getIntf();
 BOOL bEnable_spatializer = NO;
 char *psz_afilters;
-psz_afilters = config_GetPsz(p_intf, "audio-filter");
+psz_afilters = var_InheritString(pl_Get(p_intf), "audio-filter");
 if (psz_afilters) {
 bEnable_spatializer = strstr(psz_afilters, "spatializer") != NULL;
 free(psz_afilters);
@@ -964,7 +953,7 @@ static bool GetEqualizerStatus(intf_thread_t *p_custom_intf,
 intf_thread_t *p_intf = getIntf();
 BOOL bEnable_normvol = NO;
 char *psz_afilters;
-psz_afilters = config_GetPsz(p_intf, "audio-filter");
+psz_afilters = var_InheritString(pl_Get(p_intf), "audio-filter");
 if (psz_afilters) {
 [_filterHeadPhoneCheckbox setState: (NSInteger)strstr(psz_afilters, 
"headphone") ];
 [_filterKaraokeCheckbox setState: (NSInteger)strstr(psz_afilters, 
"karaoke") ];

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx: duplicate video filters options in the playlist

2017-07-13 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
<victorien.lecouviour.tuf...@gmail.com> | Tue Jun 20 16:35:27 2017 +0200| 
[b3d9857b4fc4ad46e1a56d1a31b15cd2485fcd83] | committer: Jean-Baptiste Kempf

macosx: duplicate video filters options in the playlist

Signed-off-by: Jean-Baptiste Kempf <j...@videolan.org>

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

 modules/gui/macosx/VLCCoreInteraction.m  | 13 +
 modules/gui/macosx/VLCVideoEffectsWindowController.m |  9 -
 2 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/modules/gui/macosx/VLCCoreInteraction.m 
b/modules/gui/macosx/VLCCoreInteraction.m
index 914cbc9423..7ac339b0ec 100644
--- a/modules/gui/macosx/VLCCoreInteraction.m
+++ b/modules/gui/macosx/VLCCoreInteraction.m
@@ -799,6 +799,7 @@ static int BossCallback(vlc_object_t *p_this, const char 
*psz_var,
 {
 NSArray *vouts = getVouts();
 intf_thread_t *p_intf = getIntf();
+playlist_t *p_playlist = pl_Get(p_intf);
 if (!p_intf)
 return;
 int i_type;
@@ -819,13 +820,25 @@ static int BossCallback(vlc_object_t *p_this, const char 
*psz_var,
 
 i_type &= VLC_VAR_CLASS;
 if (i_type == VLC_VAR_BOOL)
+{
+var_SetBool(p_playlist, psz_property, value.b_bool);
 config_PutInt(p_intf, psz_property, (int64_t)value.b_bool);
+}
 else if (i_type == VLC_VAR_INTEGER)
+{
+var_SetInteger(p_playlist, psz_property, value.i_int);
 config_PutInt(p_intf, psz_property, value.i_int);
+}
 else if (i_type == VLC_VAR_FLOAT)
+{
 config_PutFloat(p_intf, psz_property, value.f_float);
+var_SetFloat(p_playlist, psz_property, value.f_float);
+}
 else if (i_type == VLC_VAR_STRING)
+{
 config_PutPsz(p_intf, psz_property, EnsureUTF8(value.psz_string));
+var_SetString(p_playlist, psz_property, EnsureUTF8(value.psz_string));
+}
 else
 {
 msg_Err(p_intf,
diff --git a/modules/gui/macosx/VLCVideoEffectsWindowController.m 
b/modules/gui/macosx/VLCVideoEffectsWindowController.m
index 2ff5470116..9562fe63b6 100644
--- a/modules/gui/macosx/VLCVideoEffectsWindowController.m
+++ b/modules/gui/macosx/VLCVideoEffectsWindowController.m
@@ -267,6 +267,7 @@
 - (void)setWidgetValue: (id)widget forOption: (char *)psz_option enabled: 
(bool)b_state
 {
 intf_thread_t *p_intf = getIntf();
+playlist_t *p_playlist = pl_Get(p_intf);
 
 vlc_value_t val;
 int i_type = config_GetType(p_intf, psz_option) & VLC_VAR_CLASS;
@@ -274,18 +275,16 @@
 {
 case VLC_VAR_BOOL:
 case VLC_VAR_INTEGER:
-val.i_int = config_GetInt(p_intf, psz_option);
-break;
 case VLC_VAR_FLOAT:
-val.f_float = config_GetFloat(p_intf, psz_option);
-break;
 case VLC_VAR_STRING:
-val.psz_string = config_GetPsz(p_intf, psz_option);
 break;
 default:
 msg_Err(p_intf, "%s variable is of an unsupported type (%d)", 
psz_option, i_type);
 return;
 }
+if (var_Create(p_playlist, psz_option, i_type | VLC_VAR_DOINHERIT) ||
+var_GetChecked(p_playlist, psz_option, i_type, ))
+return;
 
 if (i_type == VLC_VAR_BOOL || i_type == VLC_VAR_INTEGER)
 {

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx: set video filters options directly in all vouts

2017-07-13 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
<victorien.lecouviour.tuf...@gmail.com> | Tue Jun 20 16:07:31 2017 +0200| 
[53d8e4becb8936b38c7418bb2d640d80aaf9eacf] | committer: Jean-Baptiste Kempf

macosx: set video filters options directly in all vouts

Signed-off-by: Jean-Baptiste Kempf <j...@videolan.org>

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

 modules/gui/macosx/VLCCoreInteraction.m | 52 +
 1 file changed, 34 insertions(+), 18 deletions(-)

diff --git a/modules/gui/macosx/VLCCoreInteraction.m 
b/modules/gui/macosx/VLCCoreInteraction.m
index 780a9154b1..914cbc9423 100644
--- a/modules/gui/macosx/VLCCoreInteraction.m
+++ b/modules/gui/macosx/VLCCoreInteraction.m
@@ -797,15 +797,29 @@ static int BossCallback(vlc_object_t *p_this, const char 
*psz_var,
  forFilter: (char const *)psz_filter
  withValue: (vlc_value_t)value
 {
-vout_thread_t *p_vout = getVout();
-vlc_object_t *p_filter;
+NSArray *vouts = getVouts();
 intf_thread_t *p_intf = getIntf();
 if (!p_intf)
 return;
+int i_type;
+bool b_is_command = false;
+char const *psz_filter_type = [self getFilterType: psz_filter];
+if (!psz_filter_type) {
+msg_Err(p_intf, "Unable to find filter module \"%s\".", psz_filter);
+return;
+}
 
-int i_type = config_GetType(p_intf, psz_property);
+if (vouts && [vouts count])
+{
+i_type = var_Type((vout_thread_t *)[[vouts firstObject] pointerValue], 
psz_property);
+b_is_command = i_type & VLC_VAR_ISCOMMAND;
+}
+if (!i_type)
+i_type = config_GetType(p_intf, psz_property);
+
+i_type &= VLC_VAR_CLASS;
 if (i_type == VLC_VAR_BOOL)
-config_PutInt(p_intf, psz_property, (int)value.b_bool);
+config_PutInt(p_intf, psz_property, (int64_t)value.b_bool);
 else if (i_type == VLC_VAR_INTEGER)
 config_PutInt(p_intf, psz_property, value.i_int);
 else if (i_type == VLC_VAR_FLOAT)
@@ -817,23 +831,25 @@ static int BossCallback(vlc_object_t *p_this, const char 
*psz_var,
 msg_Err(p_intf,
 "Module %s's %s variable is of an unsupported type ( %d )",
 psz_filter, psz_property, i_type);
-if (p_vout)
-vlc_object_release(p_vout);
-return;
+b_is_command = false;
 }
 
-if (p_vout) {
-p_filter = vlc_object_find_name(pl_Get(p_intf), psz_filter);
+if (b_is_command)
+if (vouts)
+for (NSValue *ptr in vouts)
+{
+vout_thread_t *p_vout = [ptr pointerValue];
+var_SetChecked(p_vout, psz_property, i_type, value);
+#ifndef NDEBUG
+int i_cur_type = var_Type(p_vout, psz_property);
+assert((i_cur_type & VLC_VAR_CLASS) == i_type);
+assert(i_cur_type & VLC_VAR_ISCOMMAND);
+#endif
+}
 
-if (!p_filter) {
-msg_Warn(p_intf, "filter '%s' isn't enabled", psz_filter);
-vlc_object_release(p_vout);
-return;
-}
-var_SetChecked(p_filter, psz_property, i_type, value);
-vlc_object_release(p_vout);
-vlc_object_release(p_filter);
-}
+if (vouts)
+for (NSValue *ptr in vouts)
+vlc_object_release((vout_thread_t *)[ptr pointerValue]);
 }
 
 #pragma mark -

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx: remove unused variable and empty tabulated line

2017-07-13 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
<victorien.lecouviour.tuf...@gmail.com> | Wed Jun 28 11:23:01 2017 +0200| 
[081a1a42f1f3f0cbef127ea374cd6f19789fafd3] | committer: Jean-Baptiste Kempf

macosx: remove unused variable and empty tabulated line

Signed-off-by: Jean-Baptiste Kempf <j...@videolan.org>

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

 modules/gui/macosx/VLCAudioEffectsWindowController.m | 2 --
 1 file changed, 2 deletions(-)

diff --git a/modules/gui/macosx/VLCAudioEffectsWindowController.m 
b/modules/gui/macosx/VLCAudioEffectsWindowController.m
index dd132ae72a..25f80fab3d 100644
--- a/modules/gui/macosx/VLCAudioEffectsWindowController.m
+++ b/modules/gui/macosx/VLCAudioEffectsWindowController.m
@@ -530,7 +530,6 @@ static bool GetEqualizerStatus(intf_thread_t *p_custom_intf,
 [_equalizerPresetsPopup selectItemAtIndex:currentPresetIndex];
 [self equalizerChangePreset:_equalizerPresetsPopup];
 
-
 [_equalizerPreampSlider setFloatValue:[[[defaults 
objectForKey:@"EQPreampValues"] objectAtIndex:currentPresetIndex] floatValue]];
 [self setBandSliderValuesForPreset:currentPresetIndex];
 }
@@ -538,7 +537,6 @@ static bool GetEqualizerStatus(intf_thread_t *p_custom_intf,
 - (void)equalizerUpdated
 {
 intf_thread_t *p_intf = getIntf();
-float fPreamp = config_GetFloat(p_intf, "equalizer-preamp");
 bool b_2p = (BOOL)config_GetInt(p_intf, "equalizer-2pass");
 bool bEnabled = GetEqualizerStatus(p_intf, (char *)"equalizer");
 

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx: load video profile filters strings in all vouts

2017-07-13 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
<victorien.lecouviour.tuf...@gmail.com> | Mon Jun 26 17:53:52 2017 +0200| 
[70c486c36bf029a664e504c31a165d7f5b85787f] | committer: Jean-Baptiste Kempf

macosx: load video profile filters strings in all vouts

Signed-off-by: Jean-Baptiste Kempf <j...@videolan.org>

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

 .../gui/macosx/VLCVideoEffectsWindowController.m   | 23 +++---
 1 file changed, 12 insertions(+), 11 deletions(-)

diff --git a/modules/gui/macosx/VLCVideoEffectsWindowController.m 
b/modules/gui/macosx/VLCVideoEffectsWindowController.m
index 40a3829141..0df5d87916 100644
--- a/modules/gui/macosx/VLCVideoEffectsWindowController.m
+++ b/modules/gui/macosx/VLCVideoEffectsWindowController.m
@@ -609,24 +609,25 @@
 
 /* filter handling */
 NSString *tempString = B64DecNSStr([items firstObject]);
-vout_thread_t *p_vout = getVout();
+NSArray *vouts = getVouts();
 
 /* enable the new filters */
 var_SetString(p_playlist, "video-filter", [tempString UTF8String]);
-if (p_vout) {
-var_SetString(p_vout, "video-filter", [tempString UTF8String]);
-}
+if (vouts)
+for (NSValue *ptr in vouts) {
+vout_thread_t *p_vout = [ptr pointerValue];
+var_SetString(p_vout, "video-filter", [tempString UTF8String]);
+}
 
 tempString = B64DecNSStr([items objectAtIndex:1]);
 /* enable another round of new filters */
 var_SetString(p_playlist, "sub-source", [tempString UTF8String]);
-if (p_vout) {
-var_SetString(p_vout, "sub-source", [tempString UTF8String]);
-}
-
-if (p_vout) {
-vlc_object_release(p_vout);
-}
+if (vouts)
+for (NSValue *ptr in vouts) {
+vout_thread_t *p_vout = [ptr pointerValue];
+var_SetString(p_vout, "sub-source", [tempString UTF8String]);
+vlc_object_release(p_vout);
+}
 
 tempString = B64DecNSStr([items objectAtIndex:2]);
 /* enable another round of new filters */

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx: duplicate audio filters options in the playlist

2017-07-13 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
<victorien.lecouviour.tuf...@gmail.com> | Wed Jun 28 14:19:16 2017 +0200| 
[dfe72bf9a25de94ee74beef29d8c6a0abcd32523] | committer: Jean-Baptiste Kempf

macosx: duplicate audio filters options in the playlist

Signed-off-by: Jean-Baptiste Kempf <j...@videolan.org>

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

 .../gui/macosx/VLCAudioEffectsWindowController.m   | 168 +
 1 file changed, 105 insertions(+), 63 deletions(-)

diff --git a/modules/gui/macosx/VLCAudioEffectsWindowController.m 
b/modules/gui/macosx/VLCAudioEffectsWindowController.m
index 25f80fab3d..ced1a12f81 100644
--- a/modules/gui/macosx/VLCAudioEffectsWindowController.m
+++ b/modules/gui/macosx/VLCAudioEffectsWindowController.m
@@ -537,10 +537,13 @@ static bool GetEqualizerStatus(intf_thread_t 
*p_custom_intf,
 - (void)equalizerUpdated
 {
 intf_thread_t *p_intf = getIntf();
-bool b_2p = (BOOL)config_GetInt(p_intf, "equalizer-2pass");
+playlist_t *p_playlist = pl_Get(p_intf);
+bool b_2p = var_CreateGetBool(p_playlist, "equalizer-2pass");
 bool bEnabled = GetEqualizerStatus(p_intf, (char *)"equalizer");
 
 /* Setup sliders */
+var_Create(p_playlist, "equalizer-preset",
+   VLC_VAR_STRING | VLC_VAR_DOINHERIT);
 [self updatePresetSelector];
 
 /* Set the the checkboxes */
@@ -607,13 +610,14 @@ static bool GetEqualizerStatus(intf_thread_t 
*p_custom_intf,
 - (IBAction)equalizerBandSliderUpdated:(id)sender
 {
 audio_output_t *p_aout = getAout();
+char const *psz_preset_values = [[self generatePresetString] UTF8String];
 if (p_aout) {
-var_SetString(p_aout, "equalizer-bands", [[self generatePresetString] 
UTF8String]);
+var_SetString(p_aout, "equalizer-bands", psz_preset_values);
 vlc_object_release(p_aout);
 }
 
 /* save changed to config */
-config_PutPsz(getIntf(), "equalizer-bands", [[self generatePresetString] 
UTF8String]);
+config_PutPsz(getIntf(), "equalizer-bands", psz_preset_values);
 }
 
 - (IBAction)equalizerChangePreset:(id)sender
@@ -622,24 +626,26 @@ static bool GetEqualizerStatus(intf_thread_t 
*p_custom_intf,
 NSInteger numberOfChosenPreset = [sender indexOfSelectedItem];
 NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
 
-NSString *preset = [[defaults objectForKey:@"EQValues"] 
objectAtIndex:numberOfChosenPreset];
-NSString *preamp = [[defaults objectForKey:@"EQPreampValues"] 
objectAtIndex:numberOfChosenPreset];
+char const *psz_eq_bands = [[[defaults objectForKey:@"EQValues"] 
objectAtIndex:numberOfChosenPreset] UTF8String];
+float f_eq_preamp = [[[defaults objectForKey:@"EQPreampValues"] 
objectAtIndex:numberOfChosenPreset] floatValue];
+char const *psz_eq_preset = [[[defaults objectForKey:@"EQNames"] 
objectAtIndex:numberOfChosenPreset] UTF8String];
 
 audio_output_t *p_aout = getAout();
 if (p_aout) {
-var_SetString(p_aout, "equalizer-bands", [preset UTF8String]);
-var_SetFloat(p_aout, "equalizer-preamp", [preamp floatValue]);
-var_SetString(p_aout, "equalizer-preset" , [[[defaults 
objectForKey:@"EQNames"] objectAtIndex:numberOfChosenPreset] UTF8String]);
+var_SetString(p_aout, "equalizer-bands", psz_eq_bands);
+var_SetFloat(p_aout, "equalizer-preamp", f_eq_preamp);
+var_SetString(p_aout, "equalizer-preset" , psz_eq_preset);
 vlc_object_release(p_aout);
 }
 
-[_equalizerPreampSlider setFloatValue: [preamp floatValue]];
+[_equalizerPreampSlider setFloatValue: f_eq_preamp];
 [self setBandSliderValuesForPreset:numberOfChosenPreset];
 
 /* save changed to config */
-config_PutPsz(p_intf, "equalizer-bands", [preset UTF8String]);
-config_PutFloat(p_intf, "equalizer-preamp", [preamp floatValue]);
-config_PutPsz(p_intf, "equalizer-preset", [[[defaults 
objectForKey:@"EQNames"] objectAtIndex:numberOfChosenPreset] UTF8String]);
+config_PutPsz(p_intf, "equalizer-bands", psz_eq_bands);
+config_PutFloat(p_intf, "equalizer-preamp", f_eq_preamp);
+config_PutPsz(p_intf, "equalizer-preset", psz_eq_preset);
+var_SetString(pl_Get(p_intf), "equalizer-preset", psz_eq_preset);
 }
 
 - (IBAction)equalizerPreAmpSliderUpdated:(id)sender
@@ -651,7 +657,7 @@ static bool GetEqualizerStatus(intf_thread_t *p_custom_intf,
 var_SetFloat(p_aout, "equalizer-preamp", fPreamp);
 vlc_object_release(p_aout);
 }
-
+
 /* save changed to config */
 config_PutFloat(getIntf(), "equalizer-preamp", fPreamp);
 }
@@ -660,6 +666,7 @@ stat

[vlc-commits] macosx: do not load audio profile filter string to config

2017-07-13 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
<victorien.lecouviour.tuf...@gmail.com> | Wed Jun 28 15:10:29 2017 +0200| 
[d8d42829447920c8f21f3200e0cdb841117fdc08] | committer: Jean-Baptiste Kempf

macosx: do not load audio profile filter string to config

We do not want to check for the aout validity here as
playlist_EnableAudioFilter calls aout_ChangeFilterString which checks for it,
and sets the playlist variable even if the aout is NULL. This is the wanted
behaviour of this patch.

Signed-off-by: Jean-Baptiste Kempf <j...@videolan.org>

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

 .../gui/macosx/VLCAudioEffectsWindowController.m   | 35 ++
 1 file changed, 15 insertions(+), 20 deletions(-)

diff --git a/modules/gui/macosx/VLCAudioEffectsWindowController.m 
b/modules/gui/macosx/VLCAudioEffectsWindowController.m
index 774b58341b..8ad44f04ce 100644
--- a/modules/gui/macosx/VLCAudioEffectsWindowController.m
+++ b/modules/gui/macosx/VLCAudioEffectsWindowController.m
@@ -274,19 +274,16 @@
 if (selectedProfile < 0)
 return;
 
-audio_output_t *p_aout = getAout();
 playlist_t *p_playlist = pl_Get(p_intf);
 
-if (p_aout) {
-/* disable existing filters */
-playlist_EnableAudioFilter(p_playlist, "equalizer", false);
-playlist_EnableAudioFilter(p_playlist, "compressor", false);
-playlist_EnableAudioFilter(p_playlist, "spatializer", false);
-playlist_EnableAudioFilter(p_playlist, "compressor", false);
-playlist_EnableAudioFilter(p_playlist, "headphone", false);
-playlist_EnableAudioFilter(p_playlist, "normvol", false);
-playlist_EnableAudioFilter(p_playlist, "karaoke", false);
-}
+/* disable existing filters */
+playlist_EnableAudioFilter(p_playlist, "equalizer", false);
+playlist_EnableAudioFilter(p_playlist, "compressor", false);
+playlist_EnableAudioFilter(p_playlist, "spatializer", false);
+playlist_EnableAudioFilter(p_playlist, "compressor", false);
+playlist_EnableAudioFilter(p_playlist, "headphone", false);
+playlist_EnableAudioFilter(p_playlist, "normvol", false);
+playlist_EnableAudioFilter(p_playlist, "karaoke", false);
 
 /* fetch preset */
 NSArray *items = [[[defaults objectForKey:@"AudioEffectProfiles"] 
objectAtIndex:(NSUInteger) selectedProfile] componentsSeparatedByString:@";"];
@@ -302,16 +299,13 @@
 NSString *tempString = B64DecNSStr([items objectAtIndex:1]);
 NSArray *tempArray;
 NSUInteger count;
-/* enable the new filters, if we have an aout */
-if (p_aout) {
-if ([tempString length] > 0) {
-tempArray = [tempString componentsSeparatedByString:@":"];
-count = [tempArray count];
-for (NSUInteger x = 0; x < count; x++)
-playlist_EnableAudioFilter(p_playlist, [[tempArray 
objectAtIndex:x] UTF8String], true);
-}
+/* enable the new filters */
+if ([tempString length] > 0) {
+tempArray = [tempString componentsSeparatedByString:@":"];
+count = [tempArray count];
+for (NSUInteger x = 0; x < count; x++)
+playlist_EnableAudioFilter(p_playlist, [[tempArray 
objectAtIndex:x] UTF8String], true);
 }
-config_PutPsz(p_intf,"audio-filter",[tempString UTF8String]);
 
 /* values */
 config_PutFloat(p_intf, "compressor-rms-peak",[[items objectAtIndex:2] 
floatValue]);
@@ -330,6 +324,7 @@
 config_PutInt(p_intf, "equalizer-2pass",[[items objectAtIndex:15] 
intValue]);
 
 /* set values on-the-fly if we have an aout */
+audio_output_t *p_aout = getAout();
 if (p_aout) {
 var_SetFloat(p_aout, "compressor-rms-peak", [[items objectAtIndex:2] 
floatValue]);
 var_SetFloat(p_aout, "compressor-attack", [[items objectAtIndex:3] 
floatValue]);

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx: don't save TrackSynchronization preferences

2017-07-13 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
<victorien.lecouviour.tuf...@gmail.com> | Mon Jun 26 16:26:53 2017 +0200| 
[16e99713488206ef42a33cdeafaec4cedff0e566] | committer: Jean-Baptiste Kempf

macosx: don't save TrackSynchronization preferences

Signed-off-by: Jean-Baptiste Kempf <j...@videolan.org>

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

 modules/gui/macosx/VLCTrackSynchronizationWindowController.m | 1 -
 1 file changed, 1 deletion(-)

diff --git a/modules/gui/macosx/VLCTrackSynchronizationWindowController.m 
b/modules/gui/macosx/VLCTrackSynchronizationWindowController.m
index 2293019405..b3c137e312 100644
--- a/modules/gui/macosx/VLCTrackSynchronizationWindowController.m
+++ b/modules/gui/macosx/VLCTrackSynchronizationWindowController.m
@@ -197,7 +197,6 @@
 
 if (p_input) {
 float f_factor = [_sv_durTextField floatValue];
-config_PutFloat(getIntf(), SUBSDELAY_CFG_FACTOR, f_factor);
 
 /* Try to find an instance of subsdelay, and set its factor */
 vlc_object_t *p_obj = (vlc_object_t *) 
vlc_object_find_name(getIntf()->obj.libvlc, "subsdelay");

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx: apply subsdelay-factor change on all vouts

2017-07-13 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
<victorien.lecouviour.tuf...@gmail.com> | Mon Jun 26 16:39:13 2017 +0200| 
[9c571385656300052011ac65fed083eb121d718f] | committer: Jean-Baptiste Kempf

macosx: apply subsdelay-factor change on all vouts

Signed-off-by: Jean-Baptiste Kempf <j...@videolan.org>

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

 .../gui/macosx/VLCTrackSynchronizationWindowController.m   | 14 --
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/modules/gui/macosx/VLCTrackSynchronizationWindowController.m 
b/modules/gui/macosx/VLCTrackSynchronizationWindowController.m
index b3c137e312..85d6d7f33d 100644
--- a/modules/gui/macosx/VLCTrackSynchronizationWindowController.m
+++ b/modules/gui/macosx/VLCTrackSynchronizationWindowController.m
@@ -197,13 +197,15 @@
 
 if (p_input) {
 float f_factor = [_sv_durTextField floatValue];
+NSArray *vouts = getVouts();
 
-/* Try to find an instance of subsdelay, and set its factor */
-vlc_object_t *p_obj = (vlc_object_t *) 
vlc_object_find_name(getIntf()->obj.libvlc, "subsdelay");
-if (p_obj) {
-var_SetFloat(p_obj, SUBSDELAY_CFG_FACTOR, f_factor);
-vlc_object_release(p_obj);
-}
+if (vouts)
+for (NSValue *ptr in vouts) {
+vout_thread_t *p_vout = [ptr pointerValue];
+
+var_SetFloat(p_vout, SUBSDELAY_CFG_FACTOR, f_factor);
+vlc_object_release(p_vout);
+}
 [[VLCCoreInteraction sharedInstance] setVideoFilter: "subsdelay" on: 
f_factor > 0];
 
 vlc_object_release(p_input);

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx: save video profile from playlist

2017-07-13 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
<victorien.lecouviour.tuf...@gmail.com> | Mon Jun 26 17:35:41 2017 +0200| 
[02a6e7bac61e16f36762c6c1e8d03dbf2168cb45] | committer: Jean-Baptiste Kempf

macosx: save video profile from playlist

Signed-off-by: Jean-Baptiste Kempf <j...@videolan.org>

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

 .../gui/macosx/VLCVideoEffectsWindowController.m   | 73 +++---
 1 file changed, 37 insertions(+), 36 deletions(-)

diff --git a/modules/gui/macosx/VLCVideoEffectsWindowController.m 
b/modules/gui/macosx/VLCVideoEffectsWindowController.m
index 9562fe63b6..9932fc787c 100644
--- a/modules/gui/macosx/VLCVideoEffectsWindowController.m
+++ b/modules/gui/macosx/VLCVideoEffectsWindowController.m
@@ -514,43 +514,44 @@
 - (NSString *)generateProfileString
 {
 intf_thread_t *p_intf = getIntf();
+playlist_t *p_playlist = pl_Get(p_intf);
 return [NSString 
stringWithFormat:@"%@;%@;%@;%lli;%f;%f;%f;%f;%f;%lli;%f;%@;%lli;%lli;%lli;%lli;%lli;%lli;%@;%lli;%lli;%lli;%lli;%lli;%@;%lli;%@;%lli;%lli;%lli;%lli;%lli;%lli;%f",
-B64EncAndFree(config_GetPsz(p_intf, "video-filter")),
-B64EncAndFree(config_GetPsz(p_intf, "sub-source")),
-B64EncAndFree(config_GetPsz(p_intf, "video-splitter")),
-0LL, // former "hue" value, deprecated since 3.0.0
-config_GetFloat(p_intf, "contrast"),
-config_GetFloat(p_intf, "brightness"),
-config_GetFloat(p_intf, "saturation"),
-config_GetFloat(p_intf, "gamma"),
-config_GetFloat(p_intf, "sharpen-sigma"),
-config_GetInt(p_intf, "gradfun-radius"),
-config_GetFloat(p_intf, "grain-variance"),
-B64EncAndFree(config_GetPsz(p_intf, "transform-type")),
-config_GetInt(p_intf, "puzzle-rows"),
-config_GetInt(p_intf, "puzzle-cols"),
-config_GetInt(p_intf, "colorthres-color"),
-config_GetInt(p_intf, "colorthres-saturationthres"),
-config_GetInt(p_intf, "colorthres-similaritythres"),
-config_GetInt(p_intf, "sepia-intensity"),
-B64EncAndFree(config_GetPsz(p_intf, "gradient-mode")),
-config_GetInt(p_intf, "gradient-cartoon"),
-config_GetInt(p_intf, "gradient-type"),
-config_GetInt(p_intf, "extract-component"),
-config_GetInt(p_intf, "posterize-level"),
-config_GetInt(p_intf, "blur-factor"),
-B64EncAndFree(config_GetPsz(p_intf, "marq-marquee")),
-config_GetInt(p_intf, "marq-position"),
-B64EncAndFree(config_GetPsz(p_intf, "logo-file")),
-config_GetInt(p_intf, "logo-position"),
-config_GetInt(p_intf, "logo-opacity"),
-config_GetInt(p_intf, "clone-count"),
-config_GetInt(p_intf, "wall-rows"),
-config_GetInt(p_intf, "wall-cols"),
-// version 2 of profile string:
-config_GetInt(p_intf, "brightness-threshold"), // index: 32
-// version 3 of profile string: (vlc-3.0.0)
-config_GetFloat(p_intf, "hue") // index: 33
+ B64EncAndFree(var_InheritString(p_playlist, 
"video-filter")),
+ B64EncAndFree(var_InheritString(p_playlist, 
"sub-source")),
+ B64EncAndFree(var_InheritString(p_playlist, 
"video-splitter")),
+ 0LL, // former "hue" value, deprecated since 3.0.0
+ var_InheritFloat(p_playlist, "contrast"),
+ var_InheritFloat(p_playlist, "brightness"),
+ var_InheritFloat(p_playlist, "saturation"),
+ var_InheritFloat(p_playlist, "gamma"),
+ var_InheritFloat(p_playlist, "sharpen-sigma"),
+ var_InheritInteger(p_playlist, "gradfun-radius"),
+ var_InheritFloat(p_playlist, "grain-variance"),
+ B64EncAndFree(var_InheritString(p_playlist, 
"transform-type")),
+ var_InheritInteger(p_playlist, "puzzle-rows"),
+ var_InheritInteger(p_playlist, "puzzle-cols"),
+ var_InheritInteger(p_playlist, "colorthres-color"),
+ var_InheritInteger(p_playlist, 
"colorthres-saturationthres"),
+ var_InheritInteger(p_playlist, 
"colorthres-similarityth

[vlc-commits] macosx: create variables before assigning them from video profile

2017-07-13 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
<victorien.lecouviour.tuf...@gmail.com> | Tue Jun 27 10:30:10 2017 +0200| 
[a4c86f1c6b3fbaeb6ae9cbe9dedddedb8a8b56ac] | committer: Jean-Baptiste Kempf

macosx: create variables before assigning them from video profile

Signed-off-by: Jean-Baptiste Kempf <j...@videolan.org>

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

 modules/gui/macosx/VLCVideoEffectsWindowController.m | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/gui/macosx/VLCVideoEffectsWindowController.m 
b/modules/gui/macosx/VLCVideoEffectsWindowController.m
index 0df5d87916..1fa610283f 100644
--- a/modules/gui/macosx/VLCVideoEffectsWindowController.m
+++ b/modules/gui/macosx/VLCVideoEffectsWindowController.m
@@ -638,6 +638,8 @@
 if (b_filter_changed)
 var_SetString(p_playlist, "video-splitter", [tempString UTF8String]);
 
+[self resetValues];
+
 /* try to set filter values on-the-fly and store them appropriately */
 // index 3 is deprecated
 [vci_si setVideoFilterProperty: "contrast" forFilter: "adjust" withValue: 
getWidgetFloatValue([items objectAtIndex:4])];
@@ -685,8 +687,6 @@
 
 [defaults setInteger:selectedProfile forKey:@"VideoEffectSelectedProfile"];
 [defaults synchronize];
-
-[self resetValues];
 }
 
 - (void)addProfile:(id)sender

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx: load video profile filters strings to playlist

2017-07-13 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
<victorien.lecouviour.tuf...@gmail.com> | Mon Jun 26 17:52:48 2017 +0200| 
[9f9edaa70c709a733d4b81f830814e1767f4805c] | committer: Jean-Baptiste Kempf

macosx: load video profile filters strings to playlist

Signed-off-by: Jean-Baptiste Kempf <j...@videolan.org>

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

 modules/gui/macosx/VLCVideoEffectsWindowController.m | 13 ++---
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/modules/gui/macosx/VLCVideoEffectsWindowController.m 
b/modules/gui/macosx/VLCVideoEffectsWindowController.m
index 9932fc787c..40a3829141 100644
--- a/modules/gui/macosx/VLCVideoEffectsWindowController.m
+++ b/modules/gui/macosx/VLCVideoEffectsWindowController.m
@@ -589,6 +589,7 @@
 - (IBAction)profileSelectorAction:(id)sender
 {
 intf_thread_t *p_intf = getIntf();
+playlist_t *p_playlist = pl_Get(p_intf);
 [self saveCurrentProfile];
 i_old_profile_index = [_profilePopup indexOfSelectedItem];
 VLCCoreInteraction *vci_si = [VLCCoreInteraction sharedInstance];
@@ -611,14 +612,14 @@
 vout_thread_t *p_vout = getVout();
 
 /* enable the new filters */
-config_PutPsz(p_intf, "video-filter", [tempString UTF8String]);
+var_SetString(p_playlist, "video-filter", [tempString UTF8String]);
 if (p_vout) {
 var_SetString(p_vout, "video-filter", [tempString UTF8String]);
 }
 
 tempString = B64DecNSStr([items objectAtIndex:1]);
 /* enable another round of new filters */
-config_PutPsz(p_intf, "sub-source", [tempString UTF8String]);
+var_SetString(p_playlist, "sub-source", [tempString UTF8String]);
 if (p_vout) {
 var_SetString(p_vout, "sub-source", [tempString UTF8String]);
 }
@@ -629,14 +630,12 @@
 
 tempString = B64DecNSStr([items objectAtIndex:2]);
 /* enable another round of new filters */
-char *psz_current_splitter = var_GetString(pl_Get(p_intf), 
"video-splitter");
+char *psz_current_splitter = var_GetString(p_playlist, "video-splitter");
 bool b_filter_changed = ![tempString 
isEqualToString:toNSStr(psz_current_splitter)];
 free(psz_current_splitter);
 
-if (b_filter_changed) {
-config_PutPsz(p_intf, "video-splitter", [tempString UTF8String]);
-var_SetString(pl_Get(p_intf), "video-splitter", [tempString 
UTF8String]);
-}
+if (b_filter_changed)
+var_SetString(p_playlist, "video-splitter", [tempString UTF8String]);
 
 /* try to set filter values on-the-fly and store them appropriately */
 // index 3 is deprecated

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx: remove VLCCoreInteraction::restartFilterIfNeeded

2017-07-13 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
<victorien.lecouviour.tuf...@gmail.com> | Mon Jun 26 17:10:20 2017 +0200| 
[4d53af506075065f636b6afa3cc175b6c26c1385] | committer: Jean-Baptiste Kempf

macosx: remove VLCCoreInteraction::restartFilterIfNeeded

Not needed anymore thanks to the proxy callback system which handles the
non-command variables automatically.

Signed-off-by: Jean-Baptiste Kempf <j...@videolan.org>

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

 modules/gui/macosx/VLCCoreInteraction.m | 59 -
 1 file changed, 59 deletions(-)

diff --git a/modules/gui/macosx/VLCCoreInteraction.m 
b/modules/gui/macosx/VLCCoreInteraction.m
index 98d684778a..780a9154b1 100644
--- a/modules/gui/macosx/VLCCoreInteraction.m
+++ b/modules/gui/macosx/VLCCoreInteraction.m
@@ -793,60 +793,6 @@ static int BossCallback(vlc_object_t *p_this, const char 
*psz_var,
 free(psz_string);
 }
 
-- (void)restartFilterIfNeeded: (const char *)psz_filter option: (const char 
*)psz_name
-{
-vout_thread_t *p_vout = getVout();
-intf_thread_t *p_intf = getIntf();
-if (!p_intf)
-return;
-
-if (p_vout == NULL)
-return;
-else
-vlc_object_release(p_vout);
-
-vlc_object_t *p_filter = vlc_object_find_name(pl_Get(p_intf), psz_filter);
-if (p_filter) {
-
-/* we cannot rely on the p_filter existence.
- This filter might be just
- disabled, but the object still exists. Therefore, the string
- is checked, additionally.
- */
-const char *psz_filter_type = [self getFilterType:psz_filter];
-if (!psz_filter_type) {
-msg_Err(p_intf, "Unable to find filter module \"%s\".", psz_name);
-goto out;
-}
-
-char *psz_string = config_GetPsz(p_intf, psz_filter_type);
-if (!psz_string) {
-goto out;
-}
-if (strstr(psz_string, psz_filter) == NULL) {
-free(psz_string);
-goto out;
-}
-free(psz_string);
-
-int i_type;
-i_type = var_Type(p_filter, psz_name);
-if (i_type == 0)
-i_type = config_GetType(p_intf, psz_name);
-
-if (!(i_type & VLC_VAR_ISCOMMAND)) {
-msg_Warn(p_intf, "Brute-restarting filter '%s', because the last 
changed option isn't a command", psz_name);
-
-[self setVideoFilter: psz_filter on: NO];
-[self setVideoFilter: psz_filter on: YES];
-} else
-msg_Dbg(p_intf, "restart not needed");
-
-out:
-vlc_object_release(p_filter);
-}
-}
-
 - (void)setVideoFilterProperty: (char const *)psz_property
  forFilter: (char const *)psz_filter
  withValue: (vlc_value_t)value
@@ -872,10 +818,7 @@ static int BossCallback(vlc_object_t *p_this, const char 
*psz_var,
 "Module %s's %s variable is of an unsupported type ( %d )",
 psz_filter, psz_property, i_type);
 if (p_vout)
-{
-[self restartFilterIfNeeded: psz_filter option: psz_property];
 vlc_object_release(p_vout);
-}
 return;
 }
 
@@ -890,8 +833,6 @@ static int BossCallback(vlc_object_t *p_this, const char 
*psz_var,
 var_SetChecked(p_filter, psz_property, i_type, value);
 vlc_object_release(p_vout);
 vlc_object_release(p_filter);
-
-[self restartFilterIfNeeded: psz_filter option: psz_property];
 }
 }
 

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx: refactor VLCVideoEffectsWindowController::resetValues

2017-07-13 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
<victorien.lecouviour.tuf...@gmail.com> | Fri Jun 16 20:22:54 2017 +0200| 
[b102a078b28cff72cc8557ba7801cb440d07b1c7] | committer: Jean-Baptiste Kempf

macosx: refactor VLCVideoEffectsWindowController::resetValues

Signed-off-by: Jean-Baptiste Kempf <j...@videolan.org>

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

 .../gui/macosx/VLCVideoEffectsWindowController.m   | 226 +++--
 1 file changed, 121 insertions(+), 105 deletions(-)

diff --git a/modules/gui/macosx/VLCVideoEffectsWindowController.m 
b/modules/gui/macosx/VLCVideoEffectsWindowController.m
index 780105d42c..92caa092cc 100644
--- a/modules/gui/macosx/VLCVideoEffectsWindowController.m
+++ b/modules/gui/macosx/VLCVideoEffectsWindowController.m
@@ -27,6 +27,7 @@
 #import "VLCPopupPanelController.h"
 #import "VLCTextfieldPanelController.h"
 #import "VLCCoreInteraction.h"
+#import "VLCHexNumberFormatter.h"
 
 @interface VLCVideoEffectsWindowController()
 {
@@ -97,14 +98,19 @@
 [_transformCheckbox setTitle:_NS("Transform")];
 [_transformPopup removeAllItems];
 [_transformPopup addItemWithTitle: _NS("Rotate by 90 degrees")];
+[[_transformPopup lastItem] setRepresentedObject: @"90"];
 [[_transformPopup lastItem] setTag: 90];
 [_transformPopup addItemWithTitle: _NS("Rotate by 180 degrees")];
+[[_transformPopup lastItem] setRepresentedObject: @"180"];
 [[_transformPopup lastItem] setTag: 180];
 [_transformPopup addItemWithTitle: _NS("Rotate by 270 degrees")];
+[[_transformPopup lastItem] setRepresentedObject: @"270"];
 [[_transformPopup lastItem] setTag: 270];
 [_transformPopup addItemWithTitle: _NS("Flip horizontally")];
+[[_transformPopup lastItem] setRepresentedObject: @"hflip"];
 [[_transformPopup lastItem] setTag: 1];
 [_transformPopup addItemWithTitle: _NS("Flip vertically")];
+[[_transformPopup lastItem] setRepresentedObject: @"vflip"];
 [[_transformPopup lastItem] setTag: 2];
 [_zoomCheckbox setTitle:_NS("Magnification/Zoom")];
 [_puzzleCheckbox setTitle:_NS("Puzzle game")];
@@ -118,6 +124,7 @@
 
 [_thresholdCheckbox setTitle:_NS("Color threshold")];
 [_thresholdColorLabel setStringValue:_NS("Color")];
+[_thresholdColorTextField setFormatter:[[VLCHexNumberFormatter alloc] 
init]];
 [_thresholdSaturationLabel setStringValue:_NS("Saturation")];
 [_thresholdSimilarityLabel setStringValue:_NS("Similarity")];
 [_sepiaCheckbox setTitle:_NS("Sepia")];
@@ -127,15 +134,19 @@
 [_gradientModeLabel setStringValue:_NS("Mode")];
 [_gradientModePopup removeAllItems];
 [_gradientModePopup addItemWithTitle: _NS("Gradient")];
+[[_gradientModePopup lastItem] setRepresentedObject: @"gradient"];
 [[_gradientModePopup lastItem] setTag: 1];
 [_gradientModePopup addItemWithTitle: _NS("Edge")];
+[[_gradientModePopup lastItem] setRepresentedObject: @"edge"];
 [[_gradientModePopup lastItem] setTag: 2];
 [_gradientModePopup addItemWithTitle: _NS("Hough")];
+[[_gradientModePopup lastItem] setRepresentedObject: @"hough"];
 [[_gradientModePopup lastItem] setTag: 3];
 [_gradientColorCheckbox setTitle:_NS("Color")];
 [_gradientCartoonCheckbox setTitle:_NS("Cartoon")];
 [_extractCheckbox setTitle:_NS("Color extraction")];
 [_extractLabel setStringValue:_NS("Color")];
+[_extractTextField setFormatter:[[VLCHexNumberFormatter alloc] init]];
 [_invertCheckbox setTitle:_NS("Invert colors")];
 [_posterizeCheckbox setTitle:_NS("Posterize")];
 [_posterizeLabel setStringValue:_NS("Posterize level")];
@@ -146,7 +157,6 @@
 [_wavesCheckbox setTitle:_NS("Waves")];
 [_psychedelicCheckbox setTitle:_NS("Psychedelic")];
 [_anaglyphCheckbox setTitle:_NS("Anaglyph")];
-
 [_addTextCheckbox setTitle:_NS("Add text")];
 [_addTextTextLabel setStringValue:_NS("Text")];
 [_addTextPositionLabel setStringValue:_NS("Position")];
@@ -200,7 +210,6 @@
  
name:VLCInputChangedNotification
object:nil];
 
-
 [self resetValues];
 }
 
@@ -250,6 +259,79 @@
 [self profileSelectorAction:self];
 }
 
+- (void)setWidgetValue: (id)widget forOption: (char *)psz_option enabled: 
(bool)b_state
+{
+intf_thread_t *p_intf = getIntf();
+
+vlc_value_t val;
+int i_type = config_GetType(p_intf, psz_option) & VLC_VAR_CLASS;
+switch (i_type)
+{
+case 

[vlc-commits] macosx: apply filters change on all vouts

2017-07-13 Thread Victorien Le Couviour--Tuffet
vlc | branch: master | Victorien Le Couviour--Tuffet 
<victorien.lecouviour.tuf...@gmail.com> | Tue Jun 20 16:51:39 2017 +0200| 
[d9c47b952598f1ea1007eb289c3b8e074384a741] | committer: Jean-Baptiste Kempf

macosx: apply filters change on all vouts

Signed-off-by: Jean-Baptiste Kempf <j...@videolan.org>

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

 modules/gui/macosx/VLCCoreInteraction.m  | 12 +++-
 modules/gui/macosx/VLCVideoEffectsWindowController.m | 18 ++
 2 files changed, 17 insertions(+), 13 deletions(-)

diff --git a/modules/gui/macosx/VLCCoreInteraction.m 
b/modules/gui/macosx/VLCCoreInteraction.m
index abda75c6fd..e55fca8fd8 100644
--- a/modules/gui/macosx/VLCCoreInteraction.m
+++ b/modules/gui/macosx/VLCCoreInteraction.m
@@ -781,11 +781,13 @@ static int BossCallback(vlc_object_t *p_this, const char 
*psz_var,
 
 /* Try to set non splitter filters on the fly */
 if (strcmp(psz_filter_type, "video-splitter")) {
-vout_thread_t *p_vout = getVout();
-if (p_vout) {
-var_SetString(p_vout, psz_filter_type, psz_string);
-vlc_object_release(p_vout);
-}
+NSArray *vouts = getVouts();
+if (vouts)
+for (NSValue * val in vouts) {
+vout_thread_t *p_vout = [val pointerValue];
+var_SetString(p_vout, psz_filter_type, psz_string);
+vlc_object_release(p_vout);
+}
 }
 
 free(psz_string);
diff --git a/modules/gui/macosx/VLCVideoEffectsWindowController.m 
b/modules/gui/macosx/VLCVideoEffectsWindowController.m
index 19ed86fa89..780105d42c 100644
--- a/modules/gui/macosx/VLCVideoEffectsWindowController.m
+++ b/modules/gui/macosx/VLCVideoEffectsWindowController.m
@@ -915,14 +915,16 @@
 [self setCropRightValue: [self cropLeftValue]];
 }
 
-vout_thread_t *p_vout = getVout();
-if (p_vout) {
-var_SetInteger(p_vout, "crop-top", [_cropTopTextField intValue]);
-var_SetInteger(p_vout, "crop-bottom", [_cropBottomTextField intValue]);
-var_SetInteger(p_vout, "crop-left", [_cropLeftTextField intValue]);
-var_SetInteger(p_vout, "crop-right", [_cropRightTextField intValue]);
-vlc_object_release(p_vout);
-}
+NSArray *vouts = getVouts();
+if (vouts)
+for (NSValue *ptr in vouts) {
+vout_thread_t *p_vout = [ptr pointerValue];
+var_SetInteger(p_vout, "crop-top", [_cropTopTextField intValue]);
+var_SetInteger(p_vout, "crop-bottom", [_cropBottomTextField 
intValue]);
+var_SetInteger(p_vout, "crop-left", [_cropLeftTextField intValue]);
+var_SetInteger(p_vout, "crop-right", [_cropRightTextField 
intValue]);
+vlc_object_release(p_vout);
+}
 }
 
 #pragma mark -

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


  1   2   >