소스 검색

MVK: rebase libvlc and add missing patches

Felix Paul Kühne 9 년 전
부모
커밋
0ee5a92c6d

+ 167 - 0
MobileVLCKit/patches/0016-Add-AC-3-pass-through.patch

@@ -0,0 +1,167 @@
+From f7a362b9e3e3940c0e25378f24e0bbf82ae61aea Mon Sep 17 00:00:00 2001
+From: Aman Gupta <aman@tmm1.net>
+Date: Tue, 1 Mar 2016 16:31:13 +0100
+Subject: [PATCH 16/17] Add AC-3 pass-through
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Felix Paul Kühne <fkuehne@videolan.org>
+---
+ extras/package/ios/build.sh          |  1 -
+ include/vlc/libvlc_media_player.h    | 10 +++++++++
+ lib/audio.c                          | 16 +++++++++++++++
+ lib/media_player.c                   |  1 +
+ modules/audio_output/audiounit_ios.m | 39 +++++++++++++++++++++++++++---------
+ modules/codec/a52.c                  |  2 +-
+ 6 files changed, 57 insertions(+), 12 deletions(-)
+
+diff --git a/extras/package/ios/build.sh b/extras/package/ios/build.sh
+index c480171..85d73dd 100755
+--- a/extras/package/ios/build.sh
++++ b/extras/package/ios/build.sh
+@@ -458,7 +458,6 @@ speex_resampler
+ remoteosd
+ magnify
+ gradient
+-tospdif
+ dtstofloat32
+ logger
+ visual
+diff --git a/include/vlc/libvlc_media_player.h b/include/vlc/libvlc_media_player.h
+index 17b0450..1099dd2 100644
+--- a/include/vlc/libvlc_media_player.h
++++ b/include/vlc/libvlc_media_player.h
+@@ -1934,6 +1934,16 @@ LIBVLC_API int64_t libvlc_audio_get_delay( libvlc_media_player_t *p_mi );
+ LIBVLC_API int libvlc_audio_set_delay( libvlc_media_player_t *p_mi, int64_t i_delay );
+ 
+ /**
++ * Set audio spdif mode.
++ *
++ * \param p_mi media player
++ * \param enabled the spdif state
++ * \return 0 on success, -1 on error
++ * \version LibVLC 2.x.x or later
++ */
++LIBVLC_API int libvlc_audio_set_spdif( libvlc_media_player_t *p_mi, bool enabled );
++
++/**
+  * Get the number of equalizer presets.
+  *
+  * \return number of presets
+diff --git a/lib/audio.c b/lib/audio.c
+index 7901c64..3877311 100644
+--- a/lib/audio.c
++++ b/lib/audio.c
+@@ -472,6 +472,22 @@ int libvlc_audio_set_channel( libvlc_media_player_t *mp, int channel )
+ }
+ 
+ /*****************************************************************************
++ * libvlc_audio_set_spdif : Enable/disable spdif mode
++ *****************************************************************************/
++int libvlc_audio_set_spdif( libvlc_media_player_t *p_mi, bool enabled )
++{
++    int ret = 0;
++
++    if( var_SetBool( p_mi, "spdif", enabled ) < 0 )
++    {
++        libvlc_printerr( "Error setting 'spdif'" );
++        ret = -1;
++    }
++
++    return ret;
++}
++
++/*****************************************************************************
+  * libvlc_audio_get_delay : Get the current audio delay
+  *****************************************************************************/
+ int64_t libvlc_audio_get_delay( libvlc_media_player_t *p_mi )
+diff --git a/lib/media_player.c b/lib/media_player.c
+index 29623db..ef66391 100644
+--- a/lib/media_player.c
++++ b/lib/media_player.c
+@@ -609,6 +609,7 @@ libvlc_media_player_new( libvlc_instance_t *instance )
+     var_Create (mp, "zoom", VLC_VAR_FLOAT | VLC_VAR_DOINHERIT);
+     var_Create (mp, "aspect-ratio", VLC_VAR_STRING);
+     var_Create (mp, "crop", VLC_VAR_STRING);
++    var_Create (mp, "spdif", VLC_VAR_BOOL | VLC_VAR_DOINHERIT);
+     var_Create (mp, "deinterlace", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT);
+     var_Create (mp, "deinterlace-mode", VLC_VAR_STRING);
+ 
+diff --git a/modules/audio_output/audiounit_ios.m b/modules/audio_output/audiounit_ios.m
+index cee8eab..0aa9dee 100644
+--- a/modules/audio_output/audiounit_ios.m
++++ b/modules/audio_output/audiounit_ios.m
+@@ -201,16 +201,34 @@ static int StartAnalog(audio_output_t *p_aout, audio_sample_format_t *fmt)
+     if (status != noErr)
+         msg_Warn(p_aout, "failed to set IO mode (%i)", (int)status);
+ 
++    AVAudioSession *instance = [AVAudioSession sharedInstance];
++
+     /* Get the current format */
+     AudioStreamBasicDescription streamDescription;
+     streamDescription.mSampleRate = fmt->i_rate;
+-    fmt->i_format = VLC_CODEC_FL32;
+-    fmt->i_physical_channels = fmt->i_original_channels = AOUT_CHANS_STEREO;
+     streamDescription.mFormatID = kAudioFormatLinearPCM;
+-    streamDescription.mFormatFlags = kAudioFormatFlagsNativeFloatPacked; // FL32
+-    streamDescription.mChannelsPerFrame = aout_FormatNbChannels(fmt);
+-    streamDescription.mFramesPerPacket = 1;
+-    streamDescription.mBitsPerChannel = 32;
++
++    if (AOUT_FMT_SPDIF(fmt) && var_InheritBool(p_aout, "spdif")) {
++        // request spdif
++        fmt->i_format = VLC_CODEC_SPDIFL;
++        fmt->i_bytes_per_frame = AOUT_SPDIF_SIZE;
++        fmt->i_frame_length = A52_FRAME_NB;
++
++        streamDescription.mFormatFlags = kLinearPCMFormatFlagIsSignedInteger | kLinearPCMFormatFlagIsPacked; // S16LE
++        streamDescription.mChannelsPerFrame = 2;
++        streamDescription.mFramesPerPacket = 1;
++        streamDescription.mBitsPerChannel = 16;
++    } else {
++        // request fl32 pcm
++        fmt->i_format = VLC_CODEC_FL32;
++        fmt->i_physical_channels = fmt->i_original_channels = AOUT_CHANS_STEREO;
++
++        streamDescription.mFormatFlags = kAudioFormatFlagsNativeFloatPacked; // FL32
++        streamDescription.mChannelsPerFrame = aout_FormatNbChannels(fmt);
++        streamDescription.mFramesPerPacket = 1;
++        streamDescription.mBitsPerChannel = 32;
++    }
++
+     streamDescription.mBytesPerFrame = streamDescription.mBitsPerChannel * streamDescription.mChannelsPerFrame / 8;
+     streamDescription.mBytesPerPacket = streamDescription.mBytesPerFrame * streamDescription.mFramesPerPacket;
+     i_param_size = sizeof(streamDescription);
+@@ -265,10 +283,11 @@ static int StartAnalog(audio_output_t *p_aout, audio_sample_format_t *fmt)
+     }
+ 
+     /* setup circular buffer */
+-    TPCircularBufferInit(&p_sys->circular_buffer, AUDIO_BUFFER_SIZE_IN_SECONDS * fmt->i_rate * fmt->i_bytes_per_frame);
+-
+-    /* start audio session so playback continues if mute switch is on */
+-    AVAudioSession *instance = [AVAudioSession sharedInstance];
++    if (fmt->i_format == VLC_CODEC_SPDIFL) {
++        TPCircularBufferInit(&p_sys->circular_buffer, 200 * AOUT_SPDIF_SIZE);
++    } else {
++        TPCircularBufferInit(&p_sys->circular_buffer, AUDIO_BUFFER_SIZE_IN_SECONDS * fmt->i_rate * fmt->i_bytes_per_frame);
++    }
+ 
+     /* Set audio session to mediaplayback */
+     NSError *error = nil;
+diff --git a/modules/codec/a52.c b/modules/codec/a52.c
+index 044905b..355f14f 100644
+--- a/modules/codec/a52.c
++++ b/modules/codec/a52.c
+@@ -152,7 +152,7 @@ static int OpenCommon( vlc_object_t *p_this, bool b_packetizer )
+ static int OpenDecoder( vlc_object_t *p_this )
+ {
+     /* HACK: Don't use this codec if we don't have an a52 audio filter */
+-    if( !module_exists( "a52tofloat32" ) )
++    if( !module_exists( "a52tofloat32" ) && !(module_exists("a52tospdif") && var_InheritBool(p_this, "spdif")) )
+         return VLC_EGENERIC;
+     return OpenCommon( p_this, false );
+ }
+-- 
+2.8.1
+

+ 43 - 0
MobileVLCKit/patches/0017-contrib-gsm-fix-compilation-with-Xcode-7.3.patch

@@ -0,0 +1,43 @@
+From 01651bd7e3da37cb4391b7a95a498c59701cd52f Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
+Date: Tue, 5 Apr 2016 17:14:50 +0200
+Subject: [PATCH 17/17] contrib/gsm: fix compilation with Xcode 7.3
+
+---
+ contrib/src/gsm/gsm-xcode73.patch | 11 +++++++++++
+ contrib/src/gsm/rules.mak         |  1 +
+ 2 files changed, 12 insertions(+)
+ create mode 100644 contrib/src/gsm/gsm-xcode73.patch
+
+diff --git a/contrib/src/gsm/gsm-xcode73.patch b/contrib/src/gsm/gsm-xcode73.patch
+new file mode 100644
+index 0000000..677d7b4
+--- /dev/null
++++ b/contrib/src/gsm/gsm-xcode73.patch
+@@ -0,0 +1,11 @@
++diff -ru gsm-broken/src/code.c gsm/src/code.c
++--- gsm-broken/src/code.c	2006-04-26 21:16:50.000000000 +0200
+++++ gsm/src/code.c	2016-04-05 17:13:19.000000000 +0200
++@@ -19,6 +19,7 @@
++ #include	"private.h"
++ #include	"gsm.h"
++ #include	"proto.h"
+++#include	<string.h>
++ 
++ /* 
++  *  4.2 FIXED POINT IMPLEMENTATION OF THE RPE-LTP CODER 
+diff --git a/contrib/src/gsm/rules.mak b/contrib/src/gsm/rules.mak
+index 38553d3..3cecb30 100644
+--- a/contrib/src/gsm/rules.mak
++++ b/contrib/src/gsm/rules.mak
+@@ -11,6 +11,7 @@ gsm: libgsm_$(GSM_VERSION).tar.gz .sum-gsm
+ 	$(UNPACK)
+ 	mv gsm-1.0-* libgsm_$(GSM_VERSION)
+ 	$(APPLY) $(SRC)/gsm/gsm-cross.patch
++	$(APPLY) $(SRC)/gsm/gsm-xcode73.patch
+ 	sed -e 's/^CFLAGS.*=/CFLAGS+=/' -i.orig libgsm_$(GSM_VERSION)/Makefile
+ 	$(MOVE)
+ 
+-- 
+2.8.1
+

+ 1 - 1
buildMobileVLCKit.sh

@@ -17,7 +17,7 @@ SCARY=yes
 TVOS=no
 BITCODE=no
 
-TESTEDHASH=7faca74c
+TESTEDHASH=fe425c44
 
 usage()
 {