From 94d5bf57ac9035caa07fe099f7912095ee314409 Mon Sep 17 00:00:00 2001 From: Frank van Klaveren Date: Thu, 7 May 2015 10:07:58 +0200 Subject: [PATCH 01/23] libhdhomerun: bump to 20150406 --- packages/multimedia/libhdhomerun/package.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/multimedia/libhdhomerun/package.mk b/packages/multimedia/libhdhomerun/package.mk index a8faa3e49a..cc5d6d957e 100644 --- a/packages/multimedia/libhdhomerun/package.mk +++ b/packages/multimedia/libhdhomerun/package.mk @@ -17,7 +17,7 @@ ################################################################################ PKG_NAME="libhdhomerun" -PKG_VERSION="20141210" +PKG_VERSION="20150406" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="LGPL" From ae539330cff50e721a1b5ce6f65a0fb94c4a4783 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Thu, 7 May 2015 10:18:08 +0200 Subject: [PATCH 02/23] bump audiodecoder add-ons due to split of kodiplatform --- .../mediacenter/kodi-binary-addons/audiodecoder.ncsf/package.mk | 2 +- .../kodi-binary-addons/audiodecoder.organya/package.mk | 2 +- .../mediacenter/kodi-binary-addons/audiodecoder.qsf/package.mk | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/mediacenter/kodi-binary-addons/audiodecoder.ncsf/package.mk b/packages/mediacenter/kodi-binary-addons/audiodecoder.ncsf/package.mk index 865dde660f..9cf1b58490 100644 --- a/packages/mediacenter/kodi-binary-addons/audiodecoder.ncsf/package.mk +++ b/packages/mediacenter/kodi-binary-addons/audiodecoder.ncsf/package.mk @@ -17,7 +17,7 @@ ################################################################################ PKG_NAME="audiodecoder.ncsf" -PKG_VERSION="5c99c79" +PKG_VERSION="6cbec60" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="GPL" diff --git a/packages/mediacenter/kodi-binary-addons/audiodecoder.organya/package.mk b/packages/mediacenter/kodi-binary-addons/audiodecoder.organya/package.mk index cbe37fe2e6..3841513565 100644 --- a/packages/mediacenter/kodi-binary-addons/audiodecoder.organya/package.mk +++ b/packages/mediacenter/kodi-binary-addons/audiodecoder.organya/package.mk @@ -17,7 +17,7 @@ ################################################################################ PKG_NAME="audiodecoder.organya" -PKG_VERSION="4a94300" +PKG_VERSION="2284431" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="GPL" diff --git a/packages/mediacenter/kodi-binary-addons/audiodecoder.qsf/package.mk b/packages/mediacenter/kodi-binary-addons/audiodecoder.qsf/package.mk index e19c3a3a2c..481eefb5d8 100644 --- a/packages/mediacenter/kodi-binary-addons/audiodecoder.qsf/package.mk +++ b/packages/mediacenter/kodi-binary-addons/audiodecoder.qsf/package.mk @@ -17,7 +17,7 @@ ################################################################################ PKG_NAME="audiodecoder.qsf" -PKG_VERSION="bb7b0aa" +PKG_VERSION="294fd39" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="GPL" From 3c858b49bf7ba89ba6471a037e52cd3fd4e23b3d Mon Sep 17 00:00:00 2001 From: fritsch Date: Fri, 8 May 2015 07:49:13 +0200 Subject: [PATCH 03/23] libva-intel-driver: pick field_rate workaround for mcdi and madi on SNB/IVB --- ...river-03-enable-field-rate-mcdi-madi.patch | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 packages/multimedia/libva-intel-driver/patches/libva-intel-driver-03-enable-field-rate-mcdi-madi.patch diff --git a/packages/multimedia/libva-intel-driver/patches/libva-intel-driver-03-enable-field-rate-mcdi-madi.patch b/packages/multimedia/libva-intel-driver/patches/libva-intel-driver-03-enable-field-rate-mcdi-madi.patch new file mode 100644 index 0000000000..cf0b52c49c --- /dev/null +++ b/packages/multimedia/libva-intel-driver/patches/libva-intel-driver-03-enable-field-rate-mcdi-madi.patch @@ -0,0 +1,39 @@ +From: Andy Furniss + +Signed-off-by: Andy Furniss +--- + src/i965_post_processing.c | 12 ++---------- + 1 file changed, 2 insertions(+), 10 deletions(-) + +diff --git a/src/i965_post_processing.c b/src/i965_post_processing.c +index fefc5d7..edee114 100755 +--- a/src/i965_post_processing.c ++++ b/src/i965_post_processing.c +@@ -3423,11 +3423,7 @@ pp_nv12_dndi_initialize(VADriverContextP ctx, struct i965_post_processing_contex + obj_surface->orig_width, obj_surface->orig_height, obj_surface->width, + I965_SURFACEFORMAT_R8_UNORM, 20, 1); + +- /* If we are in "First Frame" mode, i.e. past frames are not +- available for motion measure, then don't use the TFF flag */ +- dndi_top_first = !(deint_params->flags & (dndi_ctx->is_first_frame ? +- VA_DEINTERLACING_BOTTOM_FIELD : +- VA_DEINTERLACING_BOTTOM_FIELD_FIRST)); ++ dndi_top_first = !(deint_params->flags & VA_DEINTERLACING_BOTTOM_FIELD); + + /* sampler dndi */ + dri_bo_map(pp_context->sampler_state_table.bo, True); +@@ -3833,11 +3829,7 @@ gen7_pp_nv12_dndi_initialize(VADriverContextP ctx, struct i965_post_processing_c + obj_surface->orig_width, obj_surface->orig_height, obj_surface->width, + I965_SURFACEFORMAT_R8_UNORM, 33, 1); + +- /* If we are in "First Frame" mode, i.e. past frames are not +- available for motion measure, then don't use the TFF flag */ +- dndi_top_first = !(deint_params->flags & (dndi_ctx->is_first_frame ? +- VA_DEINTERLACING_BOTTOM_FIELD : +- VA_DEINTERLACING_BOTTOM_FIELD_FIRST)); ++ dndi_top_first = !(deint_params->flags & VA_DEINTERLACING_BOTTOM_FIELD); + + /* sampler dndi */ + dri_bo_map(pp_context->sampler_state_table.bo, True); +-- +1.7.9.5 From e8cd8e8f3179115a597e5b54d021ed97aecc673f Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Fri, 8 May 2015 12:23:40 +0200 Subject: [PATCH 04/23] linux: update to linux-4.0.2 Signed-off-by: Stephan Raue --- packages/linux/package.mk | 2 +- .../patches/{4.0.1 => 4.0.2}/linux-003-no_dev_console.patch | 0 .../{4.0.1 => 4.0.2}/linux-051-ouya_controller_support.patch | 0 .../{4.0.1 => 4.0.2}/linux-052-XBOX_remote_support.patch | 0 .../{4.0.1 => 4.0.2}/linux-053-spinelplus-remote-0.2.patch | 0 ...ton_revert_d7b290a1056c5564eec8a1b169c6e84ff3.6.114c13.patch | 0 .../linux-056-add_Adaptec_eHome_Infrared_Receiver.patch | 0 ...57-Removed-MCE-customer-code-restriction-in-rc6-decode.patch | 0 .../linux-057-add_SMK_Manufacturing_Inc_Infrared_Receiver.patch | 0 .../linux-058.05-hid_sony-add_autorepeat_for_PS3_remotes.patch | 0 .../{4.0.1 => 4.0.2}/linux-062-imon_pad_ignore_diagonal.patch | 0 .../linux-203-stb0899_enable_low_symbol_rate.patch | 0 .../{4.0.1 => 4.0.2}/linux-212-mantis_stb0899_faster_lock.patch | 0 .../patches/{4.0.1 => 4.0.2}/linux-221-ngene-octopus.patch | 0 .../{4.0.1 => 4.0.2}/linux-222-stb0899_signal_quality.patch | 0 .../linux-223-Fix-video-artifacts-with-tt-3600-s2-usb.patch | 0 .../{4.0.1 => 4.0.2}/linux-224-STK1160-addFramescaling.patch | 0 .../{4.0.1 => 4.0.2}/linux-227-ds3000-invalid-symbol-rate.patch | 0 .../{4.0.1 => 4.0.2}/linux-228-technotrend-s2-4600.patch | 0 .../patches/{4.0.1 => 4.0.2}/linux-229-hauppauge-hvr-955q.patch | 0 .../linux/patches/{4.0.1 => 4.0.2}/linux-706-Sitecom-N300.patch | 0 .../linux-950-saa716x_PCIe_interface_chipset.patch | 0 ...990.06-hda-Avoid-outputting-HDMI-audio-before-prepare-.patch | 0 .../{4.0.1 => 4.0.2}/linux-995-CX24120-13Z_frontend.patch | 0 .../{4.0.1 => 4.0.2}/linux-999-i915-use-legacy-turbo.patch | 0 ...999.02-0001-pm-disable-async-suspend-resume-by-default.patch | 0 ...5-eMMC-Don-t-initialize-partitions-on-RPMB-flagged-are.patch | 0 .../{4.0.1 => 4.0.2}/linux-999.10-amd-limited-color-range.patch | 0 28 files changed, 1 insertion(+), 1 deletion(-) rename packages/linux/patches/{4.0.1 => 4.0.2}/linux-003-no_dev_console.patch (100%) rename packages/linux/patches/{4.0.1 => 4.0.2}/linux-051-ouya_controller_support.patch (100%) rename packages/linux/patches/{4.0.1 => 4.0.2}/linux-052-XBOX_remote_support.patch (100%) rename packages/linux/patches/{4.0.1 => 4.0.2}/linux-053-spinelplus-remote-0.2.patch (100%) rename packages/linux/patches/{4.0.1 => 4.0.2}/linux-054-nuvoton_revert_d7b290a1056c5564eec8a1b169c6e84ff3.6.114c13.patch (100%) rename packages/linux/patches/{4.0.1 => 4.0.2}/linux-056-add_Adaptec_eHome_Infrared_Receiver.patch (100%) rename packages/linux/patches/{4.0.1 => 4.0.2}/linux-057-Removed-MCE-customer-code-restriction-in-rc6-decode.patch (100%) rename packages/linux/patches/{4.0.1 => 4.0.2}/linux-057-add_SMK_Manufacturing_Inc_Infrared_Receiver.patch (100%) rename packages/linux/patches/{4.0.1 => 4.0.2}/linux-058.05-hid_sony-add_autorepeat_for_PS3_remotes.patch (100%) rename packages/linux/patches/{4.0.1 => 4.0.2}/linux-062-imon_pad_ignore_diagonal.patch (100%) rename packages/linux/patches/{4.0.1 => 4.0.2}/linux-203-stb0899_enable_low_symbol_rate.patch (100%) rename packages/linux/patches/{4.0.1 => 4.0.2}/linux-212-mantis_stb0899_faster_lock.patch (100%) rename packages/linux/patches/{4.0.1 => 4.0.2}/linux-221-ngene-octopus.patch (100%) rename packages/linux/patches/{4.0.1 => 4.0.2}/linux-222-stb0899_signal_quality.patch (100%) rename packages/linux/patches/{4.0.1 => 4.0.2}/linux-223-Fix-video-artifacts-with-tt-3600-s2-usb.patch (100%) rename packages/linux/patches/{4.0.1 => 4.0.2}/linux-224-STK1160-addFramescaling.patch (100%) rename packages/linux/patches/{4.0.1 => 4.0.2}/linux-227-ds3000-invalid-symbol-rate.patch (100%) rename packages/linux/patches/{4.0.1 => 4.0.2}/linux-228-technotrend-s2-4600.patch (100%) rename packages/linux/patches/{4.0.1 => 4.0.2}/linux-229-hauppauge-hvr-955q.patch (100%) rename packages/linux/patches/{4.0.1 => 4.0.2}/linux-706-Sitecom-N300.patch (100%) rename packages/linux/patches/{4.0.1 => 4.0.2}/linux-950-saa716x_PCIe_interface_chipset.patch (100%) rename packages/linux/patches/{4.0.1 => 4.0.2}/linux-990.06-hda-Avoid-outputting-HDMI-audio-before-prepare-.patch (100%) rename packages/linux/patches/{4.0.1 => 4.0.2}/linux-995-CX24120-13Z_frontend.patch (100%) rename packages/linux/patches/{4.0.1 => 4.0.2}/linux-999-i915-use-legacy-turbo.patch (100%) rename packages/linux/patches/{4.0.1 => 4.0.2}/linux-999.02-0001-pm-disable-async-suspend-resume-by-default.patch (100%) rename packages/linux/patches/{4.0.1 => 4.0.2}/linux-999.05-eMMC-Don-t-initialize-partitions-on-RPMB-flagged-are.patch (100%) rename packages/linux/patches/{4.0.1 => 4.0.2}/linux-999.10-amd-limited-color-range.patch (100%) diff --git a/packages/linux/package.mk b/packages/linux/package.mk index 9ee7fa1bb0..beb4790b05 100644 --- a/packages/linux/package.mk +++ b/packages/linux/package.mk @@ -27,7 +27,7 @@ case "$LINUX" in PKG_URL="$DISTRO_SRC/$PKG_NAME-$PKG_VERSION.tar.xz" ;; *) - PKG_VERSION="4.0.1" + PKG_VERSION="4.0.2" PKG_URL="http://www.kernel.org/pub/linux/kernel/v4.x/$PKG_NAME-$PKG_VERSION.tar.xz" ;; esac diff --git a/packages/linux/patches/4.0.1/linux-003-no_dev_console.patch b/packages/linux/patches/4.0.2/linux-003-no_dev_console.patch similarity index 100% rename from packages/linux/patches/4.0.1/linux-003-no_dev_console.patch rename to packages/linux/patches/4.0.2/linux-003-no_dev_console.patch diff --git a/packages/linux/patches/4.0.1/linux-051-ouya_controller_support.patch b/packages/linux/patches/4.0.2/linux-051-ouya_controller_support.patch similarity index 100% rename from packages/linux/patches/4.0.1/linux-051-ouya_controller_support.patch rename to packages/linux/patches/4.0.2/linux-051-ouya_controller_support.patch diff --git a/packages/linux/patches/4.0.1/linux-052-XBOX_remote_support.patch b/packages/linux/patches/4.0.2/linux-052-XBOX_remote_support.patch similarity index 100% rename from packages/linux/patches/4.0.1/linux-052-XBOX_remote_support.patch rename to packages/linux/patches/4.0.2/linux-052-XBOX_remote_support.patch diff --git a/packages/linux/patches/4.0.1/linux-053-spinelplus-remote-0.2.patch b/packages/linux/patches/4.0.2/linux-053-spinelplus-remote-0.2.patch similarity index 100% rename from packages/linux/patches/4.0.1/linux-053-spinelplus-remote-0.2.patch rename to packages/linux/patches/4.0.2/linux-053-spinelplus-remote-0.2.patch diff --git a/packages/linux/patches/4.0.1/linux-054-nuvoton_revert_d7b290a1056c5564eec8a1b169c6e84ff3.6.114c13.patch b/packages/linux/patches/4.0.2/linux-054-nuvoton_revert_d7b290a1056c5564eec8a1b169c6e84ff3.6.114c13.patch similarity index 100% rename from packages/linux/patches/4.0.1/linux-054-nuvoton_revert_d7b290a1056c5564eec8a1b169c6e84ff3.6.114c13.patch rename to packages/linux/patches/4.0.2/linux-054-nuvoton_revert_d7b290a1056c5564eec8a1b169c6e84ff3.6.114c13.patch diff --git a/packages/linux/patches/4.0.1/linux-056-add_Adaptec_eHome_Infrared_Receiver.patch b/packages/linux/patches/4.0.2/linux-056-add_Adaptec_eHome_Infrared_Receiver.patch similarity index 100% rename from packages/linux/patches/4.0.1/linux-056-add_Adaptec_eHome_Infrared_Receiver.patch rename to packages/linux/patches/4.0.2/linux-056-add_Adaptec_eHome_Infrared_Receiver.patch diff --git a/packages/linux/patches/4.0.1/linux-057-Removed-MCE-customer-code-restriction-in-rc6-decode.patch b/packages/linux/patches/4.0.2/linux-057-Removed-MCE-customer-code-restriction-in-rc6-decode.patch similarity index 100% rename from packages/linux/patches/4.0.1/linux-057-Removed-MCE-customer-code-restriction-in-rc6-decode.patch rename to packages/linux/patches/4.0.2/linux-057-Removed-MCE-customer-code-restriction-in-rc6-decode.patch diff --git a/packages/linux/patches/4.0.1/linux-057-add_SMK_Manufacturing_Inc_Infrared_Receiver.patch b/packages/linux/patches/4.0.2/linux-057-add_SMK_Manufacturing_Inc_Infrared_Receiver.patch similarity index 100% rename from packages/linux/patches/4.0.1/linux-057-add_SMK_Manufacturing_Inc_Infrared_Receiver.patch rename to packages/linux/patches/4.0.2/linux-057-add_SMK_Manufacturing_Inc_Infrared_Receiver.patch diff --git a/packages/linux/patches/4.0.1/linux-058.05-hid_sony-add_autorepeat_for_PS3_remotes.patch b/packages/linux/patches/4.0.2/linux-058.05-hid_sony-add_autorepeat_for_PS3_remotes.patch similarity index 100% rename from packages/linux/patches/4.0.1/linux-058.05-hid_sony-add_autorepeat_for_PS3_remotes.patch rename to packages/linux/patches/4.0.2/linux-058.05-hid_sony-add_autorepeat_for_PS3_remotes.patch diff --git a/packages/linux/patches/4.0.1/linux-062-imon_pad_ignore_diagonal.patch b/packages/linux/patches/4.0.2/linux-062-imon_pad_ignore_diagonal.patch similarity index 100% rename from packages/linux/patches/4.0.1/linux-062-imon_pad_ignore_diagonal.patch rename to packages/linux/patches/4.0.2/linux-062-imon_pad_ignore_diagonal.patch diff --git a/packages/linux/patches/4.0.1/linux-203-stb0899_enable_low_symbol_rate.patch b/packages/linux/patches/4.0.2/linux-203-stb0899_enable_low_symbol_rate.patch similarity index 100% rename from packages/linux/patches/4.0.1/linux-203-stb0899_enable_low_symbol_rate.patch rename to packages/linux/patches/4.0.2/linux-203-stb0899_enable_low_symbol_rate.patch diff --git a/packages/linux/patches/4.0.1/linux-212-mantis_stb0899_faster_lock.patch b/packages/linux/patches/4.0.2/linux-212-mantis_stb0899_faster_lock.patch similarity index 100% rename from packages/linux/patches/4.0.1/linux-212-mantis_stb0899_faster_lock.patch rename to packages/linux/patches/4.0.2/linux-212-mantis_stb0899_faster_lock.patch diff --git a/packages/linux/patches/4.0.1/linux-221-ngene-octopus.patch b/packages/linux/patches/4.0.2/linux-221-ngene-octopus.patch similarity index 100% rename from packages/linux/patches/4.0.1/linux-221-ngene-octopus.patch rename to packages/linux/patches/4.0.2/linux-221-ngene-octopus.patch diff --git a/packages/linux/patches/4.0.1/linux-222-stb0899_signal_quality.patch b/packages/linux/patches/4.0.2/linux-222-stb0899_signal_quality.patch similarity index 100% rename from packages/linux/patches/4.0.1/linux-222-stb0899_signal_quality.patch rename to packages/linux/patches/4.0.2/linux-222-stb0899_signal_quality.patch diff --git a/packages/linux/patches/4.0.1/linux-223-Fix-video-artifacts-with-tt-3600-s2-usb.patch b/packages/linux/patches/4.0.2/linux-223-Fix-video-artifacts-with-tt-3600-s2-usb.patch similarity index 100% rename from packages/linux/patches/4.0.1/linux-223-Fix-video-artifacts-with-tt-3600-s2-usb.patch rename to packages/linux/patches/4.0.2/linux-223-Fix-video-artifacts-with-tt-3600-s2-usb.patch diff --git a/packages/linux/patches/4.0.1/linux-224-STK1160-addFramescaling.patch b/packages/linux/patches/4.0.2/linux-224-STK1160-addFramescaling.patch similarity index 100% rename from packages/linux/patches/4.0.1/linux-224-STK1160-addFramescaling.patch rename to packages/linux/patches/4.0.2/linux-224-STK1160-addFramescaling.patch diff --git a/packages/linux/patches/4.0.1/linux-227-ds3000-invalid-symbol-rate.patch b/packages/linux/patches/4.0.2/linux-227-ds3000-invalid-symbol-rate.patch similarity index 100% rename from packages/linux/patches/4.0.1/linux-227-ds3000-invalid-symbol-rate.patch rename to packages/linux/patches/4.0.2/linux-227-ds3000-invalid-symbol-rate.patch diff --git a/packages/linux/patches/4.0.1/linux-228-technotrend-s2-4600.patch b/packages/linux/patches/4.0.2/linux-228-technotrend-s2-4600.patch similarity index 100% rename from packages/linux/patches/4.0.1/linux-228-technotrend-s2-4600.patch rename to packages/linux/patches/4.0.2/linux-228-technotrend-s2-4600.patch diff --git a/packages/linux/patches/4.0.1/linux-229-hauppauge-hvr-955q.patch b/packages/linux/patches/4.0.2/linux-229-hauppauge-hvr-955q.patch similarity index 100% rename from packages/linux/patches/4.0.1/linux-229-hauppauge-hvr-955q.patch rename to packages/linux/patches/4.0.2/linux-229-hauppauge-hvr-955q.patch diff --git a/packages/linux/patches/4.0.1/linux-706-Sitecom-N300.patch b/packages/linux/patches/4.0.2/linux-706-Sitecom-N300.patch similarity index 100% rename from packages/linux/patches/4.0.1/linux-706-Sitecom-N300.patch rename to packages/linux/patches/4.0.2/linux-706-Sitecom-N300.patch diff --git a/packages/linux/patches/4.0.1/linux-950-saa716x_PCIe_interface_chipset.patch b/packages/linux/patches/4.0.2/linux-950-saa716x_PCIe_interface_chipset.patch similarity index 100% rename from packages/linux/patches/4.0.1/linux-950-saa716x_PCIe_interface_chipset.patch rename to packages/linux/patches/4.0.2/linux-950-saa716x_PCIe_interface_chipset.patch diff --git a/packages/linux/patches/4.0.1/linux-990.06-hda-Avoid-outputting-HDMI-audio-before-prepare-.patch b/packages/linux/patches/4.0.2/linux-990.06-hda-Avoid-outputting-HDMI-audio-before-prepare-.patch similarity index 100% rename from packages/linux/patches/4.0.1/linux-990.06-hda-Avoid-outputting-HDMI-audio-before-prepare-.patch rename to packages/linux/patches/4.0.2/linux-990.06-hda-Avoid-outputting-HDMI-audio-before-prepare-.patch diff --git a/packages/linux/patches/4.0.1/linux-995-CX24120-13Z_frontend.patch b/packages/linux/patches/4.0.2/linux-995-CX24120-13Z_frontend.patch similarity index 100% rename from packages/linux/patches/4.0.1/linux-995-CX24120-13Z_frontend.patch rename to packages/linux/patches/4.0.2/linux-995-CX24120-13Z_frontend.patch diff --git a/packages/linux/patches/4.0.1/linux-999-i915-use-legacy-turbo.patch b/packages/linux/patches/4.0.2/linux-999-i915-use-legacy-turbo.patch similarity index 100% rename from packages/linux/patches/4.0.1/linux-999-i915-use-legacy-turbo.patch rename to packages/linux/patches/4.0.2/linux-999-i915-use-legacy-turbo.patch diff --git a/packages/linux/patches/4.0.1/linux-999.02-0001-pm-disable-async-suspend-resume-by-default.patch b/packages/linux/patches/4.0.2/linux-999.02-0001-pm-disable-async-suspend-resume-by-default.patch similarity index 100% rename from packages/linux/patches/4.0.1/linux-999.02-0001-pm-disable-async-suspend-resume-by-default.patch rename to packages/linux/patches/4.0.2/linux-999.02-0001-pm-disable-async-suspend-resume-by-default.patch diff --git a/packages/linux/patches/4.0.1/linux-999.05-eMMC-Don-t-initialize-partitions-on-RPMB-flagged-are.patch b/packages/linux/patches/4.0.2/linux-999.05-eMMC-Don-t-initialize-partitions-on-RPMB-flagged-are.patch similarity index 100% rename from packages/linux/patches/4.0.1/linux-999.05-eMMC-Don-t-initialize-partitions-on-RPMB-flagged-are.patch rename to packages/linux/patches/4.0.2/linux-999.05-eMMC-Don-t-initialize-partitions-on-RPMB-flagged-are.patch diff --git a/packages/linux/patches/4.0.1/linux-999.10-amd-limited-color-range.patch b/packages/linux/patches/4.0.2/linux-999.10-amd-limited-color-range.patch similarity index 100% rename from packages/linux/patches/4.0.1/linux-999.10-amd-limited-color-range.patch rename to packages/linux/patches/4.0.2/linux-999.10-amd-limited-color-range.patch From adea9a8b5c01efbe2d6445315dede06a37c4be30 Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Fri, 8 May 2015 12:24:20 +0200 Subject: [PATCH 05/23] sqlite: update to sqlite-autoconf-3081000 Signed-off-by: Stephan Raue --- packages/databases/sqlite/package.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/databases/sqlite/package.mk b/packages/databases/sqlite/package.mk index 75c3dc8836..01a2a473b9 100644 --- a/packages/databases/sqlite/package.mk +++ b/packages/databases/sqlite/package.mk @@ -17,7 +17,7 @@ ################################################################################ PKG_NAME="sqlite" -PKG_VERSION="autoconf-3080900" +PKG_VERSION="autoconf-3081000" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="PublicDomain" From d400fd9e69a0b627bc0aee4e6c89e97f3fefdff9 Mon Sep 17 00:00:00 2001 From: Lukas Rusak Date: Fri, 8 May 2015 18:35:55 -0700 Subject: [PATCH 06/23] [libressl] fix certificate name --- packages/security/libressl/package.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/security/libressl/package.mk b/packages/security/libressl/package.mk index a8b1eebbe3..13256fca48 100644 --- a/packages/security/libressl/package.mk +++ b/packages/security/libressl/package.mk @@ -37,8 +37,8 @@ post_makeinstall_target() { # download url: http://curl.haxx.se # create new cert: perl ./mk-ca-bundle.pl mkdir -p $INSTALL/$SSL_CERTIFICATES - cp $PKG_DIR/cert/ca-bundle.crt $INSTALL/$SSL_CERTIFICATES/cert.pem + cp $PKG_DIR/cert/ca-bundle.crt $INSTALL/$SSL_CERTIFICATES/cacert.pem # backwards comatibility mkdir -p $INSTALL/etc/pki/tls - ln -sf $SSL_CERTIFICATES/cert.pem $INSTALL/etc/pki/tls/cacert.pem + ln -sf $SSL_CERTIFICATES/cacert.pem $INSTALL/etc/pki/tls/cacert.pem } From 9db0648dae04e58f411bfaa6b0a2c4ab8ce2afd6 Mon Sep 17 00:00:00 2001 From: Stefan Saraev Date: Sat, 9 May 2015 11:21:19 +0300 Subject: [PATCH 07/23] libressl: symlink cert.pem --- packages/security/libressl/package.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/security/libressl/package.mk b/packages/security/libressl/package.mk index 13256fca48..73a1a3d3f5 100644 --- a/packages/security/libressl/package.mk +++ b/packages/security/libressl/package.mk @@ -41,4 +41,5 @@ post_makeinstall_target() { # backwards comatibility mkdir -p $INSTALL/etc/pki/tls ln -sf $SSL_CERTIFICATES/cacert.pem $INSTALL/etc/pki/tls/cacert.pem + ln -sf $SSL_CERTIFICATES/cacert.pem $INSTALL/etc/ssl/cert.pem } From 678af3f01f7bf7de475627be4ad9a82cdae41690 Mon Sep 17 00:00:00 2001 From: Stefan Saraev Date: Mon, 4 May 2015 21:02:03 +0300 Subject: [PATCH 08/23] new package: platform --- packages/mediacenter/platform/package.mk | 48 +++++ .../platform-01-revert-cc-badness.patch | 30 +++ .../patches/platform-02-add-PR6.patch | 199 ++++++++++++++++++ 3 files changed, 277 insertions(+) create mode 100644 packages/mediacenter/platform/package.mk create mode 100644 packages/mediacenter/platform/patches/platform-01-revert-cc-badness.patch create mode 100644 packages/mediacenter/platform/patches/platform-02-add-PR6.patch diff --git a/packages/mediacenter/platform/package.mk b/packages/mediacenter/platform/package.mk new file mode 100644 index 0000000000..2f10fb6be1 --- /dev/null +++ b/packages/mediacenter/platform/package.mk @@ -0,0 +1,48 @@ +################################################################################ +# This file is part of OpenELEC - http://www.openelec.tv +# Copyright (C) 2009-2014 Stephan Raue (stephan@openelec.tv) +# +# OpenELEC is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# OpenELEC 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with OpenELEC. If not, see . +################################################################################ + +PKG_NAME="platform" +PKG_VERSION="1.0.6" +PKG_REV="1" +PKG_ARCH="any" +PKG_LICENSE="GPL" +PKG_SITE="http://www.kodi.tv" +PKG_URL="http://mirrors.xbmc.org/build-deps/sources/$PKG_NAME-$PKG_VERSION.tar.gz" +PKG_DEPENDS_TARGET="toolchain" +PKG_PRIORITY="optional" +PKG_SECTION="multimedia" +PKG_SHORTDESC="platform:" +PKG_LONGDESC="platform:" + +PKG_IS_ADDON="no" +PKG_AUTORECONF="no" + +configure_target() { + cmake -DCMAKE_TOOLCHAIN_FILE=$CMAKE_CONF \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_INSTALL_LIBDIR=/usr/lib \ + -DCMAKE_INSTALL_LIBDIR_NOARCH=/usr/lib \ + -DCMAKE_INSTALL_PREFIX_TOOLCHAIN=$SYSROOT_PREFIX/usr \ + -DCMAKE_PREFIX_PATH=$SYSROOT_PREFIX/usr \ + -DBUILD_SHARED_LIBS=0 \ + .. +} + +post_makeinstall_target() { + rm -rf $INSTALL/usr +} diff --git a/packages/mediacenter/platform/patches/platform-01-revert-cc-badness.patch b/packages/mediacenter/platform/patches/platform-01-revert-cc-badness.patch new file mode 100644 index 0000000000..3e7e5ebcc7 --- /dev/null +++ b/packages/mediacenter/platform/patches/platform-01-revert-cc-badness.patch @@ -0,0 +1,30 @@ +From f91594676d1f75530addd87363ccbc6510efb84e Mon Sep 17 00:00:00 2001 +From: Stefan Saraev +Date: Fri, 8 May 2015 11:19:42 +0300 +Subject: [PATCH] revert cc badness + +this reverts upstream commit 68f8418 +--- + CMakeLists.txt | 6 ------ + 1 file changed, 6 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 73fae2e..dc3e1b5 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -22,12 +22,6 @@ if(WIN32) + src/windows/os-threads.cpp) + endif() + +-set(platform_INCLUDE_DIRS "${CMAKE_INSTALL_PREFIX}/include/platform") +-IF(WIN32) +- LIST(APPEND platform_INCLUDE_DIRS "${CMAKE_INSTALL_PREFIX}/include/platform/windows") +-ENDIF(WIN32) +-set(platform_LIBRARIES ${CMAKE_THREAD_LIBS_INIT}) +- + if(NOT ${CORE_SYSTEM_NAME} STREQUAL "") + if(${CORE_SYSTEM_NAME} STREQUAL "darwin" OR ${CORE_SYSTEM_NAME} STREQUAL "ios") + list(APPEND platform_LIBRARIES "-framework CoreVideo -framework IOKit") +-- +1.7.10.4 + diff --git a/packages/mediacenter/platform/patches/platform-02-add-PR6.patch b/packages/mediacenter/platform/patches/platform-02-add-PR6.patch new file mode 100644 index 0000000000..9a09e3931c --- /dev/null +++ b/packages/mediacenter/platform/patches/platform-02-add-PR6.patch @@ -0,0 +1,199 @@ +From 8ff719d94b664378f3ebb61166454eef7cb20c25 Mon Sep 17 00:00:00 2001 +From: Stephan Raue +Date: Sat, 9 May 2015 17:13:25 +0200 +Subject: [PATCH] readd sockets/cdevsocket.h, needed by IMX6 and TDA995x + +--- + CMakeLists.txt | 3 +- + src/posix/os-socket.h | 16 +++++++ + src/posix/os-types.h | 2 + + src/sockets/cdevsocket.h | 117 +++++++++++++++++++++++++++++++++++++++++++++++ + 4 files changed, 137 insertions(+), 1 deletion(-) + create mode 100644 src/sockets/cdevsocket.h + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 8164286..9f577b3 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -56,7 +56,8 @@ ELSE(WIN32) + src/posix/os-types.h + DESTINATION include/platform/posix) + ENDIF(WIN32) +-install(FILES src/sockets/socket.h ++install(FILES src/sockets/cdevsocket.h ++ src/sockets/socket.h + src/sockets/tcp.h + DESTINATION include/platform/sockets) + install(FILES src/threads/atomics.h +diff --git a/src/posix/os-socket.h b/src/posix/os-socket.h +index 60c8507..05888c2 100644 +--- a/src/posix/os-socket.h ++++ b/src/posix/os-socket.h +@@ -36,6 +36,7 @@ + #include "../util/timeutils.h" + #include + #include ++#include + #include + #include + #include +@@ -164,8 +165,23 @@ namespace PLATFORM + + return iBytesRead; + } ++ ++ inline int SocketIoctl(socket_t socket, int *iError, int request, void* data) ++ { ++ if (socket == INVALID_SOCKET_VALUE) ++ { ++ *iError = EINVAL; ++ return -1; ++ } ++ ++ int iReturn = ioctl(socket, request, data); ++ if (iReturn < 0) ++ *iError = errno; ++ return iReturn; ++ } + //@} + ++ + // TCP + //@{ + inline void TcpSocketClose(tcp_socket_t socket) +diff --git a/src/posix/os-types.h b/src/posix/os-types.h +index 6134080..b48f330 100644 +--- a/src/posix/os-types.h ++++ b/src/posix/os-types.h +@@ -61,6 +61,8 @@ typedef socket_t tcp_socket_t; + #define INVALID_SOCKET_VALUE (-1) + typedef socket_t serial_socket_t; + #define INVALID_SERIAL_SOCKET_VALUE (-1) ++typedef socket_t chardev_socket_t; ++#define INVALID_CHARDEV_SOCKET_VALUE (-1) + + typedef long LONG; + #if !defined(__APPLE__) +diff --git a/src/sockets/cdevsocket.h b/src/sockets/cdevsocket.h +new file mode 100644 +index 0000000..a5ac338 +--- /dev/null ++++ b/src/sockets/cdevsocket.h +@@ -0,0 +1,117 @@ ++#pragma once ++/* ++ * This file is part of the libCEC(R) library. ++ * ++ * libCEC(R) is Copyright (C) 2011-2013 Pulse-Eight Limited. All rights reserved. ++ * libCEC(R) is an original work, containing original code. ++ * ++ * libCEC(R) is a trademark of Pulse-Eight Limited. ++ * ++ * This program is dual-licensed; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 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 General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ++ * ++ * ++ * Alternatively, you can license this library under a commercial license, ++ * please contact Pulse-Eight Licensing for more information. ++ * ++ * For more information contact: ++ * Pulse-Eight Licensing ++ * http://www.pulse-eight.com/ ++ * http://www.pulse-eight.net/ ++ */ ++ ++#include "../os.h" ++#include "../util/buffer.h" ++ ++#include ++#include ++ ++#if !defined(__WINDOWS__) ++#include ++#endif ++ ++#include "socket.h" ++ ++namespace PLATFORM ++{ ++ class CCDevSocket : public CCommonSocket ++ { ++ public: ++ CCDevSocket(const std::string &strName ) : ++ CCommonSocket(INVALID_CHARDEV_SOCKET_VALUE, strName) ++ #ifdef __WINDOWS__ ++ ,m_iCurrentReadTimeout(MAXDWORD) ++ #endif ++ {} ++ ++ virtual ~CCDevSocket(void) ++ { ++ Close(); ++ } ++ ++ virtual bool Open(uint64_t iTimeoutMs = 0) ++ { ++ (void)iTimeoutMs; ++ ++ if (IsOpen()) ++ return false; ++ ++ m_socket = open(m_strName.c_str(), O_RDWR ); ++ ++ if (m_socket == INVALID_CHARDEV_SOCKET_VALUE) ++ { ++ m_strError = strerror(errno); ++ return false; ++ } ++ ++ return true; ++ } ++ ++ virtual void Close(void) ++ { ++ if (IsOpen()) ++ { ++ SocketClose(m_socket); ++ m_socket = INVALID_CHARDEV_SOCKET_VALUE; ++ } ++ } ++ ++ virtual void Shutdown(void) ++ { ++ SocketClose(m_socket); ++ } ++ ++ virtual int Ioctl(int request, void* data) ++ { ++ return IsOpen() ? SocketIoctl(m_socket, &m_iError, request, data) : -1; ++ } ++ ++ virtual ssize_t Write(void* data, size_t len) ++ { ++ return IsOpen() ? SocketWrite(m_socket, &m_iError, data, len) : -1; ++ } ++ ++ virtual ssize_t Read(void* data, size_t len, uint64_t iTimeoutMs = 0) ++ { ++ return IsOpen() ? SocketRead(m_socket, &m_iError, data, len, iTimeoutMs) : -1; ++ } ++ ++ virtual bool IsOpen(void) ++ { ++ return m_socket != INVALID_CHARDEV_SOCKET_VALUE; ++ } ++ }; ++ ++}; ++ From 7ad44582446c84742d4760b64afe9e8f650de584 Mon Sep 17 00:00:00 2001 From: Stefan Saraev Date: Mon, 4 May 2015 21:02:39 +0300 Subject: [PATCH 09/23] libcec: update to libcec-3.0.0 --- packages/devel/libcec/package.mk | 49 ++-- .../patches/libcec-00-imx6-support.patch | 250 +++++++++++------- 2 files changed, 175 insertions(+), 124 deletions(-) diff --git a/packages/devel/libcec/package.mk b/packages/devel/libcec/package.mk index 9805f89918..9d21bed724 100644 --- a/packages/devel/libcec/package.mk +++ b/packages/devel/libcec/package.mk @@ -17,46 +17,49 @@ ################################################################################ PKG_NAME="libcec" -PKG_VERSION="2.2.0" +PKG_VERSION="3.0.0" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="GPL" PKG_SITE="http://libcec.pulse-eight.com/" -PKG_URL="http://mirrors.xbmc.org/build-deps/sources/$PKG_NAME-$PKG_VERSION-3.tar.gz" -PKG_DEPENDS_TARGET="toolchain systemd lockdev" +PKG_URL="http://mirrors.xbmc.org/build-deps/sources/$PKG_NAME-$PKG_VERSION-6.tar.gz" +PKG_DEPENDS_TARGET="toolchain systemd lockdev platform" PKG_PRIORITY="optional" PKG_SECTION="system" PKG_SHORTDESC="libCEC is an open-source dual licensed library designed for communicating with the Pulse-Eight USB - CEC Adaptor" PKG_LONGDESC="libCEC is an open-source dual licensed library designed for communicating with the Pulse-Eight USB - CEC Adaptor." PKG_IS_ADDON="no" -PKG_AUTORECONF="yes" - -PKG_CONFIGURE_OPTS_TARGET="--disable-cubox --disable-exynos" +PKG_AUTORECONF="no" if [ "$KODIPLAYER_DRIVER" = "bcm2835-driver" ]; then PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET bcm2835-driver" - - export CFLAGS="$CFLAGS \ - -I$SYSROOT_PREFIX/usr/include/interface/vcos/pthreads/ \ - -I$SYSROOT_PREFIX/usr/include/interface/vmcs_host/linux" - export CXXFLAGS="$CXXFLAGS \ - -I$SYSROOT_PREFIX/usr/include/interface/vcos/pthreads/ \ - -I$SYSROOT_PREFIX/usr/include/interface/vmcs_host/linux" - - PKG_CONFIGURE_OPTS_TARGET="$PKG_CONFIGURE_OPTS_TARGET --enable-rpi \ - --with-rpi-include-path=$SYSROOT_PREFIX/usr/include \ - --with-rpi-lib-path=$SYSROOT_PREFIX/usr/lib" -else - PKG_CONFIGURE_OPTS_TARGET="$PKG_CONFIGURE_OPTS_TARGET --disable-rpi" fi if [ "$KODIPLAYER_DRIVER" = "libfslvpuwrap" ]; then - PKG_CONFIGURE_OPTS_TARGET="$PKG_CONFIGURE_OPTS_TARGET --enable-imx6" + EXTRA_CMAKE_OPTS="-DHAVE_IMX_API=1" else - PKG_CONFIGURE_OPTS_TARGET="$PKG_CONFIGURE_OPTS_TARGET --disable-imx6" + EXTRA_CMAKE_OPTS="-DHAVE_IMX_API=0" fi +configure_target() { + if [ "$KODIPLAYER_DRIVER" = "bcm2835-driver" ]; then + export CXXFLAGS="$CXXFLAGS \ + -I$SYSROOT_PREFIX/usr/include/interface/vcos/pthreads/ \ + -I$SYSROOT_PREFIX/usr/include/interface/vmcs_host/linux" -# dont use some optimizations because of build problems - export LDFLAGS=`echo $LDFLAGS | sed -e "s|-Wl,--as-needed||"` + # detecting RPi support fails without -lvchiq_arm + export LDFLAGS="$LDFLAGS -lvchiq_arm" + fi + + cmake -DCMAKE_TOOLCHAIN_FILE=$CMAKE_CONF \ + -DBUILD_SHARED_LIBS=1 \ + -DSKIP_PYTHON_WRAPPER:STRING=1 \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_INSTALL_LIBDIR=/usr/lib \ + -DCMAKE_INSTALL_LIBDIR_NOARCH=/usr/lib \ + -DCMAKE_INSTALL_PREFIX_TOOLCHAIN=$SYSROOT_PREFIX/usr \ + -DCMAKE_PREFIX_PATH=$SYSROOT_PREFIX/usr \ + $EXTRA_CMAKE_OPTS \ + .. +} diff --git a/packages/devel/libcec/patches/libcec-00-imx6-support.patch b/packages/devel/libcec/patches/libcec-00-imx6-support.patch index 8519abb850..2c24635c46 100644 --- a/packages/devel/libcec/patches/libcec-00-imx6-support.patch +++ b/packages/devel/libcec/patches/libcec-00-imx6-support.patch @@ -1,43 +1,33 @@ -diff -Naur libcec-2.2.0/configure.ac libcec-2.2.0.patch/configure.ac ---- libcec-2.2.0/configure.ac 2014-11-01 01:51:37.000000000 +0100 -+++ libcec-2.2.0.patch/configure.ac 2014-11-10 23:14:45.210162950 +0100 -@@ -100,6 +100,14 @@ - esac - fi - -+## i.MX6 support -+AC_ARG_ENABLE([imx6], -+ [AS_HELP_STRING([--enable-imx6], -+ [enable support for freescale i.MX6 (default is no)])], -+ [use_imx6=$enableval], -+ [use_imx6=no]) -+ -+ - ## add the top dir and include to the include path, so we can include config.h and cec.h - CPPFLAGS="$CPPFLAGS -I\$(abs_top_srcdir)/src -I\$(abs_top_srcdir)/include" - -@@ -306,6 +314,17 @@ - fi - - -+## mark i.MX6 support as available -+if test "x$use_imx6" != "xno"; then -+ AC_DEFINE([HAVE_IMX_API],[1],[Define to 1 to include i.MX6 support]) -+ AM_CONDITIONAL(USE_IMX_API, true) -+ features="$features\n i.MX6 support :\t\t\tyes" -+ LIB_INFO="$LIB_INFO 'i.MX6'" -+else -+ AM_CONDITIONAL(USE_IMX_API, false) -+ features="$features\n i.MX6 support :\t\t\tno" -+fi -+ - ## check if our build system is complete - AC_CHECK_HEADER(algorithm,,AC_MSG_ERROR($msg_required_header_missing)) - AC_CHECK_HEADER(ctype.h,,AC_MSG_ERROR($msg_required_header_missing)) -diff -Naur libcec-2.2.0/include/cectypes.h libcec-2.2.0.patch/include/cectypes.h ---- libcec-2.2.0/include/cectypes.h 2014-10-28 16:20:50.000000000 +0100 -+++ libcec-2.2.0.patch/include/cectypes.h 2014-11-10 23:21:37.347945493 +0100 -@@ -307,6 +307,17 @@ +From a7f3315333c1a79259a763c6542a6cd71855b357 Mon Sep 17 00:00:00 2001 +From: Stefan Saraev +Date: Thu, 7 May 2015 11:35:04 +0300 +Subject: [PATCH] imx support + +note. I am NOT the author of the patch. just rebased it +--- + include/cectypes.h | 14 +- + src/libcec/CECTypeUtils.h | 2 + + src/libcec/adapter/AdapterFactory.cpp | 29 +- + src/libcec/adapter/IMX/AdapterMessageQueue.h | 134 +++++++++ + .../adapter/IMX/IMXCECAdapterCommunication.cpp | 328 +++++++++++++++++++++ + .../adapter/IMX/IMXCECAdapterCommunication.h | 119 ++++++++ + src/libcec/adapter/IMX/IMXCECAdapterDetection.cpp | 42 +++ + src/libcec/adapter/IMX/IMXCECAdapterDetection.h | 36 +++ + src/libcec/cmake/CheckPlatformSupport.cmake | 10 + + src/libcec/cmake/DisplayPlatformSupport.cmake | 6 + + src/libcec/env.h.in | 3 + + 11 files changed, 720 insertions(+), 3 deletions(-) + create mode 100644 src/libcec/adapter/IMX/AdapterMessageQueue.h + create mode 100644 src/libcec/adapter/IMX/IMXCECAdapterCommunication.cpp + create mode 100644 src/libcec/adapter/IMX/IMXCECAdapterCommunication.h + create mode 100644 src/libcec/adapter/IMX/IMXCECAdapterDetection.cpp + create mode 100644 src/libcec/adapter/IMX/IMXCECAdapterDetection.h + +diff --git a/include/cectypes.h b/include/cectypes.h +index acff259..0cfee8c 100644 +--- a/include/cectypes.h ++++ b/include/cectypes.h +@@ -309,6 +309,17 @@ namespace CEC { #define CEC_EXYNOS_VIRTUAL_COM "Exynos" /*! @@ -54,8 +44,8 @@ diff -Naur libcec-2.2.0/include/cectypes.h libcec-2.2.0.patch/include/cectypes.h +/*! * Mimimum client version */ - #define CEC_MIN_LIB_VERSION 2 -@@ -888,7 +899,8 @@ + #define CEC_MIN_LIB_VERSION 3 +@@ -876,7 +887,8 @@ typedef enum cec_adapter_type ADAPTERTYPE_P8_DAUGHTERBOARD = 0x2, ADAPTERTYPE_RPI = 0x100, ADAPTERTYPE_TDA995x = 0x200, @@ -64,11 +54,25 @@ diff -Naur libcec-2.2.0/include/cectypes.h libcec-2.2.0.patch/include/cectypes.h + ADAPTERTYPE_IMX = 0x400 } cec_adapter_type; - typedef struct cec_menu_language -diff -Naur libcec-2.2.0/src/lib/adapter/AdapterFactory.cpp libcec-2.2.0.patch/src/lib/adapter/AdapterFactory.cpp ---- libcec-2.2.0/src/lib/adapter/AdapterFactory.cpp 2014-10-28 16:20:50.000000000 +0100 -+++ libcec-2.2.0.patch/src/lib/adapter/AdapterFactory.cpp 2014-11-10 23:18:08.761485552 +0100 -@@ -57,6 +57,11 @@ + /** force exporting through swig */ +diff --git a/src/libcec/CECTypeUtils.h b/src/libcec/CECTypeUtils.h +index fd8046a..48cb215 100644 +--- a/src/libcec/CECTypeUtils.h ++++ b/src/libcec/CECTypeUtils.h +@@ -765,6 +765,8 @@ namespace CEC + return "Raspberry Pi"; + case ADAPTERTYPE_TDA995x: + return "TDA995x"; ++ case ADAPTERTYPE_IMX: ++ return "i.MX"; + default: + return "unknown"; + } +diff --git a/src/libcec/adapter/AdapterFactory.cpp b/src/libcec/adapter/AdapterFactory.cpp +index da05725..92e378b 100644 +--- a/src/libcec/adapter/AdapterFactory.cpp ++++ b/src/libcec/adapter/AdapterFactory.cpp +@@ -58,6 +58,11 @@ #include "Exynos/ExynosCECAdapterCommunication.h" #endif @@ -77,10 +81,10 @@ diff -Naur libcec-2.2.0/src/lib/adapter/AdapterFactory.cpp libcec-2.2.0.patch/sr +#include "IMX/IMXCECAdapterCommunication.h" +#endif + - using namespace std; using namespace CEC; -@@ -127,7 +132,22 @@ + int8_t CAdapterFactory::FindAdapters(cec_adapter *deviceList, uint8_t iBufSize, const char *strDevicePath /* = NULL */) +@@ -127,7 +132,22 @@ int8_t CAdapterFactory::DetectAdapters(cec_adapter_descriptor *deviceList, uint8 #endif @@ -104,7 +108,7 @@ diff -Naur libcec-2.2.0/src/lib/adapter/AdapterFactory.cpp libcec-2.2.0.patch/sr #error "libCEC doesn't have support for any type of adapter. please check your build system or configuration" #endif -@@ -151,11 +171,16 @@ +@@ -151,11 +171,16 @@ IAdapterCommunication *CAdapterFactory::GetInstance(const char *strPort, uint16_ return new CRPiCECAdapterCommunication(m_lib->m_cec); #endif @@ -122,9 +126,11 @@ diff -Naur libcec-2.2.0/src/lib/adapter/AdapterFactory.cpp libcec-2.2.0.patch/sr return NULL; #endif } -diff -Naur libcec-2.2.0/src/lib/adapter/IMX/AdapterMessageQueue.h libcec-2.2.0.patch/src/lib/adapter/IMX/AdapterMessageQueue.h ---- libcec-2.2.0/src/lib/adapter/IMX/AdapterMessageQueue.h 1970-01-01 01:00:00.000000000 +0100 -+++ libcec-2.2.0.patch/src/lib/adapter/IMX/AdapterMessageQueue.h 2014-11-10 23:14:45.214162390 +0100 +diff --git a/src/libcec/adapter/IMX/AdapterMessageQueue.h b/src/libcec/adapter/IMX/AdapterMessageQueue.h +new file mode 100644 +index 0000000..af6742c +--- /dev/null ++++ b/src/libcec/adapter/IMX/AdapterMessageQueue.h @@ -0,0 +1,134 @@ +#pragma once +/* @@ -159,7 +165,7 @@ diff -Naur libcec-2.2.0/src/lib/adapter/IMX/AdapterMessageQueue.h libcec-2.2.0.p + * http://www.pulse-eight.net/ + */ + -+#include "lib/platform/threads/mutex.h" ++#include "platform/threads/mutex.h" + +namespace CEC +{ @@ -260,9 +266,11 @@ diff -Naur libcec-2.2.0/src/lib/adapter/IMX/AdapterMessageQueue.h libcec-2.2.0.p + }; + +}; -diff -Naur libcec-2.2.0/src/lib/adapter/IMX/IMXCECAdapterCommunication.cpp libcec-2.2.0.patch/src/lib/adapter/IMX/IMXCECAdapterCommunication.cpp ---- libcec-2.2.0/src/lib/adapter/IMX/IMXCECAdapterCommunication.cpp 1970-01-01 01:00:00.000000000 +0100 -+++ libcec-2.2.0.patch/src/lib/adapter/IMX/IMXCECAdapterCommunication.cpp 2014-11-10 23:14:45.217161982 +0100 +diff --git a/src/libcec/adapter/IMX/IMXCECAdapterCommunication.cpp b/src/libcec/adapter/IMX/IMXCECAdapterCommunication.cpp +new file mode 100644 +index 0000000..2daa8cb +--- /dev/null ++++ b/src/libcec/adapter/IMX/IMXCECAdapterCommunication.cpp @@ -0,0 +1,328 @@ +/* + * This file is part of the libCEC(R) library. @@ -296,11 +304,11 @@ diff -Naur libcec-2.2.0/src/lib/adapter/IMX/IMXCECAdapterCommunication.cpp libce +#if defined(HAVE_IMX_API) +#include "IMXCECAdapterCommunication.h" + -+#include "lib/CECTypeUtils.h" -+#include "lib/LibCEC.h" -+#include "lib/platform/sockets/cdevsocket.h" -+#include "lib/platform/util/StdString.h" -+#include "lib/platform/util/buffer.h" ++#include "CECTypeUtils.h" ++#include "LibCEC.h" ++#include "platform/sockets/cdevsocket.h" ++#include "platform/util/StdString.h" ++#include "platform/util/buffer.h" + +/* + * Ioctl definitions from kernel header @@ -592,9 +600,11 @@ diff -Naur libcec-2.2.0/src/lib/adapter/IMX/IMXCECAdapterCommunication.cpp libce +} + +#endif // HAVE_IMX_API -diff -Naur libcec-2.2.0/src/lib/adapter/IMX/IMXCECAdapterCommunication.h libcec-2.2.0.patch/src/lib/adapter/IMX/IMXCECAdapterCommunication.h ---- libcec-2.2.0/src/lib/adapter/IMX/IMXCECAdapterCommunication.h 1970-01-01 01:00:00.000000000 +0100 -+++ libcec-2.2.0.patch/src/lib/adapter/IMX/IMXCECAdapterCommunication.h 2014-11-10 23:14:45.217161982 +0100 +diff --git a/src/libcec/adapter/IMX/IMXCECAdapterCommunication.h b/src/libcec/adapter/IMX/IMXCECAdapterCommunication.h +new file mode 100644 +index 0000000..9e899a3 +--- /dev/null ++++ b/src/libcec/adapter/IMX/IMXCECAdapterCommunication.h @@ -0,0 +1,119 @@ +#pragma once +/* @@ -626,10 +636,10 @@ diff -Naur libcec-2.2.0/src/lib/adapter/IMX/IMXCECAdapterCommunication.h libcec- + +#if defined(HAVE_IMX_API) + -+#include "lib/platform/threads/mutex.h" -+#include "lib/platform/threads/threads.h" -+#include "lib/platform/sockets/socket.h" -+#include "lib/adapter/AdapterCommunication.h" ++#include "platform/threads/mutex.h" ++#include "platform/threads/threads.h" ++#include "platform/sockets/socket.h" ++#include "adapter/AdapterCommunication.h" +#include + +#define IMX_ADAPTER_VID 0x0471 /*FIXME TBD*/ @@ -715,9 +725,11 @@ diff -Naur libcec-2.2.0/src/lib/adapter/IMX/IMXCECAdapterCommunication.h libcec- +}; + +#endif -diff -Naur libcec-2.2.0/src/lib/adapter/IMX/IMXCECAdapterDetection.cpp libcec-2.2.0.patch/src/lib/adapter/IMX/IMXCECAdapterDetection.cpp ---- libcec-2.2.0/src/lib/adapter/IMX/IMXCECAdapterDetection.cpp 1970-01-01 01:00:00.000000000 +0100 -+++ libcec-2.2.0.patch/src/lib/adapter/IMX/IMXCECAdapterDetection.cpp 2014-11-10 23:14:45.215162253 +0100 +diff --git a/src/libcec/adapter/IMX/IMXCECAdapterDetection.cpp b/src/libcec/adapter/IMX/IMXCECAdapterDetection.cpp +new file mode 100644 +index 0000000..6c93c45 +--- /dev/null ++++ b/src/libcec/adapter/IMX/IMXCECAdapterDetection.cpp @@ -0,0 +1,42 @@ +/* + * This file is part of the libCEC(R) library. @@ -761,9 +773,11 @@ diff -Naur libcec-2.2.0/src/lib/adapter/IMX/IMXCECAdapterDetection.cpp libcec-2. +} + +#endif -diff -Naur libcec-2.2.0/src/lib/adapter/IMX/IMXCECAdapterDetection.h libcec-2.2.0.patch/src/lib/adapter/IMX/IMXCECAdapterDetection.h ---- libcec-2.2.0/src/lib/adapter/IMX/IMXCECAdapterDetection.h 1970-01-01 01:00:00.000000000 +0100 -+++ libcec-2.2.0.patch/src/lib/adapter/IMX/IMXCECAdapterDetection.h 2014-11-10 23:14:45.215162253 +0100 +diff --git a/src/libcec/adapter/IMX/IMXCECAdapterDetection.h b/src/libcec/adapter/IMX/IMXCECAdapterDetection.h +new file mode 100644 +index 0000000..d54891d +--- /dev/null ++++ b/src/libcec/adapter/IMX/IMXCECAdapterDetection.h @@ -0,0 +1,36 @@ +#pragma once +/* @@ -801,31 +815,65 @@ diff -Naur libcec-2.2.0/src/lib/adapter/IMX/IMXCECAdapterDetection.h libcec-2.2. + static bool FindAdapter(void); + }; +} -diff -Naur libcec-2.2.0/src/lib/CECTypeUtils.h libcec-2.2.0.patch/src/lib/CECTypeUtils.h ---- libcec-2.2.0/src/lib/CECTypeUtils.h 2014-10-28 16:20:50.000000000 +0100 -+++ libcec-2.2.0.patch/src/lib/CECTypeUtils.h 2014-11-10 23:14:45.212162668 +0100 -@@ -877,6 +877,8 @@ - return "Raspberry Pi"; - case ADAPTERTYPE_TDA995x: - return "TDA995x"; -+ case ADAPTERTYPE_IMX: -+ return "i.MX"; - default: - return "unknown"; - } -diff -Naur libcec-2.2.0/src/lib/Makefile.am libcec-2.2.0.patch/src/lib/Makefile.am ---- libcec-2.2.0/src/lib/Makefile.am 2014-10-28 16:20:50.000000000 +0100 -+++ libcec-2.2.0.patch/src/lib/Makefile.am 2014-11-10 23:20:02.597700521 +0100 -@@ -63,6 +63,12 @@ - adapter/TDA995x/TDA995xCECAdapterCommunication.cpp - endif +diff --git a/src/libcec/cmake/CheckPlatformSupport.cmake b/src/libcec/cmake/CheckPlatformSupport.cmake +index 828cdb2..8b47795 100644 +--- a/src/libcec/cmake/CheckPlatformSupport.cmake ++++ b/src/libcec/cmake/CheckPlatformSupport.cmake +@@ -8,6 +8,7 @@ + # HAVE_RANDR 1 if xrandr is supported + # HAVE_LIBUDEV 1 if udev is supported + # HAVE_RPI_API 1 if Raspberry Pi is supported ++# HAVE_IMX_API 1 if i.MX is supported + # HAVE_TDA995X_API 1 if TDA995X is supported + # HAVE_EXYNOS_API 1 if Exynos is supported + # HAVE_P8_USB_DETECT 1 if Pulse-Eight devices can be auto-detected +@@ -87,6 +88,15 @@ else() + list(APPEND CEC_SOURCES ${CEC_SOURCES_ADAPTER_RPI}) + endif() -+## i.MX6 support -+if USE_IMX_API -+libcec_la_SOURCES += adapter/IMX/IMXCECAdapterDetection.cpp \ -+ adapter/IMX/IMXCECAdapterCommunication.cpp -+endif ++ # i.MX ++ if (HAVE_IMX_API) ++ set(LIB_INFO "${LIB_INFO}, 'IMX'") ++ set(CEC_SOURCES_ADAPTER_IMX adapter/IMX/IMXCECAdapterDetection.cpp ++ adapter/IMX/IMXCECAdapterCommunication.cpp) ++ source_group("Source Files\\adapter\\IMX" FILES ${CEC_SOURCES_ADAPTER_IMX}) ++ list(APPEND CEC_SOURCES ${CEC_SOURCES_ADAPTER_IMX}) ++ endif() + - ## Exynos support - if USE_EXYNOS_API - libcec_la_SOURCES += adapter/Exynos/ExynosCECAdapterDetection.cpp \ + # TDA995x + check_include_files("tda998x_ioctl.h;comps/tmdlHdmiCEC/inc/tmdlHdmiCEC_Types.h" HAVE_TDA995X_API) + if (HAVE_TDA995X_API) +diff --git a/src/libcec/cmake/DisplayPlatformSupport.cmake b/src/libcec/cmake/DisplayPlatformSupport.cmake +index feee111..0309c56 100644 +--- a/src/libcec/cmake/DisplayPlatformSupport.cmake ++++ b/src/libcec/cmake/DisplayPlatformSupport.cmake +@@ -32,6 +32,12 @@ else() + message(STATUS "Raspberry Pi support: no") + endif() + ++if (HAVE_IMX_API) ++ message(STATUS "i.MX support: yes") ++else() ++ message(STATUS "i.MX support: no") ++endif() ++ + if (HAVE_TDA995X_API) + message(STATUS "TDA995x support: yes") + else() +diff --git a/src/libcec/env.h.in b/src/libcec/env.h.in +index a1a1f26..f90e729 100644 +--- a/src/libcec/env.h.in ++++ b/src/libcec/env.h.in +@@ -60,6 +60,9 @@ + /* Define to 1 for Raspberry Pi support */ + #cmakedefine HAVE_RPI_API @HAVE_RPI_API@ + ++/* Define to 1 for IMX support */ ++#cmakedefine HAVE_IMX_API @HAVE_IMX_API@ ++ + /* Define to 1 for TDA995x support */ + #cmakedefine HAVE_TDA995X_API @HAVE_TDA995X_API@ + +-- +2.1.4 + From 102186ab5d6bf438ac693a66d6d15926865617cd Mon Sep 17 00:00:00 2001 From: Stefan Saraev Date: Mon, 4 May 2015 21:03:25 +0300 Subject: [PATCH 10/23] kodi: update to kodi-15.0-beta2-d6e06ad --- packages/mediacenter/kodi-theme-Confluence/package.mk | 2 +- packages/mediacenter/kodi/package.mk | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/mediacenter/kodi-theme-Confluence/package.mk b/packages/mediacenter/kodi-theme-Confluence/package.mk index 841422e493..f71d33cf93 100644 --- a/packages/mediacenter/kodi-theme-Confluence/package.mk +++ b/packages/mediacenter/kodi-theme-Confluence/package.mk @@ -17,7 +17,7 @@ ################################################################################ PKG_NAME="kodi-theme-Confluence" -PKG_VERSION="15.0-beta1-d1a2c33" +PKG_VERSION="15.0-beta2-d6e06ad" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="GPL" diff --git a/packages/mediacenter/kodi/package.mk b/packages/mediacenter/kodi/package.mk index 141c8cae04..980909a963 100644 --- a/packages/mediacenter/kodi/package.mk +++ b/packages/mediacenter/kodi/package.mk @@ -17,7 +17,7 @@ ################################################################################ PKG_NAME="kodi" -PKG_VERSION="15.0-beta1-d1a2c33" +PKG_VERSION="15.0-beta2-d6e06ad" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="GPL" From 43882cc44cdd3eceb27d16ee9575ddd72500edf6 Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Fri, 8 May 2015 20:32:28 +0200 Subject: [PATCH 11/23] libdrm: update to libdrm-2.4.61 Signed-off-by: Stephan Raue --- packages/graphics/libdrm/package.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/graphics/libdrm/package.mk b/packages/graphics/libdrm/package.mk index bb831f5648..77171128f3 100644 --- a/packages/graphics/libdrm/package.mk +++ b/packages/graphics/libdrm/package.mk @@ -17,7 +17,7 @@ ################################################################################ PKG_NAME="libdrm" -PKG_VERSION="2.4.60" +PKG_VERSION="2.4.61" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="GPL" From c189e018aa05a7f67eed7f223664a4c32e54d67e Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Sat, 9 May 2015 20:09:25 +0200 Subject: [PATCH 12/23] kodi: update to kodi-15.0-beta2-6e5ede3 Signed-off-by: Stephan Raue --- .../kodi-theme-Confluence/package.mk | 2 +- packages/mediacenter/kodi/package.mk | 2 +- .../patches/kodi-995.02-aml-cpufreq.patch | 15 - .../patches/kodi-995.11-aml.xml-support.patch | 13 - .../kodi-001-isengard-rpb-backports.patch | 3885 +++-------------- .../kodi-001-isengard-rpb-backports.patch | 3885 +++-------------- 6 files changed, 1090 insertions(+), 6712 deletions(-) delete mode 100644 packages/mediacenter/kodi/patches/kodi-995.02-aml-cpufreq.patch delete mode 100644 packages/mediacenter/kodi/patches/kodi-995.11-aml.xml-support.patch diff --git a/packages/mediacenter/kodi-theme-Confluence/package.mk b/packages/mediacenter/kodi-theme-Confluence/package.mk index f71d33cf93..16b0d9c18f 100644 --- a/packages/mediacenter/kodi-theme-Confluence/package.mk +++ b/packages/mediacenter/kodi-theme-Confluence/package.mk @@ -17,7 +17,7 @@ ################################################################################ PKG_NAME="kodi-theme-Confluence" -PKG_VERSION="15.0-beta2-d6e06ad" +PKG_VERSION="15.0-beta2-6e5ede3" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="GPL" diff --git a/packages/mediacenter/kodi/package.mk b/packages/mediacenter/kodi/package.mk index 980909a963..14d905f566 100644 --- a/packages/mediacenter/kodi/package.mk +++ b/packages/mediacenter/kodi/package.mk @@ -17,7 +17,7 @@ ################################################################################ PKG_NAME="kodi" -PKG_VERSION="15.0-beta2-d6e06ad" +PKG_VERSION="15.0-beta2-6e5ede3" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="GPL" diff --git a/packages/mediacenter/kodi/patches/kodi-995.02-aml-cpufreq.patch b/packages/mediacenter/kodi/patches/kodi-995.02-aml-cpufreq.patch deleted file mode 100644 index b2e6dc4da8..0000000000 --- a/packages/mediacenter/kodi/patches/kodi-995.02-aml-cpufreq.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff -Naur kodi-15.0-beta1-d1a2c33/xbmc/utils/AMLUtils.cpp kodi-15.0-beta1-d1a2c33.patch/xbmc/utils/AMLUtils.cpp ---- kodi-15.0-beta1-d1a2c33/xbmc/utils/AMLUtils.cpp 2015-05-03 11:53:48.000000000 +0200 -+++ kodi-15.0-beta1-d1a2c33.patch/xbmc/utils/AMLUtils.cpp 2015-05-03 20:37:14.293442201 +0200 -@@ -134,9 +134,9 @@ - { - CLog::Log(LOGERROR, "AML: no rw on /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq"); - } -- if (!SysfsUtils::HasRW("/sys/devices/cpu/cpu/cpu0/cpufreq/scaling_governor")) -+ if (!SysfsUtils::HasRW("/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor")) - { -- CLog::Log(LOGERROR, "AML: no rw on /sys/devices/cpu/cpu/cpu0/cpufreq/scaling_governor"); -+ CLog::Log(LOGERROR, "AML: no rw on /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor"); - } - #endif - } diff --git a/packages/mediacenter/kodi/patches/kodi-995.11-aml.xml-support.patch b/packages/mediacenter/kodi/patches/kodi-995.11-aml.xml-support.patch deleted file mode 100644 index 8a3f153fd0..0000000000 --- a/packages/mediacenter/kodi/patches/kodi-995.11-aml.xml-support.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff -Naur kodi-15.0-beta1-d1a2c33/xbmc/settings/Settings.cpp kodi-15.0-beta1-d1a2c33.patch/xbmc/settings/Settings.cpp ---- kodi-15.0-beta1-d1a2c33/xbmc/settings/Settings.cpp 2015-05-03 11:53:48.000000000 +0200 -+++ kodi-15.0-beta1-d1a2c33.patch/xbmc/settings/Settings.cpp 2015-05-03 16:57:27.337681882 +0200 -@@ -456,6 +456,9 @@ - #elif defined(TARGET_ANDROID) - if (CFile::Exists(SETTINGS_XML_FOLDER "android.xml") && !Initialize(SETTINGS_XML_FOLDER "android.xml")) - CLog::Log(LOGFATAL, "Unable to load android-specific settings definitions"); -+#elif defined(HAS_LIBAMCODEC) -+ if (CFile::Exists(SETTINGS_XML_FOLDER "aml.xml") && !Initialize(SETTINGS_XML_FOLDER "aml.xml")) -+ CLog::Log(LOGFATAL, "Unable to load aml-specific settings definitions"); - #elif defined(TARGET_RASPBERRY_PI) - if (CFile::Exists(SETTINGS_XML_FOLDER "rbp.xml") && !Initialize(SETTINGS_XML_FOLDER "rbp.xml")) - CLog::Log(LOGFATAL, "Unable to load rbp-specific settings definitions"); diff --git a/projects/RPi/patches/kodi/kodi-001-isengard-rpb-backports.patch b/projects/RPi/patches/kodi/kodi-001-isengard-rpb-backports.patch index 7c6476703d..c57aa0c8b0 100644 --- a/projects/RPi/patches/kodi/kodi-001-isengard-rpb-backports.patch +++ b/projects/RPi/patches/kodi/kodi-001-isengard-rpb-backports.patch @@ -1,29 +1,7 @@ -From e7a6d463c7df5946991024540c0b9afbf48e5a0a Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Fri, 24 Apr 2015 13:49:51 +0100 -Subject: [PATCH 01/56] [dvdplayer] Add back required include - ---- - xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index 6b24b25..a3922c0 100644 ---- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -+++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -@@ -33,6 +33,7 @@ - #include "DVDCodecs/Video/DVDVideoPPFFmpeg.h" - #include "DVDCodecs/Video/DVDVideoCodecFFmpeg.h" - #include "DVDDemuxers/DVDDemux.h" -+#include "DVDDemuxers/DVDDemuxUtils.h" - #include "DVDOverlayRenderer.h" - #include "guilib/GraphicContext.h" - #include - -From 29b89ed811f96193f85fd761168a9dc88270afd3 Mon Sep 17 00:00:00 2001 +From f68b3816564aa0c29d0da419bdfd854a7b15d68b Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 7 Apr 2014 18:19:32 +0100 -Subject: [PATCH 02/56] [rbp/omxplayer] When opening a stream don't try to +Subject: [PATCH 02/61] [rbp/omxplayer] When opening a stream don't try to update gui so often --- @@ -47,10 +25,10 @@ index 2faceea..889d7a2 100644 g_windowManager.ProcessRenderLoop(false); if (allowCancel && dialog->IsCanceled()) -From 3703b7999256e773486d09fdaae7d4345ff8e0f0 Mon Sep 17 00:00:00 2001 +From 7a7fc569a12d489520142ddb39dedbb6982466d5 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 29 Apr 2014 15:23:22 +0100 -Subject: [PATCH 03/56] [ffmpeg] Speed up wtv index creation +Subject: [PATCH 03/61] [ffmpeg] Speed up wtv index creation The index creation is O(N^2) with number of entries (typically thousands). On a Pi this can take more than 60 seconds to execute for a recording of a few hours. @@ -136,10 +114,10 @@ index 0000000..4ac5636 + } + } -From 7c3357d9c9c6456e35927814af7d54cd4b11bff9 Mon Sep 17 00:00:00 2001 +From 7b6da2b187ac78022c09d9428a1041d33aa9777e Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 8 Mar 2014 15:36:06 +0000 -Subject: [PATCH 04/56] [hifiberry] Hack: force it to be recognised as IEC958 +Subject: [PATCH 04/61] [hifiberry] Hack: force it to be recognised as IEC958 capable to enable passthrough options --- @@ -162,10 +140,10 @@ index e22db7a..0120bd5 100644 info.m_displayName.substr(info.m_displayName.size()-5) == " HDMI") { -From 18ae905e8eb0987c35e8a10ccfbcbcbf829ba77b Mon Sep 17 00:00:00 2001 +From 877979729163728264ccf1d9d4044cf7871bf85d Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Thu, 1 May 2014 16:28:39 +0100 -Subject: [PATCH 05/56] Improved file buffering in CArchive +Subject: [PATCH 05/61] Improved file buffering in CArchive Even though memcpy is typically inlined by the compiler into byte/word loads and stores (at least for release builds), the frequency with which 1, 2 and 4 @@ -225,20 +203,20 @@ index 6ed0f8f..8506d95 100644 } else -From e564fb5d4b4f0e0db220c3e9b4017beb307ba377 Mon Sep 17 00:00:00 2001 +From ed0c376577971a2b7dab4770d6914bb631b86d34 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 12 Aug 2014 00:31:36 +0100 -Subject: [PATCH 06/56] [omxcodec] Don't force software codec with dvds +Subject: [PATCH 06/61] [omxcodec] Don't force software codec with dvds --- xbmc/cores/dvdplayer/DVDPlayer.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp -index 37865b5..abe9f92 100644 +index 34e487f..eb5d4de 100644 --- a/xbmc/cores/dvdplayer/DVDPlayer.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp -@@ -3372,7 +3372,9 @@ bool CDVDPlayer::OpenVideoStream(CDVDStreamInfo& hint, bool reset) +@@ -3400,7 +3400,9 @@ bool CDVDPlayer::OpenVideoStream(CDVDStreamInfo& hint, bool reset) hint.aspect = aspect; hint.forced_aspect = true; } @@ -249,10 +227,10 @@ index 37865b5..abe9f92 100644 else if (m_pInputStream && m_pInputStream->IsStreamType(DVDSTREAM_TYPE_PVRMANAGER)) { -From e4d50075650921f209af54e14e2531824e24660f Mon Sep 17 00:00:00 2001 +From 15a146068f22ac23146c6bd832c9e89f041a8f3c Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 10 Aug 2014 16:45:16 +0100 -Subject: [PATCH 07/56] filesystem: Make support of browsing into archives +Subject: [PATCH 07/61] filesystem: Make support of browsing into archives optional The ability to browse, scan and play content in archives can cause problems on low powered/low memory devices. @@ -270,10 +248,10 @@ We'll let people who don't use archives disable it manually 3 files changed, 18 insertions(+) diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po -index 3e39938..06d261c 100644 +index 85df475..13b736e 100644 --- a/addons/resource.language.en_gb/resources/strings.po +++ b/addons/resource.language.en_gb/resources/strings.po -@@ -16525,6 +16525,15 @@ msgstr "" +@@ -16504,6 +16504,15 @@ msgstr "" #: system/settings/rbp.xml msgctxt "#38010" msgid "GPU accelerated" @@ -290,7 +268,7 @@ index 3e39938..06d261c 100644 #. Setting #38011 "Videos -> Library -> Show All Items entry" diff --git a/system/settings/settings.xml b/system/settings/settings.xml -index f89c00a..5b4391f 100644 +index edbab98..7d2ba34 100644 --- a/system/settings/settings.xml +++ b/system/settings/settings.xml @@ -304,6 +304,11 @@ @@ -335,19 +313,20 @@ index 3a5ba4e..f1f6f79 100644 { // XBMC Smart playlist - just XML renamed to XSP // read the name of the playlist in -From c61ee467f28a868a6788ebf63c17ad9b9b02fe0e Mon Sep 17 00:00:00 2001 +From ded5fd595dc852491d8f595e8358680f7bb97a6f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 27 Oct 2014 13:06:57 +0000 -Subject: [PATCH 09/56] [rbp] Make cachemembuffersize default depend on memory +Subject: [PATCH 09/61] [rbp] Make cachemembuffersize default depend on memory size --- - xbmc/linux/RBP.cpp | 5 +++++ - xbmc/settings/AdvancedSettings.cpp | 5 +++++ - 2 files changed, 10 insertions(+) + xbmc/linux/RBP.cpp | 10 ++++++++++ + xbmc/linux/RBP.h | 1 + + xbmc/settings/AdvancedSettings.cpp | 12 +++++++++++- + 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/xbmc/linux/RBP.cpp b/xbmc/linux/RBP.cpp -index 59dd1da..aedae18 100644 +index 59dd1da..b5c2156 100644 --- a/xbmc/linux/RBP.cpp +++ b/xbmc/linux/RBP.cpp @@ -23,6 +23,7 @@ @@ -358,17 +337,29 @@ index 59dd1da..aedae18 100644 #include "utils/log.h" #include "cores/omxplayer/OMXImage.h" -@@ -82,6 +83,9 @@ bool CRBP::Initialize() +@@ -43,6 +44,12 @@ CRBP::~CRBP() + delete m_DllBcmHost; + } + ++void CRBP::InitializeSettings() ++{ ++ if (g_advancedSettings.m_cacheMemBufferSize == ~0U) ++ g_advancedSettings.m_cacheMemBufferSize = m_arm_mem < 256 ? 1024 * 1024 * 2 : 1024 * 1024 * 20; ++} ++ + bool CRBP::Initialize() + { + CSingleLock lock (m_critSection); +@@ -82,6 +89,8 @@ bool CRBP::Initialize() if (!m_gui_resolution_limit) m_gui_resolution_limit = m_gpu_mem < 128 ? 720:1080; -+ if (g_advancedSettings.m_cacheMemBufferSize == ~0U) -+ g_advancedSettings.m_cacheMemBufferSize = m_arm_mem < 256 ? 1024 * 1024 * 2 : 1024 * 1024 * 20; ++ InitializeSettings(); + g_OMXImage.Initialize(); m_omx_image_init = true; return true; -@@ -94,6 +98,7 @@ void CRBP::LogFirmwareVerison() +@@ -94,6 +103,7 @@ void CRBP::LogFirmwareVerison() response[sizeof(response) - 1] = '\0'; CLog::Log(LOGNOTICE, "Raspberry PI firmware version: %s", response); CLog::Log(LOGNOTICE, "ARM mem: %dMB GPU mem: %dMB MPG2:%d WVC1:%d", m_arm_mem, m_gpu_mem, m_codec_mpg2_enabled, m_codec_wvc1_enabled); @@ -376,11 +367,33 @@ index 59dd1da..aedae18 100644 m_DllBcmHost->vc_gencmd(response, sizeof response, "get_config int"); response[sizeof(response) - 1] = '\0'; CLog::Log(LOGNOTICE, "Config:\n%s", response); +diff --git a/xbmc/linux/RBP.h b/xbmc/linux/RBP.h +index 9559914..7fc8b42 100644 +--- a/xbmc/linux/RBP.h ++++ b/xbmc/linux/RBP.h +@@ -48,6 +48,7 @@ class CRBP + ~CRBP(); + + bool Initialize(); ++ void InitializeSettings(); + void LogFirmwareVerison(); + void Deinitialize(); + int GetArmMem() { return m_arm_mem; } diff --git a/xbmc/settings/AdvancedSettings.cpp b/xbmc/settings/AdvancedSettings.cpp -index c4fa298..2ec904c 100644 +index 1ba951d..2d906a6 100644 --- a/xbmc/settings/AdvancedSettings.cpp +++ b/xbmc/settings/AdvancedSettings.cpp -@@ -352,7 +352,12 @@ void CAdvancedSettings::Initialize() +@@ -45,6 +45,9 @@ + #if defined(TARGET_DARWIN_IOS) + #include "osx/DarwinUtils.h" + #endif ++#if defined(TARGET_RASPBERRY_PI) ++#include "linux/RBP.h" ++#endif + + using namespace ADDON; + using namespace XFILE; +@@ -352,7 +355,12 @@ void CAdvancedSettings::Initialize() m_bPVRAutoScanIconsUserSet = false; m_iPVRNumericChannelSwitchTimeout = 1000; @@ -393,11 +406,23 @@ index c4fa298..2ec904c 100644 m_networkBufferMode = 0; // Default (buffer all internet streams/filesystems) // the following setting determines the readRate of a player data // as multiply of the default data read rate +@@ -407,7 +415,9 @@ void CAdvancedSettings::Initialize() + #endif + + m_userAgent = g_sysinfo.GetUserAgent(); +- ++#ifdef TARGET_RASPBERRY_PI ++ g_RBP.InitializeSettings(); ++#endif + m_initialized = true; + } + -From 8318924e413a137e3dbe33efd9af1ddad6313735 Mon Sep 17 00:00:00 2001 + +From ec6bf6a43c0c0680d393dc5039fbb57927a7c10f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 30 May 2014 14:58:43 +0100 -Subject: [PATCH 11/56] [settings] Experiment: Report DESKTOP resolution in +Subject: [PATCH 11/61] [settings] Experiment: Report DESKTOP resolution in video settings --- @@ -419,10 +444,10 @@ index 1fafd9a..e0288aa 100644 StringUtils::Format("%dx%d%s", resolution->width, resolution->height, ModeFlagsToString(resolution->flags, false).c_str()), -From b9b068dce6d2eb40a605a43e97633e2432c87795 Mon Sep 17 00:00:00 2001 +From 390b641d3904777dba820aa4633a94314386e081 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 9 Sep 2014 12:04:26 +0100 -Subject: [PATCH 12/56] egl: Treat unknown display aspect ratio as square pixel +Subject: [PATCH 12/61] egl: Treat unknown display aspect ratio as square pixel --- xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp | 4 ++-- @@ -451,10 +476,10 @@ index bda7430..68fc647 100644 SetResolutionString(m_desktopRes); -From b25a9d54ee084817cbf1a73925434f0213c4eb44 Mon Sep 17 00:00:00 2001 +From ca1037188ea1d60c22b13ab937d21401d4397218 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 19 Sep 2014 11:54:49 +0100 -Subject: [PATCH 13/56] [dvdplayer/rbp] Add pi specific option to maintain +Subject: [PATCH 13/61] [dvdplayer/rbp] Add pi specific option to maintain vsync with pll adjustment New A/V sync option in settings/video/playback to do "Adjust PLL". @@ -479,10 +504,10 @@ Needed updated firmware 9 files changed, 91 insertions(+), 7 deletions(-) diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po -index 06d261c..11f5315 100644 +index 13b736e..07a25d3 100644 --- a/addons/resource.language.en_gb/resources/strings.po +++ b/addons/resource.language.en_gb/resources/strings.po -@@ -6336,7 +6336,22 @@ msgctxt "#13459" +@@ -6318,7 +6318,22 @@ msgctxt "#13459" msgid "Use OMXPlayer for decoding of video files." msgstr "" @@ -506,7 +531,7 @@ index 06d261c..11f5315 100644 #: system/settings/settings.xml msgctxt "#13505" -@@ -16571,3 +16586,10 @@ msgstr "" +@@ -16550,3 +16565,10 @@ msgstr "" msgctxt "#38016" msgid "%d fps" msgstr "" @@ -518,7 +543,7 @@ index 06d261c..11f5315 100644 +msgstr "" + diff --git a/system/settings/settings.xml b/system/settings/settings.xml -index 5b4391f..27f9773 100644 +index 7d2ba34..304bd46 100644 --- a/system/settings/settings.xml +++ b/system/settings/settings.xml @@ -572,6 +572,20 @@ @@ -679,10 +704,10 @@ index 1122a1d..7389754 100644 struct SInfo { diff --git a/xbmc/linux/RBP.cpp b/xbmc/linux/RBP.cpp -index aedae18..a4b0c2a 100644 +index b5c2156..32aa409 100644 --- a/xbmc/linux/RBP.cpp +++ b/xbmc/linux/RBP.cpp -@@ -220,4 +220,18 @@ void CRBP::Deinitialize() +@@ -225,4 +225,18 @@ void CRBP::Deinitialize() m_initialized = false; m_omx_initialized = false; } @@ -702,10 +727,10 @@ index aedae18..a4b0c2a 100644 + #endif diff --git a/xbmc/linux/RBP.h b/xbmc/linux/RBP.h -index 9559914..65492fa 100644 +index 7fc8b42..b422c89 100644 --- a/xbmc/linux/RBP.h +++ b/xbmc/linux/RBP.h -@@ -63,6 +63,7 @@ class CRBP +@@ -64,6 +64,7 @@ class CRBP unsigned char *CaptureDisplay(int width, int height, int *stride, bool swap_red_blue, bool video_only = true); DllOMX *GetDllOMX() { return m_OMX ? m_OMX->GetDll() : NULL; } void WaitVsync(); @@ -714,10 +739,10 @@ index 9559914..65492fa 100644 private: DllBcmHost *m_DllBcmHost; diff --git a/xbmc/settings/AdvancedSettings.cpp b/xbmc/settings/AdvancedSettings.cpp -index 2ec904c..fd1c7c8 100644 +index 2d906a6..24df5ac 100644 --- a/xbmc/settings/AdvancedSettings.cpp +++ b/xbmc/settings/AdvancedSettings.cpp -@@ -110,6 +110,7 @@ void CAdvancedSettings::Initialize() +@@ -113,6 +113,7 @@ void CAdvancedSettings::Initialize() m_audioHeadRoom = 0; m_ac3Gain = 12.0f; m_audioApplyDrc = -1.0f; @@ -725,7 +750,7 @@ index 2ec904c..fd1c7c8 100644 m_dvdplayerIgnoreDTSinWAV = false; //default hold time of 25 ms, this allows a 20 hertz sine to pass undistorted -@@ -468,6 +469,7 @@ void CAdvancedSettings::ParseSettingsFile(const std::string &file) +@@ -475,6 +476,7 @@ void CAdvancedSettings::ParseSettingsFile(const std::string &file) if (pElement) { XMLUtils::GetFloat(pElement, "ac3downmixgain", m_ac3Gain, -96.0f, 96.0f); @@ -734,7 +759,7 @@ index 2ec904c..fd1c7c8 100644 XMLUtils::GetString(pElement, "defaultplayer", m_audioDefaultPlayer); // 101 on purpose - can be used to never automark as watched diff --git a/xbmc/settings/AdvancedSettings.h b/xbmc/settings/AdvancedSettings.h -index b0b4df1..5e0b14c 100644 +index 7df1bf7..732b69d 100644 --- a/xbmc/settings/AdvancedSettings.h +++ b/xbmc/settings/AdvancedSettings.h @@ -141,6 +141,7 @@ class CAdvancedSettings : public ISettingCallback, public ISettingsHandler @@ -746,10 +771,10 @@ index b0b4df1..5e0b14c 100644 float m_audioPlayCountMinimumPercent; bool m_dvdplayerIgnoreDTSinWAV; -From 94cec59be3b05120b76016c51cb96de2960d61ad Mon Sep 17 00:00:00 2001 +From 8c5c342953abc427f0c0fe8548ce9c6c4c67d08d Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 27 Sep 2014 15:32:37 +0100 -Subject: [PATCH 14/56] [dvdplayer] exerimental: don't raise priority of audio +Subject: [PATCH 14/61] [dvdplayer] exerimental: don't raise priority of audio thread --- @@ -757,10 +782,10 @@ Subject: [PATCH 14/56] [dvdplayer] exerimental: don't raise priority of audio 1 file changed, 4 insertions(+) diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp -index abe9f92..2f687ac 100644 +index eb5d4de..5ea3c51 100644 --- a/xbmc/cores/dvdplayer/DVDPlayer.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp -@@ -3357,7 +3357,11 @@ bool CDVDPlayer::OpenAudioStream(CDVDStreamInfo& hint, bool reset) +@@ -3385,7 +3385,11 @@ bool CDVDPlayer::OpenAudioStream(CDVDStreamInfo& hint, bool reset) m_dvdPlayerAudio->SendMessage(new CDVDMsg(CDVDMsg::PLAYER_STARTED), 1); /* audio normally won't consume full cpu, so let it have prio */ @@ -773,10 +798,10 @@ index abe9f92..2f687ac 100644 } -From c0642bc05d3c606cdd62d6e92ddb4684299df785 Mon Sep 17 00:00:00 2001 +From 66c3e2d5829fac98b54059a4d82e33ec33537b0d Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 24 Sep 2014 23:13:52 +0100 -Subject: [PATCH 15/56] [audio] Add settings option to boost centre channel +Subject: [PATCH 15/61] [audio] Add settings option to boost centre channel when downmixing This allows a dB volume increase to be added to centre channel. @@ -794,10 +819,10 @@ Should work with Pi Sink (dvdplayer/paplayer) and omxplayer 5 files changed, 45 insertions(+) diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po -index 11f5315..b5f4731 100644 +index 07a25d3..7d445f9 100644 --- a/addons/resource.language.en_gb/resources/strings.po +++ b/addons/resource.language.en_gb/resources/strings.po -@@ -16593,3 +16593,17 @@ msgctxt "#38006" +@@ -16572,3 +16572,17 @@ msgctxt "#38006" msgid "Audio has to stay in sync, this can either be done by resampling, or adjusting the PLL" msgstr "" @@ -816,10 +841,10 @@ index 11f5315..b5f4731 100644 +msgid "%i dB" +msgstr "" diff --git a/system/settings/settings.xml b/system/settings/settings.xml -index 27f9773..e833d3b 100644 +index 304bd46..2aaf772 100644 --- a/system/settings/settings.xml +++ b/system/settings/settings.xml -@@ -2645,6 +2645,18 @@ +@@ -2589,6 +2589,18 @@ true @@ -898,10 +923,10 @@ index f99c0e6..1911189 100644 // stereo upmix if (upmix && m_src_channels == 2 && m_dst_channels > 2) -From 6be4a7b9d3912b0a01869703857a97ce2996b3a4 Mon Sep 17 00:00:00 2001 +From 9832febb10d609a6e75465b3d82e681252686566 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 3 Oct 2014 18:40:06 +0100 -Subject: [PATCH 16/56] [SinkPi] Handle multichannel layout more like OMXAudio +Subject: [PATCH 16/61] [SinkPi] Handle multichannel layout more like OMXAudio --- xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp | 14 +++++++------- @@ -960,10 +985,10 @@ index a7691e8..d72a97a 100644 m_format = format; m_sinkbuffer_sec_per_byte = 1.0 / (double)(m_format.m_frameSize * m_format.m_sampleRate); -From 9da1504c7da584cbec8866b0ede520f9f7652adc Mon Sep 17 00:00:00 2001 +From d8fae79683f81ead870a5abac67da826e935183c Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 27 Oct 2014 15:23:51 +0000 -Subject: [PATCH 17/56] [rbp] Default extract thumbnails to false +Subject: [PATCH 17/61] [rbp] Default extract thumbnails to false It can take 80 seconds for a single file on a Pi. It can cause crashes with out-of-memory errors. It genereates a lot of support issues. Best to default to disabled and let users enable it if they must @@ -972,10 +997,10 @@ It genereates a lot of support issues. Best to default to disabled and let users 1 file changed, 10 insertions(+) diff --git a/system/settings/rbp.xml b/system/settings/rbp.xml -index cb83297..8496abf 100644 +index 50fe36a..a54a4c4 100644 --- a/system/settings/rbp.xml +++ b/system/settings/rbp.xml -@@ -38,6 +38,16 @@ +@@ -35,6 +35,16 @@ @@ -993,10 +1018,10 @@ index cb83297..8496abf 100644
-From f8853c406f9824daf3d4f22cd290be3515cf70fe Mon Sep 17 00:00:00 2001 +From 1326d4272c2e881b3a154256e6825c181b6ee3ad Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 15 Nov 2014 12:03:34 +0000 -Subject: [PATCH 21/56] [dvdplayer] Add lock for player creation +Subject: [PATCH 22/61] [dvdplayer] Add lock for player creation --- xbmc/cores/dvdplayer/DVDPlayer.cpp | 3 +++ @@ -1004,7 +1029,7 @@ Subject: [PATCH 21/56] [dvdplayer] Add lock for player creation 2 files changed, 4 insertions(+) diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp -index 2f687ac..5062990 100644 +index 5ea3c51..f0ffe17 100644 --- a/xbmc/cores/dvdplayer/DVDPlayer.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp @@ -517,6 +517,7 @@ int CSelectionStreams::CountSource(StreamType type, StreamSource source) const @@ -1023,7 +1048,7 @@ index 2f687ac..5062990 100644 if (!m_players_created) return; delete m_dvdPlayerVideo; -@@ -4224,6 +4226,7 @@ double CDVDPlayer::GetQueueTime() +@@ -4252,6 +4254,7 @@ double CDVDPlayer::GetQueueTime() void CDVDPlayer::GetVideoStreamInfo(SPlayerVideoStreamInfo &info) { @@ -1032,20 +1057,20 @@ index 2f687ac..5062990 100644 std::string retVal; diff --git a/xbmc/cores/dvdplayer/DVDPlayer.h b/xbmc/cores/dvdplayer/DVDPlayer.h -index f9e4bf7..41b9f22 100644 +index 71a62f1..9993ac0 100644 --- a/xbmc/cores/dvdplayer/DVDPlayer.h +++ b/xbmc/cores/dvdplayer/DVDPlayer.h -@@ -554,4 +554,5 @@ class CDVDPlayer : public IPlayer, public CThread, public IDVDPlayer +@@ -558,4 +558,5 @@ class CDVDPlayer : public IPlayer, public CThread, public IDVDPlayer // omxplayer variables struct SOmxPlayerState m_OmxPlayerState; bool m_omxplayer_mode; // using omxplayer acceleration + CCriticalSection m_players_lock; }; -From e992a3be859498cfb4831524f7e2c756a0cea155 Mon Sep 17 00:00:00 2001 +From f9b5ced2edadf501b4655a82788eaea620f6e4ed Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 24 Nov 2014 22:07:25 +0000 -Subject: [PATCH 22/56] [dvdplayervideo] Prod decoder when in stills mode +Subject: [PATCH 23/61] [dvdplayervideo] Prod decoder when in stills mode An asynchronous hardware decoder doesn't only produce output pictures when new packets arrive. In dvd stills mode give it a chance to return pictures that weren't ready when frame was decoded. @@ -1054,10 +1079,10 @@ In dvd stills mode give it a chance to return pictures that weren't ready when f 1 file changed, 28 insertions(+), 18 deletions(-) diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index a3922c0..7f0073f 100644 +index d725d32..55fa8b1 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -@@ -317,7 +317,8 @@ void CDVDPlayerVideo::Process() +@@ -314,7 +314,8 @@ void CDVDPlayerVideo::Process() while (!m_bStop) { @@ -1067,7 +1092,7 @@ index a3922c0..7f0073f 100644 int iPriority = (m_speed == DVD_PLAYSPEED_PAUSE && m_started) ? 1 : 0; CDVDMsg* pMsg; -@@ -334,27 +335,36 @@ void CDVDPlayerVideo::Process() +@@ -331,27 +332,36 @@ void CDVDPlayerVideo::Process() if( iPriority ) continue; @@ -1122,10 +1147,10 @@ index a3922c0..7f0073f 100644 if (pMsg->IsType(CDVDMsg::GENERAL_SYNCHRONIZE)) -From f9456da2ed3d4d15d703c5f366a0c1284369b769 Mon Sep 17 00:00:00 2001 +From 36666ba4c6dd8a03f0b0c0055bb5238f4e8920e2 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 27 Nov 2014 16:31:56 +0000 -Subject: [PATCH 23/56] [languageinvoker] Reduce priority of python threads +Subject: [PATCH 24/61] [languageinvoker] Reduce priority of python threads --- xbmc/interfaces/generic/LanguageInvokerThread.cpp | 5 +++++ @@ -1148,10 +1173,66 @@ index fcdd063..16f0c89 100644 } -From 288777dd146b627d5240bfec658d1b90424a78d0 Mon Sep 17 00:00:00 2001 +From fc7285cbd4934c80ed8ec948ba0762d20ada7138 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Sat, 14 Dec 2013 16:55:05 +0000 +Subject: [PATCH 25/61] logging: Add microsecond timer to log messages + +--- + xbmc/utils/log.cpp | 17 +++++++++++++++-- + 1 file changed, 15 insertions(+), 2 deletions(-) + +diff --git a/xbmc/utils/log.cpp b/xbmc/utils/log.cpp +index 3443f12..31c4a99 100644 +--- a/xbmc/utils/log.cpp ++++ b/xbmc/utils/log.cpp +@@ -24,6 +24,7 @@ + #include "threads/Thread.h" + #include "utils/StringUtils.h" + #include "CompileInfo.h" ++#include "utils/TimeUtils.cpp" + + static const char* const levelNames[] = + {"DEBUG", "INFO", "NOTICE", "WARNING", "ERROR", "SEVERE", "FATAL", "NONE"}; +@@ -198,19 +199,31 @@ void CLog::PrintDebugString(const std::string& line) + + bool CLog::WriteLogString(int logLevel, const std::string& logString) + { ++#if defined(TARGET_LINUX) ++ static const char* prefixFormat = "%02.2d:%02.2d:%02.2d %10.6f T:%" PRIu64" %7s: "; ++#else + static const char* prefixFormat = "%02.2d:%02.2d:%02.2d T:%" PRIu64" %7s: "; +- ++#endif + std::string strData(logString); + /* fixup newline alignment, number of spaces should equal prefix length */ + StringUtils::Replace(strData, "\n", "\n "); + + int hour, minute, second; + s_globals.m_platform.GetCurrentLocalTime(hour, minute, second); +- ++ ++#if defined(TARGET_LINUX) ++ struct timespec now; ++ clock_gettime(CLOCK_MONOTONIC, &now); ++ float Now = now.tv_sec + now.tv_nsec * 1e-9; ++#endif ++ + strData = StringUtils::Format(prefixFormat, + hour, + minute, + second, ++#if defined(TARGET_LINUX) ++ Now, ++#endif + (uint64_t)CThread::GetCurrentThreadId(), + levelNames[logLevel]) + strData; + + +From adb7882f273437d58e9aff7c26c11ab1a8d32a73 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 29 Nov 2014 15:25:16 +0000 -Subject: [PATCH 24/56] [rbp] hack: wait for splash to complete before changing +Subject: [PATCH 26/61] [rbp] hack: wait for splash to complete before changing hdmi mode --- @@ -1225,10 +1306,10 @@ index 68fc647..c80114e 100644 if(!m_fixedMode && GETFLAGS_GROUP(res.dwFlags) && GETFLAGS_MODE(res.dwFlags)) -From b5262ef9b401ffa4b6d2276e67b742a37c1df79d Mon Sep 17 00:00:00 2001 +From c727022054334a0f10585d36adbe9bb7814b0b82 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 11 Dec 2014 17:00:57 +0000 -Subject: [PATCH 25/56] Fix for UI not showing both extractflags and +Subject: [PATCH 27/61] Fix for UI not showing both extractflags and extractthumb --- @@ -1238,10 +1319,10 @@ Subject: [PATCH 25/56] Fix for UI not showing both extractflags and 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po -index 601cd44..fa25d45 100644 +index c52f230..aee20d0 100644 --- a/addons/resource.language.en_gb/resources/strings.po +++ b/addons/resource.language.en_gb/resources/strings.po -@@ -10962,7 +10962,7 @@ msgstr "" +@@ -10945,7 +10945,7 @@ msgstr "" #: system/settings/settings.xml msgctxt "#20433" @@ -1250,7 +1331,7 @@ index 601cd44..fa25d45 100644 msgstr "" #: xbmc/dialogs/GUIDialogSmartPlaylistRule.cpp -@@ -14492,7 +14492,7 @@ msgstr "" +@@ -14475,7 +14475,7 @@ msgstr "" #. Description of setting "Videos -> File lists -> Extract thumbnails and video information" with label #20433 #: system/settings/settings.xml msgctxt "#36178" @@ -1259,7 +1340,7 @@ index 601cd44..fa25d45 100644 msgstr "" #. Description of setting "Videos -> File lists -> Replace file names with library titles" with label #20419 -@@ -14504,7 +14504,7 @@ msgstr "" +@@ -14487,7 +14487,7 @@ msgstr "" #. Description of setting "Videos -> File lists -> Extract thumbnails and video information" with label #20433 #: system/settings/settings.xml msgctxt "#36180" @@ -1268,7 +1349,7 @@ index 601cd44..fa25d45 100644 msgstr "" #: system/settings/settings.xml -@@ -16622,3 +16622,8 @@ msgstr "" +@@ -16601,3 +16601,8 @@ msgstr "" msgctxt "#38052" msgid "Remote button press release time (ms)" msgstr "" @@ -1278,10 +1359,10 @@ index 601cd44..fa25d45 100644 +msgid "Extract thumbnails from video files" +msgstr "" diff --git a/system/settings/rbp.xml b/system/settings/rbp.xml -index 8496abf..ad65ce4 100644 +index a54a4c4..208cd49 100644 --- a/system/settings/rbp.xml +++ b/system/settings/rbp.xml -@@ -36,10 +36,6 @@ +@@ -33,10 +33,6 @@ false @@ -1293,10 +1374,10 @@ index 8496abf..ad65ce4 100644 false diff --git a/system/settings/settings.xml b/system/settings/settings.xml -index e833d3b..0e09d3d 100644 +index 2aaf772..08d8f41 100644 --- a/system/settings/settings.xml +++ b/system/settings/settings.xml -@@ -902,23 +902,23 @@ +@@ -846,23 +846,23 @@ @@ -1326,10 +1407,10 @@ index e833d3b..0e09d3d 100644 -From 913713b6debe33499641ea054f789423a00d1ed9 Mon Sep 17 00:00:00 2001 +From 5c10acd7538646333db2b57f87e4bf8faa1c2c19 Mon Sep 17 00:00:00 2001 From: anaconda Date: Thu, 11 Sep 2014 21:30:43 +0200 -Subject: [PATCH 26/56] Disable autoscrolling while on screensaver and while +Subject: [PATCH 28/61] Disable autoscrolling while on screensaver and while opening streams. --- @@ -1342,7 +1423,7 @@ Subject: [PATCH 26/56] Disable autoscrolling while on screensaver and while 6 files changed, 24 insertions(+), 3 deletions(-) diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp -index 0bdaae4..1141d7b 100644 +index 16af7df..9c6496b 100644 --- a/xbmc/Application.cpp +++ b/xbmc/Application.cpp @@ -4958,3 +4958,13 @@ bool CApplication::NotifyActionListeners(const CAction &action) const @@ -1460,10 +1541,10 @@ index 0d5b3f7..6d23024 100644 if (m_lastRenderTime) m_autoScrollDelayTime += currentTime - m_lastRenderTime; -From 9de2f40d2046fdead3be13806c7d20ff39a94dfc Mon Sep 17 00:00:00 2001 +From 796877858489b061853455e99cebd3131e76acf3 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 13 Dec 2014 18:35:20 +0000 -Subject: [PATCH 27/56] [demuxer] Avoid memcpy on every demuxer packet +Subject: [PATCH 29/61] [demuxer] Avoid memcpy on every demuxer packet Avoids an unnecessary memcpy on every demuxer packet which for high bitrate videos can be significant. @@ -1558,663 +1639,17 @@ index ab298b2..10c5ee0 100644 } catch(...) { -From 275639e41023b0fb4fe2025379dc5b10764d21ea Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Tue, 10 Feb 2015 15:29:16 +0000 -Subject: [PATCH 28/56] [libcec] Add repeating keypress patch from popcornmix' - repo - ---- - tools/depends/target/libcec/Makefile | 1 + - tools/depends/target/libcec/popcornmix.patch | 615 +++++++++++++++++++++++++++ - 2 files changed, 616 insertions(+) - create mode 100644 tools/depends/target/libcec/popcornmix.patch - -diff --git a/tools/depends/target/libcec/Makefile b/tools/depends/target/libcec/Makefile -index 6c72240..4378628 100644 ---- a/tools/depends/target/libcec/Makefile -+++ b/tools/depends/target/libcec/Makefile -@@ -21,6 +21,7 @@ $(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE) $(DEPS) - rm -rf $(PLATFORM); mkdir -p $(PLATFORM) - cd $(PLATFORM); $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE) - cd $(PLATFORM); $(AUTORECONF) -vif -+ cd $(PLATFORM); patch -p1 < ../popcornmix.patch - cd $(PLATFORM); $(CONFIGURE) - - $(LIBDYLIB): $(PLATFORM) -diff --git a/tools/depends/target/libcec/popcornmix.patch b/tools/depends/target/libcec/popcornmix.patch -new file mode 100644 -index 0000000..84adc8c ---- /dev/null -+++ b/tools/depends/target/libcec/popcornmix.patch -@@ -0,0 +1,615 @@ -+From 651fc15222923bcaea6f7925c207217a40e967ab Mon Sep 17 00:00:00 2001 -+From: popcornmix -+Date: Fri, 24 Oct 2014 13:45:21 +0100 -+Subject: [PATCH 1/5] Make released key polling wait for exact time until key -+ gets released -+ -+--- -+ src/lib/CECClient.cpp | 28 ++++++++++++++++++++++++---- -+ src/lib/CECClient.h | 2 +- -+ src/lib/CECProcessor.cpp | 8 +++++--- -+ src/lib/LibCEC.cpp | 10 ++++++++-- -+ src/lib/LibCEC.h | 4 +++- -+ 5 files changed, 41 insertions(+), 11 deletions(-) -+ -+diff --git a/src/lib/CECClient.cpp b/src/lib/CECClient.cpp -+index 0bc9705..5fb1e6a 100644 -+--- a/src/lib/CECClient.cpp -++++ b/src/lib/CECClient.cpp -+@@ -1057,10 +1057,16 @@ void CCECClient::SetCurrentButton(const cec_user_control_code iButtonCode) -+ AddKey(key); -+ } -+ -+-void CCECClient::CheckKeypressTimeout(void) -++uint16_t CCECClient::CheckKeypressTimeout(void) -+ { -++ // time when we'd like to be called again -++ unsigned int timeout = CEC_PROCESSOR_SIGNAL_WAIT_TIME; -+ cec_keypress key; -++ key.keycode = CEC_USER_CONTROL_CODE_UNKNOWN; -++ key.duration = 0; -+ -++ if (m_iCurrentButton == CEC_USER_CONTROL_CODE_UNKNOWN) -++ return timeout; -+ { -+ CLockObject lock(m_mutex); -+ uint64_t iNow = GetTimeMs(); -+@@ -1081,12 +1087,26 @@ void CCECClient::CheckKeypressTimeout(void) -+ } -+ else -+ { -+- return; -++ // time when this keypress will be released and we'd like to be called again -++ unsigned int timeout = CEC_PROCESSOR_SIGNAL_WAIT_TIME; -++ if (m_iCurrentButton != CEC_USER_CONTROL_CODE_UNKNOWN && m_iCurrentButton == comboKey && iTimeoutMs > 0) -++ timeout = iTimeoutMs - (iNow - m_buttontime) + 1; -++ else if (m_iCurrentButton != CEC_USER_CONTROL_CODE_UNKNOWN && m_iCurrentButton != comboKey) -++ timeout = CEC_BUTTON_TIMEOUT - (iNow - m_buttontime) + 1; -++ if (timeout > CEC_PROCESSOR_SIGNAL_WAIT_TIME) -++ { -++ LIB_CEC->AddLog(CEC_LOG_ERROR, "Unexpected timeout: %d (%.3f %.3f %.3f) k:%02x", timeout, iNow*1e-3, m_buttontime*1e-3, CEC_BUTTON_TIMEOUT*1e-3, m_iCurrentButton); -++ timeout = CEC_PROCESSOR_SIGNAL_WAIT_TIME; -++ } -+ } -+ } -+ -+- LIB_CEC->AddLog(CEC_LOG_DEBUG, "key auto-released: %s (%1x)", ToString(key.keycode), key.keycode); -+- CallbackAddKey(key); -++ if (key.keycode != CEC_USER_CONTROL_CODE_UNKNOWN) -++ { -++ LIB_CEC->AddLog(CEC_LOG_DEBUG, "key auto-released: %s (%1x)", ToString(key.keycode), key.keycode); -++ CallbackAddKey(key); -++ } -++ return timeout; -+ } -+ -+ bool CCECClient::EnableCallbacks(void *cbParam, ICECCallbacks *callbacks) -+diff --git a/src/lib/CECClient.h b/src/lib/CECClient.h -+index 3ef0453..88efbbb 100644 -+--- a/src/lib/CECClient.h -++++ b/src/lib/CECClient.h -+@@ -182,7 +182,7 @@ namespace CEC -+ virtual void AddKey(bool bSendComboKey = false); -+ virtual void AddKey(const cec_keypress &key); -+ virtual void SetCurrentButton(const cec_user_control_code iButtonCode); -+- virtual void CheckKeypressTimeout(void); -++ virtual uint16_t CheckKeypressTimeout(void); -+ virtual void SourceActivated(const cec_logical_address logicalAddress); -+ virtual void SourceDeactivated(const cec_logical_address logicalAddress); -+ -+diff --git a/src/lib/CECProcessor.cpp b/src/lib/CECProcessor.cpp -+index 557b76d..ecf9244 100644 -+--- a/src/lib/CECProcessor.cpp -++++ b/src/lib/CECProcessor.cpp -+@@ -51,7 +51,6 @@ using namespace CEC; -+ using namespace std; -+ using namespace PLATFORM; -+ -+-#define CEC_PROCESSOR_SIGNAL_WAIT_TIME 1000 -+ #define ACTIVE_SOURCE_CHECK_INTERVAL 500 -+ #define TV_PRESENT_CHECK_INTERVAL 30000 -+ -+@@ -244,6 +243,7 @@ bool CCECProcessor::OnCommandReceived(const cec_command &command) -+ -+ void *CCECProcessor::Process(void) -+ { -++ uint16_t timeout = CEC_PROCESSOR_SIGNAL_WAIT_TIME; -+ m_libcec->AddLog(CEC_LOG_DEBUG, "processor thread started"); -+ -+ if (!m_connCheck) -+@@ -258,13 +258,13 @@ void *CCECProcessor::Process(void) -+ while (!IsStopped() && m_communication->IsOpen()) -+ { -+ // wait for a new incoming command, and process it -+- if (m_inBuffer.Pop(command, CEC_PROCESSOR_SIGNAL_WAIT_TIME)) -++ if (m_inBuffer.Pop(command, timeout)) -+ ProcessCommand(command); -+ -+ if (CECInitialised() && !IsStopped()) -+ { -+ // check clients for keypress timeouts -+- m_libcec->CheckKeypressTimeout(); -++ timeout = m_libcec->CheckKeypressTimeout(); -+ -+ // check if we need to replace handlers -+ ReplaceHandlers(); -+@@ -295,6 +295,8 @@ void *CCECProcessor::Process(void) -+ tvPresentCheck.Init(TV_PRESENT_CHECK_INTERVAL); -+ } -+ } -++ else -++ timeout = CEC_PROCESSOR_SIGNAL_WAIT_TIME; -+ } -+ -+ return NULL; -+diff --git a/src/lib/LibCEC.cpp b/src/lib/LibCEC.cpp -+index c24b4ed..046205c 100644 -+--- a/src/lib/LibCEC.cpp -++++ b/src/lib/LibCEC.cpp -+@@ -354,11 +354,17 @@ bool CLibCEC::IsValidPhysicalAddress(uint16_t iPhysicalAddress) -+ iPhysicalAddress <= CEC_MAX_PHYSICAL_ADDRESS; -+ } -+ -+-void CLibCEC::CheckKeypressTimeout(void) -++uint16_t CLibCEC::CheckKeypressTimeout(void) -+ { -++ uint16_t timeout = CEC_PROCESSOR_SIGNAL_WAIT_TIME; -+ // check all clients -+ for (vector::iterator it = m_clients.begin(); it != m_clients.end(); it++) -+- (*it)->CheckKeypressTimeout(); -++ { -++ uint16_t t = (*it)->CheckKeypressTimeout(); -++ if (t < timeout) -++ timeout = t; -++ } -++ return timeout; -+ } -+ -+ void CLibCEC::AddLog(const cec_log_level level, const char *strFormat, ...) -+diff --git a/src/lib/LibCEC.h b/src/lib/LibCEC.h -+index 3a312c0..b7ac645 100644 -+--- a/src/lib/LibCEC.h -++++ b/src/lib/LibCEC.h -+@@ -36,6 +36,8 @@ -+ #include "platform/util/buffer.h" -+ #include "CECTypeUtils.h" -+ -++#define CEC_PROCESSOR_SIGNAL_WAIT_TIME 1000 -++ -+ namespace CEC -+ { -+ class CAdapterCommunication; -+@@ -121,7 +123,7 @@ namespace CEC -+ -+ void AddLog(const cec_log_level level, const char *strFormat, ...); -+ void AddCommand(const cec_command &command); -+- void CheckKeypressTimeout(void); -++ uint16_t CheckKeypressTimeout(void); -+ void Alert(const libcec_alert type, const libcec_parameter ¶m); -+ -+ static bool IsValidPhysicalAddress(uint16_t iPhysicalAddress); -+-- -+1.9.1 -+ -+ -+From d506af4cff04156391f34d07f921e02c41a563b7 Mon Sep 17 00:00:00 2001 -+From: popcornmix -+Date: Mon, 24 Nov 2014 23:18:52 +0000 -+Subject: [PATCH 2/5] Add settings for repeat and release -+ -+--- -+ include/cectypes.h | 6 ++++++ -+ src/lib/CECClient.cpp | 6 ++++++ -+ 2 files changed, 12 insertions(+) -+ -+diff --git a/include/cectypes.h b/include/cectypes.h -+index 0a90d0e..b75b1b3 100644 -+--- a/include/cectypes.h -++++ b/include/cectypes.h -+@@ -1532,6 +1532,8 @@ struct libcec_configuration -+ XXX changed meaning in 2.2.0 to not break binary compatibility. next major (3.0) release will fix it in a nicer way */ -+ cec_user_control_code comboKey; /*!< key code that initiates combo keys. defaults to CEC_USER_CONTROL_CODE_F1_BLUE. CEC_USER_CONTROL_CODE_UNKNOWN to disable. added in 2.0.5 */ -+ uint32_t iComboKeyTimeoutMs; /*!< timeout until the combo key is sent as normal keypress */ -++ uint32_t iButtonRepeatRateMs; /*!< rate at which buttons autorepeat. 0 means rely on CEC device */ -++ uint32_t iButtonReleaseDelayMs;/*!< duration after last update until a button is considered released */ -+ -+ #ifdef __cplusplus -+ libcec_configuration(void) { Clear(); } -+@@ -1566,6 +1568,8 @@ struct libcec_configuration -+ cecVersion == other.cecVersion && -+ adapterType == other.adapterType && -+ iDoubleTapTimeout50Ms == other.iDoubleTapTimeout50Ms && -++ iButtonRepeatRateMs == other.iButtonRepeatRateMs && -++ iButtonReleaseDelayMs == other.iButtonReleaseDelayMs && -+ (other.clientVersion <= CEC_CLIENT_VERSION_2_0_4 || comboKey == other.comboKey) && -+ (other.clientVersion <= CEC_CLIENT_VERSION_2_0_4 || iComboKeyTimeoutMs == other.iComboKeyTimeoutMs) && -+ (other.clientVersion < CEC_CLIENT_VERSION_2_1_0 || bPowerOnScreensaver == other.bPowerOnScreensaver)); -+@@ -1606,6 +1610,8 @@ struct libcec_configuration -+ iDoubleTapTimeout50Ms = CEC_DOUBLE_TAP_TIMEOUT_50_MS; -+ comboKey = CEC_USER_CONTROL_CODE_STOP; -+ iComboKeyTimeoutMs = CEC_DEFAULT_COMBO_TIMEOUT_MS; -++ iButtonRepeatRateMs = 0; -++ iButtonReleaseDelayMs = CEC_BUTTON_TIMEOUT; -+ -+ memset(strDeviceName, 0, 13); -+ deviceTypes.Clear(); -+diff --git a/src/lib/CECClient.cpp b/src/lib/CECClient.cpp -+index 5fb1e6a..02f5f4a 100644 -+--- a/src/lib/CECClient.cpp -++++ b/src/lib/CECClient.cpp -+@@ -834,6 +834,9 @@ bool CCECClient::GetCurrentConfiguration(libcec_configuration &configuration) -+ configuration.bMonitorOnly = m_configuration.bMonitorOnly; -+ configuration.cecVersion = m_configuration.cecVersion; -+ configuration.adapterType = m_configuration.adapterType; -++ configuration.iDoubleTapTimeout50Ms = m_configuration.iDoubleTapTimeout50Ms; -++ configuration.iButtonRepeatRateMs = m_configuration.iButtonRepeatRateMs; -++ configuration.iButtonReleaseDelayMs = m_configuration.iButtonReleaseDelayMs; -+ -+ return true; -+ } -+@@ -877,6 +880,9 @@ bool CCECClient::SetConfiguration(const libcec_configuration &configuration) -+ m_configuration.cecVersion = configuration.cecVersion; -+ m_configuration.adapterType = configuration.adapterType; -+ m_configuration.iDoubleTapTimeout50Ms = configuration.iDoubleTapTimeout50Ms; -++ m_configuration.iButtonRepeatRateMs = configuration.iButtonRepeatRateMs; -++ m_configuration.iButtonReleaseDelayMs = configuration.iButtonReleaseDelayMs; -++ -+ m_configuration.deviceTypes.Add(configuration.deviceTypes[0]); -+ -+ if (m_configuration.clientVersion >= CEC_CLIENT_VERSION_2_0_5) -+-- -+1.9.1 -+ -+ -+From b6a6cc8ad12571dff0e02bc9a38ce97a00424df0 Mon Sep 17 00:00:00 2001 -+From: popcornmix -+Date: Mon, 24 Nov 2014 23:20:05 +0000 -+Subject: [PATCH 3/5] Distinguish explicit and implicit forms of AddKey -+ releases -+ -+--- -+ src/lib/CECClient.cpp | 2 +- -+ src/lib/CECClient.h | 2 +- -+ src/lib/implementations/CECCommandHandler.cpp | 2 +- -+ 3 files changed, 3 insertions(+), 3 deletions(-) -+ -+diff --git a/src/lib/CECClient.cpp b/src/lib/CECClient.cpp -+index 02f5f4a..3663b24 100644 -+--- a/src/lib/CECClient.cpp -++++ b/src/lib/CECClient.cpp -+@@ -968,7 +968,7 @@ int CCECClient::MenuStateChanged(const cec_menu_state newState) -+ return CallbackMenuStateChanged(newState); -+ } -+ -+-void CCECClient::AddKey(bool bSendComboKey /* = false */) -++void CCECClient::AddKey(bool bSendComboKey /* = false */, bool bButtonRelease /* = false */) -+ { -+ cec_keypress key; -+ key.keycode = CEC_USER_CONTROL_CODE_UNKNOWN; -+diff --git a/src/lib/CECClient.h b/src/lib/CECClient.h -+index 88efbbb..84fb909 100644 -+--- a/src/lib/CECClient.h -++++ b/src/lib/CECClient.h -+@@ -179,7 +179,7 @@ namespace CEC -+ virtual int MenuStateChanged(const cec_menu_state newState); -+ virtual void Alert(const libcec_alert type, const libcec_parameter ¶m) { CallbackAlert(type, param); } -+ virtual void AddLog(const cec_log_message &message) { CallbackAddLog(message); } -+- virtual void AddKey(bool bSendComboKey = false); -++ virtual void AddKey(bool bSendComboKey = false, bool bButtonRelease = false); -+ virtual void AddKey(const cec_keypress &key); -+ virtual void SetCurrentButton(const cec_user_control_code iButtonCode); -+ virtual uint16_t CheckKeypressTimeout(void); -+diff --git a/src/lib/implementations/CECCommandHandler.cpp b/src/lib/implementations/CECCommandHandler.cpp -+index a89ebe6..932c54b 100644 -+--- a/src/lib/implementations/CECCommandHandler.cpp -++++ b/src/lib/implementations/CECCommandHandler.cpp -+@@ -745,7 +745,7 @@ int CCECCommandHandler::HandleUserControlRelease(const cec_command &command) -+ -+ CCECClient *client = m_processor->GetClient(command.destination); -+ if (client) -+- client->AddKey(); -++ client->AddKey(false, true); -+ -+ return COMMAND_HANDLED; -+ } -+-- -+1.9.1 -+ -+ -+From 3b7606a9e0653149ae4b6e80d0df9c53645bfac9 Mon Sep 17 00:00:00 2001 -+From: popcornmix -+Date: Mon, 24 Nov 2014 23:20:22 +0000 -+Subject: [PATCH 4/5] Support repeating button presses with configurable repeat -+ rate Keep track of time since initial button press and last button update -+ -+--- -+ src/lib/CECClient.cpp | 119 ++++++++++++++++++++++++++++++++++++++++---------- -+ src/lib/CECClient.h | 6 ++- -+ 2 files changed, 101 insertions(+), 24 deletions(-) -+ -+diff --git a/src/lib/CECClient.cpp b/src/lib/CECClient.cpp -+index 3663b24..68eaee9 100644 -+--- a/src/lib/CECClient.cpp -++++ b/src/lib/CECClient.cpp -+@@ -52,7 +52,11 @@ CCECClient::CCECClient(CCECProcessor *processor, const libcec_configuration &con -+ m_bInitialised(false), -+ m_bRegistered(false), -+ m_iCurrentButton(CEC_USER_CONTROL_CODE_UNKNOWN), -+- m_buttontime(0), -++ m_initialButtontime(0), -++ m_updateButtontime(0), -++ m_repeatButtontime(0), -++ m_releaseButtontime(0), -++ m_pressedButtoncount(0), -+ m_iPreventForwardingPowerOffCommand(0), -+ m_iLastKeypressTime(0) -+ { -+@@ -939,6 +943,7 @@ bool CCECClient::SetConfiguration(const libcec_configuration &configuration) -+ primary->ActivateSource(); -+ } -+ -++ LIB_CEC->AddLog(CEC_LOG_DEBUG, "%s: %d:%d:%d", __FUNCTION__, DoubleTapTimeoutMS(), m_configuration.iButtonRepeatRateMs, m_configuration.iButtonReleaseDelayMs); -+ return true; -+ } -+ -+@@ -977,9 +982,10 @@ void CCECClient::AddKey(bool bSendComboKey /* = false */, bool bButtonRelease /* -+ CLockObject lock(m_mutex); -+ if (m_iCurrentButton != CEC_USER_CONTROL_CODE_UNKNOWN) -+ { -+- key.duration = (unsigned int) (GetTimeMs() - m_buttontime); -++ unsigned int duration = (unsigned int) (GetTimeMs() - m_updateButtontime); -++ key.duration = (unsigned int) (GetTimeMs() - m_initialButtontime); -+ -+- if (key.duration > m_configuration.iComboKeyTimeoutMs || -++ if (duration > m_configuration.iComboKeyTimeoutMs || -+ m_configuration.iComboKeyTimeoutMs == 0 || -+ m_iCurrentButton != m_configuration.comboKey || -+ bSendComboKey) -+@@ -987,14 +993,22 @@ void CCECClient::AddKey(bool bSendComboKey /* = false */, bool bButtonRelease /* -+ key.keycode = m_iCurrentButton; -+ -+ m_iCurrentButton = CEC_USER_CONTROL_CODE_UNKNOWN; -+- m_buttontime = 0; -++ m_initialButtontime = 0; -++ m_updateButtontime = 0; -++ m_repeatButtontime = 0; -++ m_releaseButtontime = 0; -++ m_pressedButtoncount = 0; -+ } -+ } -+ } -+ -++ // we don't forward releases when supporting repeating keys -++ if (bButtonRelease && m_configuration.iButtonRepeatRateMs) -++ return; -++ -+ if (key.keycode != CEC_USER_CONTROL_CODE_UNKNOWN) -+ { -+- LIB_CEC->AddLog(CEC_LOG_DEBUG, "key released: %s (%1x)", ToString(key.keycode), key.keycode); -++ LIB_CEC->AddLog(CEC_LOG_DEBUG, "key released: %s (%1x) D:%dms", ToString(key.keycode), key.keycode, key.duration); -+ CallbackAddKey(key); -+ } -+ } -+@@ -1005,10 +1019,11 @@ void CCECClient::AddKey(const cec_keypress &key) -+ key.keycode < CEC_USER_CONTROL_CODE_SELECT) -+ { -+ // send back the previous key if there is one -++ LIB_CEC->AddLog(CEC_LOG_DEBUG, "Unexpected key %s (%1x) D:%dms", ToString(key.keycode), key.keycode, key.duration); -+ AddKey(); -+ return; -+ } -+- -++ bool isrepeat = false; -+ cec_keypress transmitKey(key); -+ cec_user_control_code comboKey(m_configuration.clientVersion >= CEC_CLIENT_VERSION_2_0_5 ? -+ m_configuration.comboKey : CEC_USER_CONTROL_CODE_STOP); -+@@ -1028,27 +1043,60 @@ void CCECClient::AddKey(const cec_keypress &key) -+ transmitKey.keycode = CEC_USER_CONTROL_CODE_DOT; -+ // default, send back the previous key -+ else -++ { -++ LIB_CEC->AddLog(CEC_LOG_DEBUG, "Combo key %s (%1x) D%dms:", ToString(key.keycode), key.keycode, key.duration); -+ AddKey(true); -++ } -+ } -+ -++ LIB_CEC->AddLog(CEC_LOG_DEBUG, "key pressed: %s (%1x) current(%lx) duration(%d)", ToString(transmitKey.keycode), transmitKey.keycode, m_iCurrentButton, key.duration); -++ -+ if (m_iCurrentButton == key.keycode) -+ { -+- m_buttontime = GetTimeMs(); -++ m_updateButtontime = GetTimeMs(); -++ m_releaseButtontime = m_updateButtontime + (m_configuration.iButtonReleaseDelayMs ? m_configuration.iButtonReleaseDelayMs : CEC_BUTTON_TIMEOUT); -++ // want to have seen some updated before considering a repeat -++ if (m_configuration.iButtonRepeatRateMs) -++ { -++ if (!m_repeatButtontime && m_pressedButtoncount > 1) -++ m_repeatButtontime = m_initialButtontime + DoubleTapTimeoutMS(); -++ isrepeat = true; -++ } -++ m_pressedButtoncount++; -+ } -+ else -+ { -+- AddKey(); -++ if (m_iCurrentButton != transmitKey.keycode) -++ { -++ LIB_CEC->AddLog(CEC_LOG_DEBUG, "Changed key %s (%1x) D:%dms cur:%lx", ToString(transmitKey.keycode), transmitKey.keycode, transmitKey.duration, m_iCurrentButton); -++ AddKey(); -++ } -+ if (key.duration == 0) -+ { -+ m_iCurrentButton = transmitKey.keycode; -+- m_buttontime = m_iCurrentButton == CEC_USER_CONTROL_CODE_UNKNOWN || key.duration > 0 ? 0 : GetTimeMs(); -++ if (m_iCurrentButton == CEC_USER_CONTROL_CODE_UNKNOWN) -++ { -++ m_initialButtontime = 0; -++ m_updateButtontime = 0; -++ m_repeatButtontime = 0; -++ m_releaseButtontime = 0; -++ m_pressedButtoncount = 0; -++ } -++ else -++ { -++ m_initialButtontime = GetTimeMs(); -++ m_updateButtontime = m_initialButtontime; -++ m_repeatButtontime = 0; // set this on next update -++ m_releaseButtontime = m_initialButtontime + (m_configuration.iButtonReleaseDelayMs ? m_configuration.iButtonReleaseDelayMs : CEC_BUTTON_TIMEOUT); -++ m_pressedButtoncount = 1; -++ } -+ } -+ } -+ } -+ -+- if (key.keycode != comboKey || key.duration > 0) -++ if (!isrepeat && (key.keycode != comboKey || key.duration > 0)) -+ { -+- LIB_CEC->AddLog(CEC_LOG_DEBUG, "key pressed: %s (%1x)", ToString(transmitKey.keycode), transmitKey.keycode); -++ LIB_CEC->AddLog(CEC_LOG_DEBUG, "key pressed: %s (%1x, %d)", ToString(transmitKey.keycode), transmitKey.keycode, transmitKey.duration); -+ CallbackAddKey(transmitKey); -+ } -+ } -+@@ -1060,6 +1108,7 @@ void CCECClient::SetCurrentButton(const cec_user_control_code iButtonCode) -+ key.duration = 0; -+ key.keycode = iButtonCode; -+ -++ LIB_CEC->AddLog(CEC_LOG_DEBUG, "SetCurrentButton %s (%1x) D:%dms cur:%lx", ToString(key.keycode), key.keycode, key.duration); -+ AddKey(key); -+ } -+ -+@@ -1076,35 +1125,59 @@ uint16_t CCECClient::CheckKeypressTimeout(void) -+ { -+ CLockObject lock(m_mutex); -+ uint64_t iNow = GetTimeMs(); -++ LIB_CEC->AddLog(CEC_LOG_DEBUG, "%s T:%.3f", __FUNCTION__, iNow*1e-3); -+ cec_user_control_code comboKey(m_configuration.clientVersion >= CEC_CLIENT_VERSION_2_0_5 ? -+ m_configuration.comboKey : CEC_USER_CONTROL_CODE_STOP); -+ uint32_t iTimeoutMs(m_configuration.clientVersion >= CEC_CLIENT_VERSION_2_0_5 ? -+ m_configuration.iComboKeyTimeoutMs : CEC_DEFAULT_COMBO_TIMEOUT_MS); -+ -+- if (m_iCurrentButton != CEC_USER_CONTROL_CODE_UNKNOWN && -+- ((m_iCurrentButton == comboKey && iTimeoutMs > 0 && iNow - m_buttontime > iTimeoutMs) || -+- (m_iCurrentButton != comboKey && iNow - m_buttontime > CEC_BUTTON_TIMEOUT))) -++ if (m_iCurrentButton == comboKey && iTimeoutMs > 0 && iNow - m_updateButtontime >= iTimeoutMs) -+ { -+- key.duration = (unsigned int) (iNow - m_buttontime); -++ key.duration = (unsigned int) (iNow - m_initialButtontime); -+ key.keycode = m_iCurrentButton; -+ -+ m_iCurrentButton = CEC_USER_CONTROL_CODE_UNKNOWN; -+- m_buttontime = 0; -++ m_initialButtontime = 0; -++ m_updateButtontime = 0; -++ m_repeatButtontime = 0; -++ m_releaseButtontime = 0; -++ m_pressedButtoncount = 0; -++ } -++ else if (m_iCurrentButton != comboKey && m_releaseButtontime && iNow >= (uint64_t)m_releaseButtontime) -++ { -++ key.duration = (unsigned int) (iNow - m_initialButtontime); -++ key.keycode = CEC_USER_CONTROL_CODE_UNKNOWN; -++ -++ m_iCurrentButton = CEC_USER_CONTROL_CODE_UNKNOWN; -++ m_initialButtontime = 0; -++ m_updateButtontime = 0; -++ m_repeatButtontime = 0; -++ m_releaseButtontime = 0; -++ m_pressedButtoncount = 0; -++ } -++ else if (m_iCurrentButton != comboKey && m_repeatButtontime && iNow >= (uint64_t)m_repeatButtontime) -++ { -++ key.duration = (unsigned int) (iNow - m_initialButtontime); -++ key.keycode = m_iCurrentButton; -++ m_repeatButtontime = iNow + m_configuration.iButtonRepeatRateMs; -++ timeout = std::min((uint64_t)timeout, m_repeatButtontime - iNow); -+ } -+ else -+ { -+- // time when this keypress will be released and we'd like to be called again -+- unsigned int timeout = CEC_PROCESSOR_SIGNAL_WAIT_TIME; -+- if (m_iCurrentButton != CEC_USER_CONTROL_CODE_UNKNOWN && m_iCurrentButton == comboKey && iTimeoutMs > 0) -+- timeout = iTimeoutMs - (iNow - m_buttontime) + 1; -+- else if (m_iCurrentButton != CEC_USER_CONTROL_CODE_UNKNOWN && m_iCurrentButton != comboKey) -+- timeout = CEC_BUTTON_TIMEOUT - (iNow - m_buttontime) + 1; -++ if (m_iCurrentButton == comboKey && iTimeoutMs > 0) -++ timeout = std::min((uint64_t)timeout, m_updateButtontime - iNow + iTimeoutMs); -++ if (m_iCurrentButton != comboKey && m_releaseButtontime) -++ timeout = std::min((uint64_t)timeout, m_releaseButtontime - iNow); -++ if (m_iCurrentButton != comboKey && m_repeatButtontime) -++ timeout = std::min((uint64_t)timeout, m_repeatButtontime - iNow); -+ if (timeout > CEC_PROCESSOR_SIGNAL_WAIT_TIME) -+ { -+- LIB_CEC->AddLog(CEC_LOG_ERROR, "Unexpected timeout: %d (%.3f %.3f %.3f) k:%02x", timeout, iNow*1e-3, m_buttontime*1e-3, CEC_BUTTON_TIMEOUT*1e-3, m_iCurrentButton); -++ LIB_CEC->AddLog(CEC_LOG_ERROR, "Unexpected timeout: %d (%.3f %.3f %.3f) k:%02x", timeout, iNow*1e-3, m_updateButtontime*1e-3, m_releaseButtontime*1e-3, m_iCurrentButton); -+ timeout = CEC_PROCESSOR_SIGNAL_WAIT_TIME; -+ } -+ } -++ LIB_CEC->AddLog(CEC_LOG_DEBUG, "Key %s: %s (duration:%d) (%1x) timeout:%dms (rel:%d,rep:%d,prs:%d)", ToString(m_iCurrentButton), key.keycode == CEC_USER_CONTROL_CODE_UNKNOWN ? "idle" : m_repeatButtontime ? "repeated" : "released", key.duration, -++ m_iCurrentButton, timeout, (int)(m_releaseButtontime ? m_releaseButtontime - iNow : 0), (int)(m_repeatButtontime ? m_repeatButtontime - iNow : 0), m_pressedButtoncount); -+ } -+ -+ if (key.keycode != CEC_USER_CONTROL_CODE_UNKNOWN) -+diff --git a/src/lib/CECClient.h b/src/lib/CECClient.h -+index 84fb909..27af3f9 100644 -+--- a/src/lib/CECClient.h -++++ b/src/lib/CECClient.h -+@@ -311,7 +311,11 @@ namespace CEC -+ PLATFORM::CMutex m_mutex; /**< mutex for changes to this instance */ -+ PLATFORM::CMutex m_cbMutex; /**< mutex that is held when doing anything with callbacks */ -+ cec_user_control_code m_iCurrentButton; /**< the control code of the button that's currently held down (if any) */ -+- int64_t m_buttontime; /**< the timestamp when the button was pressed (in seconds since epoch), or 0 if none was pressed. */ -++ int64_t m_initialButtontime; /**< the timestamp when the button was initially pressed (in seconds since epoch), or 0 if none was pressed. */ -++ int64_t m_updateButtontime; /**< the timestamp when the button was updated (in seconds since epoch), or 0 if none was pressed. */ -++ int64_t m_repeatButtontime; /**< the timestamp when the button will next repeat (in seconds since epoch), or 0 if repeat is disabled. */ -++ int64_t m_releaseButtontime; /**< the timestamp when the button will be released (in seconds since epoch), or 0 if none was pressed. */ -++ int32_t m_pressedButtoncount; /**< the number of times a button released message has been seen for this press. */ -+ int64_t m_iPreventForwardingPowerOffCommand; /**< prevent forwarding standby commands until this time */ -+ int64_t m_iLastKeypressTime; /**< last time a key press was sent to the client */ -+ cec_keypress m_lastKeypress; /**< the last key press that was sent to the client */ -+-- -+1.9.1 -+ -+ -+From 23860987ec534a4aecf93100bef3736c2620fb93 Mon Sep 17 00:00:00 2001 -+From: popcornmix -+Date: Tue, 28 Oct 2014 01:21:35 +0000 -+Subject: [PATCH 5/5] Skip double press removal. It is handled through other -+ means. -+ -+--- -+ src/lib/CECClient.cpp | 18 +----------------- -+ src/lib/CECClient.h | 2 -- -+ 2 files changed, 1 insertion(+), 19 deletions(-) -+ -+diff --git a/src/lib/CECClient.cpp b/src/lib/CECClient.cpp -+index 68eaee9..9b4b533 100644 -+--- a/src/lib/CECClient.cpp -++++ b/src/lib/CECClient.cpp -+@@ -57,11 +57,8 @@ CCECClient::CCECClient(CCECProcessor *processor, const libcec_configuration &con -+ m_repeatButtontime(0), -+ m_releaseButtontime(0), -+ m_pressedButtoncount(0), -+- m_iPreventForwardingPowerOffCommand(0), -+- m_iLastKeypressTime(0) -++ m_iPreventForwardingPowerOffCommand(0) -+ { -+- m_lastKeypress.keycode = CEC_USER_CONTROL_CODE_UNKNOWN; -+- m_lastKeypress.duration = 0; -+ m_configuration.Clear(); -+ // set the initial configuration -+ SetConfiguration(configuration); -+@@ -1568,20 +1565,7 @@ void CCECClient::CallbackAddKey(const cec_keypress &key) -+ { -+ CLockObject lock(m_cbMutex); -+ if (m_configuration.callbacks && m_configuration.callbacks->CBCecKeyPress) -+- { -+- // prevent double taps -+- int64_t now = GetTimeMs(); -+- if (m_lastKeypress.keycode != key.keycode || -+- key.duration > 0 || -+- now - m_iLastKeypressTime >= DoubleTapTimeoutMS()) -+- { -+- // no double tap -+- if (key.duration == 0) -+- m_iLastKeypressTime = now; -+- m_lastKeypress = key; -+ m_configuration.callbacks->CBCecKeyPress(m_configuration.callbackParam, key); -+- } -+- } -+ } -+ -+ void CCECClient::CallbackAddLog(const cec_log_message &message) -+diff --git a/src/lib/CECClient.h b/src/lib/CECClient.h -+index 27af3f9..eb11d9b 100644 -+--- a/src/lib/CECClient.h -++++ b/src/lib/CECClient.h -+@@ -317,7 +317,5 @@ namespace CEC -+ int64_t m_releaseButtontime; /**< the timestamp when the button will be released (in seconds since epoch), or 0 if none was pressed. */ -+ int32_t m_pressedButtoncount; /**< the number of times a button released message has been seen for this press. */ -+ int64_t m_iPreventForwardingPowerOffCommand; /**< prevent forwarding standby commands until this time */ -+- int64_t m_iLastKeypressTime; /**< last time a key press was sent to the client */ -+- cec_keypress m_lastKeypress; /**< the last key press that was sent to the client */ -+ }; -+ } -+-- -+1.9.1 - -From 37c1e4ba09cacd1fd0bf30883606fcab6c51d71d Mon Sep 17 00:00:00 2001 +From 5c9736a99bc81334fd7aedf28578392c7780fb1a Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 15 Feb 2015 14:06:12 +0000 -Subject: [PATCH 29/56] [mmal] Allow mmal codec for dvd stills +Subject: [PATCH 30/61] [mmal] Allow mmal codec for dvd stills --- xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp -index 0a16b4b..b77a168 100644 +index eafabb3..8a3beb7 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp @@ -50,6 +50,9 @@ @@ -2227,7 +1662,7 @@ index 0a16b4b..b77a168 100644 #include "Audio/DVDAudioCodecFFmpeg.h" #include "Audio/DVDAudioCodecPassthrough.h" #include "Overlay/DVDOverlayCodecSSA.h" -@@ -199,6 +202,10 @@ CDVDVideoCodec* CDVDFactoryCodec::CreateVideoCodec(CDVDStreamInfo &hint, unsigne +@@ -201,6 +204,10 @@ CDVDVideoCodec* CDVDFactoryCodec::CreateVideoCodec(CDVDStreamInfo &hint, const C #endif CLog::Log(LOGDEBUG, "CDVDFactoryCodec: compiled in hardware support: %s", hwSupport.c_str()); @@ -2239,10 +1674,113 @@ index 0a16b4b..b77a168 100644 { // If dvd is an mpeg2 and hint.stills -From e1e93abe7d9cb7e9232c67c6d1362fa294c290cb Mon Sep 17 00:00:00 2001 +From 0b367aae0fae2d797055a20dd70949207659220f Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Tue, 31 Mar 2015 17:31:47 +0100 +Subject: [PATCH 42/61] [mmalrenderer] Add SetCodecControl function and prefer + to return pictures when renderer is low (disabled) + +--- + xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 13 +++++++++++++ + xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h | 2 ++ + 2 files changed, 15 insertions(+) + +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp +index 27fa9c4..a2510be 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp +@@ -124,6 +124,7 @@ CMMALVideo::CMMALVideo() + m_es_format = mmal_format_alloc(); + m_preroll = true; + m_speed = DVD_PLAYSPEED_NORMAL; ++ m_codecControlFlags = 0; + } + + CMMALVideo::~CMMALVideo() +@@ -864,6 +865,9 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) + if (g_advancedSettings.CanLogComponent(LOGVIDEO)) + CLog::Log(LOGDEBUG, "%s::%s - got output picture:%d", CLASSNAME, __func__, m_output_ready.size()); + ret |= VC_PICTURE; ++ // renderer is low - give priority to returning pictures ++ if (0 && m_codecControlFlags & DVD_CODEC_CTRL_DRAIN) ++ ret &= ~VC_BUFFER; + } + if (!ret) + { +@@ -942,6 +946,7 @@ void CMMALVideo::Reset(void) + m_startframe = false; + m_decoderPts = DVD_NOPTS_VALUE; + m_preroll = !m_hints.stills && (m_speed == DVD_PLAYSPEED_NORMAL || m_speed == DVD_PLAYSPEED_PAUSE); ++ m_codecControlFlags = 0; + } + + void CMMALVideo::SetSpeed(int iSpeed) +@@ -1057,3 +1062,11 @@ bool CMMALVideo::GetCodecStats(double &pts, int &droppedPics) + droppedPics= -1; + return false; + } ++ ++void CMMALVideo::SetCodecControl(int flags) ++{ ++ CSingleLock lock(m_sharedSection); ++ m_codecControlFlags = flags; ++ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) ++ CLog::Log(LOGDEBUG, "%s::%s flags:%x", CLASSNAME, __func__, flags); ++} +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h +index 51a64d1..bde8c06 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h +@@ -86,6 +86,7 @@ class CMMALVideo : public CDVDVideoCodec + virtual void SetDropState(bool bDrop); + virtual const char* GetName(void) { return m_pFormatName ? m_pFormatName:"mmal-xxx"; } + virtual bool GetCodecStats(double &pts, int &droppedPics); ++ virtual void SetCodecControl(int flags); + virtual void SetSpeed(int iSpeed); + + // MMAL decoder callback routines. +@@ -130,6 +131,7 @@ class CMMALVideo : public CDVDVideoCodec + double m_decoderPts; + int m_speed; + bool m_preroll; ++ int m_codecControlFlags; + + CCriticalSection m_sharedSection; + MMAL_COMPONENT_T *m_dec; + +From 7ec37cce302f39ca91ba8bc86be80e7e1d7368c5 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Wed, 1 Apr 2015 16:31:37 +0100 +Subject: [PATCH 43/61] [mmalcodec] Limit submitted video frames. Seems to + avoid stutter issues with low bitrate videos + +--- + xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp +index a2510be..c37f321 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp +@@ -848,10 +848,11 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) + break; + } + int ret = 0; +- if (mmal_queue_length(m_dec_input_pool->queue) > 0 && !m_demux_queue_length) ++ double queued = m_decoderPts != DVD_NOPTS_VALUE && pts != DVD_NOPTS_VALUE ? pts - m_decoderPts : 0.0; ++ if (mmal_queue_length(m_dec_input_pool->queue) > 0 && !m_demux_queue_length && queued <= DVD_MSEC_TO_TIME(500)) + { + if (g_advancedSettings.CanLogComponent(LOGVIDEO)) +- CLog::Log(LOGDEBUG, "%s::%s - got space for output: demux_queue(%d) space(%d)", CLASSNAME, __func__, m_demux_queue_length, mmal_queue_length(m_dec_input_pool->queue) * m_dec_input->buffer_size); ++ CLog::Log(LOGDEBUG, "%s::%s - got space for output: demux_queue(%d) space(%d) queued(%.2f)", CLASSNAME, __func__, m_demux_queue_length, mmal_queue_length(m_dec_input_pool->queue) * m_dec_input->buffer_size, queued*1e-6); + ret |= VC_BUFFER; + } + else + +From 959ec414be56d1d4ca4774508069d350c61a83e9 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 24 Feb 2015 15:57:29 +0000 -Subject: [PATCH 30/56] [mmalrenderer] Fix for stereo view modes +Subject: [PATCH 44/61] [mmalrenderer] Fix for stereo view modes PR6090 (dirty regions for video) meant that RenderUpate is no longer called with the expected stereo view mode. So, just explicitly set this before calling ManageDisplay to get the desired rectangles @@ -2251,10 +1789,10 @@ So, just explicitly set this before calling ManageDisplay to get the desired rec 1 file changed, 4 insertions(+) diff --git a/xbmc/cores/VideoRenderers/MMALRenderer.cpp b/xbmc/cores/VideoRenderers/MMALRenderer.cpp -index 3329980..d53de35 100644 +index fc9dfca..f1e3252 100644 --- a/xbmc/cores/VideoRenderers/MMALRenderer.cpp +++ b/xbmc/cores/VideoRenderers/MMALRenderer.cpp -@@ -351,7 +351,11 @@ void CMMALRenderer::RenderUpdate(bool clear, DWORD flags, DWORD alpha) +@@ -366,7 +366,11 @@ void CMMALRenderer::RenderUpdate(bool clear, DWORD flags, DWORD alpha) if (!m_bConfigured) return; @@ -2267,10 +1805,10 @@ index 3329980..d53de35 100644 // if running bypass, then the player might need the src/dst rects // for sizing video playback on a layer other than the gles layer. -From e11c6931312b66a33fd8ddc52a1c121894c913ab Mon Sep 17 00:00:00 2001 +From c755cacee4346e3a55cd337d85630471fe6ef309 Mon Sep 17 00:00:00 2001 From: anaconda Date: Wed, 25 Feb 2015 18:22:21 +0100 -Subject: [PATCH 31/56] Load OSD dialogs on startup. +Subject: [PATCH 45/61] Load OSD dialogs on startup. Fixes skipped frames the first time they're loaded in memory on less powered devices, like a Raspberry Pi, when using DVDPlayer. @@ -2365,10 +1903,10 @@ index 4940561..f52698c 100644 CGUIDialogVideoSettings::~CGUIDialogVideoSettings() { } -From 71e5a4591b65a12c3621395644c2542b1216c94f Mon Sep 17 00:00:00 2001 +From b54cf11f709c406dfaafdab2703d1c111d0b61b8 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 7 Mar 2015 22:46:21 +0000 -Subject: [PATCH 32/56] configure: Add raspberry-pi2 platform +Subject: [PATCH 46/61] configure: Add raspberry-pi2 platform --- configure.ac | 14 +++++++-- @@ -2380,7 +1918,7 @@ Subject: [PATCH 32/56] configure: Add raspberry-pi2 platform 6 files changed, 44 insertions(+), 22 deletions(-) diff --git a/configure.ac b/configure.ac -index ea94c1d..2a80a9d 100644 +index cf18212..65df15f 100644 --- a/configure.ac +++ b/configure.ac @@ -746,8 +746,17 @@ case $use_platform in @@ -2542,10 +2080,10 @@ index cdc2fe4..379bd1d 100644 set(CMAKE_SYSTEM_NAME Linux) endif() -From 05272dd1d48f92910c02f134d58cad85e236b567 Mon Sep 17 00:00:00 2001 +From eded2ce0900d7837f4e451d5b58bc02153ce1e79 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 16 Apr 2014 21:18:06 +0100 -Subject: [PATCH 33/56] [omxplayer] Don't propagate 3d flags based on supported +Subject: [PATCH 47/61] [omxplayer] Don't propagate 3d flags based on supported 3d modes --- @@ -2553,10 +2091,10 @@ Subject: [PATCH 33/56] [omxplayer] Don't propagate 3d flags based on supported 1 file changed, 3 insertions(+), 26 deletions(-) diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -index 5ca7665..2e077e5 100644 +index 212a89b..dd509ea 100644 --- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -@@ -762,40 +762,17 @@ void OMXPlayerVideo::ResolutionUpdateCallBack(uint32_t width, uint32_t height, f +@@ -752,40 +752,17 @@ void OMXPlayerVideo::ResolutionUpdateCallBack(uint32_t width, uint32_t height, f uint32_t video_width = CDisplaySettings::Get().GetResolutionInfo(res).iScreenWidth; uint32_t video_height = CDisplaySettings::Get().GetResolutionInfo(res).iScreenHeight; @@ -2601,10 +2139,10 @@ index 5ca7665..2e077e5 100644 unsigned int iDisplayHeight = height; -From f4aec8de701350aacbfbde39cef3290a03f27dcc Mon Sep 17 00:00:00 2001 +From 98545b6d99c3ab0d9c2b55931cbae5e45b68411c Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 17 Apr 2014 13:01:51 +0100 -Subject: [PATCH 34/56] [graphics] Allow switching to a more suitable 3D +Subject: [PATCH 48/61] [graphics] Allow switching to a more suitable 3D resolution --- @@ -2690,10 +2228,10 @@ index 5c1501a..aba11cd 100644 void ResetOverscan(RESOLUTION_INFO &resinfo); void ResetScreenParameters(RESOLUTION res); -From 78450508b10c875a8d4d48015f256a6c1d2b2c40 Mon Sep 17 00:00:00 2001 +From 6376797042cac6d4c821c850e4569ccf66c03ebb Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 17 Apr 2014 13:38:55 +0100 -Subject: [PATCH 35/56] [3D] Support switching to 3D resolutions +Subject: [PATCH 49/61] [3D] Support switching to 3D resolutions Include matching 3D flags (SBS/TAB) in the score of a resolution to switch to, to enable switching to 3d modes. Also remove the old code that treated 3D modes differently when assigning a score. @@ -2775,10 +2313,10 @@ index 4345c0f..cc5dc60 100644 return current; } -From cc039a1f0c00c08a795e2afb33a3c7f2f494bab2 Mon Sep 17 00:00:00 2001 +From 1ca60872dbd7c116d44a2f9a49d5cc704e5193e2 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 23 Apr 2014 00:05:07 +0100 -Subject: [PATCH 36/56] [graphics] Make pixel ratio for 3d modes consistent +Subject: [PATCH 50/61] [graphics] Make pixel ratio for 3d modes consistent Note: Use the stored stereo flags from lists of resolutions. Use current stereo mode for current resolution. @@ -2981,25 +2519,151 @@ index c80114e..80c05d2 100644 AddUniqueResolution(res2, resolutions); -From ceb6bdca72eebab222cea1ea26ebc853e96e6465 Mon Sep 17 00:00:00 2001 +From 322614f99f49aea527c75d9573e245da12cfbade Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Tue, 10 Mar 2015 17:05:18 +0000 +Subject: [PATCH 51/61] [players] Add settings option to enable MVC support + +--- + addons/resource.language.en_gb/resources/strings.po | 10 ++++++++++ + system/settings/rbp.xml | 7 +++++++ + xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 5 +++++ + xbmc/cores/omxplayer/OMXVideo.cpp | 5 +++++ + 4 files changed, 27 insertions(+) + +diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po +index aee20d0..3d6b660 100644 +--- a/addons/resource.language.en_gb/resources/strings.po ++++ b/addons/resource.language.en_gb/resources/strings.po +@@ -16602,6 +16602,16 @@ msgctxt "#38052" + msgid "Remote button press release time (ms)" + msgstr "" + ++#: system/settings/rbp.xml ++msgctxt "#38110" ++msgid "Support MVC video (full frame 3D)" ++msgstr "" ++ ++#: system/settings/rbp.xml ++msgctxt "#38111" ++msgid "This option decodes frames for both eyes of MVC video. Disabling may improve performance if you don't require 3D" ++msgstr "" ++ + #: system/settings/settings.xml + msgctxt "#38103" + msgid "Extract thumbnails from video files" +diff --git a/system/settings/rbp.xml b/system/settings/rbp.xml +index 208cd49..6357b1d 100644 +--- a/system/settings/rbp.xml ++++ b/system/settings/rbp.xml +@@ -27,6 +27,13 @@ + + + ++ ++ ++ 2 ++ true ++ ++ ++ + + + +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp +index c37f321..a583450 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp +@@ -537,6 +537,11 @@ bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options) + // H.264 + m_codingType = MMAL_ENCODING_H264; + m_pFormatName = "mmal-h264"; ++ if (CSettings::Get().GetBool("videoplayer.supportmvc")) ++ { ++ m_codingType = MMAL_ENCODING_MVC; ++ m_pFormatName= "mmal-mvc"; ++ } + break; + case AV_CODEC_ID_H263: + case AV_CODEC_ID_MPEG4: +diff --git a/xbmc/cores/omxplayer/OMXVideo.cpp b/xbmc/cores/omxplayer/OMXVideo.cpp +index e4f6d86..5d324f4 100644 +--- a/xbmc/cores/omxplayer/OMXVideo.cpp ++++ b/xbmc/cores/omxplayer/OMXVideo.cpp +@@ -430,6 +430,11 @@ bool COMXVideo::Open(CDVDStreamInfo &hints, OMXClock *clock, EDEINTERLACEMODE de + break; + } + } ++ if (CSettings::Get().GetBool("videoplayer.supportmvc")) ++ { ++ m_codingType = OMX_VIDEO_CodingMVC; ++ m_video_codec_name = "omx-mvc"; ++ } + break; + case AV_CODEC_ID_MPEG4: + // (role name) video_decoder.mpeg4 + +From 9fed5fcd6c6c2150ba465abc04fb7776cb878b03 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 14 Mar 2015 12:38:08 +0000 -Subject: [PATCH 37/56] [mmalrenderer] Switch to using transform flags for 3d +Subject: [PATCH 52/61] [mmalrenderer] Switch to using transform flags for 3d modes --- - xbmc/cores/VideoRenderers/MMALRenderer.cpp | 92 +++++++------------------ - xbmc/cores/omxplayer/OMXPlayerVideo.cpp | 46 ++----------- - xbmc/cores/omxplayer/OMXVideo.cpp | 36 ++++------ - xbmc/cores/omxplayer/OMXVideo.h | 2 +- - xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp | 11 ++- - 5 files changed, 57 insertions(+), 130 deletions(-) + .../resource.language.en_gb/resources/strings.po | 10 +++ + system/settings/rbp.xml | 8 ++ + xbmc/cores/VideoRenderers/MMALRenderer.cpp | 92 ++++++---------------- + xbmc/cores/omxplayer/OMXPlayerVideo.cpp | 46 ++--------- + xbmc/cores/omxplayer/OMXVideo.cpp | 36 ++++----- + xbmc/cores/omxplayer/OMXVideo.h | 2 +- + xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp | 11 ++- + 7 files changed, 75 insertions(+), 130 deletions(-) +diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po +index 3d6b660..eeb6d0a 100644 +--- a/addons/resource.language.en_gb/resources/strings.po ++++ b/addons/resource.language.en_gb/resources/strings.po +@@ -16612,6 +16612,16 @@ msgctxt "#38111" + msgid "This option decodes frames for both eyes of MVC video. Disabling may improve performance if you don't require 3D" + msgstr "" + ++#: system/settings/rbp.xml ++msgctxt "#38112" ++msgid "Use Full HD HDMI modes for 3D" ++msgstr "" ++ ++#: system/settings/rbp.xml ++msgctxt "#38113" ++msgid "This option uses frame-packing to output full resolution for 3D through HDMI" ++msgstr "" ++ + #: system/settings/settings.xml + msgctxt "#38103" + msgid "Extract thumbnails from video files" +diff --git a/system/settings/rbp.xml b/system/settings/rbp.xml +index 6357b1d..77e983b 100644 +--- a/system/settings/rbp.xml ++++ b/system/settings/rbp.xml +@@ -33,6 +33,14 @@ + true + + ++ ++ ++ true ++ ++ 2 ++ true ++ ++ + + + diff --git a/xbmc/cores/VideoRenderers/MMALRenderer.cpp b/xbmc/cores/VideoRenderers/MMALRenderer.cpp -index d53de35..c30de9c 100644 +index f1e3252..8ffcf23 100644 --- a/xbmc/cores/VideoRenderers/MMALRenderer.cpp +++ b/xbmc/cores/VideoRenderers/MMALRenderer.cpp -@@ -351,11 +351,7 @@ void CMMALRenderer::RenderUpdate(bool clear, DWORD flags, DWORD alpha) +@@ -366,11 +366,7 @@ void CMMALRenderer::RenderUpdate(bool clear, DWORD flags, DWORD alpha) if (!m_bConfigured) return; @@ -3011,18 +2675,19 @@ index d53de35..c30de9c 100644 // if running bypass, then the player might need the src/dst rects // for sizing video playback on a layer other than the gles layer. -@@ -560,9 +556,7 @@ EINTERLACEMETHOD CMMALRenderer::AutoInterlaceMethod() +@@ -581,10 +577,8 @@ EINTERLACEMETHOD CMMALRenderer::AutoInterlaceMethod() void CMMALRenderer::SetVideoRect(const CRect& InSrcRect, const CRect& InDestRect) { - // we get called twice a frame for left/right. Can ignore the rights. - if (g_graphicsContext.GetStereoView() == RENDER_STEREO_VIEW_RIGHT) - return; + CSingleLock lock(m_sharedSection); + assert(g_graphicsContext.GetStereoView() != RENDER_STEREO_VIEW_RIGHT); if (!m_vout_input) return; -@@ -604,41 +598,10 @@ void CMMALRenderer::SetVideoRect(const CRect& InSrcRect, const CRect& InDestRect +@@ -626,41 +620,10 @@ void CMMALRenderer::SetVideoRect(const CRect& InSrcRect, const CRect& InDestRect CRect gui(0, 0, CDisplaySettings::Get().GetResolutionInfo(res).iWidth, CDisplaySettings::Get().GetResolutionInfo(res).iHeight); CRect display(0, 0, CDisplaySettings::Get().GetResolutionInfo(res).iScreenWidth, CDisplaySettings::Get().GetResolutionInfo(res).iScreenHeight); @@ -3068,7 +2733,7 @@ index d53de35..c30de9c 100644 if (gui != display) { -@@ -653,7 +616,7 @@ void CMMALRenderer::SetVideoRect(const CRect& InSrcRect, const CRect& InDestRect +@@ -675,7 +638,7 @@ void CMMALRenderer::SetVideoRect(const CRect& InSrcRect, const CRect& InDestRect MMAL_DISPLAYREGION_T region; memset(®ion, 0, sizeof region); @@ -3077,7 +2742,7 @@ index d53de35..c30de9c 100644 region.dest_rect.x = lrintf(DestRect.x1); region.dest_rect.y = lrintf(DestRect.y1); region.dest_rect.width = lrintf(DestRect.Width()); -@@ -666,35 +629,32 @@ void CMMALRenderer::SetVideoRect(const CRect& InSrcRect, const CRect& InDestRect +@@ -688,35 +651,32 @@ void CMMALRenderer::SetVideoRect(const CRect& InSrcRect, const CRect& InDestRect region.fullscreen = MMAL_FALSE; region.noaspect = MMAL_TRUE; @@ -3134,10 +2799,10 @@ index d53de35..c30de9c 100644 + region.dest_rect.x, region.dest_rect.y, region.dest_rect.width, region.dest_rect.height, region.transform); } diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -index 2e077e5..f6c6eb0 100644 +index dd509ea..adf9910 100644 --- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -@@ -659,9 +659,7 @@ int OMXPlayerVideo::GetFreeSpace() +@@ -649,9 +649,7 @@ int OMXPlayerVideo::GetFreeSpace() void OMXPlayerVideo::SetVideoRect(const CRect &InSrcRect, const CRect &InDestRect) { @@ -3148,7 +2813,7 @@ index 2e077e5..f6c6eb0 100644 CRect SrcRect = InSrcRect, DestRect = InDestRect; unsigned flags = GetStereoModeFlags(GetStereoMode()); -@@ -701,42 +699,10 @@ void OMXPlayerVideo::SetVideoRect(const CRect &InSrcRect, const CRect &InDestRec +@@ -691,42 +689,10 @@ void OMXPlayerVideo::SetVideoRect(const CRect &InSrcRect, const CRect &InDestRec CRect gui(0, 0, CDisplaySettings::Get().GetResolutionInfo(res).iWidth, CDisplaySettings::Get().GetResolutionInfo(res).iHeight); CRect display(0, 0, CDisplaySettings::Get().GetResolutionInfo(res).iScreenWidth, CDisplaySettings::Get().GetResolutionInfo(res).iScreenHeight); @@ -3195,7 +2860,7 @@ index 2e077e5..f6c6eb0 100644 if (gui != display) { -@@ -747,7 +713,7 @@ void OMXPlayerVideo::SetVideoRect(const CRect &InSrcRect, const CRect &InDestRec +@@ -737,7 +703,7 @@ void OMXPlayerVideo::SetVideoRect(const CRect &InSrcRect, const CRect &InDestRec DestRect.y1 *= yscale; DestRect.y2 *= yscale; } @@ -3205,7 +2870,7 @@ index 2e077e5..f6c6eb0 100644 void OMXPlayerVideo::RenderUpdateCallBack(const void *ctx, const CRect &SrcRect, const CRect &DestRect) diff --git a/xbmc/cores/omxplayer/OMXVideo.cpp b/xbmc/cores/omxplayer/OMXVideo.cpp -index ca40a37..bb4d572 100644 +index 5d324f4..832a9c9 100644 --- a/xbmc/cores/omxplayer/OMXVideo.cpp +++ b/xbmc/cores/omxplayer/OMXVideo.cpp @@ -220,15 +220,6 @@ bool COMXVideo::PortSettingsChanged() @@ -3224,7 +2889,7 @@ index ca40a37..bb4d572 100644 if(m_hdmi_clock_sync) { OMX_CONFIG_LATENCYTARGETTYPE latencyTarget; -@@ -855,7 +846,7 @@ void COMXVideo::Reset(void) +@@ -845,7 +836,7 @@ void COMXVideo::Reset(void) } /////////////////////////////////////////////////////////////////////////////////////////// @@ -3233,7 +2898,7 @@ index ca40a37..bb4d572 100644 { CSingleLock lock (m_critSection); if(!m_is_open) -@@ -865,7 +856,7 @@ void COMXVideo::SetVideoRect(const CRect& SrcRect, const CRect& DestRect, RENDER +@@ -855,7 +846,7 @@ void COMXVideo::SetVideoRect(const CRect& SrcRect, const CRect& DestRect, RENDER OMX_INIT_STRUCTURE(configDisplay); configDisplay.nPortIndex = m_omx_render.GetInputPort(); @@ -3242,7 +2907,7 @@ index ca40a37..bb4d572 100644 configDisplay.dest_rect.x_offset = lrintf(DestRect.x1); configDisplay.dest_rect.y_offset = lrintf(DestRect.y1); configDisplay.dest_rect.width = lrintf(DestRect.Width()); -@@ -878,23 +869,24 @@ void COMXVideo::SetVideoRect(const CRect& SrcRect, const CRect& DestRect, RENDER +@@ -868,23 +859,24 @@ void COMXVideo::SetVideoRect(const CRect& SrcRect, const CRect& DestRect, RENDER configDisplay.fullscreen = OMX_FALSE; configDisplay.noaspect = OMX_TRUE; @@ -3279,7 +2944,7 @@ index ca40a37..bb4d572 100644 int COMXVideo::GetInputBufferSize() diff --git a/xbmc/cores/omxplayer/OMXVideo.h b/xbmc/cores/omxplayer/OMXVideo.h -index 9f26427..3ea02dc 100644 +index d0634bb..86e94ce 100644 --- a/xbmc/cores/omxplayer/OMXVideo.h +++ b/xbmc/cores/omxplayer/OMXVideo.h @@ -59,7 +59,7 @@ class COMXVideo @@ -3321,10 +2986,10 @@ index 80c05d2..ae85484 100644 m_width, m_height, dst_rect.width, dst_rect.height, res.fRefreshRate, GETFLAGS_GROUP(res.dwFlags), GETFLAGS_MODE(res.dwFlags), (int)res.dwFlags, res.fPixelRatio); -From 978189928bf88240aa551e48921a6f74b90957f1 Mon Sep 17 00:00:00 2001 +From 1935fc178acf61dacda8f982802e4f326390dba5 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 17 Mar 2015 20:33:54 +0000 -Subject: [PATCH 38/56] alsa: enable-shared is required +Subject: [PATCH 53/61] alsa: enable-shared is required --- tools/depends/target/alsa-lib/Makefile | 2 +- @@ -3344,882 +3009,11 @@ index b03fc19..a04d933 100644 LIBDYLIB=$(PLATFORM)/src/.libs/$(LIBNAME).a -From c906a8a2edab573281ccbd99563c7c05f644d1e2 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Tue, 31 Mar 2015 17:31:47 +0100 -Subject: [PATCH 39/56] [mmalrenderer] Add SetCodecControl function and prefer - to return pictures when renderer is low (disabled) ---- - xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.cpp | 5 +++++ - xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.h | 1 + - xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 12 ++++++++++++ - xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h | 2 ++ - 4 files changed, 20 insertions(+) - -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.cpp -index 262283d..ee7d6f2 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.cpp -@@ -96,6 +96,11 @@ bool CDVDVideoCodecMMAL::GetCodecStats(double &pts, int &droppedPics) - return m_decoder->GetCodecStats(pts, droppedPics); - } - -+void CDVDVideoCodecMMAL::SetCodecControl(int flags) -+{ -+ m_decoder->SetCodecControl(flags); -+} -+ - void CDVDVideoCodecMMAL::SetSpeed(int iSpeed) - { - m_decoder->SetSpeed(iSpeed); -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.h -index a768e70..aa8e87f 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.h -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.h -@@ -42,6 +42,7 @@ class CDVDVideoCodecMMAL : public CDVDVideoCodec - virtual void SetDropState(bool bDrop); - virtual const char* GetName(void); - virtual bool GetCodecStats(double &pts, int &droppedPics); -+ virtual void SetCodecControl(int flags); - virtual void SetSpeed(int iSpeed); - - protected: -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -index df282f3..6eb7f7c 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -@@ -128,6 +128,7 @@ CMMALVideo::CMMALVideo() - m_es_format = mmal_format_alloc(); - m_preroll = true; - m_speed = DVD_PLAYSPEED_NORMAL; -+ m_codecControlFlags = 0; - } - - CMMALVideo::~CMMALVideo() -@@ -939,6 +940,9 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) - CLog::Log(LOGDEBUG, "%s::%s - got output picture:%d", CLASSNAME, __func__, m_output_ready.size()); - ret |= VC_PICTURE; -+ // renderer is low - give priority to returning pictures -+ if (0 && m_codecControlFlags & DVD_CODEC_CTRL_DRAIN) -+ ret &= ~VC_BUFFER; - } - if (!ret) - { -@@ -990,6 +994,7 @@ void CMMALVideo::Reset(void) - m_startframe = false; - m_decoderPts = DVD_NOPTS_VALUE; - m_preroll = !m_hints.stills && (m_speed == DVD_PLAYSPEED_NORMAL || m_speed == DVD_PLAYSPEED_PAUSE); -+ m_codecControlFlags = 0; - } - - void CMMALVideo::SetSpeed(int iSpeed) -@@ -1123,3 +1128,10 @@ bool CMMALVideo::GetCodecStats(double &pts, int &droppedPics) - // CLog::Log(LOGDEBUG, "%s::%s - pts:%.0f droppedPics:%d", CLASSNAME, __func__, pts, droppedPics); - return true; - } -+ -+void CMMALVideo::SetCodecControl(int flags) -+{ -+ m_codecControlFlags = flags; -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ CLog::Log(LOGDEBUG, "%s::%s flags:%x", CLASSNAME, __func__, flags); -+} -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -index 4c9b20f..c405aa1 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -@@ -89,6 +89,7 @@ class CMMALVideo - virtual void SetDropState(bool bDrop); - virtual const char* GetName(void) { return (const char*)m_pFormatName; } - virtual bool GetCodecStats(double &pts, int &droppedPics); -+ virtual void SetCodecControl(int flags); - virtual void SetSpeed(int iSpeed); - - // MMAL decoder callback routines. -@@ -140,6 +141,7 @@ class CMMALVideo - unsigned int m_droppedPics; - int m_speed; - bool m_preroll; -+ int m_codecControlFlags; - - MMAL_COMPONENT_T *m_dec; - MMAL_PORT_T *m_dec_input; - -From 84bcf7c0aa9499fde22571ce993b520053a4353e Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Wed, 1 Apr 2015 16:31:37 +0100 -Subject: [PATCH 40/56] [mmalcodec] Limit submitted video frames. Seems to - avoid stutter issues with low bitrate videos - ---- - xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -index 6eb7f7c..24ddc3b 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -@@ -923,7 +923,8 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) - break; - } - int ret = 0; -- if (mmal_queue_length(m_dec_input_pool->queue) > 0 && !m_demux_queue_length) -+ int fps = m_hints.fpsrate && m_hints.fpsscale ? (float)m_hints.fpsrate / (float)m_hints.fpsscale : 25; -+ if (mmal_queue_length(m_dec_input_pool->queue) > 0 && !m_demux_queue_length && m_dts_queue.size() <= fps/2) - { - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) - CLog::Log(LOGDEBUG, "%s::%s - got space for output: demux_queue(%d) space(%d)", CLASSNAME, __func__, m_demux_queue_length, mmal_queue_length(m_dec_input_pool->queue) * m_dec_input->buffer_size); - -From 01e34be063309eb5cc05984a90be0eeb27e18f83 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Mon, 6 Apr 2015 19:06:26 +0100 -Subject: [PATCH 41/56] [mmalcodec] Remove the decoder queue and use gpu - timestamps - -There are too many streams that don't have a 1:1 mapping of encoded video frames to decoded pictures. -If that isn't true, the dts queues gets out of sync with the real frames. - -Interlaces streams and streams with errors cause issues. - -Instead remove the dts queue and use the gpu's timestamps. ---- - xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 88 +++++++++++----------- - xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h | 2 +- - 2 files changed, 46 insertions(+), 44 deletions(-) - -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -index 24ddc3b..4bdca80 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -@@ -129,6 +129,7 @@ CMMALVideo::CMMALVideo() - m_preroll = true; - m_speed = DVD_PLAYSPEED_NORMAL; - m_codecControlFlags = 0; -+ m_history_valid_pts = 0; - } - - CMMALVideo::~CMMALVideo() -@@ -258,27 +259,7 @@ void CMMALVideo::dec_output_port_cb(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buf - { - assert(!(buffer->flags & MMAL_BUFFER_HEADER_FLAG_DECODEONLY)); - double dts = DVD_NOPTS_VALUE; -- if (buffer->flags & MMAL_BUFFER_HEADER_FLAG_USER0) -- { -- pthread_mutex_lock(&m_output_mutex); -- if (!m_dts_queue.empty()) -- { -- dts = m_dts_queue.front(); -- m_dts_queue.pop(); -- } -- else assert(0); -- pthread_mutex_unlock(&m_output_mutex); -- } -- -- if (m_drop_state) -- { -- pthread_mutex_lock(&m_output_mutex); -- m_droppedPics++; -- pthread_mutex_unlock(&m_output_mutex); -- if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -- CLog::Log(LOGDEBUG, "%s::%s - dropping %p (drop:%d)", CLASSNAME, __func__, buffer, m_drop_state); -- } -- else -+ if (!m_drop_state) // && !(g_advancedSettings.m_omxDecodeStartWithValidFrame && (buffer->flags & MMAL_BUFFER_HEADER_FLAG_CORRUPTED))) - { - CMMALVideoBuffer *omvb = new CMMALVideoBuffer(this); - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -@@ -297,6 +278,14 @@ void CMMALVideo::dec_output_port_cb(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buf - pthread_mutex_unlock(&m_output_mutex); - kept = true; - } -+ else -+ { -+ pthread_mutex_lock(&m_output_mutex); -+ m_droppedPics++; -+ pthread_mutex_unlock(&m_output_mutex); -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ CLog::Log(LOGDEBUG, "%s::%s - dropping %p dts:%.3f pts:%.3f (drop:%d len:%d flags:%x)", CLASSNAME, __func__, buffer, dts*1e-6, buffer->pts*1e-6, m_drop_state, buffer->length, buffer->flags); -+ } - } - } - else if (buffer->cmd == MMAL_EVENT_FORMAT_CHANGED) -@@ -648,6 +637,10 @@ bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options, MMALVide - if (status != MMAL_SUCCESS) - CLog::Log(LOGERROR, "%s::%s Failed to enable extra buffers on %s (status=%x %s)", CLASSNAME, __func__, m_dec_input->name, status, mmal_status_to_string(status)); - -+ status = mmal_port_parameter_set_uint32(m_dec_input, MMAL_PARAMETER_VIDEO_TIMESTAMP_FIFO, 1); -+ if (status != MMAL_SUCCESS) -+ CLog::Log(LOGERROR, "%s::%s Failed to enable timestamp fifo mode on %s (status=%x %s)", CLASSNAME, __func__, m_dec_input->name, status, mmal_status_to_string(status)); -+ - status = mmal_port_format_commit(m_dec_input); - if (status != MMAL_SUCCESS) - { -@@ -716,6 +709,8 @@ bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options, MMALVide - m_startframe = false; - m_preroll = !m_hints.stills; - m_speed = DVD_PLAYSPEED_NORMAL; -+ // start from assuming all recent frames had valid pts -+ m_history_valid_pts = ~0; - - return true; - } -@@ -731,10 +726,9 @@ void CMMALVideo::Dispose() - done = true; - pthread_mutex_unlock(&m_output_mutex); - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -- CLog::Log(LOGDEBUG, "%s::%s dts_queue(%d) ready_queue(%d) busy_queue(%d) done:%d", CLASSNAME, __func__, m_dts_queue.size(), m_output_ready.size(), m_output_busy, done); -+ CLog::Log(LOGDEBUG, "%s::%s ready_queue(%d) busy_queue(%d) done:%d", CLASSNAME, __func__, m_output_ready.size(), m_output_busy, done); - if (done) - { -- assert(m_dts_queue.empty()); - m_myself.reset(); - } - } -@@ -767,11 +761,19 @@ void CMMALVideo::SetDropState(bool bDrop) - } - } - -+static unsigned count_bits(int32_t value) -+{ -+ unsigned bits = 0; -+ for(;value;++bits) -+ value &= value - 1; -+ return bits; -+} -+ - int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) - { - //if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -- // CLog::Log(LOGDEBUG, "%s::%s - %-8p %-6d dts:%.3f pts:%.3f dts_queue(%d) ready_queue(%d) busy_queue(%d)", -- // CLASSNAME, __func__, pData, iSize, dts == DVD_NOPTS_VALUE ? 0.0 : dts*1e-6, pts == DVD_NOPTS_VALUE ? 0.0 : pts*1e-6, m_dts_queue.size(), m_output_ready.size(), m_output_busy); -+ // CLog::Log(LOGDEBUG, "%s::%s - %-8p %-6d dts:%.3f pts:%.3f ready_queue(%d) busy_queue(%d)", -+ // CLASSNAME, __func__, pData, iSize, dts == DVD_NOPTS_VALUE ? 0.0 : dts*1e-6, pts == DVD_NOPTS_VALUE ? 0.0 : pts*1e-6, m_output_ready.size(), m_output_busy); - - unsigned int demuxer_bytes = 0; - uint8_t *demuxer_content = NULL; -@@ -835,6 +837,13 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) - return VC_ERROR; - } - -+ // some packed bitstream AVI files set almost all pts values to DVD_NOPTS_VALUE, but have a scattering of real pts values. -+ // the valid pts values match the dts values. -+ // if a stream has had more than 4 valid pts values in the last 16, the use UNKNOWN, otherwise use dts -+ m_history_valid_pts = (m_history_valid_pts << 1) | (pts != DVD_NOPTS_VALUE); -+ if (count_bits(m_history_valid_pts & 0xffff) < 4) -+ pts = dts; -+ - mmal_buffer_header_reset(buffer); - buffer->cmd = 0; - if (!m_startframe && pts == DVD_NOPTS_VALUE) -@@ -857,8 +866,8 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) - buffer->flags |= MMAL_BUFFER_HEADER_FLAG_FRAME_END; - - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -- CLog::Log(LOGDEBUG, "%s::%s - %-8p %-6d/%-6d dts:%.3f pts:%.3f flags:%x dts_queue(%d) ready_queue(%d) busy_queue(%d) demux_queue(%d) space(%d)", -- CLASSNAME, __func__, buffer, buffer->length, demuxer_bytes, dts == DVD_NOPTS_VALUE ? 0.0 : dts*1e-6, pts == DVD_NOPTS_VALUE ? 0.0 : pts*1e-6, buffer->flags, m_dts_queue.size(), m_output_ready.size(), m_output_busy, m_demux_queue_length, mmal_queue_length(m_dec_input_pool->queue) * m_dec_input->buffer_size); -+ CLog::Log(LOGDEBUG, "%s::%s - %-8p %-6d/%-6d dts:%.3f pts:%.3f flags:%x ready_queue(%d) busy_queue(%d) demux_queue(%d) space(%d)", -+ CLASSNAME, __func__, buffer, buffer->length, demuxer_bytes, dts == DVD_NOPTS_VALUE ? 0.0 : dts*1e-6, pts == DVD_NOPTS_VALUE ? 0.0 : pts*1e-6, buffer->flags, m_output_ready.size(), m_output_busy, m_demux_queue_length, mmal_queue_length(m_dec_input_pool->queue) * m_dec_input->buffer_size); - assert((int)buffer->length > 0); - status = mmal_port_send_buffer(m_dec_input, buffer); - if (status != MMAL_SUCCESS) -@@ -875,12 +884,6 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) - { - m_droppedPics += m_deint ? 2:1; - } -- else -- { -- // only push if we are successful with feeding mmal -- m_dts_queue.push(dts); -- assert(m_dts_queue.size() < 5000); -- } - pthread_mutex_unlock(&m_output_mutex); - if (m_changed_count_dec != m_changed_count) - { -@@ -923,11 +926,11 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) - break; - } - int ret = 0; -- int fps = m_hints.fpsrate && m_hints.fpsscale ? (float)m_hints.fpsrate / (float)m_hints.fpsscale : 25; -- if (mmal_queue_length(m_dec_input_pool->queue) > 0 && !m_demux_queue_length && m_dts_queue.size() <= fps/2) -+ double queued = m_decoderPts != DVD_NOPTS_VALUE && pts != DVD_NOPTS_VALUE ? pts - m_decoderPts : 0.0; -+ if (mmal_queue_length(m_dec_input_pool->queue) > 0 && !m_demux_queue_length && queued <= DVD_MSEC_TO_TIME(500)) - { - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -- CLog::Log(LOGDEBUG, "%s::%s - got space for output: demux_queue(%d) space(%d)", CLASSNAME, __func__, m_demux_queue_length, mmal_queue_length(m_dec_input_pool->queue) * m_dec_input->buffer_size); -+ CLog::Log(LOGDEBUG, "%s::%s - got space for output: demux_queue(%d) space(%d) queued(%.2f)", CLASSNAME, __func__, m_demux_queue_length, mmal_queue_length(m_dec_input_pool->queue) * m_dec_input->buffer_size, queued*1e-6); - ret |= VC_BUFFER; - } - else -@@ -948,8 +951,8 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) - if (!ret) - { - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -- CLog::Log(LOGDEBUG, "%s::%s - Nothing to do: dts_queue(%d) ready_queue(%d) busy_queue(%d) demux_queue(%d) space(%d) preroll(%d)", -- CLASSNAME, __func__, m_dts_queue.size(), m_output_ready.size(), m_output_busy, m_demux_queue_length, mmal_queue_length(m_dec_input_pool->queue) * m_dec_input->buffer_size, m_preroll); -+ CLog::Log(LOGDEBUG, "%s::%s - Nothing to do: ready_queue(%d) busy_queue(%d) demux_queue(%d) space(%d) preroll(%d)", -+ CLASSNAME, __func__, m_output_ready.size(), m_output_busy, m_demux_queue_length, mmal_queue_length(m_dec_input_pool->queue) * m_dec_input->buffer_size, m_preroll); - Sleep(10); // otherwise we busy spin - } - return ret; -@@ -979,8 +982,6 @@ void CMMALVideo::Reset(void) - bool old_drop_state = m_drop_state; - SetDropState(true); - pthread_mutex_lock(&m_output_mutex); -- while(!m_dts_queue.empty()) -- m_dts_queue.pop(); - while (!m_demux_queue.empty()) - m_demux_queue.pop(); - m_demux_queue_length = 0; -@@ -996,6 +997,7 @@ void CMMALVideo::Reset(void) - m_decoderPts = DVD_NOPTS_VALUE; - m_preroll = !m_hints.stills && (m_speed == DVD_PLAYSPEED_NORMAL || m_speed == DVD_PLAYSPEED_PAUSE); - m_codecControlFlags = 0; -+ m_history_valid_pts = ~0; - } - - void CMMALVideo::SetSpeed(int iSpeed) -@@ -1015,8 +1017,8 @@ void CMMALVideo::Recycle(MMAL_BUFFER_HEADER_T *buffer) - mmal_buffer_header_reset(buffer); - buffer->cmd = 0; - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -- CLog::Log(LOGDEBUG, "%s::%s Send buffer %p from pool to decoder output port %p dts_queue(%d) ready_queue(%d) busy_queue(%d)", CLASSNAME, __func__, buffer, m_dec_output, -- m_dts_queue.size(), m_output_ready.size(), m_output_busy); -+ CLog::Log(LOGDEBUG, "%s::%s Send buffer %p from pool to decoder output port %p ready_queue(%d) busy_queue(%d)", CLASSNAME, __func__, buffer, m_dec_output, -+ m_output_ready.size(), m_output_busy); - status = mmal_port_send_buffer(m_dec_output, buffer); - if (status != MMAL_SUCCESS) - { -@@ -1043,7 +1045,7 @@ void CMMALVideo::ReleaseBuffer(CMMALVideoBuffer *buffer) - if (done) - m_myself.reset(); - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -- CLog::Log(LOGDEBUG, "%s::%s %p (%p) dts_queue(%d) ready_queue(%d) busy_queue(%d) done:%d", CLASSNAME, __func__, buffer, buffer->mmal_buffer, m_dts_queue.size(), m_output_ready.size(), m_output_busy, done); -+ CLog::Log(LOGDEBUG, "%s::%s %p (%p) ready_queue(%d) busy_queue(%d) done:%d", CLASSNAME, __func__, buffer, buffer->mmal_buffer, m_output_ready.size(), m_output_busy, done); - delete buffer; - } - -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -index c405aa1..f5f664a 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -@@ -118,7 +118,6 @@ class CMMALVideo - const char *m_pFormatName; - MMALVideoPtr m_myself; - -- std::queue m_dts_queue; - std::queue m_demux_queue; - unsigned m_demux_queue_length; - -@@ -142,6 +141,7 @@ class CMMALVideo - int m_speed; - bool m_preroll; - int m_codecControlFlags; -+ uint32_t m_history_valid_pts; - - MMAL_COMPONENT_T *m_dec; - MMAL_PORT_T *m_dec_input; - -From e5cc4fea13487d975d3ff1f4223932f76445ac33 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Thu, 9 Apr 2015 18:18:09 +0100 -Subject: [PATCH 42/56] [mmalrenderer] Remove dropping logic. It only seems to - make things worse - ---- - xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 76 +++++++--------------- - xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h | 2 - - 2 files changed, 23 insertions(+), 55 deletions(-) - -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -index 4bdca80..ea93e32 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -@@ -97,7 +97,6 @@ CMMALVideo::CMMALVideo() - CLog::Log(LOGDEBUG, "%s::%s %p", CLASSNAME, __func__, this); - pthread_mutex_init(&m_output_mutex, NULL); - -- m_drop_state = false; - m_decoded_width = 0; - m_decoded_height = 0; - -@@ -108,7 +107,6 @@ CMMALVideo::CMMALVideo() - m_interlace_method = VS_INTERLACEMETHOD_NONE; - m_startframe = false; - m_decoderPts = DVD_NOPTS_VALUE; -- m_droppedPics = 0; - - m_dec = NULL; - m_dec_input = NULL; -@@ -259,7 +257,7 @@ void CMMALVideo::dec_output_port_cb(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buf - { - assert(!(buffer->flags & MMAL_BUFFER_HEADER_FLAG_DECODEONLY)); - double dts = DVD_NOPTS_VALUE; -- if (!m_drop_state) // && !(g_advancedSettings.m_omxDecodeStartWithValidFrame && (buffer->flags & MMAL_BUFFER_HEADER_FLAG_CORRUPTED))) -+ if (1)//(!(g_advancedSettings.m_omxDecodeStartWithValidFrame && (buffer->flags & MMAL_BUFFER_HEADER_FLAG_CORRUPTED))) - { - CMMALVideoBuffer *omvb = new CMMALVideoBuffer(this); - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -@@ -280,11 +278,8 @@ void CMMALVideo::dec_output_port_cb(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buf - } - else - { -- pthread_mutex_lock(&m_output_mutex); -- m_droppedPics++; -- pthread_mutex_unlock(&m_output_mutex); - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -- CLog::Log(LOGDEBUG, "%s::%s - dropping %p dts:%.3f pts:%.3f (drop:%d len:%d flags:%x)", CLASSNAME, __func__, buffer, dts*1e-6, buffer->pts*1e-6, m_drop_state, buffer->length, buffer->flags); -+ CLog::Log(LOGDEBUG, "%s::%s - discarding %p dts:%.3f pts:%.3f (len:%d flags:%x)", CLASSNAME, __func__, buffer, dts*1e-6, buffer->pts*1e-6, buffer->length, buffer->flags); - } - } - } -@@ -705,7 +700,6 @@ bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options, MMALVide - if (!SendCodecConfigData()) - return false; - -- m_drop_state = false; - m_startframe = false; - m_preroll = !m_hints.stills; - m_speed = DVD_PLAYSPEED_NORMAL; -@@ -735,30 +729,8 @@ void CMMALVideo::Dispose() - - void CMMALVideo::SetDropState(bool bDrop) - { -- if (m_drop_state != bDrop) -- if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -- CLog::Log(LOGDEBUG, "%s::%s - m_drop_state(%d)", CLASSNAME, __func__, bDrop); -- m_drop_state = bDrop; -- if (m_drop_state) -- { -- while (1) -- { -- CMMALVideoBuffer *buffer = NULL; -- pthread_mutex_lock(&m_output_mutex); -- // fetch a output buffer and pop it off the ready list -- if (!m_output_ready.empty()) -- { -- buffer = m_output_ready.front(); -- m_output_ready.pop(); -- m_droppedPics++; -- } -- pthread_mutex_unlock(&m_output_mutex); -- if (buffer) -- ReleaseBuffer(buffer); -- else -- break; -- } -- } -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ CLog::Log(LOGDEBUG, "%s::%s - bDrop(%d)", CLASSNAME, __func__, bDrop); - } - - static unsigned count_bits(int32_t value) -@@ -854,10 +826,6 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) - // set a flag so we can identify primary frames from generated frames (deinterlace) - buffer->flags = MMAL_BUFFER_HEADER_FLAG_USER0; - -- // Request decode only (maintain ref frames, but don't return a picture) -- if (m_drop_state) -- buffer->flags |= MMAL_BUFFER_HEADER_FLAG_DECODEONLY; -- - memcpy(buffer->data, demuxer_content, buffer->length); - demuxer_bytes -= buffer->length; - demuxer_content += buffer->length; -@@ -880,10 +848,6 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) - { - pthread_mutex_lock(&m_output_mutex); - m_startframe = true; -- if (m_drop_state) -- { -- m_droppedPics += m_deint ? 2:1; -- } - pthread_mutex_unlock(&m_output_mutex); - if (m_changed_count_dec != m_changed_count) - { -@@ -979,16 +943,28 @@ void CMMALVideo::Reset(void) - mmal_port_enable(m_dec_output, dec_output_port_cb_static); - } - // blow all ready video frames -- bool old_drop_state = m_drop_state; -- SetDropState(true); -+ while (1) -+ { -+ CMMALVideoBuffer *buffer = NULL; -+ pthread_mutex_lock(&m_output_mutex); -+ // fetch a output buffer and pop it off the ready list -+ if (!m_output_ready.empty()) -+ { -+ buffer = m_output_ready.front(); -+ m_output_ready.pop(); -+ } -+ pthread_mutex_unlock(&m_output_mutex); -+ if (buffer) -+ ReleaseBuffer(buffer); -+ else -+ break; -+ } -+ - pthread_mutex_lock(&m_output_mutex); - while (!m_demux_queue.empty()) - m_demux_queue.pop(); - m_demux_queue_length = 0; -- m_droppedPics = 0; - pthread_mutex_unlock(&m_output_mutex); -- if (!old_drop_state) -- SetDropState(false); - - if (!m_finished) - SendCodecConfigData(); -@@ -1122,14 +1098,8 @@ bool CMMALVideo::ClearPicture(DVDVideoPicture* pDvdVideoPicture) - - bool CMMALVideo::GetCodecStats(double &pts, int &droppedPics) - { -- pthread_mutex_lock(&m_output_mutex); -- pts = m_decoderPts; -- droppedPics = m_droppedPics; -- m_droppedPics = 0; -- pthread_mutex_unlock(&m_output_mutex); -- //if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -- // CLog::Log(LOGDEBUG, "%s::%s - pts:%.0f droppedPics:%d", CLASSNAME, __func__, pts, droppedPics); -- return true; -+ droppedPics= -1; -+ return false; - } - - void CMMALVideo::SetCodecControl(int flags) -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -index f5f664a..f79fed5 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -@@ -109,7 +109,6 @@ class CMMALVideo - bool DestroyDeinterlace(); - - // Video format -- bool m_drop_state; - int m_decoded_width; - int m_decoded_height; - unsigned int m_egl_buffer_count; -@@ -137,7 +136,6 @@ class CMMALVideo - EINTERLACEMETHOD m_interlace_method; - bool m_startframe; - double m_decoderPts; -- unsigned int m_droppedPics; - int m_speed; - bool m_preroll; - int m_codecControlFlags; - -From ff4c4b5773c669e0b7eb13919e246cbc5c3328fb Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Wed, 8 Apr 2015 12:47:04 +0100 -Subject: [PATCH 43/56] [players] Make use of new scheme to submit DTS - timestamps - -Latest firmware supports marking timestamps as DTS, -and it will reorder the timestamps with the decoded frame - -This avoids some of the current hacks of supporting PTS and DTS -timestamps in a single field. ---- - xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 35 +++++----------------- - xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h | 2 -- - xbmc/cores/omxplayer/OMXPlayerVideo.cpp | 28 ++++++----------- - xbmc/cores/omxplayer/OMXPlayerVideo.h | 1 - - xbmc/cores/omxplayer/OMXVideo.cpp | 25 ++++------------ - xbmc/cores/omxplayer/OMXVideo.h | 2 +- - 6 files changed, 23 insertions(+), 70 deletions(-) - -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -index ea93e32..ea85f25 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -@@ -57,7 +57,6 @@ CMMALVideoBuffer::CMMALVideoBuffer(CMMALVideo *omv) - height = 0; - m_aspect_ratio = 0.0f; - m_changed_count = 0; -- dts = DVD_NOPTS_VALUE; - } - - CMMALVideoBuffer::~CMMALVideoBuffer() -@@ -127,7 +126,6 @@ CMMALVideo::CMMALVideo() - m_preroll = true; - m_speed = DVD_PLAYSPEED_NORMAL; - m_codecControlFlags = 0; -- m_history_valid_pts = 0; - } - - CMMALVideo::~CMMALVideo() -@@ -256,17 +254,15 @@ void CMMALVideo::dec_output_port_cb(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buf - if (buffer->length > 0) - { - assert(!(buffer->flags & MMAL_BUFFER_HEADER_FLAG_DECODEONLY)); -- double dts = DVD_NOPTS_VALUE; - if (1)//(!(g_advancedSettings.m_omxDecodeStartWithValidFrame && (buffer->flags & MMAL_BUFFER_HEADER_FLAG_CORRUPTED))) - { - CMMALVideoBuffer *omvb = new CMMALVideoBuffer(this); - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) - CLog::Log(LOGDEBUG, "%s::%s - %p (%p) buffer_size(%u) dts:%.3f pts:%.3f flags:%x:%x frame:%d", -- CLASSNAME, __func__, buffer, omvb, buffer->length, dts*1e-6, buffer->pts*1e-6, buffer->flags, buffer->type->video.flags, omvb->m_changed_count); -+ CLASSNAME, __func__, buffer, omvb, buffer->length, buffer->dts*1e-6, buffer->pts*1e-6, buffer->flags, buffer->type->video.flags, omvb->m_changed_count); - omvb->mmal_buffer = buffer; - buffer->user_data = (void *)omvb; - omvb->m_changed_count = m_changed_count; -- omvb->dts = dts; - omvb->width = m_decoded_width; - omvb->height = m_decoded_height; - omvb->m_aspect_ratio = m_aspect_ratio; -@@ -279,7 +275,7 @@ void CMMALVideo::dec_output_port_cb(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buf - else - { - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -- CLog::Log(LOGDEBUG, "%s::%s - discarding %p dts:%.3f pts:%.3f (len:%d flags:%x)", CLASSNAME, __func__, buffer, dts*1e-6, buffer->pts*1e-6, buffer->length, buffer->flags); -+ CLog::Log(LOGDEBUG, "%s::%s - dropping %p dts:%.3f pts:%.3f (len:%d flags:%x)", CLASSNAME, __func__, buffer, buffer->dts*1e-6, buffer->pts*1e-6, buffer->length, buffer->flags); - } - } - } -@@ -632,7 +628,11 @@ bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options, MMALVide - if (status != MMAL_SUCCESS) - CLog::Log(LOGERROR, "%s::%s Failed to enable extra buffers on %s (status=%x %s)", CLASSNAME, __func__, m_dec_input->name, status, mmal_status_to_string(status)); - -- status = mmal_port_parameter_set_uint32(m_dec_input, MMAL_PARAMETER_VIDEO_TIMESTAMP_FIFO, 1); -+ status = mmal_port_parameter_set_uint32(m_dec_input, MMAL_PARAMETER_VIDEO_TIMESTAMP_FIFO, 0); -+ if (status != MMAL_SUCCESS) -+ CLog::Log(LOGERROR, "%s::%s Failed to enable timestamp fifo mode on %s (status=%x %s)", CLASSNAME, __func__, m_dec_input->name, status, mmal_status_to_string(status)); -+ -+ status = mmal_port_parameter_set_uint32(m_dec_input, MMAL_PARAMETER_VIDEO_INTERPOLATE_TIMESTAMPS, 0); - if (status != MMAL_SUCCESS) - CLog::Log(LOGERROR, "%s::%s Failed to enable timestamp fifo mode on %s (status=%x %s)", CLASSNAME, __func__, m_dec_input->name, status, mmal_status_to_string(status)); - -@@ -703,8 +703,6 @@ bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options, MMALVide - m_startframe = false; - m_preroll = !m_hints.stills; - m_speed = DVD_PLAYSPEED_NORMAL; -- // start from assuming all recent frames had valid pts -- m_history_valid_pts = ~0; - - return true; - } -@@ -733,14 +731,6 @@ void CMMALVideo::SetDropState(bool bDrop) - CLog::Log(LOGDEBUG, "%s::%s - bDrop(%d)", CLASSNAME, __func__, bDrop); - } - --static unsigned count_bits(int32_t value) --{ -- unsigned bits = 0; -- for(;value;++bits) -- value &= value - 1; -- return bits; --} -- - int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) - { - //if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -@@ -808,14 +798,6 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) - CLog::Log(LOGERROR, "%s::%s - mmal_queue_get failed", CLASSNAME, __func__); - return VC_ERROR; - } -- -- // some packed bitstream AVI files set almost all pts values to DVD_NOPTS_VALUE, but have a scattering of real pts values. -- // the valid pts values match the dts values. -- // if a stream has had more than 4 valid pts values in the last 16, the use UNKNOWN, otherwise use dts -- m_history_valid_pts = (m_history_valid_pts << 1) | (pts != DVD_NOPTS_VALUE); -- if (count_bits(m_history_valid_pts & 0xffff) < 4) -- pts = dts; -- - mmal_buffer_header_reset(buffer); - buffer->cmd = 0; - if (!m_startframe && pts == DVD_NOPTS_VALUE) -@@ -973,7 +955,6 @@ void CMMALVideo::Reset(void) - m_decoderPts = DVD_NOPTS_VALUE; - m_preroll = !m_hints.stills && (m_speed == DVD_PLAYSPEED_NORMAL || m_speed == DVD_PLAYSPEED_PAUSE); - m_codecControlFlags = 0; -- m_history_valid_pts = ~0; - } - - void CMMALVideo::SetSpeed(int iSpeed) -@@ -1059,7 +1040,7 @@ bool CMMALVideo::GetPicture(DVDVideoPicture* pDvdVideoPicture) - } - - // timestamp is in microseconds -- pDvdVideoPicture->dts = buffer->dts; -+ pDvdVideoPicture->dts = buffer->mmal_buffer->dts == MMAL_TIME_UNKNOWN || buffer->mmal_buffer->dts == 0 ? DVD_NOPTS_VALUE : buffer->mmal_buffer->dts; - pDvdVideoPicture->pts = buffer->mmal_buffer->pts == MMAL_TIME_UNKNOWN || buffer->mmal_buffer->pts == 0 ? DVD_NOPTS_VALUE : buffer->mmal_buffer->pts; - - pDvdVideoPicture->MMALBuffer->Acquire(); -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -index f79fed5..415f3e3 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -@@ -55,7 +55,6 @@ class CMMALVideoBuffer - int width; - int height; - float m_aspect_ratio; -- double dts; - uint32_t m_changed_count; - // reference counting - CMMALVideoBuffer* Acquire(); -@@ -139,7 +138,6 @@ class CMMALVideo - int m_speed; - bool m_preroll; - int m_codecControlFlags; -- uint32_t m_history_valid_pts; - - MMAL_COMPONENT_T *m_dec; - MMAL_PORT_T *m_dec_input; -diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -index f6c6eb0..d953b1c 100644 ---- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -+++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -@@ -105,7 +105,6 @@ OMXPlayerVideo::OMXPlayerVideo(OMXClock *av_clock, - m_iCurrentPts = DVD_NOPTS_VALUE; - m_nextOverlay = DVD_NOPTS_VALUE; - m_flush = false; -- m_history_valid_pts = 0; - } - - OMXPlayerVideo::~OMXPlayerVideo() -@@ -313,14 +312,6 @@ void OMXPlayerVideo::Output(double pts, bool bDropPacket) - g_renderManager.FlipPage(CThread::m_bStop, time/DVD_TIME_BASE); - } - --static unsigned count_bits(int32_t value) --{ -- unsigned bits = 0; -- for(;value;++bits) -- value &= value - 1; -- return bits; --} -- - void OMXPlayerVideo::Process() - { - double frametime = (double)DVD_TIME_BASE / m_fFrameRate; -@@ -495,18 +486,20 @@ void OMXPlayerVideo::Process() - m_stalled = false; - } - -- // some packed bitstream AVI files set almost all pts values to DVD_NOPTS_VALUE, but have a scattering of real pts values. -- // the valid pts values match the dts values. -- // if a stream has had more than 4 valid pts values in the last 16, the use UNKNOWN, otherwise use dts -- m_history_valid_pts = (m_history_valid_pts << 1) | (pPacket->pts != DVD_NOPTS_VALUE); -+ double dts = pPacket->dts; - double pts = pPacket->pts; -- if(count_bits(m_history_valid_pts & 0xffff) < 4) -- pts = pPacket->dts; -+ -+ if (dts != DVD_NOPTS_VALUE) -+ dts += m_iVideoDelay; - - if (pts != DVD_NOPTS_VALUE) - pts += m_iVideoDelay; - -- m_omxVideo.Decode(pPacket->pData, pPacket->iSize, pts); -+ m_omxVideo.Decode(pPacket->pData, pPacket->iSize, dts, pts); -+ -+ if (pts == DVD_NOPTS_VALUE) -+ pts = dts; -+ - Output(pts, bRequestDrop); - if(pts != DVD_NOPTS_VALUE) - m_iCurrentPts = pts; -@@ -582,9 +575,6 @@ bool OMXPlayerVideo::OpenDecoder() - m_codecname = m_omxVideo.GetDecoderName(); - } - -- // start from assuming all recent frames had valid pts -- m_history_valid_pts = ~0; -- - return bVideoDecoderOpen; - } - -diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.h b/xbmc/cores/omxplayer/OMXPlayerVideo.h -index 2748a41..3bd5625 100644 ---- a/xbmc/cores/omxplayer/OMXPlayerVideo.h -+++ b/xbmc/cores/omxplayer/OMXPlayerVideo.h -@@ -69,7 +69,6 @@ class OMXPlayerVideo : public CThread, public IDVDStreamPlayerVideo - RENDER_STEREO_MODE m_video_stereo_mode; - RENDER_STEREO_MODE m_display_stereo_mode; - bool m_StereoInvert; -- uint32_t m_history_valid_pts; - DllBcmHost m_DllBcmHost; - - CDVDOverlayContainer *m_pOverlayContainer; -diff --git a/xbmc/cores/omxplayer/OMXVideo.cpp b/xbmc/cores/omxplayer/OMXVideo.cpp -index bb4d572..1011b5d 100644 ---- a/xbmc/cores/omxplayer/OMXVideo.cpp -+++ b/xbmc/cores/omxplayer/OMXVideo.cpp -@@ -597,23 +597,6 @@ bool COMXVideo::Open(CDVDStreamInfo &hints, OMXClock *clock, EDEINTERLACEMODE de - return false; - } - -- // broadcom omx entension: -- // When enabled, the timestamp fifo mode will change the way incoming timestamps are associated with output images. -- // In this mode the incoming timestamps get used without re-ordering on output images. -- // recent firmware will actually automatically choose the timestamp stream with the least variance, so always enable -- { -- OMX_CONFIG_BOOLEANTYPE timeStampMode; -- OMX_INIT_STRUCTURE(timeStampMode); -- timeStampMode.bEnabled = OMX_TRUE; -- -- omx_err = m_omx_decoder.SetParameter((OMX_INDEXTYPE)OMX_IndexParamBrcmVideoTimestampFifo, &timeStampMode); -- if (omx_err != OMX_ErrorNone) -- { -- CLog::Log(LOGERROR, "COMXVideo::Open OMX_IndexParamBrcmVideoTimestampFifo error (0%08x)\n", omx_err); -- return false; -- } -- } -- - if(NaluFormatStartCodes(hints.codec, m_extradata, m_extrasize)) - { - OMX_NALSTREAMFORMATTYPE nalStreamFormat; -@@ -753,7 +736,7 @@ bool COMXVideo::GetPlayerInfo(double &match, double &phase, double &pll) - } - - --int COMXVideo::Decode(uint8_t *pData, int iSize, double pts) -+int COMXVideo::Decode(uint8_t *pData, int iSize, double dts, double pts) - { - CSingleLock lock (m_critSection); - OMX_ERRORTYPE omx_err; -@@ -778,6 +761,7 @@ int COMXVideo::Decode(uint8_t *pData, int iSize, double pts) - - omx_buffer->nFlags = 0; - omx_buffer->nOffset = 0; -+ omx_buffer->nTimeStamp = ToOMXTime((uint64_t)(pts != DVD_NOPTS_VALUE ? pts : dts != DVD_NOPTS_VALUE ? dts : 0)); - - if(m_setStartTime) - { -@@ -785,10 +769,11 @@ int COMXVideo::Decode(uint8_t *pData, int iSize, double pts) - CLog::Log(LOGDEBUG, "OMXVideo::Decode VDec : setStartTime %f\n", (pts == DVD_NOPTS_VALUE ? 0.0 : pts) / DVD_TIME_BASE); - m_setStartTime = false; - } -- if(pts == DVD_NOPTS_VALUE) -+ else if (pts == DVD_NOPTS_VALUE && dts == DVD_NOPTS_VALUE) - omx_buffer->nFlags |= OMX_BUFFERFLAG_TIME_UNKNOWN; -+ else if (pts == DVD_NOPTS_VALUE) -+ omx_buffer->nFlags |= OMX_BUFFERFLAG_TIME_IS_DTS; - -- omx_buffer->nTimeStamp = ToOMXTime((uint64_t)(pts == DVD_NOPTS_VALUE) ? 0 : pts); - omx_buffer->nFilledLen = std::min((OMX_U32)demuxer_bytes, omx_buffer->nAllocLen); - memcpy(omx_buffer->pBuffer, demuxer_content, omx_buffer->nFilledLen); - -diff --git a/xbmc/cores/omxplayer/OMXVideo.h b/xbmc/cores/omxplayer/OMXVideo.h -index 3ea02dc..86e94ce 100644 ---- a/xbmc/cores/omxplayer/OMXVideo.h -+++ b/xbmc/cores/omxplayer/OMXVideo.h -@@ -55,7 +55,7 @@ class COMXVideo - void Close(void); - unsigned int GetFreeSpace(); - unsigned int GetSize(); -- int Decode(uint8_t *pData, int iSize, double pts); -+ int Decode(uint8_t *pData, int iSize, double dts, double pts); - void Reset(void); - void SetDropState(bool bDrop); - std::string GetDecoderName() { return m_video_codec_name; }; - -From 8806ac18c5c1d43fef3357f5a15bd960f493cd51 Mon Sep 17 00:00:00 2001 +From 1d7052cf03293af8a4247348ae72b8ca07731a9f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 14 Apr 2015 20:51:14 +0100 -Subject: [PATCH 44/56] [gui] Also limit GUI updates when in non full-screen +Subject: [PATCH 56/61] [gui] Also limit GUI updates when in non full-screen video mode --- @@ -4227,7 +3021,7 @@ Subject: [PATCH 44/56] [gui] Also limit GUI updates when in non full-screen 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp -index 1141d7b..832b22d 100644 +index 9c6496b..01a711e 100644 --- a/xbmc/Application.cpp +++ b/xbmc/Application.cpp @@ -2495,7 +2495,7 @@ void CApplication::FrameMove(bool processEvents, bool processGUI) @@ -4249,1656 +3043,10 @@ index 1141d7b..832b22d 100644 g_windowManager.FrameMove(); } -From a9d65318b7758e3afcb8841999bc98e15117afeb Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Wed, 15 Apr 2015 22:57:45 +0100 -Subject: [PATCH 45/56] [mmalcodec] Return mmal buffers explicitly - ---- - xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 29 ++++++++++++++-------- - xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h | 1 + - 2 files changed, 20 insertions(+), 10 deletions(-) - -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -index ea85f25..5bdf145 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -@@ -133,7 +133,6 @@ CMMALVideo::~CMMALVideo() - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) - CLog::Log(LOGDEBUG, "%s::%s %p", CLASSNAME, __func__, this); - assert(m_finished); -- Reset(); - - pthread_mutex_destroy(&m_output_mutex); - -@@ -413,7 +412,7 @@ bool CMMALVideo::CreateDeinterlace(EINTERLACEMETHOD interlace_method) - - m_dec_output = m_deint->output[0]; - m_interlace_method = interlace_method; -- -+ Prime(); - return true; - } - -@@ -469,6 +468,7 @@ bool CMMALVideo::DestroyDeinterlace() - - m_dec_output = m_dec->output[0]; - m_interlace_method = VS_INTERLACEMETHOD_NONE; -+ Prime(); - return true; - } - -@@ -700,6 +700,7 @@ bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options, MMALVide - if (!SendCodecConfigData()) - return false; - -+ Prime(); - m_startframe = false; - m_preroll = !m_hints.stills; - m_speed = DVD_PLAYSPEED_NORMAL; -@@ -742,8 +743,6 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) - MMAL_BUFFER_HEADER_T *buffer; - MMAL_STATUS_T status; - -- while (buffer = mmal_queue_get(m_dec_output_pool->queue), buffer) -- Recycle(buffer); - // we need to queue then de-queue the demux packet, seems silly but - // mmal might not have an input buffer available when we are called - // and we must store the demuxer packet and try again later. -@@ -770,9 +769,6 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) - - while (1) - { -- while (buffer = mmal_queue_get(m_dec_output_pool->queue), buffer) -- Recycle(buffer); -- - space = mmal_queue_length(m_dec_input_pool->queue) * m_dec_input->buffer_size; - if (!demuxer_bytes && !m_demux_queue.empty()) - { -@@ -864,8 +860,6 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) - demuxer_content = NULL; - continue; - } -- while (buffer = mmal_queue_get(m_dec_output_pool->queue), buffer) -- Recycle(buffer); - } - } - if (!demuxer_bytes) -@@ -904,6 +898,13 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) - return ret; - } - -+void CMMALVideo::Prime() -+{ -+ MMAL_BUFFER_HEADER_T *buffer; -+ while (buffer = mmal_queue_get(m_dec_output_pool->queue), buffer) -+ Recycle(buffer); -+} -+ - void CMMALVideo::Reset(void) - { - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -@@ -949,8 +950,10 @@ void CMMALVideo::Reset(void) - pthread_mutex_unlock(&m_output_mutex); - - if (!m_finished) -+ { - SendCodecConfigData(); -- -+ Prime(); -+ } - m_startframe = false; - m_decoderPts = DVD_NOPTS_VALUE; - m_preroll = !m_hints.stills && (m_speed == DVD_PLAYSPEED_NORMAL || m_speed == DVD_PLAYSPEED_PAUSE); -@@ -970,6 +973,12 @@ void CMMALVideo::Recycle(MMAL_BUFFER_HEADER_T *buffer) - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) - CLog::Log(LOGDEBUG, "%s::%s %p", CLASSNAME, __func__, buffer); - -+ if (m_finished) -+ { -+ mmal_buffer_header_release(buffer); -+ return; -+ } -+ - MMAL_STATUS_T status; - mmal_buffer_header_reset(buffer); - buffer->cmd = 0; -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -index 415f3e3..011ae04 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -@@ -106,6 +106,7 @@ class CMMALVideo - void QueryCodec(void); - bool CreateDeinterlace(EINTERLACEMETHOD interlace_method); - bool DestroyDeinterlace(); -+ void Prime(); - - // Video format - int m_decoded_width; - -From 990f8994f15059962b6470b9ebf6469a3698b25b Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Wed, 15 Apr 2015 23:26:47 +0100 -Subject: [PATCH 46/56] [mmalcodec] Handle resolution change from callback - ---- - xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 26 +++++----------------- - xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h | 3 --- - 2 files changed, 6 insertions(+), 23 deletions(-) - -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -index 5bdf145..f20eac7 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -@@ -56,7 +56,6 @@ CMMALVideoBuffer::CMMALVideoBuffer(CMMALVideo *omv) - width = 0; - height = 0; - m_aspect_ratio = 0.0f; -- m_changed_count = 0; - } - - CMMALVideoBuffer::~CMMALVideoBuffer() -@@ -118,8 +117,6 @@ CMMALVideo::CMMALVideo() - - m_codingType = 0; - -- m_changed_count = 0; -- m_changed_count_dec = 0; - m_output_busy = 0; - m_demux_queue_length = 0; - m_es_format = mmal_format_alloc(); -@@ -183,7 +180,6 @@ void CMMALVideo::PortSettingsChanged(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *bu - { - MMAL_EVENT_FORMAT_CHANGED_T *fmt = mmal_event_format_changed_get(buffer); - mmal_format_copy(m_es_format, fmt->format); -- m_changed_count++; - - if (m_es_format->es->video.crop.width && m_es_format->es->video.crop.height) - { -@@ -192,10 +188,13 @@ void CMMALVideo::PortSettingsChanged(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *bu - m_decoded_width = m_es_format->es->video.crop.width; - m_decoded_height = m_es_format->es->video.crop.height; - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -- CLog::Log(LOGDEBUG, "%s::%s format changed: %dx%d %.2f frame:%d", CLASSNAME, __func__, m_decoded_width, m_decoded_height, m_aspect_ratio, m_changed_count); -+ CLog::Log(LOGDEBUG, "%s::%s format changed: %dx%d %.2f", CLASSNAME, __func__, m_decoded_width, m_decoded_height, m_aspect_ratio); - } - else - CLog::Log(LOGERROR, "%s::%s format changed: Unexpected %dx%d", CLASSNAME, __func__, m_es_format->es->video.crop.width, m_es_format->es->video.crop.height); -+ -+ if (!change_dec_output_format()) -+ CLog::Log(LOGERROR, "%s::%s - change_dec_output_format() failed", CLASSNAME, __func__); - } - - void CMMALVideo::dec_control_port_cb(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buffer) -@@ -257,11 +256,10 @@ void CMMALVideo::dec_output_port_cb(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buf - { - CMMALVideoBuffer *omvb = new CMMALVideoBuffer(this); - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -- CLog::Log(LOGDEBUG, "%s::%s - %p (%p) buffer_size(%u) dts:%.3f pts:%.3f flags:%x:%x frame:%d", -- CLASSNAME, __func__, buffer, omvb, buffer->length, buffer->dts*1e-6, buffer->pts*1e-6, buffer->flags, buffer->type->video.flags, omvb->m_changed_count); -+ CLog::Log(LOGDEBUG, "%s::%s - %p (%p) buffer_size(%u) dts:%.3f pts:%.3f flags:%x:%x", -+ CLASSNAME, __func__, buffer, omvb, buffer->length, buffer->dts*1e-6, buffer->pts*1e-6, buffer->flags, buffer->type->video.flags); - omvb->mmal_buffer = buffer; - buffer->user_data = (void *)omvb; -- omvb->m_changed_count = m_changed_count; - omvb->width = m_decoded_width; - omvb->height = m_decoded_height; - omvb->m_aspect_ratio = m_aspect_ratio; -@@ -313,7 +311,6 @@ bool CMMALVideo::change_dec_output_format() - else - CLog::Log(LOGERROR, "%s::%s Failed to query interlace type on %s (status=%x %s)", CLASSNAME, __func__, m_dec_output->name, status, mmal_status_to_string(status)); - -- // todo: if we don't disable/enable we can do this from callback - mmal_format_copy(m_dec_output->format, m_es_format); - status = mmal_port_format_commit(m_dec_output); - if (status != MMAL_SUCCESS) -@@ -827,17 +824,6 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) - pthread_mutex_lock(&m_output_mutex); - m_startframe = true; - pthread_mutex_unlock(&m_output_mutex); -- if (m_changed_count_dec != m_changed_count) -- { -- if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -- CLog::Log(LOGDEBUG, "%s::%s format changed frame:%d(%d)", CLASSNAME, __func__, m_changed_count_dec, m_changed_count); -- m_changed_count_dec = m_changed_count; -- if (!change_dec_output_format()) -- { -- CLog::Log(LOGERROR, "%s::%s - change_dec_output_format() failed", CLASSNAME, __func__); -- return VC_ERROR; -- } -- } - EDEINTERLACEMODE deinterlace_request = CMediaSettings::Get().GetCurrentVideoSettings().m_DeinterlaceMode; - EINTERLACEMETHOD interlace_method = g_renderManager.AutoInterlaceMethod(CMediaSettings::Get().GetCurrentVideoSettings().m_InterlaceMethod); - -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -index 011ae04..fcc6a15 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -@@ -55,7 +55,6 @@ class CMMALVideoBuffer - int width; - int height; - float m_aspect_ratio; -- uint32_t m_changed_count; - // reference counting - CMMALVideoBuffer* Acquire(); - long Release(); -@@ -99,8 +98,6 @@ class CMMALVideo - void dec_output_port_cb(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buffer); - void dec_control_port_cb(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buffer); - void dec_input_port_cb(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buffer); -- uint32_t m_changed_count; -- uint32_t m_changed_count_dec; - - protected: - void QueryCodec(void); - -From 1bc141b43b3995999f59422f2fb525c794c11b29 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Thu, 16 Apr 2015 17:27:27 +0100 -Subject: [PATCH 47/56] [mmal] Enable zero copy - -This is a bit subtle, but the reference counting of pictures is only shared -between arm side and gpu side when in zero copy mode. ---- - xbmc/cores/VideoRenderers/MMALRenderer.cpp | 6 ++++++ - xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 18 ++++++++++++++++-- - 2 files changed, 22 insertions(+), 2 deletions(-) - -diff --git a/xbmc/cores/VideoRenderers/MMALRenderer.cpp b/xbmc/cores/VideoRenderers/MMALRenderer.cpp -index c30de9c..cfceb78 100644 ---- a/xbmc/cores/VideoRenderers/MMALRenderer.cpp -+++ b/xbmc/cores/VideoRenderers/MMALRenderer.cpp -@@ -132,6 +132,12 @@ bool CMMALRenderer::init_vout(ERenderFormat format) - es_format->es->video.color_space = MMAL_COLOR_SPACE_SMPTE240M; - } - -+ if (m_format == RENDER_FMT_MMAL) -+ { -+ status = mmal_port_parameter_set_boolean(m_vout_input, MMAL_PARAMETER_ZERO_COPY, MMAL_TRUE); -+ if (status != MMAL_SUCCESS) -+ CLog::Log(LOGERROR, "%s::%s Failed to enable zero copy mode on %s (status=%x %s)", CLASSNAME, __func__, m_vout_input->name, status, mmal_status_to_string(status)); -+ } - status = mmal_port_format_commit(m_vout_input); - if (status != MMAL_SUCCESS) - { -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -index f20eac7..443e023 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -@@ -312,6 +312,11 @@ bool CMMALVideo::change_dec_output_format() - CLog::Log(LOGERROR, "%s::%s Failed to query interlace type on %s (status=%x %s)", CLASSNAME, __func__, m_dec_output->name, status, mmal_status_to_string(status)); - - mmal_format_copy(m_dec_output->format, m_es_format); -+ -+ status = mmal_port_parameter_set_boolean(m_dec_output, MMAL_PARAMETER_ZERO_COPY, MMAL_TRUE); -+ if (status != MMAL_SUCCESS) -+ CLog::Log(LOGERROR, "%s::%s Failed to enable zero copy mode on %s (status=%x %s)", CLASSNAME, __func__, m_dec_output->name, status, mmal_status_to_string(status)); -+ - status = mmal_port_format_commit(m_dec_output); - if (status != MMAL_SUCCESS) - { -@@ -383,6 +388,11 @@ bool CMMALVideo::CreateDeinterlace(EINTERLACEMETHOD interlace_method) - } - - mmal_format_copy(m_deint->output[0]->format, m_es_format); -+ -+ status = mmal_port_parameter_set_boolean(m_deint->output[0], MMAL_PARAMETER_ZERO_COPY, MMAL_TRUE); -+ if (status != MMAL_SUCCESS) -+ CLog::Log(LOGERROR, "%s::%s Failed to enable zero copy mode on %s (status=%x %s)", CLASSNAME, __func__, m_deint->output[0]->name, status, mmal_status_to_string(status)); -+ - status = mmal_port_format_commit(m_deint->output[0]); - if (status != MMAL_SUCCESS) - { -@@ -656,6 +666,10 @@ bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options, MMALVide - m_dec_output->format->encoding = MMAL_ENCODING_OPAQUE; - mmal_format_copy(m_es_format, m_dec_output->format); - -+ status = mmal_port_parameter_set_boolean(m_dec_output, MMAL_PARAMETER_ZERO_COPY, MMAL_TRUE); -+ if (status != MMAL_SUCCESS) -+ CLog::Log(LOGERROR, "%s::%s Failed to enable zero copy mode on %s (status=%x %s)", CLASSNAME, __func__, m_dec_output->name, status, mmal_status_to_string(status)); -+ - status = mmal_port_format_commit(m_dec_output); - if (status != MMAL_SUCCESS) - { -@@ -680,14 +694,14 @@ bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options, MMALVide - return false; - } - -- m_dec_input_pool = mmal_pool_create(m_dec_input->buffer_num, m_dec_input->buffer_size); -+ m_dec_input_pool = mmal_port_pool_create(m_dec_input, m_dec_input->buffer_num, m_dec_input->buffer_size); - if (!m_dec_input_pool) - { - CLog::Log(LOGERROR, "%s::%s Failed to create pool for decoder input port (status=%x %s)", CLASSNAME, __func__, status, mmal_status_to_string(status)); - return false; - } - -- m_dec_output_pool = mmal_pool_create(m_dec_output->buffer_num, m_dec_output->buffer_size); -+ m_dec_output_pool = mmal_port_pool_create(m_dec_output, m_dec_output->buffer_num, m_dec_output->buffer_size); - if(!m_dec_output_pool) - { - CLog::Log(LOGERROR, "%s::%s Failed to create pool for decode output port (status=%x %s)", CLASSNAME, __func__, status, mmal_status_to_string(status)); - -From 4deb049fc48343d69f5f736967cb922800baf439 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Thu, 16 Apr 2015 19:09:31 +0100 -Subject: [PATCH 48/56] [mmalcodec] flags debug - ---- - xbmc/cores/VideoRenderers/MMALRenderer.cpp | 11 ++++++----- - xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 2 ++ - 2 files changed, 8 insertions(+), 5 deletions(-) - -diff --git a/xbmc/cores/VideoRenderers/MMALRenderer.cpp b/xbmc/cores/VideoRenderers/MMALRenderer.cpp -index cfceb78..4b09b1f 100644 ---- a/xbmc/cores/VideoRenderers/MMALRenderer.cpp -+++ b/xbmc/cores/VideoRenderers/MMALRenderer.cpp -@@ -48,12 +48,13 @@ void CMMALRenderer::vout_input_port_cb(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T * - { - #if defined(MMAL_DEBUG_VERBOSE) - CMMALVideoBuffer *omvb = (CMMALVideoBuffer *)buffer->user_data; -- CLog::Log(LOGDEBUG, "%s::%s port:%p buffer %p (%p), len %d cmd:%x", CLASSNAME, __func__, port, buffer, omvb, buffer->length, buffer->cmd); -+ CLog::Log(LOGDEBUG, "%s::%s port:%p buffer %p (%p), len %d cmd:%x f:%x", CLASSNAME, __func__, port, buffer, omvb, buffer->length, buffer->cmd, buffer->flags); - #endif - -+ assert(!(buffer->flags & MMAL_BUFFER_HEADER_FLAG_TRANSMISSION_FAILED)); -+ buffer->flags &= ~MMAL_BUFFER_HEADER_FLAG_USER2; - if (m_format == RENDER_FMT_MMAL) - { -- buffer->flags &= ~MMAL_BUFFER_HEADER_FLAG_USER2; - mmal_queue_put(m_release_queue, buffer); - } - else if (m_format == RENDER_FMT_YUV420P) -@@ -376,7 +377,7 @@ void CMMALRenderer::RenderUpdate(bool clear, DWORD flags, DWORD alpha) - if (omvb) - { - #if defined(MMAL_DEBUG_VERBOSE) -- CLog::Log(LOGDEBUG, "%s::%s %p (%p)", CLASSNAME, __func__, omvb, omvb->mmal_buffer); -+ CLog::Log(LOGDEBUG, "%s::%s %p (%p) f:%x", CLASSNAME, __func__, omvb, omvb->mmal_buffer, omvb->mmal_buffer->flags); - #endif - // we only want to upload frames once - if (omvb->mmal_buffer->flags & MMAL_BUFFER_HEADER_FLAG_USER1) -@@ -390,14 +391,14 @@ void CMMALRenderer::RenderUpdate(bool clear, DWORD flags, DWORD alpha) - } - else if (m_format == RENDER_FMT_YUV420P) - { -- CLog::Log(LOGDEBUG, "%s::%s - %p %d", CLASSNAME, __func__, buffer->mmal_buffer, source); - if (buffer->mmal_buffer) - { -+ CLog::Log(LOGDEBUG, "%s::%s - %p %d f:%x", CLASSNAME, __func__, buffer->mmal_buffer, source, buffer->mmal_buffer->flags); - // we only want to upload frames once - if (buffer->mmal_buffer->flags & MMAL_BUFFER_HEADER_FLAG_USER1) - return; - // sanity check it is not on display -- buffer->mmal_buffer->flags |= MMAL_BUFFER_HEADER_FLAG_USER1; -+ buffer->mmal_buffer->flags |= MMAL_BUFFER_HEADER_FLAG_USER1 | MMAL_BUFFER_HEADER_FLAG_USER2; - mmal_port_send_buffer(m_vout_input, buffer->mmal_buffer); - } - else -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -index 443e023..6c6e05e 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -@@ -83,6 +83,7 @@ long CMMALVideoBuffer::Release() - { - m_omv->ReleaseBuffer(this); - } -+ else assert(count > 0); - return count; - } - -@@ -247,6 +248,7 @@ void CMMALVideo::dec_output_port_cb(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buf - - bool kept = false; - -+ assert(!(buffer->flags & MMAL_BUFFER_HEADER_FLAG_TRANSMISSION_FAILED)); - if (buffer->cmd == 0) - { - if (buffer->length > 0) - -From 768fa749d337b9016a5b7b561c77701b4008998d Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Thu, 16 Apr 2015 18:18:14 +0100 -Subject: [PATCH 49/56] [mmal] Move the image pool from decoder to renderer - ---- - xbmc/cores/VideoRenderers/BaseRenderer.h | 5 ++ - xbmc/cores/VideoRenderers/MMALRenderer.cpp | 78 ++++++++++++++++++---- - xbmc/cores/VideoRenderers/MMALRenderer.h | 4 ++ - xbmc/cores/VideoRenderers/RenderManager.cpp | 8 +++ - xbmc/cores/VideoRenderers/RenderManager.h | 5 ++ - xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 30 ++------- - xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h | 2 - - 7 files changed, 92 insertions(+), 40 deletions(-) - -diff --git a/xbmc/cores/VideoRenderers/BaseRenderer.h b/xbmc/cores/VideoRenderers/BaseRenderer.h -index 389695a..264f0ad 100644 ---- a/xbmc/cores/VideoRenderers/BaseRenderer.h -+++ b/xbmc/cores/VideoRenderers/BaseRenderer.h -@@ -112,6 +112,11 @@ class CBaseRenderer - - static void SettingOptionsRenderMethodsFiller(const CSetting *setting, std::vector< std::pair > &list, int ¤t, void *data); - -+ /** -+ * Magic api for communicating between codec and renderer -+ */ -+ virtual void *PassCookie(void *cookie) { return NULL; } -+ - protected: - void ChooseBestResolution(float fps); - bool FindResolutionFromOverride(float fps, float& weight, bool fallback); -diff --git a/xbmc/cores/VideoRenderers/MMALRenderer.cpp b/xbmc/cores/VideoRenderers/MMALRenderer.cpp -index 4b09b1f..5a65572 100644 ---- a/xbmc/cores/VideoRenderers/MMALRenderer.cpp -+++ b/xbmc/cores/VideoRenderers/MMALRenderer.cpp -@@ -39,6 +39,50 @@ - #define MMAL_DEBUG_VERBOSE - #endif - -+ -+ -+void CMMALRenderer::Prime() -+{ -+ #if defined(MMAL_DEBUG_VERBOSE) -+ CLog::Log(LOGDEBUG, "%s::%s format:%d dec:%p pool:%p", CLASSNAME, __func__, m_format, m_mmal_video, m_vout_input_pool); -+ #endif -+ -+ if (m_format != RENDER_FMT_MMAL || !m_vout_input_pool) -+ return; -+ -+ MMAL_BUFFER_HEADER_T *buffer; -+ while (buffer = mmal_queue_get(m_vout_input_pool->queue), buffer) -+ { -+ CLog::Log(LOGDEBUG, "%s::%s buffer:%p mmal_video:%p", CLASSNAME, __func__, buffer, m_mmal_video); -+ if (m_mmal_video) -+ { -+ m_mmal_video->Recycle(buffer); -+ } -+ else -+ { -+ mmal_buffer_header_release(buffer); -+ break; -+ } -+ } -+} -+ -+void *CMMALRenderer::PassCookie(void *cookie) -+{ -+ m_mmal_video = (CMMALVideo *)cookie; -+ #if defined(MMAL_DEBUG_VERBOSE) -+ CLog::Log(LOGDEBUG, "%s::%s cookie:%p", CLASSNAME, __func__, cookie); -+ #endif -+ -+ if (m_mmal_video) -+ { -+ bool formatChanged = m_format != RENDER_FMT_MMAL; -+ m_format = RENDER_FMT_MMAL; -+ m_bConfigured = init_vout(formatChanged); -+ Prime(); -+ } -+ return NULL; -+} -+ - static void vout_control_port_cb(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buffer) - { - mmal_buffer_header_release(buffer); -@@ -163,14 +207,11 @@ bool CMMALRenderer::init_vout(ERenderFormat format) - return false; - } - -- if (m_format == RENDER_FMT_YUV420P) -+ m_vout_input_pool = mmal_port_pool_create(m_vout_input , m_vout_input->buffer_num, m_vout_input->buffer_size); -+ if (!m_vout_input_pool) - { -- m_vout_input_pool = mmal_pool_create(m_vout_input->buffer_num, m_vout_input->buffer_size); -- if (!m_vout_input_pool) -- { -- CLog::Log(LOGERROR, "%s::%s Failed to create pool for decoder input port (status=%x %s)", CLASSNAME, __func__, status, mmal_status_to_string(status)); -- return false; -- } -+ CLog::Log(LOGERROR, "%s::%s Failed to create pool for decoder input port (status=%x %s)", CLASSNAME, __func__, status, mmal_status_to_string(status)); -+ return false; - } - return true; - } -@@ -178,10 +219,17 @@ bool CMMALRenderer::init_vout(ERenderFormat format) - void CMMALRenderer::Process() - { - MMAL_BUFFER_HEADER_T *buffer; -- while (buffer = mmal_queue_wait(m_release_queue), buffer && buffer != &m_quit_packet) -+ while (buffer = mmal_queue_timedwait(m_release_queue, 100), buffer != &m_quit_packet) - { -- CMMALVideoBuffer *omvb = (CMMALVideoBuffer *)buffer->user_data; -- omvb->Release(); -+ if (buffer) -+ { -+ CMMALVideoBuffer *omvb = (CMMALVideoBuffer *)buffer->user_data; -+ omvb->Release(); -+ } -+ else -+ { -+ Prime(); -+ } - } - m_sync.Set(); - } -@@ -198,6 +246,7 @@ CMMALRenderer::CMMALRenderer() - m_release_queue = mmal_queue_create(); - m_iFlags = 0; - m_format = RENDER_FMT_NONE; -+ m_mmal_video = NULL; - m_iYV12RenderBuffer = 0; - Create(); - } -@@ -381,7 +430,7 @@ void CMMALRenderer::RenderUpdate(bool clear, DWORD flags, DWORD alpha) - #endif - // we only want to upload frames once - if (omvb->mmal_buffer->flags & MMAL_BUFFER_HEADER_FLAG_USER1) -- return; -+ goto done; - omvb->Acquire(); - omvb->mmal_buffer->flags |= MMAL_BUFFER_HEADER_FLAG_USER1 | MMAL_BUFFER_HEADER_FLAG_USER2; - mmal_port_send_buffer(m_vout_input, omvb->mmal_buffer); -@@ -396,7 +445,7 @@ void CMMALRenderer::RenderUpdate(bool clear, DWORD flags, DWORD alpha) - CLog::Log(LOGDEBUG, "%s::%s - %p %d f:%x", CLASSNAME, __func__, buffer->mmal_buffer, source, buffer->mmal_buffer->flags); - // we only want to upload frames once - if (buffer->mmal_buffer->flags & MMAL_BUFFER_HEADER_FLAG_USER1) -- return; -+ goto done; - // sanity check it is not on display - buffer->mmal_buffer->flags |= MMAL_BUFFER_HEADER_FLAG_USER1 | MMAL_BUFFER_HEADER_FLAG_USER2; - mmal_port_send_buffer(m_vout_input, buffer->mmal_buffer); -@@ -405,6 +454,8 @@ void CMMALRenderer::RenderUpdate(bool clear, DWORD flags, DWORD alpha) - CLog::Log(LOGDEBUG, "%s::%s - No buffer to update", CLASSNAME, __func__); - } - else assert(0); -+done: -+ Prime(); - } - - void CMMALRenderer::FlipPage(int source) -@@ -466,6 +517,8 @@ void CMMALRenderer::UnInitMMAL() - m_vout_input = NULL; - } - -+ ReleaseBuffers(); -+ - if (m_vout_input_pool) - { - mmal_pool_destroy(m_vout_input_pool); -@@ -477,7 +530,6 @@ void CMMALRenderer::UnInitMMAL() - mmal_component_release(m_vout); - m_vout = NULL; - } -- ReleaseBuffers(); - - m_RenderUpdateCallBackFn = NULL; - m_RenderUpdateCallBackCtx = NULL; -diff --git a/xbmc/cores/VideoRenderers/MMALRenderer.h b/xbmc/cores/VideoRenderers/MMALRenderer.h -index 17b189e..f515d7a 100644 ---- a/xbmc/cores/VideoRenderers/MMALRenderer.h -+++ b/xbmc/cores/VideoRenderers/MMALRenderer.h -@@ -40,6 +40,7 @@ - - class CBaseTexture; - class CMMALVideoBuffer; -+class CMMALVideo; - - struct DVDVideoPicture; - -@@ -90,6 +91,7 @@ class CMMALRenderer : public CBaseRenderer, public CThread - virtual bool IsGuiLayer() { return false; } - - void vout_input_port_cb(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buffer); -+ virtual void *PassCookie(void *cookie); - protected: - int m_iYV12RenderBuffer; - int m_NumYV12Buffers; -@@ -116,8 +118,10 @@ class CMMALRenderer : public CBaseRenderer, public CThread - MMAL_QUEUE_T *m_release_queue; - CEvent m_sync; - MMAL_BUFFER_HEADER_T m_quit_packet; -+ CMMALVideo *m_mmal_video; - - bool init_vout(ERenderFormat format); - void ReleaseBuffers(); - void UnInitMMAL(); -+ void Prime(); - }; -diff --git a/xbmc/cores/VideoRenderers/RenderManager.cpp b/xbmc/cores/VideoRenderers/RenderManager.cpp -index 6de299e..dfd1072 100644 ---- a/xbmc/cores/VideoRenderers/RenderManager.cpp -+++ b/xbmc/cores/VideoRenderers/RenderManager.cpp -@@ -948,6 +948,14 @@ unsigned int CXBMCRenderManager::GetOptimalBufferSize() - return m_pRenderer->GetMaxBufferSize(); - } - -+void *CXBMCRenderManager::PassCookie(void *cookie) -+{ -+ if (m_pRenderer) -+ return m_pRenderer->PassCookie(cookie); -+ assert(0); -+} -+ -+ - // Supported pixel formats, can be called before configure - std::vector CXBMCRenderManager::SupportedFormats() - { -diff --git a/xbmc/cores/VideoRenderers/RenderManager.h b/xbmc/cores/VideoRenderers/RenderManager.h -index 4e553cb..606cbbd 100644 ---- a/xbmc/cores/VideoRenderers/RenderManager.h -+++ b/xbmc/cores/VideoRenderers/RenderManager.h -@@ -195,6 +195,11 @@ class CXBMCRenderManager - */ - void DiscardBuffer(); - -+ /** -+ * Magic api for communicating between codec and renderer -+ */ -+ void *PassCookie(void *cookie); -+ - protected: - - void PresentSingle(bool clear, DWORD flags, DWORD alpha); -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -index 6c6e05e..3fcd79b 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -@@ -111,7 +111,6 @@ CMMALVideo::CMMALVideo() - m_dec_input = NULL; - m_dec_output = NULL; - m_dec_input_pool = NULL; -- m_dec_output_pool = NULL; - - m_deint = NULL; - m_deint_connection = NULL; -@@ -162,10 +161,6 @@ CMMALVideo::~CMMALVideo() - mmal_pool_destroy(m_dec_input_pool); - m_dec_input_pool = NULL; - -- if (m_dec_output_pool) -- mmal_pool_destroy(m_dec_output_pool); -- m_dec_output_pool = NULL; -- - if (m_deint) - mmal_component_destroy(m_deint); - m_deint = NULL; -@@ -421,7 +416,7 @@ bool CMMALVideo::CreateDeinterlace(EINTERLACEMETHOD interlace_method) - - m_dec_output = m_deint->output[0]; - m_interlace_method = interlace_method; -- Prime(); -+ - return true; - } - -@@ -477,7 +472,7 @@ bool CMMALVideo::DestroyDeinterlace() - - m_dec_output = m_dec->output[0]; - m_interlace_method = VS_INTERLACEMETHOD_NONE; -- Prime(); -+ - return true; - } - -@@ -703,17 +698,9 @@ bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options, MMALVide - return false; - } - -- m_dec_output_pool = mmal_port_pool_create(m_dec_output, m_dec_output->buffer_num, m_dec_output->buffer_size); -- if(!m_dec_output_pool) -- { -- CLog::Log(LOGERROR, "%s::%s Failed to create pool for decode output port (status=%x %s)", CLASSNAME, __func__, status, mmal_status_to_string(status)); -- return false; -- } -- - if (!SendCodecConfigData()) - return false; - -- Prime(); - m_startframe = false; - m_preroll = !m_hints.stills; - m_speed = DVD_PLAYSPEED_NORMAL; -@@ -725,6 +712,7 @@ void CMMALVideo::Dispose() - { - // we are happy to exit, but let last shared pointer being deleted trigger the destructor - bool done = false; -+ g_renderManager.PassCookie(NULL); - m_finished = true; - Reset(); - pthread_mutex_lock(&m_output_mutex); -@@ -747,6 +735,7 @@ void CMMALVideo::SetDropState(bool bDrop) - - int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) - { -+ g_renderManager.PassCookie(this); - //if (g_advancedSettings.CanLogComponent(LOGVIDEO)) - // CLog::Log(LOGDEBUG, "%s::%s - %-8p %-6d dts:%.3f pts:%.3f ready_queue(%d) busy_queue(%d)", - // CLASSNAME, __func__, pData, iSize, dts == DVD_NOPTS_VALUE ? 0.0 : dts*1e-6, pts == DVD_NOPTS_VALUE ? 0.0 : pts*1e-6, m_output_ready.size(), m_output_busy); -@@ -900,13 +889,6 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) - return ret; - } - --void CMMALVideo::Prime() --{ -- MMAL_BUFFER_HEADER_T *buffer; -- while (buffer = mmal_queue_get(m_dec_output_pool->queue), buffer) -- Recycle(buffer); --} -- - void CMMALVideo::Reset(void) - { - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -@@ -952,10 +934,8 @@ void CMMALVideo::Reset(void) - pthread_mutex_unlock(&m_output_mutex); - - if (!m_finished) -- { - SendCodecConfigData(); -- Prime(); -- } -+ - m_startframe = false; - m_decoderPts = DVD_NOPTS_VALUE; - m_preroll = !m_hints.stills && (m_speed == DVD_PLAYSPEED_NORMAL || m_speed == DVD_PLAYSPEED_PAUSE); -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -index fcc6a15..204f004 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -@@ -103,7 +103,6 @@ class CMMALVideo - void QueryCodec(void); - bool CreateDeinterlace(EINTERLACEMETHOD interlace_method); - bool DestroyDeinterlace(); -- void Prime(); - - // Video format - int m_decoded_width; -@@ -141,7 +140,6 @@ class CMMALVideo - MMAL_PORT_T *m_dec_input; - MMAL_PORT_T *m_dec_output; - MMAL_POOL_T *m_dec_input_pool; -- MMAL_POOL_T *m_dec_output_pool; - - MMAL_ES_FORMAT_T *m_es_format; - MMAL_COMPONENT_T *m_deint; - -From 14e949b4786aec964686e1b14af0db1175f64bab Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Fri, 17 Apr 2015 16:07:40 +0100 -Subject: [PATCH 50/56] [mmalrenderer] Separate mmal and renderer configured - flags - ---- - xbmc/cores/VideoRenderers/MMALRenderer.cpp | 26 +++++++++++++++----------- - xbmc/cores/VideoRenderers/MMALRenderer.h | 1 + - 2 files changed, 16 insertions(+), 11 deletions(-) - -diff --git a/xbmc/cores/VideoRenderers/MMALRenderer.cpp b/xbmc/cores/VideoRenderers/MMALRenderer.cpp -index 5a65572..05ccbac 100644 ---- a/xbmc/cores/VideoRenderers/MMALRenderer.cpp -+++ b/xbmc/cores/VideoRenderers/MMALRenderer.cpp -@@ -73,13 +73,12 @@ void *CMMALRenderer::PassCookie(void *cookie) - CLog::Log(LOGDEBUG, "%s::%s cookie:%p", CLASSNAME, __func__, cookie); - #endif - -- if (m_mmal_video) -- { -- bool formatChanged = m_format != RENDER_FMT_MMAL; -- m_format = RENDER_FMT_MMAL; -- m_bConfigured = init_vout(formatChanged); -+ if (m_mmal_video && !m_bMMALConfigured) -+ m_bMMALConfigured = init_vout(RENDER_FMT_MMAL); -+ -+ if (m_mmal_video && m_bMMALConfigured) - Prime(); -- } -+ - return NULL; - } - -@@ -121,10 +120,10 @@ bool CMMALRenderer::init_vout(ERenderFormat format) - - CLog::Log(LOGDEBUG, "%s::%s configured:%d format:%d->%d", CLASSNAME, __func__, m_bConfigured, m_format, format); - -- if (m_bConfigured && formatChanged) -+ if (m_bMMALConfigured && formatChanged) - UnInitMMAL(); - -- if (m_bConfigured) -+ if (m_bMMALConfigured) - return true; - - m_format = RENDER_FMT_MMAL; -@@ -247,6 +246,8 @@ CMMALRenderer::CMMALRenderer() - m_iFlags = 0; - m_format = RENDER_FMT_NONE; - m_mmal_video = NULL; -+ m_bConfigured = false; -+ m_bMMALConfigured = false; - m_iYV12RenderBuffer = 0; - Create(); - } -@@ -297,8 +298,9 @@ bool CMMALRenderer::Configure(unsigned int width, unsigned int height, unsigned - SetViewMode(CMediaSettings::Get().GetCurrentVideoSettings().m_ViewMode); - ManageDisplay(); - -- m_bConfigured = init_vout(format); -- -+ m_bMMALConfigured = init_vout(format); -+ m_bConfigured = m_bMMALConfigured; -+ assert(m_bConfigured); - return m_bConfigured; - } - -@@ -361,7 +363,8 @@ int CMMALRenderer::GetImage(YV12Image *image, int source, bool readonly) - - void CMMALRenderer::ReleaseBuffer(int idx) - { -- if (!m_bConfigured || m_format == RENDER_FMT_BYPASS) -+ CSingleLock lock(m_sharedSection); -+ if (!m_bMMALConfigured || m_format == RENDER_FMT_BYPASS) - return; - - #if defined(MMAL_DEBUG_VERBOSE) -@@ -541,6 +544,7 @@ void CMMALRenderer::UnInitMMAL() - m_StereoInvert = false; - - m_bConfigured = false; -+ m_bMMALConfigured = false; - } - - void CMMALRenderer::UnInit() -diff --git a/xbmc/cores/VideoRenderers/MMALRenderer.h b/xbmc/cores/VideoRenderers/MMALRenderer.h -index f515d7a..a694182 100644 ---- a/xbmc/cores/VideoRenderers/MMALRenderer.h -+++ b/xbmc/cores/VideoRenderers/MMALRenderer.h -@@ -100,6 +100,7 @@ class CMMALRenderer : public CBaseRenderer, public CThread - - YUVBUFFER m_buffers[NUM_BUFFERS]; - bool m_bConfigured; -+ bool m_bMMALConfigured; - unsigned int m_extended_format; - unsigned int m_destWidth; - unsigned int m_destHeight; - -From 74db1bf9cffab54f174c5eddd63154228bab959f Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Thu, 16 Apr 2015 21:43:27 +0100 -Subject: [PATCH 51/56] [mmal] Separate the buffers from the decoder so decoder - can be destroyed first - ---- - .../DVDCodecs/Video/DVDVideoCodecMMAL.cpp | 4 +- - .../dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.h | 2 +- - xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 63 ++++++---------------- - xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h | 6 +-- - 4 files changed, 20 insertions(+), 55 deletions(-) - -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.cpp -index ee7d6f2..48e347c 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.cpp -@@ -44,11 +44,13 @@ CDVDVideoCodecMMAL::~CDVDVideoCodecMMAL() - { - CLog::Log(LOGDEBUG, "%s::%s %p\n", CLASSNAME, __func__, this); - Dispose(); -+ delete m_decoder; -+ m_decoder = NULL; - } - - bool CDVDVideoCodecMMAL::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options) - { -- return m_decoder->Open(hints, options, m_decoder); -+ return m_decoder->Open(hints, options); - } - - const char* CDVDVideoCodecMMAL::GetName(void) -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.h -index aa8e87f..6014363 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.h -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.h -@@ -46,7 +46,7 @@ class CDVDVideoCodecMMAL : public CDVDVideoCodec - virtual void SetSpeed(int iSpeed); - - protected: -- MMALVideoPtr m_decoder; -+ CMMALVideo *m_decoder; - }; - - #endif -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -index 3fcd79b..6110c32 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -@@ -81,7 +81,8 @@ long CMMALVideoBuffer::Release() - CLog::Log(LOGDEBUG, "%s::%s %p (%p) ref:%ld", CLASSNAME, __func__, this, mmal_buffer, count); - if (count == 0) - { -- m_omv->ReleaseBuffer(this); -+ mmal_buffer_header_release(mmal_buffer); -+ delete this; - } - else assert(count > 0); - return count; -@@ -117,7 +118,6 @@ CMMALVideo::CMMALVideo() - - m_codingType = 0; - -- m_output_busy = 0; - m_demux_queue_length = 0; - m_es_format = mmal_format_alloc(); - m_preroll = true; -@@ -261,7 +261,6 @@ void CMMALVideo::dec_output_port_cb(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buf - omvb->height = m_decoded_height; - omvb->m_aspect_ratio = m_aspect_ratio; - pthread_mutex_lock(&m_output_mutex); -- m_output_busy++; - m_output_ready.push(omvb); - pthread_mutex_unlock(&m_output_mutex); - kept = true; -@@ -505,7 +504,7 @@ bool CMMALVideo::SendCodecConfigData() - return true; - } - --bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options, MMALVideoPtr myself) -+bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options) - { - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) - CLog::Log(LOGDEBUG, "%s::%s usemmal:%d software:%d %dx%d", CLASSNAME, __func__, CSettings::Get().GetBool("videoplayer.usemmal"), hints.software, hints.width, hints.height); -@@ -518,7 +517,6 @@ bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options, MMALVide - MMAL_STATUS_T status; - MMAL_PARAMETER_BOOLEAN_T error_concealment; - -- m_myself = myself; - m_decoded_width = hints.width; - m_decoded_height = hints.height; - -@@ -710,21 +708,9 @@ bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options, MMALVide - - void CMMALVideo::Dispose() - { -- // we are happy to exit, but let last shared pointer being deleted trigger the destructor -- bool done = false; - g_renderManager.PassCookie(NULL); - m_finished = true; - Reset(); -- pthread_mutex_lock(&m_output_mutex); -- if (!m_output_busy) -- done = true; -- pthread_mutex_unlock(&m_output_mutex); -- if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -- CLog::Log(LOGDEBUG, "%s::%s ready_queue(%d) busy_queue(%d) done:%d", CLASSNAME, __func__, m_output_ready.size(), m_output_busy, done); -- if (done) -- { -- m_myself.reset(); -- } - } - - void CMMALVideo::SetDropState(bool bDrop) -@@ -737,8 +723,8 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) - { - g_renderManager.PassCookie(this); - //if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -- // CLog::Log(LOGDEBUG, "%s::%s - %-8p %-6d dts:%.3f pts:%.3f ready_queue(%d) busy_queue(%d)", -- // CLASSNAME, __func__, pData, iSize, dts == DVD_NOPTS_VALUE ? 0.0 : dts*1e-6, pts == DVD_NOPTS_VALUE ? 0.0 : pts*1e-6, m_output_ready.size(), m_output_busy); -+ // CLog::Log(LOGDEBUG, "%s::%s - %-8p %-6d dts:%.3f pts:%.3f ready_queue(%d)", -+ // CLASSNAME, __func__, pData, iSize, dts == DVD_NOPTS_VALUE ? 0.0 : dts*1e-6, pts == DVD_NOPTS_VALUE ? 0.0 : pts*1e-6, m_output_ready.size()); - - unsigned int demuxer_bytes = 0; - uint8_t *demuxer_content = NULL; -@@ -814,8 +800,8 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) - buffer->flags |= MMAL_BUFFER_HEADER_FLAG_FRAME_END; - - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -- CLog::Log(LOGDEBUG, "%s::%s - %-8p %-6d/%-6d dts:%.3f pts:%.3f flags:%x ready_queue(%d) busy_queue(%d) demux_queue(%d) space(%d)", -- CLASSNAME, __func__, buffer, buffer->length, demuxer_bytes, dts == DVD_NOPTS_VALUE ? 0.0 : dts*1e-6, pts == DVD_NOPTS_VALUE ? 0.0 : pts*1e-6, buffer->flags, m_output_ready.size(), m_output_busy, m_demux_queue_length, mmal_queue_length(m_dec_input_pool->queue) * m_dec_input->buffer_size); -+ CLog::Log(LOGDEBUG, "%s::%s - %-8p %-6d/%-6d dts:%.3f pts:%.3f flags:%x ready_queue(%d) demux_queue(%d) space(%d)", -+ CLASSNAME, __func__, buffer, buffer->length, demuxer_bytes, dts == DVD_NOPTS_VALUE ? 0.0 : dts*1e-6, pts == DVD_NOPTS_VALUE ? 0.0 : pts*1e-6, buffer->flags, m_output_ready.size(), m_demux_queue_length, mmal_queue_length(m_dec_input_pool->queue) * m_dec_input->buffer_size); - assert((int)buffer->length > 0); - status = mmal_port_send_buffer(m_dec_input, buffer); - if (status != MMAL_SUCCESS) -@@ -882,8 +868,8 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) - if (!ret) - { - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -- CLog::Log(LOGDEBUG, "%s::%s - Nothing to do: ready_queue(%d) busy_queue(%d) demux_queue(%d) space(%d) preroll(%d)", -- CLASSNAME, __func__, m_output_ready.size(), m_output_busy, m_demux_queue_length, mmal_queue_length(m_dec_input_pool->queue) * m_dec_input->buffer_size, m_preroll); -+ CLog::Log(LOGDEBUG, "%s::%s - Nothing to do: ready_queue(%d) demux_queue(%d) space(%d) preroll(%d)", -+ CLASSNAME, __func__, m_output_ready.size(), m_demux_queue_length, mmal_queue_length(m_dec_input_pool->queue) * m_dec_input->buffer_size, m_preroll); - Sleep(10); // otherwise we busy spin - } - return ret; -@@ -922,7 +908,10 @@ void CMMALVideo::Reset(void) - } - pthread_mutex_unlock(&m_output_mutex); - if (buffer) -- ReleaseBuffer(buffer); -+ { -+ buffer->Acquire(); -+ buffer->Release(); -+ } - else - break; - } -@@ -965,8 +954,8 @@ void CMMALVideo::Recycle(MMAL_BUFFER_HEADER_T *buffer) - mmal_buffer_header_reset(buffer); - buffer->cmd = 0; - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -- CLog::Log(LOGDEBUG, "%s::%s Send buffer %p from pool to decoder output port %p ready_queue(%d) busy_queue(%d)", CLASSNAME, __func__, buffer, m_dec_output, -- m_output_ready.size(), m_output_busy); -+ CLog::Log(LOGDEBUG, "%s::%s Send buffer %p from pool to decoder output port %p ready_queue(%d)", CLASSNAME, __func__, buffer, m_dec_output, -+ m_output_ready.size()); - status = mmal_port_send_buffer(m_dec_output, buffer); - if (status != MMAL_SUCCESS) - { -@@ -975,28 +964,6 @@ void CMMALVideo::Recycle(MMAL_BUFFER_HEADER_T *buffer) - } - } - --void CMMALVideo::ReleaseBuffer(CMMALVideoBuffer *buffer) --{ -- // remove from busy list -- pthread_mutex_lock(&m_output_mutex); -- assert(m_output_busy > 0); -- m_output_busy--; -- pthread_mutex_unlock(&m_output_mutex); -- // sanity check it is not on display -- assert(!(buffer->mmal_buffer->flags & MMAL_BUFFER_HEADER_FLAG_USER2)); -- Recycle(buffer->mmal_buffer); -- bool done = false; -- pthread_mutex_lock(&m_output_mutex); -- if (m_finished && !m_output_busy) -- done = true; -- pthread_mutex_unlock(&m_output_mutex); -- if (done) -- m_myself.reset(); -- if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -- CLog::Log(LOGDEBUG, "%s::%s %p (%p) ready_queue(%d) busy_queue(%d) done:%d", CLASSNAME, __func__, buffer, buffer->mmal_buffer, m_output_ready.size(), m_output_busy, done); -- delete buffer; --} -- - bool CMMALVideo::GetPicture(DVDVideoPicture* pDvdVideoPicture) - { - if (!m_output_ready.empty()) -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -index 204f004..ab6e958 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -@@ -42,7 +42,6 @@ - #include "cores/VideoRenderers/BaseRenderer.h" - - class CMMALVideo; --typedef std::shared_ptr MMALVideoPtr; - - // a mmal video frame - class CMMALVideoBuffer -@@ -77,7 +76,7 @@ class CMMALVideo - virtual ~CMMALVideo(); - - // Required overrides -- virtual bool Open(CDVDStreamInfo &hints, CDVDCodecOptions &options, MMALVideoPtr myself); -+ virtual bool Open(CDVDStreamInfo &hints, CDVDCodecOptions &options); - virtual void Dispose(void); - virtual int Decode(uint8_t *pData, int iSize, double dts, double pts); - virtual void Reset(void); -@@ -91,7 +90,6 @@ class CMMALVideo - virtual void SetSpeed(int iSpeed); - - // MMAL decoder callback routines. -- void ReleaseBuffer(CMMALVideoBuffer *buffer); - void Recycle(MMAL_BUFFER_HEADER_T *buffer); - - // MMAL decoder callback routines. -@@ -111,14 +109,12 @@ class CMMALVideo - bool m_finished; - float m_aspect_ratio; - const char *m_pFormatName; -- MMALVideoPtr m_myself; - - std::queue m_demux_queue; - unsigned m_demux_queue_length; - - // mmal output buffers (video frames) - pthread_mutex_t m_output_mutex; -- int m_output_busy; - std::queue m_output_ready; - - // initialize mmal and get decoder component - -From 8cf59f193e56c3e7eba46e729490f326b08659d1 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Thu, 16 Apr 2015 21:50:10 +0100 -Subject: [PATCH 52/56] [mmalcodec] Remove DVDVideoCodecMMAL wrapper - ---- - xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp | 4 +- - .../DVDCodecs/Video/DVDVideoCodecMMAL.cpp | 111 --------------------- - .../dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.h | 52 ---------- - xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 3 +- - xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h | 4 +- - xbmc/cores/dvdplayer/DVDCodecs/Video/Makefile.in | 1 - - 6 files changed, 6 insertions(+), 169 deletions(-) - delete mode 100644 xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.cpp - delete mode 100644 xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.h - -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp -index b77a168..4633c18 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp -@@ -40,7 +40,7 @@ - #if defined(HAS_IMXVPU) - #include "Video/DVDVideoCodecIMX.h" - #endif --#include "Video/DVDVideoCodecMMAL.h" -+#include "Video/MMALCodec.h" - #include "Video/DVDVideoCodecStageFright.h" - #if defined(HAS_LIBAMCODEC) - #include "utils/AMLUtils.h" -@@ -306,7 +306,7 @@ CDVDVideoCodec* CDVDFactoryCodec::CreateVideoCodec(CDVDStreamInfo &hint, unsigne - hint.codec == AV_CODEC_ID_VP6 || hint.codec == AV_CODEC_ID_VP6F || hint.codec == AV_CODEC_ID_VP6A || hint.codec == AV_CODEC_ID_VP8 || - hint.codec == AV_CODEC_ID_THEORA || hint.codec == AV_CODEC_ID_MJPEG || hint.codec == AV_CODEC_ID_MJPEGB || hint.codec == AV_CODEC_ID_VC1 || hint.codec == AV_CODEC_ID_WMV3) - { -- if ( (pCodec = OpenCodec(new CDVDVideoCodecMMAL(), hint, options)) ) return pCodec; -+ if ( (pCodec = OpenCodec(new CMMALVideo(), hint, options)) ) return pCodec; - } - } - #endif -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.cpp -deleted file mode 100644 -index 48e347c..0000000 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.cpp -+++ /dev/null -@@ -1,111 +0,0 @@ --/* -- * Copyright (C) 2010-2013 Team XBMC -- * http://xbmc.org -- * -- * This Program is free software; you can redistribute it and/or modify -- * it under the terms of the GNU General Public License as published by -- * the Free Software Foundation; either version 2, 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 General Public License for more details. -- * -- * You should have received a copy of the GNU General Public License -- * along with XBMC; see the file COPYING. If not, see -- * . -- * -- */ -- --#if (defined HAVE_CONFIG_H) && (!defined TARGET_WINDOWS) -- #include "config.h" --#elif defined(TARGET_WINDOWS) --#include "system.h" --#endif -- --#if defined(HAS_MMAL) --#include "DVDClock.h" --#include "DVDStreamInfo.h" --#include "DVDVideoCodecMMAL.h" --#include "settings/Settings.h" --#include "utils/log.h" -- --#define CLASSNAME "CDVDVideoCodecMMAL" --//////////////////////////////////////////////////////////////////////////////////////////// --//////////////////////////////////////////////////////////////////////////////////////////// --CDVDVideoCodecMMAL::CDVDVideoCodecMMAL() -- : m_decoder( new CMMALVideo ) --{ -- CLog::Log(LOGDEBUG, "%s::%s %p\n", CLASSNAME, __func__, this); --} -- --CDVDVideoCodecMMAL::~CDVDVideoCodecMMAL() --{ -- CLog::Log(LOGDEBUG, "%s::%s %p\n", CLASSNAME, __func__, this); -- Dispose(); -- delete m_decoder; -- m_decoder = NULL; --} -- --bool CDVDVideoCodecMMAL::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options) --{ -- return m_decoder->Open(hints, options); --} -- --const char* CDVDVideoCodecMMAL::GetName(void) --{ -- return m_decoder ? m_decoder->GetName() : "mmal-xxx"; --} -- --void CDVDVideoCodecMMAL::Dispose() --{ -- m_decoder->Dispose(); --} -- --void CDVDVideoCodecMMAL::SetDropState(bool bDrop) --{ -- m_decoder->SetDropState(bDrop); --} -- --int CDVDVideoCodecMMAL::Decode(uint8_t* pData, int iSize, double dts, double pts) --{ -- return m_decoder->Decode(pData, iSize, dts, pts); --} -- --unsigned CDVDVideoCodecMMAL::GetAllowedReferences() --{ -- return m_decoder->GetAllowedReferences(); --} -- --void CDVDVideoCodecMMAL::Reset(void) --{ -- m_decoder->Reset(); --} -- --bool CDVDVideoCodecMMAL::GetPicture(DVDVideoPicture* pDvdVideoPicture) --{ -- return m_decoder->GetPicture(pDvdVideoPicture); --} -- --bool CDVDVideoCodecMMAL::ClearPicture(DVDVideoPicture* pDvdVideoPicture) --{ -- return m_decoder->ClearPicture(pDvdVideoPicture); --} -- --bool CDVDVideoCodecMMAL::GetCodecStats(double &pts, int &droppedPics) --{ -- return m_decoder->GetCodecStats(pts, droppedPics); --} -- --void CDVDVideoCodecMMAL::SetCodecControl(int flags) --{ -- m_decoder->SetCodecControl(flags); --} -- --void CDVDVideoCodecMMAL::SetSpeed(int iSpeed) --{ -- m_decoder->SetSpeed(iSpeed); --} -- --#endif -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.h -deleted file mode 100644 -index 6014363..0000000 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.h -+++ /dev/null -@@ -1,52 +0,0 @@ --#pragma once --/* -- * Copyright (C) 2010-2013 Team XBMC -- * http://xbmc.org -- * -- * This Program is free software; you can redistribute it and/or modify -- * it under the terms of the GNU General Public License as published by -- * the Free Software Foundation; either version 2, 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 General Public License for more details. -- * -- * You should have received a copy of the GNU General Public License -- * along with XBMC; see the file COPYING. If not, see -- * . -- * -- */ -- --#if defined(HAS_MMAL) -- --#include "DVDVideoCodec.h" --#include "MMALCodec.h" -- --class CMMALVideo; --class CDVDVideoCodecMMAL : public CDVDVideoCodec --{ --public: -- CDVDVideoCodecMMAL(); -- virtual ~CDVDVideoCodecMMAL(); -- -- // Required overrides -- virtual bool Open(CDVDStreamInfo &hints, CDVDCodecOptions &options); -- virtual void Dispose(void); -- virtual int Decode(uint8_t *pData, int iSize, double dts, double pts); -- virtual void Reset(void); -- virtual bool GetPicture(DVDVideoPicture *pDvdVideoPicture); -- virtual bool ClearPicture(DVDVideoPicture* pDvdVideoPicture); -- virtual unsigned GetAllowedReferences(); -- virtual void SetDropState(bool bDrop); -- virtual const char* GetName(void); -- virtual bool GetCodecStats(double &pts, int &droppedPics); -- virtual void SetCodecControl(int flags); -- virtual void SetSpeed(int iSpeed); -- --protected: -- CMMALVideo *m_decoder; --}; -- --#endif -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -index 6110c32..1bf1940 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -@@ -129,7 +129,8 @@ CMMALVideo::~CMMALVideo() - { - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) - CLog::Log(LOGDEBUG, "%s::%s %p", CLASSNAME, __func__, this); -- assert(m_finished); -+ if (!m_finished) -+ Dispose(); - - pthread_mutex_destroy(&m_output_mutex); - -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -index ab6e958..3e444f7 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -@@ -62,7 +62,7 @@ class CMMALVideoBuffer - private: - }; - --class CMMALVideo -+class CMMALVideo : public CDVDVideoCodec - { - typedef struct mmal_demux_packet { - uint8_t *buff; -@@ -84,7 +84,7 @@ class CMMALVideo - virtual bool ClearPicture(DVDVideoPicture* pDvdVideoPicture); - virtual unsigned GetAllowedReferences() { return 3; } - virtual void SetDropState(bool bDrop); -- virtual const char* GetName(void) { return (const char*)m_pFormatName; } -+ virtual const char* GetName(void) { return m_pFormatName ? m_pFormatName:"mmal-xxx"; } - virtual bool GetCodecStats(double &pts, int &droppedPics); - virtual void SetCodecControl(int flags); - virtual void SetSpeed(int iSpeed); -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/Makefile.in b/xbmc/cores/dvdplayer/DVDCodecs/Video/Makefile.in -index 6f5d3e8..56ec6a3 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/Makefile.in -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/Makefile.in -@@ -39,7 +39,6 @@ endif - - ifeq (@USE_MMAL@,1) - SRCS += MMALCodec.cpp --SRCS += DVDVideoCodecMMAL.cpp - endif - - LIB=Video.a - -From 2ced0d8763938f359bd7920b037d7e969a3a06ed Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Fri, 17 Apr 2015 15:46:55 +0100 -Subject: [PATCH 53/56] [mmalcodec] Add shared lock around MMAL operations - ---- - xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 16 ++++++++++++++++ - xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h | 1 + - 2 files changed, 17 insertions(+) - -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -index 1bf1940..09d15fe88 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -@@ -127,6 +127,7 @@ CMMALVideo::CMMALVideo() - - CMMALVideo::~CMMALVideo() - { -+ CSingleLock lock(m_sharedSection); - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) - CLog::Log(LOGDEBUG, "%s::%s %p", CLASSNAME, __func__, this); - if (!m_finished) -@@ -175,6 +176,7 @@ CMMALVideo::~CMMALVideo() - - void CMMALVideo::PortSettingsChanged(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buffer) - { -+ CSingleLock lock(m_sharedSection); - MMAL_EVENT_FORMAT_CHANGED_T *fmt = mmal_event_format_changed_get(buffer); - mmal_format_copy(m_es_format, fmt->format); - -@@ -289,6 +291,7 @@ static void dec_output_port_cb_static(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *b - - bool CMMALVideo::change_dec_output_format() - { -+ CSingleLock lock(m_sharedSection); - MMAL_STATUS_T status; - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) - CLog::Log(LOGDEBUG, "%s::%s", CLASSNAME, __func__); -@@ -325,6 +328,7 @@ bool CMMALVideo::change_dec_output_format() - - bool CMMALVideo::CreateDeinterlace(EINTERLACEMETHOD interlace_method) - { -+ CSingleLock lock(m_sharedSection); - MMAL_STATUS_T status; - - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -@@ -422,6 +426,7 @@ bool CMMALVideo::CreateDeinterlace(EINTERLACEMETHOD interlace_method) - - bool CMMALVideo::DestroyDeinterlace() - { -+ CSingleLock lock(m_sharedSection); - MMAL_STATUS_T status; - - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -@@ -478,6 +483,7 @@ bool CMMALVideo::DestroyDeinterlace() - - bool CMMALVideo::SendCodecConfigData() - { -+ CSingleLock lock(m_sharedSection); - MMAL_STATUS_T status; - if (!m_dec_input_pool) - return true; -@@ -507,6 +513,7 @@ bool CMMALVideo::SendCodecConfigData() - - bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options) - { -+ CSingleLock lock(m_sharedSection); - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) - CLog::Log(LOGDEBUG, "%s::%s usemmal:%d software:%d %dx%d", CLASSNAME, __func__, CSettings::Get().GetBool("videoplayer.usemmal"), hints.software, hints.width, hints.height); - -@@ -710,6 +717,7 @@ bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options) - void CMMALVideo::Dispose() - { - g_renderManager.PassCookie(NULL); -+ CSingleLock lock(m_sharedSection); - m_finished = true; - Reset(); - } -@@ -723,6 +731,7 @@ void CMMALVideo::SetDropState(bool bDrop) - int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) - { - g_renderManager.PassCookie(this); -+ CSingleLock lock(m_sharedSection); - //if (g_advancedSettings.CanLogComponent(LOGVIDEO)) - // CLog::Log(LOGDEBUG, "%s::%s - %-8p %-6d dts:%.3f pts:%.3f ready_queue(%d)", - // CLASSNAME, __func__, pData, iSize, dts == DVD_NOPTS_VALUE ? 0.0 : dts*1e-6, pts == DVD_NOPTS_VALUE ? 0.0 : pts*1e-6, m_output_ready.size()); -@@ -871,6 +880,7 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) - CLog::Log(LOGDEBUG, "%s::%s - Nothing to do: ready_queue(%d) demux_queue(%d) space(%d) preroll(%d)", - CLASSNAME, __func__, m_output_ready.size(), m_demux_queue_length, mmal_queue_length(m_dec_input_pool->queue) * m_dec_input->buffer_size, m_preroll); -+ lock.Leave(); - Sleep(10); // otherwise we busy spin - } - return ret; -@@ -878,6 +888,7 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) - - void CMMALVideo::Reset(void) - { -+ CSingleLock lock(m_sharedSection); - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) - CLog::Log(LOGDEBUG, "%s::%s", CLASSNAME, __func__); - -@@ -942,6 +953,7 @@ void CMMALVideo::SetSpeed(int iSpeed) - - void CMMALVideo::Recycle(MMAL_BUFFER_HEADER_T *buffer) - { -+ CSingleLock lock(m_sharedSection); - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) - CLog::Log(LOGDEBUG, "%s::%s %p", CLASSNAME, __func__, buffer); - -@@ -967,6 +979,7 @@ void CMMALVideo::Recycle(MMAL_BUFFER_HEADER_T *buffer) - - bool CMMALVideo::GetPicture(DVDVideoPicture* pDvdVideoPicture) - { -+ CSingleLock lock(m_sharedSection); - if (!m_output_ready.empty()) - { - CMMALVideoBuffer *buffer; -@@ -1026,6 +1039,7 @@ bool CMMALVideo::GetPicture(DVDVideoPicture* pDvdVideoPicture) - - bool CMMALVideo::ClearPicture(DVDVideoPicture* pDvdVideoPicture) - { -+ CSingleLock lock(m_sharedSection); - if (pDvdVideoPicture->format == RENDER_FMT_MMAL) - { - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -@@ -1038,12 +1052,14 @@ bool CMMALVideo::ClearPicture(DVDVideoPicture* pDvdVideoPicture) - - bool CMMALVideo::GetCodecStats(double &pts, int &droppedPics) - { -+ CSingleLock lock(m_sharedSection); - droppedPics= -1; - return false; - } - - void CMMALVideo::SetCodecControl(int flags) - { -+ CSingleLock lock(m_sharedSection); - m_codecControlFlags = flags; - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) - CLog::Log(LOGDEBUG, "%s::%s flags:%x", CLASSNAME, __func__, flags); -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -index 3e444f7..e686b4b 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -@@ -132,6 +132,7 @@ class CMMALVideo : public CDVDVideoCodec - bool m_preroll; - int m_codecControlFlags; - -+ CCriticalSection m_sharedSection; - MMAL_COMPONENT_T *m_dec; - MMAL_PORT_T *m_dec_input; - MMAL_PORT_T *m_dec_output; - -From d693f1d572b85e7c2e0c230bd518d0e3c094d938 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Fri, 17 Apr 2015 15:59:12 +0100 -Subject: [PATCH 54/56] [mmalrenderer] Add shared lock around MMAL operations - ---- - xbmc/cores/VideoRenderers/MMALRenderer.cpp | 11 ++++++++++- - xbmc/cores/VideoRenderers/MMALRenderer.h | 1 + - 2 files changed, 11 insertions(+), 1 deletion(-) - -diff --git a/xbmc/cores/VideoRenderers/MMALRenderer.cpp b/xbmc/cores/VideoRenderers/MMALRenderer.cpp -index 05ccbac..270036d 100644 ---- a/xbmc/cores/VideoRenderers/MMALRenderer.cpp -+++ b/xbmc/cores/VideoRenderers/MMALRenderer.cpp -@@ -43,6 +43,7 @@ - - void CMMALRenderer::Prime() - { -+ CSingleLock lock(m_sharedSection); - #if defined(MMAL_DEBUG_VERBOSE) - CLog::Log(LOGDEBUG, "%s::%s format:%d dec:%p pool:%p", CLASSNAME, __func__, m_format, m_mmal_video, m_vout_input_pool); - #endif -@@ -68,6 +69,7 @@ void CMMALRenderer::Prime() - - void *CMMALRenderer::PassCookie(void *cookie) - { -+ CSingleLock lock(m_sharedSection); - m_mmal_video = (CMMALVideo *)cookie; - #if defined(MMAL_DEBUG_VERBOSE) - CLog::Log(LOGDEBUG, "%s::%s cookie:%p", CLASSNAME, __func__, cookie); -@@ -115,6 +117,7 @@ static void vout_input_port_cb_static(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *b - - bool CMMALRenderer::init_vout(ERenderFormat format) - { -+ CSingleLock lock(m_sharedSection); - bool formatChanged = m_format != format; - MMAL_STATUS_T status; - -@@ -254,6 +257,7 @@ CMMALRenderer::CMMALRenderer() - - CMMALRenderer::~CMMALRenderer() - { -+ CSingleLock lock(m_sharedSection); - CLog::Log(LOGDEBUG, "%s::%s", CLASSNAME, __func__); - // shutdown thread - mmal_queue_put(m_release_queue, &m_quit_packet); -@@ -276,6 +280,7 @@ void CMMALRenderer::AddProcessor(CMMALVideoBuffer *buffer, int index) - - bool CMMALRenderer::Configure(unsigned int width, unsigned int height, unsigned int d_width, unsigned int d_height, float fps, unsigned flags, ERenderFormat format, unsigned extended_format, unsigned int orientation) - { -+ CSingleLock lock(m_sharedSection); - ReleaseBuffers(); - - m_sourceWidth = width; -@@ -363,7 +368,6 @@ int CMMALRenderer::GetImage(YV12Image *image, int source, bool readonly) - - void CMMALRenderer::ReleaseBuffer(int idx) - { -- CSingleLock lock(m_sharedSection); - if (!m_bMMALConfigured || m_format == RENDER_FMT_BYPASS) - return; - -@@ -403,6 +407,7 @@ void CMMALRenderer::Update() - - void CMMALRenderer::RenderUpdate(bool clear, DWORD flags, DWORD alpha) - { -+ CSingleLock lock(m_sharedSection); - int source = m_iYV12RenderBuffer; - #if defined(MMAL_DEBUG_VERBOSE) - CLog::Log(LOGDEBUG, "%s::%s - %d %x %d %d", CLASSNAME, __func__, clear, flags, alpha, source); -@@ -463,6 +468,7 @@ void CMMALRenderer::RenderUpdate(bool clear, DWORD flags, DWORD alpha) - - void CMMALRenderer::FlipPage(int source) - { -+ CSingleLock lock(m_sharedSection); - if (!m_bConfigured || m_format == RENDER_FMT_BYPASS) - return; - -@@ -475,6 +481,7 @@ void CMMALRenderer::FlipPage(int source) - - unsigned int CMMALRenderer::PreInit() - { -+ CSingleLock lock(m_sharedSection); - m_bConfigured = false; - UnInit(); - -@@ -506,6 +513,7 @@ void CMMALRenderer::ReleaseBuffers() - - void CMMALRenderer::UnInitMMAL() - { -+ CSingleLock lock(m_sharedSection); - CLog::Log(LOGDEBUG, "%s::%s", CLASSNAME, __func__); - if (m_vout) - { -@@ -619,6 +627,7 @@ EINTERLACEMETHOD CMMALRenderer::AutoInterlaceMethod() - - void CMMALRenderer::SetVideoRect(const CRect& InSrcRect, const CRect& InDestRect) - { -+ CSingleLock lock(m_sharedSection); - assert(g_graphicsContext.GetStereoView() != RENDER_STEREO_VIEW_RIGHT); - - if (!m_vout_input) -diff --git a/xbmc/cores/VideoRenderers/MMALRenderer.h b/xbmc/cores/VideoRenderers/MMALRenderer.h -index a694182..6474c1b 100644 ---- a/xbmc/cores/VideoRenderers/MMALRenderer.h -+++ b/xbmc/cores/VideoRenderers/MMALRenderer.h -@@ -112,6 +112,7 @@ class CMMALRenderer : public CBaseRenderer, public CThread - RENDER_STEREO_MODE m_display_stereo_mode; - bool m_StereoInvert; - -+ CCriticalSection m_sharedSection; - MMAL_COMPONENT_T *m_vout; - MMAL_PORT_T *m_vout_input; - MMAL_POOL_T *m_vout_input_pool; - -From 055a522a3a5298ad53f3d0bad491d43d7f562ac8 Mon Sep 17 00:00:00 2001 +From 0768d7332735c93b675a7553c2f50988e10218cd Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 21 Apr 2015 14:32:07 +0100 -Subject: [PATCH 56/56] [mmalrenderer] Add sharpness control +Subject: [PATCH 57/61] [mmalrenderer] Add sharpness control --- addons/resource.language.en_gb/resources/strings.po | 2 +- @@ -5907,10 +3055,10 @@ Subject: [PATCH 56/56] [mmalrenderer] Add sharpness control 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po -index fa25d45..94679d8 100644 +index d8ffaf4..474ffef 100644 --- a/addons/resource.language.en_gb/resources/strings.po +++ b/addons/resource.language.en_gb/resources/strings.po -@@ -7492,7 +7492,7 @@ msgstr "" +@@ -7474,7 +7474,7 @@ msgstr "" #: xbmc/video/dialogs/GUIDialogVideoSettings.cpp msgctxt "#16313" @@ -5920,18 +3068,18 @@ index fa25d45..94679d8 100644 #: xbmc/video/dialogs/GUIDialogVideoSettings.cpp diff --git a/xbmc/cores/VideoRenderers/MMALRenderer.cpp b/xbmc/cores/VideoRenderers/MMALRenderer.cpp -index e73feed..30e62b9 100644 +index 8ffcf23..67daa9e 100644 --- a/xbmc/cores/VideoRenderers/MMALRenderer.cpp +++ b/xbmc/cores/VideoRenderers/MMALRenderer.cpp -@@ -252,6 +252,7 @@ CMMALRenderer::CMMALRenderer() +@@ -207,6 +207,7 @@ CMMALRenderer::CMMALRenderer() m_bConfigured = false; m_bMMALConfigured = false; m_iYV12RenderBuffer = 0; + m_sharpness = -2.0f; - Create(); } -@@ -422,6 +423,15 @@ void CMMALRenderer::RenderUpdate(bool clear, DWORD flags, DWORD alpha) + CMMALRenderer::~CMMALRenderer() +@@ -373,6 +374,15 @@ void CMMALRenderer::RenderUpdate(bool clear, DWORD flags, DWORD alpha) if (m_RenderUpdateCallBackFn) (*m_RenderUpdateCallBackFn)(m_RenderUpdateCallBackCtx, m_sourceRect, m_destRect); @@ -5947,7 +3095,7 @@ index e73feed..30e62b9 100644 if (m_format == RENDER_FMT_BYPASS) return; -@@ -610,7 +620,8 @@ bool CMMALRenderer::Supports(ERENDERFEATURE feature) +@@ -559,7 +569,8 @@ bool CMMALRenderer::Supports(ERENDERFEATURE feature) feature == RENDERFEATURE_ZOOM || feature == RENDERFEATURE_ROTATION || feature == RENDERFEATURE_VERTICAL_SHIFT || @@ -5958,10 +3106,10 @@ index e73feed..30e62b9 100644 return false; diff --git a/xbmc/cores/VideoRenderers/MMALRenderer.h b/xbmc/cores/VideoRenderers/MMALRenderer.h -index 6474c1b..8a22454 100644 +index 1404fb3..9bced7e 100644 --- a/xbmc/cores/VideoRenderers/MMALRenderer.h +++ b/xbmc/cores/VideoRenderers/MMALRenderer.h -@@ -111,6 +111,7 @@ class CMMALRenderer : public CBaseRenderer, public CThread +@@ -105,6 +105,7 @@ class CMMALRenderer : public CBaseRenderer RENDER_STEREO_MODE m_video_stereo_mode; RENDER_STEREO_MODE m_display_stereo_mode; bool m_StereoInvert; @@ -5969,3 +3117,58 @@ index 6474c1b..8a22454 100644 CCriticalSection m_sharedSection; MMAL_COMPONENT_T *m_vout; + +From bbc34ab2aff74da8ce3ba13dd6937ea5f00f1844 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Fri, 24 Apr 2015 13:49:51 +0100 +Subject: [PATCH 58/61] [dvdplayer] Add back required include + +--- + xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +index 55fa8b1..23edcd6 100644 +--- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp ++++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +@@ -33,6 +33,7 @@ + #include "DVDCodecs/Video/DVDVideoPPFFmpeg.h" + #include "DVDCodecs/Video/DVDVideoCodecFFmpeg.h" + #include "DVDDemuxers/DVDDemux.h" ++#include "DVDDemuxers/DVDDemuxUtils.h" + #include "DVDOverlayRenderer.h" + #include "guilib/GraphicContext.h" + #include + +From 93943251b2afa14881cd57ba1cc7a1b917e007b9 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Tue, 5 May 2015 23:58:06 +0100 +Subject: [PATCH 60/61] [screensaver] Leave GUI contents available for + screensaver + +--- + xbmc/guilib/GUIWindowManager.cpp | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +diff --git a/xbmc/guilib/GUIWindowManager.cpp b/xbmc/guilib/GUIWindowManager.cpp +index a22fb74..eb35710 100644 +--- a/xbmc/guilib/GUIWindowManager.cpp ++++ b/xbmc/guilib/GUIWindowManager.cpp +@@ -792,7 +792,16 @@ void CGUIWindowManager::ActivateWindow_Internal(int iWindowID, const vectorClose(true, iWindowID); ++ } ++ else ++ { ++ CloseWindowSync(pWindow, iWindowID); ++ } ++ } + g_infoManager.SetNextWindow(WINDOW_INVALID); + + // Add window to the history list (we must do this before we activate it, diff --git a/projects/RPi2/patches/kodi/kodi-001-isengard-rpb-backports.patch b/projects/RPi2/patches/kodi/kodi-001-isengard-rpb-backports.patch index 7c6476703d..c57aa0c8b0 100644 --- a/projects/RPi2/patches/kodi/kodi-001-isengard-rpb-backports.patch +++ b/projects/RPi2/patches/kodi/kodi-001-isengard-rpb-backports.patch @@ -1,29 +1,7 @@ -From e7a6d463c7df5946991024540c0b9afbf48e5a0a Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Fri, 24 Apr 2015 13:49:51 +0100 -Subject: [PATCH 01/56] [dvdplayer] Add back required include - ---- - xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index 6b24b25..a3922c0 100644 ---- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -+++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -@@ -33,6 +33,7 @@ - #include "DVDCodecs/Video/DVDVideoPPFFmpeg.h" - #include "DVDCodecs/Video/DVDVideoCodecFFmpeg.h" - #include "DVDDemuxers/DVDDemux.h" -+#include "DVDDemuxers/DVDDemuxUtils.h" - #include "DVDOverlayRenderer.h" - #include "guilib/GraphicContext.h" - #include - -From 29b89ed811f96193f85fd761168a9dc88270afd3 Mon Sep 17 00:00:00 2001 +From f68b3816564aa0c29d0da419bdfd854a7b15d68b Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 7 Apr 2014 18:19:32 +0100 -Subject: [PATCH 02/56] [rbp/omxplayer] When opening a stream don't try to +Subject: [PATCH 02/61] [rbp/omxplayer] When opening a stream don't try to update gui so often --- @@ -47,10 +25,10 @@ index 2faceea..889d7a2 100644 g_windowManager.ProcessRenderLoop(false); if (allowCancel && dialog->IsCanceled()) -From 3703b7999256e773486d09fdaae7d4345ff8e0f0 Mon Sep 17 00:00:00 2001 +From 7a7fc569a12d489520142ddb39dedbb6982466d5 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 29 Apr 2014 15:23:22 +0100 -Subject: [PATCH 03/56] [ffmpeg] Speed up wtv index creation +Subject: [PATCH 03/61] [ffmpeg] Speed up wtv index creation The index creation is O(N^2) with number of entries (typically thousands). On a Pi this can take more than 60 seconds to execute for a recording of a few hours. @@ -136,10 +114,10 @@ index 0000000..4ac5636 + } + } -From 7c3357d9c9c6456e35927814af7d54cd4b11bff9 Mon Sep 17 00:00:00 2001 +From 7b6da2b187ac78022c09d9428a1041d33aa9777e Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 8 Mar 2014 15:36:06 +0000 -Subject: [PATCH 04/56] [hifiberry] Hack: force it to be recognised as IEC958 +Subject: [PATCH 04/61] [hifiberry] Hack: force it to be recognised as IEC958 capable to enable passthrough options --- @@ -162,10 +140,10 @@ index e22db7a..0120bd5 100644 info.m_displayName.substr(info.m_displayName.size()-5) == " HDMI") { -From 18ae905e8eb0987c35e8a10ccfbcbcbf829ba77b Mon Sep 17 00:00:00 2001 +From 877979729163728264ccf1d9d4044cf7871bf85d Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Thu, 1 May 2014 16:28:39 +0100 -Subject: [PATCH 05/56] Improved file buffering in CArchive +Subject: [PATCH 05/61] Improved file buffering in CArchive Even though memcpy is typically inlined by the compiler into byte/word loads and stores (at least for release builds), the frequency with which 1, 2 and 4 @@ -225,20 +203,20 @@ index 6ed0f8f..8506d95 100644 } else -From e564fb5d4b4f0e0db220c3e9b4017beb307ba377 Mon Sep 17 00:00:00 2001 +From ed0c376577971a2b7dab4770d6914bb631b86d34 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 12 Aug 2014 00:31:36 +0100 -Subject: [PATCH 06/56] [omxcodec] Don't force software codec with dvds +Subject: [PATCH 06/61] [omxcodec] Don't force software codec with dvds --- xbmc/cores/dvdplayer/DVDPlayer.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp -index 37865b5..abe9f92 100644 +index 34e487f..eb5d4de 100644 --- a/xbmc/cores/dvdplayer/DVDPlayer.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp -@@ -3372,7 +3372,9 @@ bool CDVDPlayer::OpenVideoStream(CDVDStreamInfo& hint, bool reset) +@@ -3400,7 +3400,9 @@ bool CDVDPlayer::OpenVideoStream(CDVDStreamInfo& hint, bool reset) hint.aspect = aspect; hint.forced_aspect = true; } @@ -249,10 +227,10 @@ index 37865b5..abe9f92 100644 else if (m_pInputStream && m_pInputStream->IsStreamType(DVDSTREAM_TYPE_PVRMANAGER)) { -From e4d50075650921f209af54e14e2531824e24660f Mon Sep 17 00:00:00 2001 +From 15a146068f22ac23146c6bd832c9e89f041a8f3c Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 10 Aug 2014 16:45:16 +0100 -Subject: [PATCH 07/56] filesystem: Make support of browsing into archives +Subject: [PATCH 07/61] filesystem: Make support of browsing into archives optional The ability to browse, scan and play content in archives can cause problems on low powered/low memory devices. @@ -270,10 +248,10 @@ We'll let people who don't use archives disable it manually 3 files changed, 18 insertions(+) diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po -index 3e39938..06d261c 100644 +index 85df475..13b736e 100644 --- a/addons/resource.language.en_gb/resources/strings.po +++ b/addons/resource.language.en_gb/resources/strings.po -@@ -16525,6 +16525,15 @@ msgstr "" +@@ -16504,6 +16504,15 @@ msgstr "" #: system/settings/rbp.xml msgctxt "#38010" msgid "GPU accelerated" @@ -290,7 +268,7 @@ index 3e39938..06d261c 100644 #. Setting #38011 "Videos -> Library -> Show All Items entry" diff --git a/system/settings/settings.xml b/system/settings/settings.xml -index f89c00a..5b4391f 100644 +index edbab98..7d2ba34 100644 --- a/system/settings/settings.xml +++ b/system/settings/settings.xml @@ -304,6 +304,11 @@ @@ -335,19 +313,20 @@ index 3a5ba4e..f1f6f79 100644 { // XBMC Smart playlist - just XML renamed to XSP // read the name of the playlist in -From c61ee467f28a868a6788ebf63c17ad9b9b02fe0e Mon Sep 17 00:00:00 2001 +From ded5fd595dc852491d8f595e8358680f7bb97a6f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 27 Oct 2014 13:06:57 +0000 -Subject: [PATCH 09/56] [rbp] Make cachemembuffersize default depend on memory +Subject: [PATCH 09/61] [rbp] Make cachemembuffersize default depend on memory size --- - xbmc/linux/RBP.cpp | 5 +++++ - xbmc/settings/AdvancedSettings.cpp | 5 +++++ - 2 files changed, 10 insertions(+) + xbmc/linux/RBP.cpp | 10 ++++++++++ + xbmc/linux/RBP.h | 1 + + xbmc/settings/AdvancedSettings.cpp | 12 +++++++++++- + 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/xbmc/linux/RBP.cpp b/xbmc/linux/RBP.cpp -index 59dd1da..aedae18 100644 +index 59dd1da..b5c2156 100644 --- a/xbmc/linux/RBP.cpp +++ b/xbmc/linux/RBP.cpp @@ -23,6 +23,7 @@ @@ -358,17 +337,29 @@ index 59dd1da..aedae18 100644 #include "utils/log.h" #include "cores/omxplayer/OMXImage.h" -@@ -82,6 +83,9 @@ bool CRBP::Initialize() +@@ -43,6 +44,12 @@ CRBP::~CRBP() + delete m_DllBcmHost; + } + ++void CRBP::InitializeSettings() ++{ ++ if (g_advancedSettings.m_cacheMemBufferSize == ~0U) ++ g_advancedSettings.m_cacheMemBufferSize = m_arm_mem < 256 ? 1024 * 1024 * 2 : 1024 * 1024 * 20; ++} ++ + bool CRBP::Initialize() + { + CSingleLock lock (m_critSection); +@@ -82,6 +89,8 @@ bool CRBP::Initialize() if (!m_gui_resolution_limit) m_gui_resolution_limit = m_gpu_mem < 128 ? 720:1080; -+ if (g_advancedSettings.m_cacheMemBufferSize == ~0U) -+ g_advancedSettings.m_cacheMemBufferSize = m_arm_mem < 256 ? 1024 * 1024 * 2 : 1024 * 1024 * 20; ++ InitializeSettings(); + g_OMXImage.Initialize(); m_omx_image_init = true; return true; -@@ -94,6 +98,7 @@ void CRBP::LogFirmwareVerison() +@@ -94,6 +103,7 @@ void CRBP::LogFirmwareVerison() response[sizeof(response) - 1] = '\0'; CLog::Log(LOGNOTICE, "Raspberry PI firmware version: %s", response); CLog::Log(LOGNOTICE, "ARM mem: %dMB GPU mem: %dMB MPG2:%d WVC1:%d", m_arm_mem, m_gpu_mem, m_codec_mpg2_enabled, m_codec_wvc1_enabled); @@ -376,11 +367,33 @@ index 59dd1da..aedae18 100644 m_DllBcmHost->vc_gencmd(response, sizeof response, "get_config int"); response[sizeof(response) - 1] = '\0'; CLog::Log(LOGNOTICE, "Config:\n%s", response); +diff --git a/xbmc/linux/RBP.h b/xbmc/linux/RBP.h +index 9559914..7fc8b42 100644 +--- a/xbmc/linux/RBP.h ++++ b/xbmc/linux/RBP.h +@@ -48,6 +48,7 @@ class CRBP + ~CRBP(); + + bool Initialize(); ++ void InitializeSettings(); + void LogFirmwareVerison(); + void Deinitialize(); + int GetArmMem() { return m_arm_mem; } diff --git a/xbmc/settings/AdvancedSettings.cpp b/xbmc/settings/AdvancedSettings.cpp -index c4fa298..2ec904c 100644 +index 1ba951d..2d906a6 100644 --- a/xbmc/settings/AdvancedSettings.cpp +++ b/xbmc/settings/AdvancedSettings.cpp -@@ -352,7 +352,12 @@ void CAdvancedSettings::Initialize() +@@ -45,6 +45,9 @@ + #if defined(TARGET_DARWIN_IOS) + #include "osx/DarwinUtils.h" + #endif ++#if defined(TARGET_RASPBERRY_PI) ++#include "linux/RBP.h" ++#endif + + using namespace ADDON; + using namespace XFILE; +@@ -352,7 +355,12 @@ void CAdvancedSettings::Initialize() m_bPVRAutoScanIconsUserSet = false; m_iPVRNumericChannelSwitchTimeout = 1000; @@ -393,11 +406,23 @@ index c4fa298..2ec904c 100644 m_networkBufferMode = 0; // Default (buffer all internet streams/filesystems) // the following setting determines the readRate of a player data // as multiply of the default data read rate +@@ -407,7 +415,9 @@ void CAdvancedSettings::Initialize() + #endif + + m_userAgent = g_sysinfo.GetUserAgent(); +- ++#ifdef TARGET_RASPBERRY_PI ++ g_RBP.InitializeSettings(); ++#endif + m_initialized = true; + } + -From 8318924e413a137e3dbe33efd9af1ddad6313735 Mon Sep 17 00:00:00 2001 + +From ec6bf6a43c0c0680d393dc5039fbb57927a7c10f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 30 May 2014 14:58:43 +0100 -Subject: [PATCH 11/56] [settings] Experiment: Report DESKTOP resolution in +Subject: [PATCH 11/61] [settings] Experiment: Report DESKTOP resolution in video settings --- @@ -419,10 +444,10 @@ index 1fafd9a..e0288aa 100644 StringUtils::Format("%dx%d%s", resolution->width, resolution->height, ModeFlagsToString(resolution->flags, false).c_str()), -From b9b068dce6d2eb40a605a43e97633e2432c87795 Mon Sep 17 00:00:00 2001 +From 390b641d3904777dba820aa4633a94314386e081 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 9 Sep 2014 12:04:26 +0100 -Subject: [PATCH 12/56] egl: Treat unknown display aspect ratio as square pixel +Subject: [PATCH 12/61] egl: Treat unknown display aspect ratio as square pixel --- xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp | 4 ++-- @@ -451,10 +476,10 @@ index bda7430..68fc647 100644 SetResolutionString(m_desktopRes); -From b25a9d54ee084817cbf1a73925434f0213c4eb44 Mon Sep 17 00:00:00 2001 +From ca1037188ea1d60c22b13ab937d21401d4397218 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 19 Sep 2014 11:54:49 +0100 -Subject: [PATCH 13/56] [dvdplayer/rbp] Add pi specific option to maintain +Subject: [PATCH 13/61] [dvdplayer/rbp] Add pi specific option to maintain vsync with pll adjustment New A/V sync option in settings/video/playback to do "Adjust PLL". @@ -479,10 +504,10 @@ Needed updated firmware 9 files changed, 91 insertions(+), 7 deletions(-) diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po -index 06d261c..11f5315 100644 +index 13b736e..07a25d3 100644 --- a/addons/resource.language.en_gb/resources/strings.po +++ b/addons/resource.language.en_gb/resources/strings.po -@@ -6336,7 +6336,22 @@ msgctxt "#13459" +@@ -6318,7 +6318,22 @@ msgctxt "#13459" msgid "Use OMXPlayer for decoding of video files." msgstr "" @@ -506,7 +531,7 @@ index 06d261c..11f5315 100644 #: system/settings/settings.xml msgctxt "#13505" -@@ -16571,3 +16586,10 @@ msgstr "" +@@ -16550,3 +16565,10 @@ msgstr "" msgctxt "#38016" msgid "%d fps" msgstr "" @@ -518,7 +543,7 @@ index 06d261c..11f5315 100644 +msgstr "" + diff --git a/system/settings/settings.xml b/system/settings/settings.xml -index 5b4391f..27f9773 100644 +index 7d2ba34..304bd46 100644 --- a/system/settings/settings.xml +++ b/system/settings/settings.xml @@ -572,6 +572,20 @@ @@ -679,10 +704,10 @@ index 1122a1d..7389754 100644 struct SInfo { diff --git a/xbmc/linux/RBP.cpp b/xbmc/linux/RBP.cpp -index aedae18..a4b0c2a 100644 +index b5c2156..32aa409 100644 --- a/xbmc/linux/RBP.cpp +++ b/xbmc/linux/RBP.cpp -@@ -220,4 +220,18 @@ void CRBP::Deinitialize() +@@ -225,4 +225,18 @@ void CRBP::Deinitialize() m_initialized = false; m_omx_initialized = false; } @@ -702,10 +727,10 @@ index aedae18..a4b0c2a 100644 + #endif diff --git a/xbmc/linux/RBP.h b/xbmc/linux/RBP.h -index 9559914..65492fa 100644 +index 7fc8b42..b422c89 100644 --- a/xbmc/linux/RBP.h +++ b/xbmc/linux/RBP.h -@@ -63,6 +63,7 @@ class CRBP +@@ -64,6 +64,7 @@ class CRBP unsigned char *CaptureDisplay(int width, int height, int *stride, bool swap_red_blue, bool video_only = true); DllOMX *GetDllOMX() { return m_OMX ? m_OMX->GetDll() : NULL; } void WaitVsync(); @@ -714,10 +739,10 @@ index 9559914..65492fa 100644 private: DllBcmHost *m_DllBcmHost; diff --git a/xbmc/settings/AdvancedSettings.cpp b/xbmc/settings/AdvancedSettings.cpp -index 2ec904c..fd1c7c8 100644 +index 2d906a6..24df5ac 100644 --- a/xbmc/settings/AdvancedSettings.cpp +++ b/xbmc/settings/AdvancedSettings.cpp -@@ -110,6 +110,7 @@ void CAdvancedSettings::Initialize() +@@ -113,6 +113,7 @@ void CAdvancedSettings::Initialize() m_audioHeadRoom = 0; m_ac3Gain = 12.0f; m_audioApplyDrc = -1.0f; @@ -725,7 +750,7 @@ index 2ec904c..fd1c7c8 100644 m_dvdplayerIgnoreDTSinWAV = false; //default hold time of 25 ms, this allows a 20 hertz sine to pass undistorted -@@ -468,6 +469,7 @@ void CAdvancedSettings::ParseSettingsFile(const std::string &file) +@@ -475,6 +476,7 @@ void CAdvancedSettings::ParseSettingsFile(const std::string &file) if (pElement) { XMLUtils::GetFloat(pElement, "ac3downmixgain", m_ac3Gain, -96.0f, 96.0f); @@ -734,7 +759,7 @@ index 2ec904c..fd1c7c8 100644 XMLUtils::GetString(pElement, "defaultplayer", m_audioDefaultPlayer); // 101 on purpose - can be used to never automark as watched diff --git a/xbmc/settings/AdvancedSettings.h b/xbmc/settings/AdvancedSettings.h -index b0b4df1..5e0b14c 100644 +index 7df1bf7..732b69d 100644 --- a/xbmc/settings/AdvancedSettings.h +++ b/xbmc/settings/AdvancedSettings.h @@ -141,6 +141,7 @@ class CAdvancedSettings : public ISettingCallback, public ISettingsHandler @@ -746,10 +771,10 @@ index b0b4df1..5e0b14c 100644 float m_audioPlayCountMinimumPercent; bool m_dvdplayerIgnoreDTSinWAV; -From 94cec59be3b05120b76016c51cb96de2960d61ad Mon Sep 17 00:00:00 2001 +From 8c5c342953abc427f0c0fe8548ce9c6c4c67d08d Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 27 Sep 2014 15:32:37 +0100 -Subject: [PATCH 14/56] [dvdplayer] exerimental: don't raise priority of audio +Subject: [PATCH 14/61] [dvdplayer] exerimental: don't raise priority of audio thread --- @@ -757,10 +782,10 @@ Subject: [PATCH 14/56] [dvdplayer] exerimental: don't raise priority of audio 1 file changed, 4 insertions(+) diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp -index abe9f92..2f687ac 100644 +index eb5d4de..5ea3c51 100644 --- a/xbmc/cores/dvdplayer/DVDPlayer.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp -@@ -3357,7 +3357,11 @@ bool CDVDPlayer::OpenAudioStream(CDVDStreamInfo& hint, bool reset) +@@ -3385,7 +3385,11 @@ bool CDVDPlayer::OpenAudioStream(CDVDStreamInfo& hint, bool reset) m_dvdPlayerAudio->SendMessage(new CDVDMsg(CDVDMsg::PLAYER_STARTED), 1); /* audio normally won't consume full cpu, so let it have prio */ @@ -773,10 +798,10 @@ index abe9f92..2f687ac 100644 } -From c0642bc05d3c606cdd62d6e92ddb4684299df785 Mon Sep 17 00:00:00 2001 +From 66c3e2d5829fac98b54059a4d82e33ec33537b0d Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 24 Sep 2014 23:13:52 +0100 -Subject: [PATCH 15/56] [audio] Add settings option to boost centre channel +Subject: [PATCH 15/61] [audio] Add settings option to boost centre channel when downmixing This allows a dB volume increase to be added to centre channel. @@ -794,10 +819,10 @@ Should work with Pi Sink (dvdplayer/paplayer) and omxplayer 5 files changed, 45 insertions(+) diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po -index 11f5315..b5f4731 100644 +index 07a25d3..7d445f9 100644 --- a/addons/resource.language.en_gb/resources/strings.po +++ b/addons/resource.language.en_gb/resources/strings.po -@@ -16593,3 +16593,17 @@ msgctxt "#38006" +@@ -16572,3 +16572,17 @@ msgctxt "#38006" msgid "Audio has to stay in sync, this can either be done by resampling, or adjusting the PLL" msgstr "" @@ -816,10 +841,10 @@ index 11f5315..b5f4731 100644 +msgid "%i dB" +msgstr "" diff --git a/system/settings/settings.xml b/system/settings/settings.xml -index 27f9773..e833d3b 100644 +index 304bd46..2aaf772 100644 --- a/system/settings/settings.xml +++ b/system/settings/settings.xml -@@ -2645,6 +2645,18 @@ +@@ -2589,6 +2589,18 @@ true @@ -898,10 +923,10 @@ index f99c0e6..1911189 100644 // stereo upmix if (upmix && m_src_channels == 2 && m_dst_channels > 2) -From 6be4a7b9d3912b0a01869703857a97ce2996b3a4 Mon Sep 17 00:00:00 2001 +From 9832febb10d609a6e75465b3d82e681252686566 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 3 Oct 2014 18:40:06 +0100 -Subject: [PATCH 16/56] [SinkPi] Handle multichannel layout more like OMXAudio +Subject: [PATCH 16/61] [SinkPi] Handle multichannel layout more like OMXAudio --- xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp | 14 +++++++------- @@ -960,10 +985,10 @@ index a7691e8..d72a97a 100644 m_format = format; m_sinkbuffer_sec_per_byte = 1.0 / (double)(m_format.m_frameSize * m_format.m_sampleRate); -From 9da1504c7da584cbec8866b0ede520f9f7652adc Mon Sep 17 00:00:00 2001 +From d8fae79683f81ead870a5abac67da826e935183c Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 27 Oct 2014 15:23:51 +0000 -Subject: [PATCH 17/56] [rbp] Default extract thumbnails to false +Subject: [PATCH 17/61] [rbp] Default extract thumbnails to false It can take 80 seconds for a single file on a Pi. It can cause crashes with out-of-memory errors. It genereates a lot of support issues. Best to default to disabled and let users enable it if they must @@ -972,10 +997,10 @@ It genereates a lot of support issues. Best to default to disabled and let users 1 file changed, 10 insertions(+) diff --git a/system/settings/rbp.xml b/system/settings/rbp.xml -index cb83297..8496abf 100644 +index 50fe36a..a54a4c4 100644 --- a/system/settings/rbp.xml +++ b/system/settings/rbp.xml -@@ -38,6 +38,16 @@ +@@ -35,6 +35,16 @@ @@ -993,10 +1018,10 @@ index cb83297..8496abf 100644
-From f8853c406f9824daf3d4f22cd290be3515cf70fe Mon Sep 17 00:00:00 2001 +From 1326d4272c2e881b3a154256e6825c181b6ee3ad Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 15 Nov 2014 12:03:34 +0000 -Subject: [PATCH 21/56] [dvdplayer] Add lock for player creation +Subject: [PATCH 22/61] [dvdplayer] Add lock for player creation --- xbmc/cores/dvdplayer/DVDPlayer.cpp | 3 +++ @@ -1004,7 +1029,7 @@ Subject: [PATCH 21/56] [dvdplayer] Add lock for player creation 2 files changed, 4 insertions(+) diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp -index 2f687ac..5062990 100644 +index 5ea3c51..f0ffe17 100644 --- a/xbmc/cores/dvdplayer/DVDPlayer.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp @@ -517,6 +517,7 @@ int CSelectionStreams::CountSource(StreamType type, StreamSource source) const @@ -1023,7 +1048,7 @@ index 2f687ac..5062990 100644 if (!m_players_created) return; delete m_dvdPlayerVideo; -@@ -4224,6 +4226,7 @@ double CDVDPlayer::GetQueueTime() +@@ -4252,6 +4254,7 @@ double CDVDPlayer::GetQueueTime() void CDVDPlayer::GetVideoStreamInfo(SPlayerVideoStreamInfo &info) { @@ -1032,20 +1057,20 @@ index 2f687ac..5062990 100644 std::string retVal; diff --git a/xbmc/cores/dvdplayer/DVDPlayer.h b/xbmc/cores/dvdplayer/DVDPlayer.h -index f9e4bf7..41b9f22 100644 +index 71a62f1..9993ac0 100644 --- a/xbmc/cores/dvdplayer/DVDPlayer.h +++ b/xbmc/cores/dvdplayer/DVDPlayer.h -@@ -554,4 +554,5 @@ class CDVDPlayer : public IPlayer, public CThread, public IDVDPlayer +@@ -558,4 +558,5 @@ class CDVDPlayer : public IPlayer, public CThread, public IDVDPlayer // omxplayer variables struct SOmxPlayerState m_OmxPlayerState; bool m_omxplayer_mode; // using omxplayer acceleration + CCriticalSection m_players_lock; }; -From e992a3be859498cfb4831524f7e2c756a0cea155 Mon Sep 17 00:00:00 2001 +From f9b5ced2edadf501b4655a82788eaea620f6e4ed Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 24 Nov 2014 22:07:25 +0000 -Subject: [PATCH 22/56] [dvdplayervideo] Prod decoder when in stills mode +Subject: [PATCH 23/61] [dvdplayervideo] Prod decoder when in stills mode An asynchronous hardware decoder doesn't only produce output pictures when new packets arrive. In dvd stills mode give it a chance to return pictures that weren't ready when frame was decoded. @@ -1054,10 +1079,10 @@ In dvd stills mode give it a chance to return pictures that weren't ready when f 1 file changed, 28 insertions(+), 18 deletions(-) diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index a3922c0..7f0073f 100644 +index d725d32..55fa8b1 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -@@ -317,7 +317,8 @@ void CDVDPlayerVideo::Process() +@@ -314,7 +314,8 @@ void CDVDPlayerVideo::Process() while (!m_bStop) { @@ -1067,7 +1092,7 @@ index a3922c0..7f0073f 100644 int iPriority = (m_speed == DVD_PLAYSPEED_PAUSE && m_started) ? 1 : 0; CDVDMsg* pMsg; -@@ -334,27 +335,36 @@ void CDVDPlayerVideo::Process() +@@ -331,27 +332,36 @@ void CDVDPlayerVideo::Process() if( iPriority ) continue; @@ -1122,10 +1147,10 @@ index a3922c0..7f0073f 100644 if (pMsg->IsType(CDVDMsg::GENERAL_SYNCHRONIZE)) -From f9456da2ed3d4d15d703c5f366a0c1284369b769 Mon Sep 17 00:00:00 2001 +From 36666ba4c6dd8a03f0b0c0055bb5238f4e8920e2 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 27 Nov 2014 16:31:56 +0000 -Subject: [PATCH 23/56] [languageinvoker] Reduce priority of python threads +Subject: [PATCH 24/61] [languageinvoker] Reduce priority of python threads --- xbmc/interfaces/generic/LanguageInvokerThread.cpp | 5 +++++ @@ -1148,10 +1173,66 @@ index fcdd063..16f0c89 100644 } -From 288777dd146b627d5240bfec658d1b90424a78d0 Mon Sep 17 00:00:00 2001 +From fc7285cbd4934c80ed8ec948ba0762d20ada7138 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Sat, 14 Dec 2013 16:55:05 +0000 +Subject: [PATCH 25/61] logging: Add microsecond timer to log messages + +--- + xbmc/utils/log.cpp | 17 +++++++++++++++-- + 1 file changed, 15 insertions(+), 2 deletions(-) + +diff --git a/xbmc/utils/log.cpp b/xbmc/utils/log.cpp +index 3443f12..31c4a99 100644 +--- a/xbmc/utils/log.cpp ++++ b/xbmc/utils/log.cpp +@@ -24,6 +24,7 @@ + #include "threads/Thread.h" + #include "utils/StringUtils.h" + #include "CompileInfo.h" ++#include "utils/TimeUtils.cpp" + + static const char* const levelNames[] = + {"DEBUG", "INFO", "NOTICE", "WARNING", "ERROR", "SEVERE", "FATAL", "NONE"}; +@@ -198,19 +199,31 @@ void CLog::PrintDebugString(const std::string& line) + + bool CLog::WriteLogString(int logLevel, const std::string& logString) + { ++#if defined(TARGET_LINUX) ++ static const char* prefixFormat = "%02.2d:%02.2d:%02.2d %10.6f T:%" PRIu64" %7s: "; ++#else + static const char* prefixFormat = "%02.2d:%02.2d:%02.2d T:%" PRIu64" %7s: "; +- ++#endif + std::string strData(logString); + /* fixup newline alignment, number of spaces should equal prefix length */ + StringUtils::Replace(strData, "\n", "\n "); + + int hour, minute, second; + s_globals.m_platform.GetCurrentLocalTime(hour, minute, second); +- ++ ++#if defined(TARGET_LINUX) ++ struct timespec now; ++ clock_gettime(CLOCK_MONOTONIC, &now); ++ float Now = now.tv_sec + now.tv_nsec * 1e-9; ++#endif ++ + strData = StringUtils::Format(prefixFormat, + hour, + minute, + second, ++#if defined(TARGET_LINUX) ++ Now, ++#endif + (uint64_t)CThread::GetCurrentThreadId(), + levelNames[logLevel]) + strData; + + +From adb7882f273437d58e9aff7c26c11ab1a8d32a73 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 29 Nov 2014 15:25:16 +0000 -Subject: [PATCH 24/56] [rbp] hack: wait for splash to complete before changing +Subject: [PATCH 26/61] [rbp] hack: wait for splash to complete before changing hdmi mode --- @@ -1225,10 +1306,10 @@ index 68fc647..c80114e 100644 if(!m_fixedMode && GETFLAGS_GROUP(res.dwFlags) && GETFLAGS_MODE(res.dwFlags)) -From b5262ef9b401ffa4b6d2276e67b742a37c1df79d Mon Sep 17 00:00:00 2001 +From c727022054334a0f10585d36adbe9bb7814b0b82 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 11 Dec 2014 17:00:57 +0000 -Subject: [PATCH 25/56] Fix for UI not showing both extractflags and +Subject: [PATCH 27/61] Fix for UI not showing both extractflags and extractthumb --- @@ -1238,10 +1319,10 @@ Subject: [PATCH 25/56] Fix for UI not showing both extractflags and 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po -index 601cd44..fa25d45 100644 +index c52f230..aee20d0 100644 --- a/addons/resource.language.en_gb/resources/strings.po +++ b/addons/resource.language.en_gb/resources/strings.po -@@ -10962,7 +10962,7 @@ msgstr "" +@@ -10945,7 +10945,7 @@ msgstr "" #: system/settings/settings.xml msgctxt "#20433" @@ -1250,7 +1331,7 @@ index 601cd44..fa25d45 100644 msgstr "" #: xbmc/dialogs/GUIDialogSmartPlaylistRule.cpp -@@ -14492,7 +14492,7 @@ msgstr "" +@@ -14475,7 +14475,7 @@ msgstr "" #. Description of setting "Videos -> File lists -> Extract thumbnails and video information" with label #20433 #: system/settings/settings.xml msgctxt "#36178" @@ -1259,7 +1340,7 @@ index 601cd44..fa25d45 100644 msgstr "" #. Description of setting "Videos -> File lists -> Replace file names with library titles" with label #20419 -@@ -14504,7 +14504,7 @@ msgstr "" +@@ -14487,7 +14487,7 @@ msgstr "" #. Description of setting "Videos -> File lists -> Extract thumbnails and video information" with label #20433 #: system/settings/settings.xml msgctxt "#36180" @@ -1268,7 +1349,7 @@ index 601cd44..fa25d45 100644 msgstr "" #: system/settings/settings.xml -@@ -16622,3 +16622,8 @@ msgstr "" +@@ -16601,3 +16601,8 @@ msgstr "" msgctxt "#38052" msgid "Remote button press release time (ms)" msgstr "" @@ -1278,10 +1359,10 @@ index 601cd44..fa25d45 100644 +msgid "Extract thumbnails from video files" +msgstr "" diff --git a/system/settings/rbp.xml b/system/settings/rbp.xml -index 8496abf..ad65ce4 100644 +index a54a4c4..208cd49 100644 --- a/system/settings/rbp.xml +++ b/system/settings/rbp.xml -@@ -36,10 +36,6 @@ +@@ -33,10 +33,6 @@ false @@ -1293,10 +1374,10 @@ index 8496abf..ad65ce4 100644 false diff --git a/system/settings/settings.xml b/system/settings/settings.xml -index e833d3b..0e09d3d 100644 +index 2aaf772..08d8f41 100644 --- a/system/settings/settings.xml +++ b/system/settings/settings.xml -@@ -902,23 +902,23 @@ +@@ -846,23 +846,23 @@ @@ -1326,10 +1407,10 @@ index e833d3b..0e09d3d 100644 -From 913713b6debe33499641ea054f789423a00d1ed9 Mon Sep 17 00:00:00 2001 +From 5c10acd7538646333db2b57f87e4bf8faa1c2c19 Mon Sep 17 00:00:00 2001 From: anaconda Date: Thu, 11 Sep 2014 21:30:43 +0200 -Subject: [PATCH 26/56] Disable autoscrolling while on screensaver and while +Subject: [PATCH 28/61] Disable autoscrolling while on screensaver and while opening streams. --- @@ -1342,7 +1423,7 @@ Subject: [PATCH 26/56] Disable autoscrolling while on screensaver and while 6 files changed, 24 insertions(+), 3 deletions(-) diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp -index 0bdaae4..1141d7b 100644 +index 16af7df..9c6496b 100644 --- a/xbmc/Application.cpp +++ b/xbmc/Application.cpp @@ -4958,3 +4958,13 @@ bool CApplication::NotifyActionListeners(const CAction &action) const @@ -1460,10 +1541,10 @@ index 0d5b3f7..6d23024 100644 if (m_lastRenderTime) m_autoScrollDelayTime += currentTime - m_lastRenderTime; -From 9de2f40d2046fdead3be13806c7d20ff39a94dfc Mon Sep 17 00:00:00 2001 +From 796877858489b061853455e99cebd3131e76acf3 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 13 Dec 2014 18:35:20 +0000 -Subject: [PATCH 27/56] [demuxer] Avoid memcpy on every demuxer packet +Subject: [PATCH 29/61] [demuxer] Avoid memcpy on every demuxer packet Avoids an unnecessary memcpy on every demuxer packet which for high bitrate videos can be significant. @@ -1558,663 +1639,17 @@ index ab298b2..10c5ee0 100644 } catch(...) { -From 275639e41023b0fb4fe2025379dc5b10764d21ea Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Tue, 10 Feb 2015 15:29:16 +0000 -Subject: [PATCH 28/56] [libcec] Add repeating keypress patch from popcornmix' - repo - ---- - tools/depends/target/libcec/Makefile | 1 + - tools/depends/target/libcec/popcornmix.patch | 615 +++++++++++++++++++++++++++ - 2 files changed, 616 insertions(+) - create mode 100644 tools/depends/target/libcec/popcornmix.patch - -diff --git a/tools/depends/target/libcec/Makefile b/tools/depends/target/libcec/Makefile -index 6c72240..4378628 100644 ---- a/tools/depends/target/libcec/Makefile -+++ b/tools/depends/target/libcec/Makefile -@@ -21,6 +21,7 @@ $(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE) $(DEPS) - rm -rf $(PLATFORM); mkdir -p $(PLATFORM) - cd $(PLATFORM); $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE) - cd $(PLATFORM); $(AUTORECONF) -vif -+ cd $(PLATFORM); patch -p1 < ../popcornmix.patch - cd $(PLATFORM); $(CONFIGURE) - - $(LIBDYLIB): $(PLATFORM) -diff --git a/tools/depends/target/libcec/popcornmix.patch b/tools/depends/target/libcec/popcornmix.patch -new file mode 100644 -index 0000000..84adc8c ---- /dev/null -+++ b/tools/depends/target/libcec/popcornmix.patch -@@ -0,0 +1,615 @@ -+From 651fc15222923bcaea6f7925c207217a40e967ab Mon Sep 17 00:00:00 2001 -+From: popcornmix -+Date: Fri, 24 Oct 2014 13:45:21 +0100 -+Subject: [PATCH 1/5] Make released key polling wait for exact time until key -+ gets released -+ -+--- -+ src/lib/CECClient.cpp | 28 ++++++++++++++++++++++++---- -+ src/lib/CECClient.h | 2 +- -+ src/lib/CECProcessor.cpp | 8 +++++--- -+ src/lib/LibCEC.cpp | 10 ++++++++-- -+ src/lib/LibCEC.h | 4 +++- -+ 5 files changed, 41 insertions(+), 11 deletions(-) -+ -+diff --git a/src/lib/CECClient.cpp b/src/lib/CECClient.cpp -+index 0bc9705..5fb1e6a 100644 -+--- a/src/lib/CECClient.cpp -++++ b/src/lib/CECClient.cpp -+@@ -1057,10 +1057,16 @@ void CCECClient::SetCurrentButton(const cec_user_control_code iButtonCode) -+ AddKey(key); -+ } -+ -+-void CCECClient::CheckKeypressTimeout(void) -++uint16_t CCECClient::CheckKeypressTimeout(void) -+ { -++ // time when we'd like to be called again -++ unsigned int timeout = CEC_PROCESSOR_SIGNAL_WAIT_TIME; -+ cec_keypress key; -++ key.keycode = CEC_USER_CONTROL_CODE_UNKNOWN; -++ key.duration = 0; -+ -++ if (m_iCurrentButton == CEC_USER_CONTROL_CODE_UNKNOWN) -++ return timeout; -+ { -+ CLockObject lock(m_mutex); -+ uint64_t iNow = GetTimeMs(); -+@@ -1081,12 +1087,26 @@ void CCECClient::CheckKeypressTimeout(void) -+ } -+ else -+ { -+- return; -++ // time when this keypress will be released and we'd like to be called again -++ unsigned int timeout = CEC_PROCESSOR_SIGNAL_WAIT_TIME; -++ if (m_iCurrentButton != CEC_USER_CONTROL_CODE_UNKNOWN && m_iCurrentButton == comboKey && iTimeoutMs > 0) -++ timeout = iTimeoutMs - (iNow - m_buttontime) + 1; -++ else if (m_iCurrentButton != CEC_USER_CONTROL_CODE_UNKNOWN && m_iCurrentButton != comboKey) -++ timeout = CEC_BUTTON_TIMEOUT - (iNow - m_buttontime) + 1; -++ if (timeout > CEC_PROCESSOR_SIGNAL_WAIT_TIME) -++ { -++ LIB_CEC->AddLog(CEC_LOG_ERROR, "Unexpected timeout: %d (%.3f %.3f %.3f) k:%02x", timeout, iNow*1e-3, m_buttontime*1e-3, CEC_BUTTON_TIMEOUT*1e-3, m_iCurrentButton); -++ timeout = CEC_PROCESSOR_SIGNAL_WAIT_TIME; -++ } -+ } -+ } -+ -+- LIB_CEC->AddLog(CEC_LOG_DEBUG, "key auto-released: %s (%1x)", ToString(key.keycode), key.keycode); -+- CallbackAddKey(key); -++ if (key.keycode != CEC_USER_CONTROL_CODE_UNKNOWN) -++ { -++ LIB_CEC->AddLog(CEC_LOG_DEBUG, "key auto-released: %s (%1x)", ToString(key.keycode), key.keycode); -++ CallbackAddKey(key); -++ } -++ return timeout; -+ } -+ -+ bool CCECClient::EnableCallbacks(void *cbParam, ICECCallbacks *callbacks) -+diff --git a/src/lib/CECClient.h b/src/lib/CECClient.h -+index 3ef0453..88efbbb 100644 -+--- a/src/lib/CECClient.h -++++ b/src/lib/CECClient.h -+@@ -182,7 +182,7 @@ namespace CEC -+ virtual void AddKey(bool bSendComboKey = false); -+ virtual void AddKey(const cec_keypress &key); -+ virtual void SetCurrentButton(const cec_user_control_code iButtonCode); -+- virtual void CheckKeypressTimeout(void); -++ virtual uint16_t CheckKeypressTimeout(void); -+ virtual void SourceActivated(const cec_logical_address logicalAddress); -+ virtual void SourceDeactivated(const cec_logical_address logicalAddress); -+ -+diff --git a/src/lib/CECProcessor.cpp b/src/lib/CECProcessor.cpp -+index 557b76d..ecf9244 100644 -+--- a/src/lib/CECProcessor.cpp -++++ b/src/lib/CECProcessor.cpp -+@@ -51,7 +51,6 @@ using namespace CEC; -+ using namespace std; -+ using namespace PLATFORM; -+ -+-#define CEC_PROCESSOR_SIGNAL_WAIT_TIME 1000 -+ #define ACTIVE_SOURCE_CHECK_INTERVAL 500 -+ #define TV_PRESENT_CHECK_INTERVAL 30000 -+ -+@@ -244,6 +243,7 @@ bool CCECProcessor::OnCommandReceived(const cec_command &command) -+ -+ void *CCECProcessor::Process(void) -+ { -++ uint16_t timeout = CEC_PROCESSOR_SIGNAL_WAIT_TIME; -+ m_libcec->AddLog(CEC_LOG_DEBUG, "processor thread started"); -+ -+ if (!m_connCheck) -+@@ -258,13 +258,13 @@ void *CCECProcessor::Process(void) -+ while (!IsStopped() && m_communication->IsOpen()) -+ { -+ // wait for a new incoming command, and process it -+- if (m_inBuffer.Pop(command, CEC_PROCESSOR_SIGNAL_WAIT_TIME)) -++ if (m_inBuffer.Pop(command, timeout)) -+ ProcessCommand(command); -+ -+ if (CECInitialised() && !IsStopped()) -+ { -+ // check clients for keypress timeouts -+- m_libcec->CheckKeypressTimeout(); -++ timeout = m_libcec->CheckKeypressTimeout(); -+ -+ // check if we need to replace handlers -+ ReplaceHandlers(); -+@@ -295,6 +295,8 @@ void *CCECProcessor::Process(void) -+ tvPresentCheck.Init(TV_PRESENT_CHECK_INTERVAL); -+ } -+ } -++ else -++ timeout = CEC_PROCESSOR_SIGNAL_WAIT_TIME; -+ } -+ -+ return NULL; -+diff --git a/src/lib/LibCEC.cpp b/src/lib/LibCEC.cpp -+index c24b4ed..046205c 100644 -+--- a/src/lib/LibCEC.cpp -++++ b/src/lib/LibCEC.cpp -+@@ -354,11 +354,17 @@ bool CLibCEC::IsValidPhysicalAddress(uint16_t iPhysicalAddress) -+ iPhysicalAddress <= CEC_MAX_PHYSICAL_ADDRESS; -+ } -+ -+-void CLibCEC::CheckKeypressTimeout(void) -++uint16_t CLibCEC::CheckKeypressTimeout(void) -+ { -++ uint16_t timeout = CEC_PROCESSOR_SIGNAL_WAIT_TIME; -+ // check all clients -+ for (vector::iterator it = m_clients.begin(); it != m_clients.end(); it++) -+- (*it)->CheckKeypressTimeout(); -++ { -++ uint16_t t = (*it)->CheckKeypressTimeout(); -++ if (t < timeout) -++ timeout = t; -++ } -++ return timeout; -+ } -+ -+ void CLibCEC::AddLog(const cec_log_level level, const char *strFormat, ...) -+diff --git a/src/lib/LibCEC.h b/src/lib/LibCEC.h -+index 3a312c0..b7ac645 100644 -+--- a/src/lib/LibCEC.h -++++ b/src/lib/LibCEC.h -+@@ -36,6 +36,8 @@ -+ #include "platform/util/buffer.h" -+ #include "CECTypeUtils.h" -+ -++#define CEC_PROCESSOR_SIGNAL_WAIT_TIME 1000 -++ -+ namespace CEC -+ { -+ class CAdapterCommunication; -+@@ -121,7 +123,7 @@ namespace CEC -+ -+ void AddLog(const cec_log_level level, const char *strFormat, ...); -+ void AddCommand(const cec_command &command); -+- void CheckKeypressTimeout(void); -++ uint16_t CheckKeypressTimeout(void); -+ void Alert(const libcec_alert type, const libcec_parameter ¶m); -+ -+ static bool IsValidPhysicalAddress(uint16_t iPhysicalAddress); -+-- -+1.9.1 -+ -+ -+From d506af4cff04156391f34d07f921e02c41a563b7 Mon Sep 17 00:00:00 2001 -+From: popcornmix -+Date: Mon, 24 Nov 2014 23:18:52 +0000 -+Subject: [PATCH 2/5] Add settings for repeat and release -+ -+--- -+ include/cectypes.h | 6 ++++++ -+ src/lib/CECClient.cpp | 6 ++++++ -+ 2 files changed, 12 insertions(+) -+ -+diff --git a/include/cectypes.h b/include/cectypes.h -+index 0a90d0e..b75b1b3 100644 -+--- a/include/cectypes.h -++++ b/include/cectypes.h -+@@ -1532,6 +1532,8 @@ struct libcec_configuration -+ XXX changed meaning in 2.2.0 to not break binary compatibility. next major (3.0) release will fix it in a nicer way */ -+ cec_user_control_code comboKey; /*!< key code that initiates combo keys. defaults to CEC_USER_CONTROL_CODE_F1_BLUE. CEC_USER_CONTROL_CODE_UNKNOWN to disable. added in 2.0.5 */ -+ uint32_t iComboKeyTimeoutMs; /*!< timeout until the combo key is sent as normal keypress */ -++ uint32_t iButtonRepeatRateMs; /*!< rate at which buttons autorepeat. 0 means rely on CEC device */ -++ uint32_t iButtonReleaseDelayMs;/*!< duration after last update until a button is considered released */ -+ -+ #ifdef __cplusplus -+ libcec_configuration(void) { Clear(); } -+@@ -1566,6 +1568,8 @@ struct libcec_configuration -+ cecVersion == other.cecVersion && -+ adapterType == other.adapterType && -+ iDoubleTapTimeout50Ms == other.iDoubleTapTimeout50Ms && -++ iButtonRepeatRateMs == other.iButtonRepeatRateMs && -++ iButtonReleaseDelayMs == other.iButtonReleaseDelayMs && -+ (other.clientVersion <= CEC_CLIENT_VERSION_2_0_4 || comboKey == other.comboKey) && -+ (other.clientVersion <= CEC_CLIENT_VERSION_2_0_4 || iComboKeyTimeoutMs == other.iComboKeyTimeoutMs) && -+ (other.clientVersion < CEC_CLIENT_VERSION_2_1_0 || bPowerOnScreensaver == other.bPowerOnScreensaver)); -+@@ -1606,6 +1610,8 @@ struct libcec_configuration -+ iDoubleTapTimeout50Ms = CEC_DOUBLE_TAP_TIMEOUT_50_MS; -+ comboKey = CEC_USER_CONTROL_CODE_STOP; -+ iComboKeyTimeoutMs = CEC_DEFAULT_COMBO_TIMEOUT_MS; -++ iButtonRepeatRateMs = 0; -++ iButtonReleaseDelayMs = CEC_BUTTON_TIMEOUT; -+ -+ memset(strDeviceName, 0, 13); -+ deviceTypes.Clear(); -+diff --git a/src/lib/CECClient.cpp b/src/lib/CECClient.cpp -+index 5fb1e6a..02f5f4a 100644 -+--- a/src/lib/CECClient.cpp -++++ b/src/lib/CECClient.cpp -+@@ -834,6 +834,9 @@ bool CCECClient::GetCurrentConfiguration(libcec_configuration &configuration) -+ configuration.bMonitorOnly = m_configuration.bMonitorOnly; -+ configuration.cecVersion = m_configuration.cecVersion; -+ configuration.adapterType = m_configuration.adapterType; -++ configuration.iDoubleTapTimeout50Ms = m_configuration.iDoubleTapTimeout50Ms; -++ configuration.iButtonRepeatRateMs = m_configuration.iButtonRepeatRateMs; -++ configuration.iButtonReleaseDelayMs = m_configuration.iButtonReleaseDelayMs; -+ -+ return true; -+ } -+@@ -877,6 +880,9 @@ bool CCECClient::SetConfiguration(const libcec_configuration &configuration) -+ m_configuration.cecVersion = configuration.cecVersion; -+ m_configuration.adapterType = configuration.adapterType; -+ m_configuration.iDoubleTapTimeout50Ms = configuration.iDoubleTapTimeout50Ms; -++ m_configuration.iButtonRepeatRateMs = configuration.iButtonRepeatRateMs; -++ m_configuration.iButtonReleaseDelayMs = configuration.iButtonReleaseDelayMs; -++ -+ m_configuration.deviceTypes.Add(configuration.deviceTypes[0]); -+ -+ if (m_configuration.clientVersion >= CEC_CLIENT_VERSION_2_0_5) -+-- -+1.9.1 -+ -+ -+From b6a6cc8ad12571dff0e02bc9a38ce97a00424df0 Mon Sep 17 00:00:00 2001 -+From: popcornmix -+Date: Mon, 24 Nov 2014 23:20:05 +0000 -+Subject: [PATCH 3/5] Distinguish explicit and implicit forms of AddKey -+ releases -+ -+--- -+ src/lib/CECClient.cpp | 2 +- -+ src/lib/CECClient.h | 2 +- -+ src/lib/implementations/CECCommandHandler.cpp | 2 +- -+ 3 files changed, 3 insertions(+), 3 deletions(-) -+ -+diff --git a/src/lib/CECClient.cpp b/src/lib/CECClient.cpp -+index 02f5f4a..3663b24 100644 -+--- a/src/lib/CECClient.cpp -++++ b/src/lib/CECClient.cpp -+@@ -968,7 +968,7 @@ int CCECClient::MenuStateChanged(const cec_menu_state newState) -+ return CallbackMenuStateChanged(newState); -+ } -+ -+-void CCECClient::AddKey(bool bSendComboKey /* = false */) -++void CCECClient::AddKey(bool bSendComboKey /* = false */, bool bButtonRelease /* = false */) -+ { -+ cec_keypress key; -+ key.keycode = CEC_USER_CONTROL_CODE_UNKNOWN; -+diff --git a/src/lib/CECClient.h b/src/lib/CECClient.h -+index 88efbbb..84fb909 100644 -+--- a/src/lib/CECClient.h -++++ b/src/lib/CECClient.h -+@@ -179,7 +179,7 @@ namespace CEC -+ virtual int MenuStateChanged(const cec_menu_state newState); -+ virtual void Alert(const libcec_alert type, const libcec_parameter ¶m) { CallbackAlert(type, param); } -+ virtual void AddLog(const cec_log_message &message) { CallbackAddLog(message); } -+- virtual void AddKey(bool bSendComboKey = false); -++ virtual void AddKey(bool bSendComboKey = false, bool bButtonRelease = false); -+ virtual void AddKey(const cec_keypress &key); -+ virtual void SetCurrentButton(const cec_user_control_code iButtonCode); -+ virtual uint16_t CheckKeypressTimeout(void); -+diff --git a/src/lib/implementations/CECCommandHandler.cpp b/src/lib/implementations/CECCommandHandler.cpp -+index a89ebe6..932c54b 100644 -+--- a/src/lib/implementations/CECCommandHandler.cpp -++++ b/src/lib/implementations/CECCommandHandler.cpp -+@@ -745,7 +745,7 @@ int CCECCommandHandler::HandleUserControlRelease(const cec_command &command) -+ -+ CCECClient *client = m_processor->GetClient(command.destination); -+ if (client) -+- client->AddKey(); -++ client->AddKey(false, true); -+ -+ return COMMAND_HANDLED; -+ } -+-- -+1.9.1 -+ -+ -+From 3b7606a9e0653149ae4b6e80d0df9c53645bfac9 Mon Sep 17 00:00:00 2001 -+From: popcornmix -+Date: Mon, 24 Nov 2014 23:20:22 +0000 -+Subject: [PATCH 4/5] Support repeating button presses with configurable repeat -+ rate Keep track of time since initial button press and last button update -+ -+--- -+ src/lib/CECClient.cpp | 119 ++++++++++++++++++++++++++++++++++++++++---------- -+ src/lib/CECClient.h | 6 ++- -+ 2 files changed, 101 insertions(+), 24 deletions(-) -+ -+diff --git a/src/lib/CECClient.cpp b/src/lib/CECClient.cpp -+index 3663b24..68eaee9 100644 -+--- a/src/lib/CECClient.cpp -++++ b/src/lib/CECClient.cpp -+@@ -52,7 +52,11 @@ CCECClient::CCECClient(CCECProcessor *processor, const libcec_configuration &con -+ m_bInitialised(false), -+ m_bRegistered(false), -+ m_iCurrentButton(CEC_USER_CONTROL_CODE_UNKNOWN), -+- m_buttontime(0), -++ m_initialButtontime(0), -++ m_updateButtontime(0), -++ m_repeatButtontime(0), -++ m_releaseButtontime(0), -++ m_pressedButtoncount(0), -+ m_iPreventForwardingPowerOffCommand(0), -+ m_iLastKeypressTime(0) -+ { -+@@ -939,6 +943,7 @@ bool CCECClient::SetConfiguration(const libcec_configuration &configuration) -+ primary->ActivateSource(); -+ } -+ -++ LIB_CEC->AddLog(CEC_LOG_DEBUG, "%s: %d:%d:%d", __FUNCTION__, DoubleTapTimeoutMS(), m_configuration.iButtonRepeatRateMs, m_configuration.iButtonReleaseDelayMs); -+ return true; -+ } -+ -+@@ -977,9 +982,10 @@ void CCECClient::AddKey(bool bSendComboKey /* = false */, bool bButtonRelease /* -+ CLockObject lock(m_mutex); -+ if (m_iCurrentButton != CEC_USER_CONTROL_CODE_UNKNOWN) -+ { -+- key.duration = (unsigned int) (GetTimeMs() - m_buttontime); -++ unsigned int duration = (unsigned int) (GetTimeMs() - m_updateButtontime); -++ key.duration = (unsigned int) (GetTimeMs() - m_initialButtontime); -+ -+- if (key.duration > m_configuration.iComboKeyTimeoutMs || -++ if (duration > m_configuration.iComboKeyTimeoutMs || -+ m_configuration.iComboKeyTimeoutMs == 0 || -+ m_iCurrentButton != m_configuration.comboKey || -+ bSendComboKey) -+@@ -987,14 +993,22 @@ void CCECClient::AddKey(bool bSendComboKey /* = false */, bool bButtonRelease /* -+ key.keycode = m_iCurrentButton; -+ -+ m_iCurrentButton = CEC_USER_CONTROL_CODE_UNKNOWN; -+- m_buttontime = 0; -++ m_initialButtontime = 0; -++ m_updateButtontime = 0; -++ m_repeatButtontime = 0; -++ m_releaseButtontime = 0; -++ m_pressedButtoncount = 0; -+ } -+ } -+ } -+ -++ // we don't forward releases when supporting repeating keys -++ if (bButtonRelease && m_configuration.iButtonRepeatRateMs) -++ return; -++ -+ if (key.keycode != CEC_USER_CONTROL_CODE_UNKNOWN) -+ { -+- LIB_CEC->AddLog(CEC_LOG_DEBUG, "key released: %s (%1x)", ToString(key.keycode), key.keycode); -++ LIB_CEC->AddLog(CEC_LOG_DEBUG, "key released: %s (%1x) D:%dms", ToString(key.keycode), key.keycode, key.duration); -+ CallbackAddKey(key); -+ } -+ } -+@@ -1005,10 +1019,11 @@ void CCECClient::AddKey(const cec_keypress &key) -+ key.keycode < CEC_USER_CONTROL_CODE_SELECT) -+ { -+ // send back the previous key if there is one -++ LIB_CEC->AddLog(CEC_LOG_DEBUG, "Unexpected key %s (%1x) D:%dms", ToString(key.keycode), key.keycode, key.duration); -+ AddKey(); -+ return; -+ } -+- -++ bool isrepeat = false; -+ cec_keypress transmitKey(key); -+ cec_user_control_code comboKey(m_configuration.clientVersion >= CEC_CLIENT_VERSION_2_0_5 ? -+ m_configuration.comboKey : CEC_USER_CONTROL_CODE_STOP); -+@@ -1028,27 +1043,60 @@ void CCECClient::AddKey(const cec_keypress &key) -+ transmitKey.keycode = CEC_USER_CONTROL_CODE_DOT; -+ // default, send back the previous key -+ else -++ { -++ LIB_CEC->AddLog(CEC_LOG_DEBUG, "Combo key %s (%1x) D%dms:", ToString(key.keycode), key.keycode, key.duration); -+ AddKey(true); -++ } -+ } -+ -++ LIB_CEC->AddLog(CEC_LOG_DEBUG, "key pressed: %s (%1x) current(%lx) duration(%d)", ToString(transmitKey.keycode), transmitKey.keycode, m_iCurrentButton, key.duration); -++ -+ if (m_iCurrentButton == key.keycode) -+ { -+- m_buttontime = GetTimeMs(); -++ m_updateButtontime = GetTimeMs(); -++ m_releaseButtontime = m_updateButtontime + (m_configuration.iButtonReleaseDelayMs ? m_configuration.iButtonReleaseDelayMs : CEC_BUTTON_TIMEOUT); -++ // want to have seen some updated before considering a repeat -++ if (m_configuration.iButtonRepeatRateMs) -++ { -++ if (!m_repeatButtontime && m_pressedButtoncount > 1) -++ m_repeatButtontime = m_initialButtontime + DoubleTapTimeoutMS(); -++ isrepeat = true; -++ } -++ m_pressedButtoncount++; -+ } -+ else -+ { -+- AddKey(); -++ if (m_iCurrentButton != transmitKey.keycode) -++ { -++ LIB_CEC->AddLog(CEC_LOG_DEBUG, "Changed key %s (%1x) D:%dms cur:%lx", ToString(transmitKey.keycode), transmitKey.keycode, transmitKey.duration, m_iCurrentButton); -++ AddKey(); -++ } -+ if (key.duration == 0) -+ { -+ m_iCurrentButton = transmitKey.keycode; -+- m_buttontime = m_iCurrentButton == CEC_USER_CONTROL_CODE_UNKNOWN || key.duration > 0 ? 0 : GetTimeMs(); -++ if (m_iCurrentButton == CEC_USER_CONTROL_CODE_UNKNOWN) -++ { -++ m_initialButtontime = 0; -++ m_updateButtontime = 0; -++ m_repeatButtontime = 0; -++ m_releaseButtontime = 0; -++ m_pressedButtoncount = 0; -++ } -++ else -++ { -++ m_initialButtontime = GetTimeMs(); -++ m_updateButtontime = m_initialButtontime; -++ m_repeatButtontime = 0; // set this on next update -++ m_releaseButtontime = m_initialButtontime + (m_configuration.iButtonReleaseDelayMs ? m_configuration.iButtonReleaseDelayMs : CEC_BUTTON_TIMEOUT); -++ m_pressedButtoncount = 1; -++ } -+ } -+ } -+ } -+ -+- if (key.keycode != comboKey || key.duration > 0) -++ if (!isrepeat && (key.keycode != comboKey || key.duration > 0)) -+ { -+- LIB_CEC->AddLog(CEC_LOG_DEBUG, "key pressed: %s (%1x)", ToString(transmitKey.keycode), transmitKey.keycode); -++ LIB_CEC->AddLog(CEC_LOG_DEBUG, "key pressed: %s (%1x, %d)", ToString(transmitKey.keycode), transmitKey.keycode, transmitKey.duration); -+ CallbackAddKey(transmitKey); -+ } -+ } -+@@ -1060,6 +1108,7 @@ void CCECClient::SetCurrentButton(const cec_user_control_code iButtonCode) -+ key.duration = 0; -+ key.keycode = iButtonCode; -+ -++ LIB_CEC->AddLog(CEC_LOG_DEBUG, "SetCurrentButton %s (%1x) D:%dms cur:%lx", ToString(key.keycode), key.keycode, key.duration); -+ AddKey(key); -+ } -+ -+@@ -1076,35 +1125,59 @@ uint16_t CCECClient::CheckKeypressTimeout(void) -+ { -+ CLockObject lock(m_mutex); -+ uint64_t iNow = GetTimeMs(); -++ LIB_CEC->AddLog(CEC_LOG_DEBUG, "%s T:%.3f", __FUNCTION__, iNow*1e-3); -+ cec_user_control_code comboKey(m_configuration.clientVersion >= CEC_CLIENT_VERSION_2_0_5 ? -+ m_configuration.comboKey : CEC_USER_CONTROL_CODE_STOP); -+ uint32_t iTimeoutMs(m_configuration.clientVersion >= CEC_CLIENT_VERSION_2_0_5 ? -+ m_configuration.iComboKeyTimeoutMs : CEC_DEFAULT_COMBO_TIMEOUT_MS); -+ -+- if (m_iCurrentButton != CEC_USER_CONTROL_CODE_UNKNOWN && -+- ((m_iCurrentButton == comboKey && iTimeoutMs > 0 && iNow - m_buttontime > iTimeoutMs) || -+- (m_iCurrentButton != comboKey && iNow - m_buttontime > CEC_BUTTON_TIMEOUT))) -++ if (m_iCurrentButton == comboKey && iTimeoutMs > 0 && iNow - m_updateButtontime >= iTimeoutMs) -+ { -+- key.duration = (unsigned int) (iNow - m_buttontime); -++ key.duration = (unsigned int) (iNow - m_initialButtontime); -+ key.keycode = m_iCurrentButton; -+ -+ m_iCurrentButton = CEC_USER_CONTROL_CODE_UNKNOWN; -+- m_buttontime = 0; -++ m_initialButtontime = 0; -++ m_updateButtontime = 0; -++ m_repeatButtontime = 0; -++ m_releaseButtontime = 0; -++ m_pressedButtoncount = 0; -++ } -++ else if (m_iCurrentButton != comboKey && m_releaseButtontime && iNow >= (uint64_t)m_releaseButtontime) -++ { -++ key.duration = (unsigned int) (iNow - m_initialButtontime); -++ key.keycode = CEC_USER_CONTROL_CODE_UNKNOWN; -++ -++ m_iCurrentButton = CEC_USER_CONTROL_CODE_UNKNOWN; -++ m_initialButtontime = 0; -++ m_updateButtontime = 0; -++ m_repeatButtontime = 0; -++ m_releaseButtontime = 0; -++ m_pressedButtoncount = 0; -++ } -++ else if (m_iCurrentButton != comboKey && m_repeatButtontime && iNow >= (uint64_t)m_repeatButtontime) -++ { -++ key.duration = (unsigned int) (iNow - m_initialButtontime); -++ key.keycode = m_iCurrentButton; -++ m_repeatButtontime = iNow + m_configuration.iButtonRepeatRateMs; -++ timeout = std::min((uint64_t)timeout, m_repeatButtontime - iNow); -+ } -+ else -+ { -+- // time when this keypress will be released and we'd like to be called again -+- unsigned int timeout = CEC_PROCESSOR_SIGNAL_WAIT_TIME; -+- if (m_iCurrentButton != CEC_USER_CONTROL_CODE_UNKNOWN && m_iCurrentButton == comboKey && iTimeoutMs > 0) -+- timeout = iTimeoutMs - (iNow - m_buttontime) + 1; -+- else if (m_iCurrentButton != CEC_USER_CONTROL_CODE_UNKNOWN && m_iCurrentButton != comboKey) -+- timeout = CEC_BUTTON_TIMEOUT - (iNow - m_buttontime) + 1; -++ if (m_iCurrentButton == comboKey && iTimeoutMs > 0) -++ timeout = std::min((uint64_t)timeout, m_updateButtontime - iNow + iTimeoutMs); -++ if (m_iCurrentButton != comboKey && m_releaseButtontime) -++ timeout = std::min((uint64_t)timeout, m_releaseButtontime - iNow); -++ if (m_iCurrentButton != comboKey && m_repeatButtontime) -++ timeout = std::min((uint64_t)timeout, m_repeatButtontime - iNow); -+ if (timeout > CEC_PROCESSOR_SIGNAL_WAIT_TIME) -+ { -+- LIB_CEC->AddLog(CEC_LOG_ERROR, "Unexpected timeout: %d (%.3f %.3f %.3f) k:%02x", timeout, iNow*1e-3, m_buttontime*1e-3, CEC_BUTTON_TIMEOUT*1e-3, m_iCurrentButton); -++ LIB_CEC->AddLog(CEC_LOG_ERROR, "Unexpected timeout: %d (%.3f %.3f %.3f) k:%02x", timeout, iNow*1e-3, m_updateButtontime*1e-3, m_releaseButtontime*1e-3, m_iCurrentButton); -+ timeout = CEC_PROCESSOR_SIGNAL_WAIT_TIME; -+ } -+ } -++ LIB_CEC->AddLog(CEC_LOG_DEBUG, "Key %s: %s (duration:%d) (%1x) timeout:%dms (rel:%d,rep:%d,prs:%d)", ToString(m_iCurrentButton), key.keycode == CEC_USER_CONTROL_CODE_UNKNOWN ? "idle" : m_repeatButtontime ? "repeated" : "released", key.duration, -++ m_iCurrentButton, timeout, (int)(m_releaseButtontime ? m_releaseButtontime - iNow : 0), (int)(m_repeatButtontime ? m_repeatButtontime - iNow : 0), m_pressedButtoncount); -+ } -+ -+ if (key.keycode != CEC_USER_CONTROL_CODE_UNKNOWN) -+diff --git a/src/lib/CECClient.h b/src/lib/CECClient.h -+index 84fb909..27af3f9 100644 -+--- a/src/lib/CECClient.h -++++ b/src/lib/CECClient.h -+@@ -311,7 +311,11 @@ namespace CEC -+ PLATFORM::CMutex m_mutex; /**< mutex for changes to this instance */ -+ PLATFORM::CMutex m_cbMutex; /**< mutex that is held when doing anything with callbacks */ -+ cec_user_control_code m_iCurrentButton; /**< the control code of the button that's currently held down (if any) */ -+- int64_t m_buttontime; /**< the timestamp when the button was pressed (in seconds since epoch), or 0 if none was pressed. */ -++ int64_t m_initialButtontime; /**< the timestamp when the button was initially pressed (in seconds since epoch), or 0 if none was pressed. */ -++ int64_t m_updateButtontime; /**< the timestamp when the button was updated (in seconds since epoch), or 0 if none was pressed. */ -++ int64_t m_repeatButtontime; /**< the timestamp when the button will next repeat (in seconds since epoch), or 0 if repeat is disabled. */ -++ int64_t m_releaseButtontime; /**< the timestamp when the button will be released (in seconds since epoch), or 0 if none was pressed. */ -++ int32_t m_pressedButtoncount; /**< the number of times a button released message has been seen for this press. */ -+ int64_t m_iPreventForwardingPowerOffCommand; /**< prevent forwarding standby commands until this time */ -+ int64_t m_iLastKeypressTime; /**< last time a key press was sent to the client */ -+ cec_keypress m_lastKeypress; /**< the last key press that was sent to the client */ -+-- -+1.9.1 -+ -+ -+From 23860987ec534a4aecf93100bef3736c2620fb93 Mon Sep 17 00:00:00 2001 -+From: popcornmix -+Date: Tue, 28 Oct 2014 01:21:35 +0000 -+Subject: [PATCH 5/5] Skip double press removal. It is handled through other -+ means. -+ -+--- -+ src/lib/CECClient.cpp | 18 +----------------- -+ src/lib/CECClient.h | 2 -- -+ 2 files changed, 1 insertion(+), 19 deletions(-) -+ -+diff --git a/src/lib/CECClient.cpp b/src/lib/CECClient.cpp -+index 68eaee9..9b4b533 100644 -+--- a/src/lib/CECClient.cpp -++++ b/src/lib/CECClient.cpp -+@@ -57,11 +57,8 @@ CCECClient::CCECClient(CCECProcessor *processor, const libcec_configuration &con -+ m_repeatButtontime(0), -+ m_releaseButtontime(0), -+ m_pressedButtoncount(0), -+- m_iPreventForwardingPowerOffCommand(0), -+- m_iLastKeypressTime(0) -++ m_iPreventForwardingPowerOffCommand(0) -+ { -+- m_lastKeypress.keycode = CEC_USER_CONTROL_CODE_UNKNOWN; -+- m_lastKeypress.duration = 0; -+ m_configuration.Clear(); -+ // set the initial configuration -+ SetConfiguration(configuration); -+@@ -1568,20 +1565,7 @@ void CCECClient::CallbackAddKey(const cec_keypress &key) -+ { -+ CLockObject lock(m_cbMutex); -+ if (m_configuration.callbacks && m_configuration.callbacks->CBCecKeyPress) -+- { -+- // prevent double taps -+- int64_t now = GetTimeMs(); -+- if (m_lastKeypress.keycode != key.keycode || -+- key.duration > 0 || -+- now - m_iLastKeypressTime >= DoubleTapTimeoutMS()) -+- { -+- // no double tap -+- if (key.duration == 0) -+- m_iLastKeypressTime = now; -+- m_lastKeypress = key; -+ m_configuration.callbacks->CBCecKeyPress(m_configuration.callbackParam, key); -+- } -+- } -+ } -+ -+ void CCECClient::CallbackAddLog(const cec_log_message &message) -+diff --git a/src/lib/CECClient.h b/src/lib/CECClient.h -+index 27af3f9..eb11d9b 100644 -+--- a/src/lib/CECClient.h -++++ b/src/lib/CECClient.h -+@@ -317,7 +317,5 @@ namespace CEC -+ int64_t m_releaseButtontime; /**< the timestamp when the button will be released (in seconds since epoch), or 0 if none was pressed. */ -+ int32_t m_pressedButtoncount; /**< the number of times a button released message has been seen for this press. */ -+ int64_t m_iPreventForwardingPowerOffCommand; /**< prevent forwarding standby commands until this time */ -+- int64_t m_iLastKeypressTime; /**< last time a key press was sent to the client */ -+- cec_keypress m_lastKeypress; /**< the last key press that was sent to the client */ -+ }; -+ } -+-- -+1.9.1 - -From 37c1e4ba09cacd1fd0bf30883606fcab6c51d71d Mon Sep 17 00:00:00 2001 +From 5c9736a99bc81334fd7aedf28578392c7780fb1a Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 15 Feb 2015 14:06:12 +0000 -Subject: [PATCH 29/56] [mmal] Allow mmal codec for dvd stills +Subject: [PATCH 30/61] [mmal] Allow mmal codec for dvd stills --- xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp -index 0a16b4b..b77a168 100644 +index eafabb3..8a3beb7 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp @@ -50,6 +50,9 @@ @@ -2227,7 +1662,7 @@ index 0a16b4b..b77a168 100644 #include "Audio/DVDAudioCodecFFmpeg.h" #include "Audio/DVDAudioCodecPassthrough.h" #include "Overlay/DVDOverlayCodecSSA.h" -@@ -199,6 +202,10 @@ CDVDVideoCodec* CDVDFactoryCodec::CreateVideoCodec(CDVDStreamInfo &hint, unsigne +@@ -201,6 +204,10 @@ CDVDVideoCodec* CDVDFactoryCodec::CreateVideoCodec(CDVDStreamInfo &hint, const C #endif CLog::Log(LOGDEBUG, "CDVDFactoryCodec: compiled in hardware support: %s", hwSupport.c_str()); @@ -2239,10 +1674,113 @@ index 0a16b4b..b77a168 100644 { // If dvd is an mpeg2 and hint.stills -From e1e93abe7d9cb7e9232c67c6d1362fa294c290cb Mon Sep 17 00:00:00 2001 +From 0b367aae0fae2d797055a20dd70949207659220f Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Tue, 31 Mar 2015 17:31:47 +0100 +Subject: [PATCH 42/61] [mmalrenderer] Add SetCodecControl function and prefer + to return pictures when renderer is low (disabled) + +--- + xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 13 +++++++++++++ + xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h | 2 ++ + 2 files changed, 15 insertions(+) + +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp +index 27fa9c4..a2510be 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp +@@ -124,6 +124,7 @@ CMMALVideo::CMMALVideo() + m_es_format = mmal_format_alloc(); + m_preroll = true; + m_speed = DVD_PLAYSPEED_NORMAL; ++ m_codecControlFlags = 0; + } + + CMMALVideo::~CMMALVideo() +@@ -864,6 +865,9 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) + if (g_advancedSettings.CanLogComponent(LOGVIDEO)) + CLog::Log(LOGDEBUG, "%s::%s - got output picture:%d", CLASSNAME, __func__, m_output_ready.size()); + ret |= VC_PICTURE; ++ // renderer is low - give priority to returning pictures ++ if (0 && m_codecControlFlags & DVD_CODEC_CTRL_DRAIN) ++ ret &= ~VC_BUFFER; + } + if (!ret) + { +@@ -942,6 +946,7 @@ void CMMALVideo::Reset(void) + m_startframe = false; + m_decoderPts = DVD_NOPTS_VALUE; + m_preroll = !m_hints.stills && (m_speed == DVD_PLAYSPEED_NORMAL || m_speed == DVD_PLAYSPEED_PAUSE); ++ m_codecControlFlags = 0; + } + + void CMMALVideo::SetSpeed(int iSpeed) +@@ -1057,3 +1062,11 @@ bool CMMALVideo::GetCodecStats(double &pts, int &droppedPics) + droppedPics= -1; + return false; + } ++ ++void CMMALVideo::SetCodecControl(int flags) ++{ ++ CSingleLock lock(m_sharedSection); ++ m_codecControlFlags = flags; ++ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) ++ CLog::Log(LOGDEBUG, "%s::%s flags:%x", CLASSNAME, __func__, flags); ++} +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h +index 51a64d1..bde8c06 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h +@@ -86,6 +86,7 @@ class CMMALVideo : public CDVDVideoCodec + virtual void SetDropState(bool bDrop); + virtual const char* GetName(void) { return m_pFormatName ? m_pFormatName:"mmal-xxx"; } + virtual bool GetCodecStats(double &pts, int &droppedPics); ++ virtual void SetCodecControl(int flags); + virtual void SetSpeed(int iSpeed); + + // MMAL decoder callback routines. +@@ -130,6 +131,7 @@ class CMMALVideo : public CDVDVideoCodec + double m_decoderPts; + int m_speed; + bool m_preroll; ++ int m_codecControlFlags; + + CCriticalSection m_sharedSection; + MMAL_COMPONENT_T *m_dec; + +From 7ec37cce302f39ca91ba8bc86be80e7e1d7368c5 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Wed, 1 Apr 2015 16:31:37 +0100 +Subject: [PATCH 43/61] [mmalcodec] Limit submitted video frames. Seems to + avoid stutter issues with low bitrate videos + +--- + xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp +index a2510be..c37f321 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp +@@ -848,10 +848,11 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) + break; + } + int ret = 0; +- if (mmal_queue_length(m_dec_input_pool->queue) > 0 && !m_demux_queue_length) ++ double queued = m_decoderPts != DVD_NOPTS_VALUE && pts != DVD_NOPTS_VALUE ? pts - m_decoderPts : 0.0; ++ if (mmal_queue_length(m_dec_input_pool->queue) > 0 && !m_demux_queue_length && queued <= DVD_MSEC_TO_TIME(500)) + { + if (g_advancedSettings.CanLogComponent(LOGVIDEO)) +- CLog::Log(LOGDEBUG, "%s::%s - got space for output: demux_queue(%d) space(%d)", CLASSNAME, __func__, m_demux_queue_length, mmal_queue_length(m_dec_input_pool->queue) * m_dec_input->buffer_size); ++ CLog::Log(LOGDEBUG, "%s::%s - got space for output: demux_queue(%d) space(%d) queued(%.2f)", CLASSNAME, __func__, m_demux_queue_length, mmal_queue_length(m_dec_input_pool->queue) * m_dec_input->buffer_size, queued*1e-6); + ret |= VC_BUFFER; + } + else + +From 959ec414be56d1d4ca4774508069d350c61a83e9 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 24 Feb 2015 15:57:29 +0000 -Subject: [PATCH 30/56] [mmalrenderer] Fix for stereo view modes +Subject: [PATCH 44/61] [mmalrenderer] Fix for stereo view modes PR6090 (dirty regions for video) meant that RenderUpate is no longer called with the expected stereo view mode. So, just explicitly set this before calling ManageDisplay to get the desired rectangles @@ -2251,10 +1789,10 @@ So, just explicitly set this before calling ManageDisplay to get the desired rec 1 file changed, 4 insertions(+) diff --git a/xbmc/cores/VideoRenderers/MMALRenderer.cpp b/xbmc/cores/VideoRenderers/MMALRenderer.cpp -index 3329980..d53de35 100644 +index fc9dfca..f1e3252 100644 --- a/xbmc/cores/VideoRenderers/MMALRenderer.cpp +++ b/xbmc/cores/VideoRenderers/MMALRenderer.cpp -@@ -351,7 +351,11 @@ void CMMALRenderer::RenderUpdate(bool clear, DWORD flags, DWORD alpha) +@@ -366,7 +366,11 @@ void CMMALRenderer::RenderUpdate(bool clear, DWORD flags, DWORD alpha) if (!m_bConfigured) return; @@ -2267,10 +1805,10 @@ index 3329980..d53de35 100644 // if running bypass, then the player might need the src/dst rects // for sizing video playback on a layer other than the gles layer. -From e11c6931312b66a33fd8ddc52a1c121894c913ab Mon Sep 17 00:00:00 2001 +From c755cacee4346e3a55cd337d85630471fe6ef309 Mon Sep 17 00:00:00 2001 From: anaconda Date: Wed, 25 Feb 2015 18:22:21 +0100 -Subject: [PATCH 31/56] Load OSD dialogs on startup. +Subject: [PATCH 45/61] Load OSD dialogs on startup. Fixes skipped frames the first time they're loaded in memory on less powered devices, like a Raspberry Pi, when using DVDPlayer. @@ -2365,10 +1903,10 @@ index 4940561..f52698c 100644 CGUIDialogVideoSettings::~CGUIDialogVideoSettings() { } -From 71e5a4591b65a12c3621395644c2542b1216c94f Mon Sep 17 00:00:00 2001 +From b54cf11f709c406dfaafdab2703d1c111d0b61b8 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 7 Mar 2015 22:46:21 +0000 -Subject: [PATCH 32/56] configure: Add raspberry-pi2 platform +Subject: [PATCH 46/61] configure: Add raspberry-pi2 platform --- configure.ac | 14 +++++++-- @@ -2380,7 +1918,7 @@ Subject: [PATCH 32/56] configure: Add raspberry-pi2 platform 6 files changed, 44 insertions(+), 22 deletions(-) diff --git a/configure.ac b/configure.ac -index ea94c1d..2a80a9d 100644 +index cf18212..65df15f 100644 --- a/configure.ac +++ b/configure.ac @@ -746,8 +746,17 @@ case $use_platform in @@ -2542,10 +2080,10 @@ index cdc2fe4..379bd1d 100644 set(CMAKE_SYSTEM_NAME Linux) endif() -From 05272dd1d48f92910c02f134d58cad85e236b567 Mon Sep 17 00:00:00 2001 +From eded2ce0900d7837f4e451d5b58bc02153ce1e79 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 16 Apr 2014 21:18:06 +0100 -Subject: [PATCH 33/56] [omxplayer] Don't propagate 3d flags based on supported +Subject: [PATCH 47/61] [omxplayer] Don't propagate 3d flags based on supported 3d modes --- @@ -2553,10 +2091,10 @@ Subject: [PATCH 33/56] [omxplayer] Don't propagate 3d flags based on supported 1 file changed, 3 insertions(+), 26 deletions(-) diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -index 5ca7665..2e077e5 100644 +index 212a89b..dd509ea 100644 --- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -@@ -762,40 +762,17 @@ void OMXPlayerVideo::ResolutionUpdateCallBack(uint32_t width, uint32_t height, f +@@ -752,40 +752,17 @@ void OMXPlayerVideo::ResolutionUpdateCallBack(uint32_t width, uint32_t height, f uint32_t video_width = CDisplaySettings::Get().GetResolutionInfo(res).iScreenWidth; uint32_t video_height = CDisplaySettings::Get().GetResolutionInfo(res).iScreenHeight; @@ -2601,10 +2139,10 @@ index 5ca7665..2e077e5 100644 unsigned int iDisplayHeight = height; -From f4aec8de701350aacbfbde39cef3290a03f27dcc Mon Sep 17 00:00:00 2001 +From 98545b6d99c3ab0d9c2b55931cbae5e45b68411c Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 17 Apr 2014 13:01:51 +0100 -Subject: [PATCH 34/56] [graphics] Allow switching to a more suitable 3D +Subject: [PATCH 48/61] [graphics] Allow switching to a more suitable 3D resolution --- @@ -2690,10 +2228,10 @@ index 5c1501a..aba11cd 100644 void ResetOverscan(RESOLUTION_INFO &resinfo); void ResetScreenParameters(RESOLUTION res); -From 78450508b10c875a8d4d48015f256a6c1d2b2c40 Mon Sep 17 00:00:00 2001 +From 6376797042cac6d4c821c850e4569ccf66c03ebb Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 17 Apr 2014 13:38:55 +0100 -Subject: [PATCH 35/56] [3D] Support switching to 3D resolutions +Subject: [PATCH 49/61] [3D] Support switching to 3D resolutions Include matching 3D flags (SBS/TAB) in the score of a resolution to switch to, to enable switching to 3d modes. Also remove the old code that treated 3D modes differently when assigning a score. @@ -2775,10 +2313,10 @@ index 4345c0f..cc5dc60 100644 return current; } -From cc039a1f0c00c08a795e2afb33a3c7f2f494bab2 Mon Sep 17 00:00:00 2001 +From 1ca60872dbd7c116d44a2f9a49d5cc704e5193e2 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 23 Apr 2014 00:05:07 +0100 -Subject: [PATCH 36/56] [graphics] Make pixel ratio for 3d modes consistent +Subject: [PATCH 50/61] [graphics] Make pixel ratio for 3d modes consistent Note: Use the stored stereo flags from lists of resolutions. Use current stereo mode for current resolution. @@ -2981,25 +2519,151 @@ index c80114e..80c05d2 100644 AddUniqueResolution(res2, resolutions); -From ceb6bdca72eebab222cea1ea26ebc853e96e6465 Mon Sep 17 00:00:00 2001 +From 322614f99f49aea527c75d9573e245da12cfbade Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Tue, 10 Mar 2015 17:05:18 +0000 +Subject: [PATCH 51/61] [players] Add settings option to enable MVC support + +--- + addons/resource.language.en_gb/resources/strings.po | 10 ++++++++++ + system/settings/rbp.xml | 7 +++++++ + xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 5 +++++ + xbmc/cores/omxplayer/OMXVideo.cpp | 5 +++++ + 4 files changed, 27 insertions(+) + +diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po +index aee20d0..3d6b660 100644 +--- a/addons/resource.language.en_gb/resources/strings.po ++++ b/addons/resource.language.en_gb/resources/strings.po +@@ -16602,6 +16602,16 @@ msgctxt "#38052" + msgid "Remote button press release time (ms)" + msgstr "" + ++#: system/settings/rbp.xml ++msgctxt "#38110" ++msgid "Support MVC video (full frame 3D)" ++msgstr "" ++ ++#: system/settings/rbp.xml ++msgctxt "#38111" ++msgid "This option decodes frames for both eyes of MVC video. Disabling may improve performance if you don't require 3D" ++msgstr "" ++ + #: system/settings/settings.xml + msgctxt "#38103" + msgid "Extract thumbnails from video files" +diff --git a/system/settings/rbp.xml b/system/settings/rbp.xml +index 208cd49..6357b1d 100644 +--- a/system/settings/rbp.xml ++++ b/system/settings/rbp.xml +@@ -27,6 +27,13 @@ + + + ++ ++ ++ 2 ++ true ++ ++ ++ + + + +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp +index c37f321..a583450 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp +@@ -537,6 +537,11 @@ bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options) + // H.264 + m_codingType = MMAL_ENCODING_H264; + m_pFormatName = "mmal-h264"; ++ if (CSettings::Get().GetBool("videoplayer.supportmvc")) ++ { ++ m_codingType = MMAL_ENCODING_MVC; ++ m_pFormatName= "mmal-mvc"; ++ } + break; + case AV_CODEC_ID_H263: + case AV_CODEC_ID_MPEG4: +diff --git a/xbmc/cores/omxplayer/OMXVideo.cpp b/xbmc/cores/omxplayer/OMXVideo.cpp +index e4f6d86..5d324f4 100644 +--- a/xbmc/cores/omxplayer/OMXVideo.cpp ++++ b/xbmc/cores/omxplayer/OMXVideo.cpp +@@ -430,6 +430,11 @@ bool COMXVideo::Open(CDVDStreamInfo &hints, OMXClock *clock, EDEINTERLACEMODE de + break; + } + } ++ if (CSettings::Get().GetBool("videoplayer.supportmvc")) ++ { ++ m_codingType = OMX_VIDEO_CodingMVC; ++ m_video_codec_name = "omx-mvc"; ++ } + break; + case AV_CODEC_ID_MPEG4: + // (role name) video_decoder.mpeg4 + +From 9fed5fcd6c6c2150ba465abc04fb7776cb878b03 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 14 Mar 2015 12:38:08 +0000 -Subject: [PATCH 37/56] [mmalrenderer] Switch to using transform flags for 3d +Subject: [PATCH 52/61] [mmalrenderer] Switch to using transform flags for 3d modes --- - xbmc/cores/VideoRenderers/MMALRenderer.cpp | 92 +++++++------------------ - xbmc/cores/omxplayer/OMXPlayerVideo.cpp | 46 ++----------- - xbmc/cores/omxplayer/OMXVideo.cpp | 36 ++++------ - xbmc/cores/omxplayer/OMXVideo.h | 2 +- - xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp | 11 ++- - 5 files changed, 57 insertions(+), 130 deletions(-) + .../resource.language.en_gb/resources/strings.po | 10 +++ + system/settings/rbp.xml | 8 ++ + xbmc/cores/VideoRenderers/MMALRenderer.cpp | 92 ++++++---------------- + xbmc/cores/omxplayer/OMXPlayerVideo.cpp | 46 ++--------- + xbmc/cores/omxplayer/OMXVideo.cpp | 36 ++++----- + xbmc/cores/omxplayer/OMXVideo.h | 2 +- + xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp | 11 ++- + 7 files changed, 75 insertions(+), 130 deletions(-) +diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po +index 3d6b660..eeb6d0a 100644 +--- a/addons/resource.language.en_gb/resources/strings.po ++++ b/addons/resource.language.en_gb/resources/strings.po +@@ -16612,6 +16612,16 @@ msgctxt "#38111" + msgid "This option decodes frames for both eyes of MVC video. Disabling may improve performance if you don't require 3D" + msgstr "" + ++#: system/settings/rbp.xml ++msgctxt "#38112" ++msgid "Use Full HD HDMI modes for 3D" ++msgstr "" ++ ++#: system/settings/rbp.xml ++msgctxt "#38113" ++msgid "This option uses frame-packing to output full resolution for 3D through HDMI" ++msgstr "" ++ + #: system/settings/settings.xml + msgctxt "#38103" + msgid "Extract thumbnails from video files" +diff --git a/system/settings/rbp.xml b/system/settings/rbp.xml +index 6357b1d..77e983b 100644 +--- a/system/settings/rbp.xml ++++ b/system/settings/rbp.xml +@@ -33,6 +33,14 @@ + true + + ++ ++ ++ true ++ ++ 2 ++ true ++ ++ + + + diff --git a/xbmc/cores/VideoRenderers/MMALRenderer.cpp b/xbmc/cores/VideoRenderers/MMALRenderer.cpp -index d53de35..c30de9c 100644 +index f1e3252..8ffcf23 100644 --- a/xbmc/cores/VideoRenderers/MMALRenderer.cpp +++ b/xbmc/cores/VideoRenderers/MMALRenderer.cpp -@@ -351,11 +351,7 @@ void CMMALRenderer::RenderUpdate(bool clear, DWORD flags, DWORD alpha) +@@ -366,11 +366,7 @@ void CMMALRenderer::RenderUpdate(bool clear, DWORD flags, DWORD alpha) if (!m_bConfigured) return; @@ -3011,18 +2675,19 @@ index d53de35..c30de9c 100644 // if running bypass, then the player might need the src/dst rects // for sizing video playback on a layer other than the gles layer. -@@ -560,9 +556,7 @@ EINTERLACEMETHOD CMMALRenderer::AutoInterlaceMethod() +@@ -581,10 +577,8 @@ EINTERLACEMETHOD CMMALRenderer::AutoInterlaceMethod() void CMMALRenderer::SetVideoRect(const CRect& InSrcRect, const CRect& InDestRect) { - // we get called twice a frame for left/right. Can ignore the rights. - if (g_graphicsContext.GetStereoView() == RENDER_STEREO_VIEW_RIGHT) - return; + CSingleLock lock(m_sharedSection); + assert(g_graphicsContext.GetStereoView() != RENDER_STEREO_VIEW_RIGHT); if (!m_vout_input) return; -@@ -604,41 +598,10 @@ void CMMALRenderer::SetVideoRect(const CRect& InSrcRect, const CRect& InDestRect +@@ -626,41 +620,10 @@ void CMMALRenderer::SetVideoRect(const CRect& InSrcRect, const CRect& InDestRect CRect gui(0, 0, CDisplaySettings::Get().GetResolutionInfo(res).iWidth, CDisplaySettings::Get().GetResolutionInfo(res).iHeight); CRect display(0, 0, CDisplaySettings::Get().GetResolutionInfo(res).iScreenWidth, CDisplaySettings::Get().GetResolutionInfo(res).iScreenHeight); @@ -3068,7 +2733,7 @@ index d53de35..c30de9c 100644 if (gui != display) { -@@ -653,7 +616,7 @@ void CMMALRenderer::SetVideoRect(const CRect& InSrcRect, const CRect& InDestRect +@@ -675,7 +638,7 @@ void CMMALRenderer::SetVideoRect(const CRect& InSrcRect, const CRect& InDestRect MMAL_DISPLAYREGION_T region; memset(®ion, 0, sizeof region); @@ -3077,7 +2742,7 @@ index d53de35..c30de9c 100644 region.dest_rect.x = lrintf(DestRect.x1); region.dest_rect.y = lrintf(DestRect.y1); region.dest_rect.width = lrintf(DestRect.Width()); -@@ -666,35 +629,32 @@ void CMMALRenderer::SetVideoRect(const CRect& InSrcRect, const CRect& InDestRect +@@ -688,35 +651,32 @@ void CMMALRenderer::SetVideoRect(const CRect& InSrcRect, const CRect& InDestRect region.fullscreen = MMAL_FALSE; region.noaspect = MMAL_TRUE; @@ -3134,10 +2799,10 @@ index d53de35..c30de9c 100644 + region.dest_rect.x, region.dest_rect.y, region.dest_rect.width, region.dest_rect.height, region.transform); } diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -index 2e077e5..f6c6eb0 100644 +index dd509ea..adf9910 100644 --- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -@@ -659,9 +659,7 @@ int OMXPlayerVideo::GetFreeSpace() +@@ -649,9 +649,7 @@ int OMXPlayerVideo::GetFreeSpace() void OMXPlayerVideo::SetVideoRect(const CRect &InSrcRect, const CRect &InDestRect) { @@ -3148,7 +2813,7 @@ index 2e077e5..f6c6eb0 100644 CRect SrcRect = InSrcRect, DestRect = InDestRect; unsigned flags = GetStereoModeFlags(GetStereoMode()); -@@ -701,42 +699,10 @@ void OMXPlayerVideo::SetVideoRect(const CRect &InSrcRect, const CRect &InDestRec +@@ -691,42 +689,10 @@ void OMXPlayerVideo::SetVideoRect(const CRect &InSrcRect, const CRect &InDestRec CRect gui(0, 0, CDisplaySettings::Get().GetResolutionInfo(res).iWidth, CDisplaySettings::Get().GetResolutionInfo(res).iHeight); CRect display(0, 0, CDisplaySettings::Get().GetResolutionInfo(res).iScreenWidth, CDisplaySettings::Get().GetResolutionInfo(res).iScreenHeight); @@ -3195,7 +2860,7 @@ index 2e077e5..f6c6eb0 100644 if (gui != display) { -@@ -747,7 +713,7 @@ void OMXPlayerVideo::SetVideoRect(const CRect &InSrcRect, const CRect &InDestRec +@@ -737,7 +703,7 @@ void OMXPlayerVideo::SetVideoRect(const CRect &InSrcRect, const CRect &InDestRec DestRect.y1 *= yscale; DestRect.y2 *= yscale; } @@ -3205,7 +2870,7 @@ index 2e077e5..f6c6eb0 100644 void OMXPlayerVideo::RenderUpdateCallBack(const void *ctx, const CRect &SrcRect, const CRect &DestRect) diff --git a/xbmc/cores/omxplayer/OMXVideo.cpp b/xbmc/cores/omxplayer/OMXVideo.cpp -index ca40a37..bb4d572 100644 +index 5d324f4..832a9c9 100644 --- a/xbmc/cores/omxplayer/OMXVideo.cpp +++ b/xbmc/cores/omxplayer/OMXVideo.cpp @@ -220,15 +220,6 @@ bool COMXVideo::PortSettingsChanged() @@ -3224,7 +2889,7 @@ index ca40a37..bb4d572 100644 if(m_hdmi_clock_sync) { OMX_CONFIG_LATENCYTARGETTYPE latencyTarget; -@@ -855,7 +846,7 @@ void COMXVideo::Reset(void) +@@ -845,7 +836,7 @@ void COMXVideo::Reset(void) } /////////////////////////////////////////////////////////////////////////////////////////// @@ -3233,7 +2898,7 @@ index ca40a37..bb4d572 100644 { CSingleLock lock (m_critSection); if(!m_is_open) -@@ -865,7 +856,7 @@ void COMXVideo::SetVideoRect(const CRect& SrcRect, const CRect& DestRect, RENDER +@@ -855,7 +846,7 @@ void COMXVideo::SetVideoRect(const CRect& SrcRect, const CRect& DestRect, RENDER OMX_INIT_STRUCTURE(configDisplay); configDisplay.nPortIndex = m_omx_render.GetInputPort(); @@ -3242,7 +2907,7 @@ index ca40a37..bb4d572 100644 configDisplay.dest_rect.x_offset = lrintf(DestRect.x1); configDisplay.dest_rect.y_offset = lrintf(DestRect.y1); configDisplay.dest_rect.width = lrintf(DestRect.Width()); -@@ -878,23 +869,24 @@ void COMXVideo::SetVideoRect(const CRect& SrcRect, const CRect& DestRect, RENDER +@@ -868,23 +859,24 @@ void COMXVideo::SetVideoRect(const CRect& SrcRect, const CRect& DestRect, RENDER configDisplay.fullscreen = OMX_FALSE; configDisplay.noaspect = OMX_TRUE; @@ -3279,7 +2944,7 @@ index ca40a37..bb4d572 100644 int COMXVideo::GetInputBufferSize() diff --git a/xbmc/cores/omxplayer/OMXVideo.h b/xbmc/cores/omxplayer/OMXVideo.h -index 9f26427..3ea02dc 100644 +index d0634bb..86e94ce 100644 --- a/xbmc/cores/omxplayer/OMXVideo.h +++ b/xbmc/cores/omxplayer/OMXVideo.h @@ -59,7 +59,7 @@ class COMXVideo @@ -3321,10 +2986,10 @@ index 80c05d2..ae85484 100644 m_width, m_height, dst_rect.width, dst_rect.height, res.fRefreshRate, GETFLAGS_GROUP(res.dwFlags), GETFLAGS_MODE(res.dwFlags), (int)res.dwFlags, res.fPixelRatio); -From 978189928bf88240aa551e48921a6f74b90957f1 Mon Sep 17 00:00:00 2001 +From 1935fc178acf61dacda8f982802e4f326390dba5 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 17 Mar 2015 20:33:54 +0000 -Subject: [PATCH 38/56] alsa: enable-shared is required +Subject: [PATCH 53/61] alsa: enable-shared is required --- tools/depends/target/alsa-lib/Makefile | 2 +- @@ -3344,882 +3009,11 @@ index b03fc19..a04d933 100644 LIBDYLIB=$(PLATFORM)/src/.libs/$(LIBNAME).a -From c906a8a2edab573281ccbd99563c7c05f644d1e2 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Tue, 31 Mar 2015 17:31:47 +0100 -Subject: [PATCH 39/56] [mmalrenderer] Add SetCodecControl function and prefer - to return pictures when renderer is low (disabled) ---- - xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.cpp | 5 +++++ - xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.h | 1 + - xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 12 ++++++++++++ - xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h | 2 ++ - 4 files changed, 20 insertions(+) - -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.cpp -index 262283d..ee7d6f2 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.cpp -@@ -96,6 +96,11 @@ bool CDVDVideoCodecMMAL::GetCodecStats(double &pts, int &droppedPics) - return m_decoder->GetCodecStats(pts, droppedPics); - } - -+void CDVDVideoCodecMMAL::SetCodecControl(int flags) -+{ -+ m_decoder->SetCodecControl(flags); -+} -+ - void CDVDVideoCodecMMAL::SetSpeed(int iSpeed) - { - m_decoder->SetSpeed(iSpeed); -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.h -index a768e70..aa8e87f 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.h -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.h -@@ -42,6 +42,7 @@ class CDVDVideoCodecMMAL : public CDVDVideoCodec - virtual void SetDropState(bool bDrop); - virtual const char* GetName(void); - virtual bool GetCodecStats(double &pts, int &droppedPics); -+ virtual void SetCodecControl(int flags); - virtual void SetSpeed(int iSpeed); - - protected: -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -index df282f3..6eb7f7c 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -@@ -128,6 +128,7 @@ CMMALVideo::CMMALVideo() - m_es_format = mmal_format_alloc(); - m_preroll = true; - m_speed = DVD_PLAYSPEED_NORMAL; -+ m_codecControlFlags = 0; - } - - CMMALVideo::~CMMALVideo() -@@ -939,6 +940,9 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) - CLog::Log(LOGDEBUG, "%s::%s - got output picture:%d", CLASSNAME, __func__, m_output_ready.size()); - ret |= VC_PICTURE; -+ // renderer is low - give priority to returning pictures -+ if (0 && m_codecControlFlags & DVD_CODEC_CTRL_DRAIN) -+ ret &= ~VC_BUFFER; - } - if (!ret) - { -@@ -990,6 +994,7 @@ void CMMALVideo::Reset(void) - m_startframe = false; - m_decoderPts = DVD_NOPTS_VALUE; - m_preroll = !m_hints.stills && (m_speed == DVD_PLAYSPEED_NORMAL || m_speed == DVD_PLAYSPEED_PAUSE); -+ m_codecControlFlags = 0; - } - - void CMMALVideo::SetSpeed(int iSpeed) -@@ -1123,3 +1128,10 @@ bool CMMALVideo::GetCodecStats(double &pts, int &droppedPics) - // CLog::Log(LOGDEBUG, "%s::%s - pts:%.0f droppedPics:%d", CLASSNAME, __func__, pts, droppedPics); - return true; - } -+ -+void CMMALVideo::SetCodecControl(int flags) -+{ -+ m_codecControlFlags = flags; -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ CLog::Log(LOGDEBUG, "%s::%s flags:%x", CLASSNAME, __func__, flags); -+} -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -index 4c9b20f..c405aa1 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -@@ -89,6 +89,7 @@ class CMMALVideo - virtual void SetDropState(bool bDrop); - virtual const char* GetName(void) { return (const char*)m_pFormatName; } - virtual bool GetCodecStats(double &pts, int &droppedPics); -+ virtual void SetCodecControl(int flags); - virtual void SetSpeed(int iSpeed); - - // MMAL decoder callback routines. -@@ -140,6 +141,7 @@ class CMMALVideo - unsigned int m_droppedPics; - int m_speed; - bool m_preroll; -+ int m_codecControlFlags; - - MMAL_COMPONENT_T *m_dec; - MMAL_PORT_T *m_dec_input; - -From 84bcf7c0aa9499fde22571ce993b520053a4353e Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Wed, 1 Apr 2015 16:31:37 +0100 -Subject: [PATCH 40/56] [mmalcodec] Limit submitted video frames. Seems to - avoid stutter issues with low bitrate videos - ---- - xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -index 6eb7f7c..24ddc3b 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -@@ -923,7 +923,8 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) - break; - } - int ret = 0; -- if (mmal_queue_length(m_dec_input_pool->queue) > 0 && !m_demux_queue_length) -+ int fps = m_hints.fpsrate && m_hints.fpsscale ? (float)m_hints.fpsrate / (float)m_hints.fpsscale : 25; -+ if (mmal_queue_length(m_dec_input_pool->queue) > 0 && !m_demux_queue_length && m_dts_queue.size() <= fps/2) - { - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) - CLog::Log(LOGDEBUG, "%s::%s - got space for output: demux_queue(%d) space(%d)", CLASSNAME, __func__, m_demux_queue_length, mmal_queue_length(m_dec_input_pool->queue) * m_dec_input->buffer_size); - -From 01e34be063309eb5cc05984a90be0eeb27e18f83 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Mon, 6 Apr 2015 19:06:26 +0100 -Subject: [PATCH 41/56] [mmalcodec] Remove the decoder queue and use gpu - timestamps - -There are too many streams that don't have a 1:1 mapping of encoded video frames to decoded pictures. -If that isn't true, the dts queues gets out of sync with the real frames. - -Interlaces streams and streams with errors cause issues. - -Instead remove the dts queue and use the gpu's timestamps. ---- - xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 88 +++++++++++----------- - xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h | 2 +- - 2 files changed, 46 insertions(+), 44 deletions(-) - -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -index 24ddc3b..4bdca80 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -@@ -129,6 +129,7 @@ CMMALVideo::CMMALVideo() - m_preroll = true; - m_speed = DVD_PLAYSPEED_NORMAL; - m_codecControlFlags = 0; -+ m_history_valid_pts = 0; - } - - CMMALVideo::~CMMALVideo() -@@ -258,27 +259,7 @@ void CMMALVideo::dec_output_port_cb(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buf - { - assert(!(buffer->flags & MMAL_BUFFER_HEADER_FLAG_DECODEONLY)); - double dts = DVD_NOPTS_VALUE; -- if (buffer->flags & MMAL_BUFFER_HEADER_FLAG_USER0) -- { -- pthread_mutex_lock(&m_output_mutex); -- if (!m_dts_queue.empty()) -- { -- dts = m_dts_queue.front(); -- m_dts_queue.pop(); -- } -- else assert(0); -- pthread_mutex_unlock(&m_output_mutex); -- } -- -- if (m_drop_state) -- { -- pthread_mutex_lock(&m_output_mutex); -- m_droppedPics++; -- pthread_mutex_unlock(&m_output_mutex); -- if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -- CLog::Log(LOGDEBUG, "%s::%s - dropping %p (drop:%d)", CLASSNAME, __func__, buffer, m_drop_state); -- } -- else -+ if (!m_drop_state) // && !(g_advancedSettings.m_omxDecodeStartWithValidFrame && (buffer->flags & MMAL_BUFFER_HEADER_FLAG_CORRUPTED))) - { - CMMALVideoBuffer *omvb = new CMMALVideoBuffer(this); - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -@@ -297,6 +278,14 @@ void CMMALVideo::dec_output_port_cb(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buf - pthread_mutex_unlock(&m_output_mutex); - kept = true; - } -+ else -+ { -+ pthread_mutex_lock(&m_output_mutex); -+ m_droppedPics++; -+ pthread_mutex_unlock(&m_output_mutex); -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ CLog::Log(LOGDEBUG, "%s::%s - dropping %p dts:%.3f pts:%.3f (drop:%d len:%d flags:%x)", CLASSNAME, __func__, buffer, dts*1e-6, buffer->pts*1e-6, m_drop_state, buffer->length, buffer->flags); -+ } - } - } - else if (buffer->cmd == MMAL_EVENT_FORMAT_CHANGED) -@@ -648,6 +637,10 @@ bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options, MMALVide - if (status != MMAL_SUCCESS) - CLog::Log(LOGERROR, "%s::%s Failed to enable extra buffers on %s (status=%x %s)", CLASSNAME, __func__, m_dec_input->name, status, mmal_status_to_string(status)); - -+ status = mmal_port_parameter_set_uint32(m_dec_input, MMAL_PARAMETER_VIDEO_TIMESTAMP_FIFO, 1); -+ if (status != MMAL_SUCCESS) -+ CLog::Log(LOGERROR, "%s::%s Failed to enable timestamp fifo mode on %s (status=%x %s)", CLASSNAME, __func__, m_dec_input->name, status, mmal_status_to_string(status)); -+ - status = mmal_port_format_commit(m_dec_input); - if (status != MMAL_SUCCESS) - { -@@ -716,6 +709,8 @@ bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options, MMALVide - m_startframe = false; - m_preroll = !m_hints.stills; - m_speed = DVD_PLAYSPEED_NORMAL; -+ // start from assuming all recent frames had valid pts -+ m_history_valid_pts = ~0; - - return true; - } -@@ -731,10 +726,9 @@ void CMMALVideo::Dispose() - done = true; - pthread_mutex_unlock(&m_output_mutex); - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -- CLog::Log(LOGDEBUG, "%s::%s dts_queue(%d) ready_queue(%d) busy_queue(%d) done:%d", CLASSNAME, __func__, m_dts_queue.size(), m_output_ready.size(), m_output_busy, done); -+ CLog::Log(LOGDEBUG, "%s::%s ready_queue(%d) busy_queue(%d) done:%d", CLASSNAME, __func__, m_output_ready.size(), m_output_busy, done); - if (done) - { -- assert(m_dts_queue.empty()); - m_myself.reset(); - } - } -@@ -767,11 +761,19 @@ void CMMALVideo::SetDropState(bool bDrop) - } - } - -+static unsigned count_bits(int32_t value) -+{ -+ unsigned bits = 0; -+ for(;value;++bits) -+ value &= value - 1; -+ return bits; -+} -+ - int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) - { - //if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -- // CLog::Log(LOGDEBUG, "%s::%s - %-8p %-6d dts:%.3f pts:%.3f dts_queue(%d) ready_queue(%d) busy_queue(%d)", -- // CLASSNAME, __func__, pData, iSize, dts == DVD_NOPTS_VALUE ? 0.0 : dts*1e-6, pts == DVD_NOPTS_VALUE ? 0.0 : pts*1e-6, m_dts_queue.size(), m_output_ready.size(), m_output_busy); -+ // CLog::Log(LOGDEBUG, "%s::%s - %-8p %-6d dts:%.3f pts:%.3f ready_queue(%d) busy_queue(%d)", -+ // CLASSNAME, __func__, pData, iSize, dts == DVD_NOPTS_VALUE ? 0.0 : dts*1e-6, pts == DVD_NOPTS_VALUE ? 0.0 : pts*1e-6, m_output_ready.size(), m_output_busy); - - unsigned int demuxer_bytes = 0; - uint8_t *demuxer_content = NULL; -@@ -835,6 +837,13 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) - return VC_ERROR; - } - -+ // some packed bitstream AVI files set almost all pts values to DVD_NOPTS_VALUE, but have a scattering of real pts values. -+ // the valid pts values match the dts values. -+ // if a stream has had more than 4 valid pts values in the last 16, the use UNKNOWN, otherwise use dts -+ m_history_valid_pts = (m_history_valid_pts << 1) | (pts != DVD_NOPTS_VALUE); -+ if (count_bits(m_history_valid_pts & 0xffff) < 4) -+ pts = dts; -+ - mmal_buffer_header_reset(buffer); - buffer->cmd = 0; - if (!m_startframe && pts == DVD_NOPTS_VALUE) -@@ -857,8 +866,8 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) - buffer->flags |= MMAL_BUFFER_HEADER_FLAG_FRAME_END; - - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -- CLog::Log(LOGDEBUG, "%s::%s - %-8p %-6d/%-6d dts:%.3f pts:%.3f flags:%x dts_queue(%d) ready_queue(%d) busy_queue(%d) demux_queue(%d) space(%d)", -- CLASSNAME, __func__, buffer, buffer->length, demuxer_bytes, dts == DVD_NOPTS_VALUE ? 0.0 : dts*1e-6, pts == DVD_NOPTS_VALUE ? 0.0 : pts*1e-6, buffer->flags, m_dts_queue.size(), m_output_ready.size(), m_output_busy, m_demux_queue_length, mmal_queue_length(m_dec_input_pool->queue) * m_dec_input->buffer_size); -+ CLog::Log(LOGDEBUG, "%s::%s - %-8p %-6d/%-6d dts:%.3f pts:%.3f flags:%x ready_queue(%d) busy_queue(%d) demux_queue(%d) space(%d)", -+ CLASSNAME, __func__, buffer, buffer->length, demuxer_bytes, dts == DVD_NOPTS_VALUE ? 0.0 : dts*1e-6, pts == DVD_NOPTS_VALUE ? 0.0 : pts*1e-6, buffer->flags, m_output_ready.size(), m_output_busy, m_demux_queue_length, mmal_queue_length(m_dec_input_pool->queue) * m_dec_input->buffer_size); - assert((int)buffer->length > 0); - status = mmal_port_send_buffer(m_dec_input, buffer); - if (status != MMAL_SUCCESS) -@@ -875,12 +884,6 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) - { - m_droppedPics += m_deint ? 2:1; - } -- else -- { -- // only push if we are successful with feeding mmal -- m_dts_queue.push(dts); -- assert(m_dts_queue.size() < 5000); -- } - pthread_mutex_unlock(&m_output_mutex); - if (m_changed_count_dec != m_changed_count) - { -@@ -923,11 +926,11 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) - break; - } - int ret = 0; -- int fps = m_hints.fpsrate && m_hints.fpsscale ? (float)m_hints.fpsrate / (float)m_hints.fpsscale : 25; -- if (mmal_queue_length(m_dec_input_pool->queue) > 0 && !m_demux_queue_length && m_dts_queue.size() <= fps/2) -+ double queued = m_decoderPts != DVD_NOPTS_VALUE && pts != DVD_NOPTS_VALUE ? pts - m_decoderPts : 0.0; -+ if (mmal_queue_length(m_dec_input_pool->queue) > 0 && !m_demux_queue_length && queued <= DVD_MSEC_TO_TIME(500)) - { - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -- CLog::Log(LOGDEBUG, "%s::%s - got space for output: demux_queue(%d) space(%d)", CLASSNAME, __func__, m_demux_queue_length, mmal_queue_length(m_dec_input_pool->queue) * m_dec_input->buffer_size); -+ CLog::Log(LOGDEBUG, "%s::%s - got space for output: demux_queue(%d) space(%d) queued(%.2f)", CLASSNAME, __func__, m_demux_queue_length, mmal_queue_length(m_dec_input_pool->queue) * m_dec_input->buffer_size, queued*1e-6); - ret |= VC_BUFFER; - } - else -@@ -948,8 +951,8 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) - if (!ret) - { - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -- CLog::Log(LOGDEBUG, "%s::%s - Nothing to do: dts_queue(%d) ready_queue(%d) busy_queue(%d) demux_queue(%d) space(%d) preroll(%d)", -- CLASSNAME, __func__, m_dts_queue.size(), m_output_ready.size(), m_output_busy, m_demux_queue_length, mmal_queue_length(m_dec_input_pool->queue) * m_dec_input->buffer_size, m_preroll); -+ CLog::Log(LOGDEBUG, "%s::%s - Nothing to do: ready_queue(%d) busy_queue(%d) demux_queue(%d) space(%d) preroll(%d)", -+ CLASSNAME, __func__, m_output_ready.size(), m_output_busy, m_demux_queue_length, mmal_queue_length(m_dec_input_pool->queue) * m_dec_input->buffer_size, m_preroll); - Sleep(10); // otherwise we busy spin - } - return ret; -@@ -979,8 +982,6 @@ void CMMALVideo::Reset(void) - bool old_drop_state = m_drop_state; - SetDropState(true); - pthread_mutex_lock(&m_output_mutex); -- while(!m_dts_queue.empty()) -- m_dts_queue.pop(); - while (!m_demux_queue.empty()) - m_demux_queue.pop(); - m_demux_queue_length = 0; -@@ -996,6 +997,7 @@ void CMMALVideo::Reset(void) - m_decoderPts = DVD_NOPTS_VALUE; - m_preroll = !m_hints.stills && (m_speed == DVD_PLAYSPEED_NORMAL || m_speed == DVD_PLAYSPEED_PAUSE); - m_codecControlFlags = 0; -+ m_history_valid_pts = ~0; - } - - void CMMALVideo::SetSpeed(int iSpeed) -@@ -1015,8 +1017,8 @@ void CMMALVideo::Recycle(MMAL_BUFFER_HEADER_T *buffer) - mmal_buffer_header_reset(buffer); - buffer->cmd = 0; - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -- CLog::Log(LOGDEBUG, "%s::%s Send buffer %p from pool to decoder output port %p dts_queue(%d) ready_queue(%d) busy_queue(%d)", CLASSNAME, __func__, buffer, m_dec_output, -- m_dts_queue.size(), m_output_ready.size(), m_output_busy); -+ CLog::Log(LOGDEBUG, "%s::%s Send buffer %p from pool to decoder output port %p ready_queue(%d) busy_queue(%d)", CLASSNAME, __func__, buffer, m_dec_output, -+ m_output_ready.size(), m_output_busy); - status = mmal_port_send_buffer(m_dec_output, buffer); - if (status != MMAL_SUCCESS) - { -@@ -1043,7 +1045,7 @@ void CMMALVideo::ReleaseBuffer(CMMALVideoBuffer *buffer) - if (done) - m_myself.reset(); - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -- CLog::Log(LOGDEBUG, "%s::%s %p (%p) dts_queue(%d) ready_queue(%d) busy_queue(%d) done:%d", CLASSNAME, __func__, buffer, buffer->mmal_buffer, m_dts_queue.size(), m_output_ready.size(), m_output_busy, done); -+ CLog::Log(LOGDEBUG, "%s::%s %p (%p) ready_queue(%d) busy_queue(%d) done:%d", CLASSNAME, __func__, buffer, buffer->mmal_buffer, m_output_ready.size(), m_output_busy, done); - delete buffer; - } - -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -index c405aa1..f5f664a 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -@@ -118,7 +118,6 @@ class CMMALVideo - const char *m_pFormatName; - MMALVideoPtr m_myself; - -- std::queue m_dts_queue; - std::queue m_demux_queue; - unsigned m_demux_queue_length; - -@@ -142,6 +141,7 @@ class CMMALVideo - int m_speed; - bool m_preroll; - int m_codecControlFlags; -+ uint32_t m_history_valid_pts; - - MMAL_COMPONENT_T *m_dec; - MMAL_PORT_T *m_dec_input; - -From e5cc4fea13487d975d3ff1f4223932f76445ac33 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Thu, 9 Apr 2015 18:18:09 +0100 -Subject: [PATCH 42/56] [mmalrenderer] Remove dropping logic. It only seems to - make things worse - ---- - xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 76 +++++++--------------- - xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h | 2 - - 2 files changed, 23 insertions(+), 55 deletions(-) - -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -index 4bdca80..ea93e32 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -@@ -97,7 +97,6 @@ CMMALVideo::CMMALVideo() - CLog::Log(LOGDEBUG, "%s::%s %p", CLASSNAME, __func__, this); - pthread_mutex_init(&m_output_mutex, NULL); - -- m_drop_state = false; - m_decoded_width = 0; - m_decoded_height = 0; - -@@ -108,7 +107,6 @@ CMMALVideo::CMMALVideo() - m_interlace_method = VS_INTERLACEMETHOD_NONE; - m_startframe = false; - m_decoderPts = DVD_NOPTS_VALUE; -- m_droppedPics = 0; - - m_dec = NULL; - m_dec_input = NULL; -@@ -259,7 +257,7 @@ void CMMALVideo::dec_output_port_cb(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buf - { - assert(!(buffer->flags & MMAL_BUFFER_HEADER_FLAG_DECODEONLY)); - double dts = DVD_NOPTS_VALUE; -- if (!m_drop_state) // && !(g_advancedSettings.m_omxDecodeStartWithValidFrame && (buffer->flags & MMAL_BUFFER_HEADER_FLAG_CORRUPTED))) -+ if (1)//(!(g_advancedSettings.m_omxDecodeStartWithValidFrame && (buffer->flags & MMAL_BUFFER_HEADER_FLAG_CORRUPTED))) - { - CMMALVideoBuffer *omvb = new CMMALVideoBuffer(this); - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -@@ -280,11 +278,8 @@ void CMMALVideo::dec_output_port_cb(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buf - } - else - { -- pthread_mutex_lock(&m_output_mutex); -- m_droppedPics++; -- pthread_mutex_unlock(&m_output_mutex); - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -- CLog::Log(LOGDEBUG, "%s::%s - dropping %p dts:%.3f pts:%.3f (drop:%d len:%d flags:%x)", CLASSNAME, __func__, buffer, dts*1e-6, buffer->pts*1e-6, m_drop_state, buffer->length, buffer->flags); -+ CLog::Log(LOGDEBUG, "%s::%s - discarding %p dts:%.3f pts:%.3f (len:%d flags:%x)", CLASSNAME, __func__, buffer, dts*1e-6, buffer->pts*1e-6, buffer->length, buffer->flags); - } - } - } -@@ -705,7 +700,6 @@ bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options, MMALVide - if (!SendCodecConfigData()) - return false; - -- m_drop_state = false; - m_startframe = false; - m_preroll = !m_hints.stills; - m_speed = DVD_PLAYSPEED_NORMAL; -@@ -735,30 +729,8 @@ void CMMALVideo::Dispose() - - void CMMALVideo::SetDropState(bool bDrop) - { -- if (m_drop_state != bDrop) -- if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -- CLog::Log(LOGDEBUG, "%s::%s - m_drop_state(%d)", CLASSNAME, __func__, bDrop); -- m_drop_state = bDrop; -- if (m_drop_state) -- { -- while (1) -- { -- CMMALVideoBuffer *buffer = NULL; -- pthread_mutex_lock(&m_output_mutex); -- // fetch a output buffer and pop it off the ready list -- if (!m_output_ready.empty()) -- { -- buffer = m_output_ready.front(); -- m_output_ready.pop(); -- m_droppedPics++; -- } -- pthread_mutex_unlock(&m_output_mutex); -- if (buffer) -- ReleaseBuffer(buffer); -- else -- break; -- } -- } -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ CLog::Log(LOGDEBUG, "%s::%s - bDrop(%d)", CLASSNAME, __func__, bDrop); - } - - static unsigned count_bits(int32_t value) -@@ -854,10 +826,6 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) - // set a flag so we can identify primary frames from generated frames (deinterlace) - buffer->flags = MMAL_BUFFER_HEADER_FLAG_USER0; - -- // Request decode only (maintain ref frames, but don't return a picture) -- if (m_drop_state) -- buffer->flags |= MMAL_BUFFER_HEADER_FLAG_DECODEONLY; -- - memcpy(buffer->data, demuxer_content, buffer->length); - demuxer_bytes -= buffer->length; - demuxer_content += buffer->length; -@@ -880,10 +848,6 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) - { - pthread_mutex_lock(&m_output_mutex); - m_startframe = true; -- if (m_drop_state) -- { -- m_droppedPics += m_deint ? 2:1; -- } - pthread_mutex_unlock(&m_output_mutex); - if (m_changed_count_dec != m_changed_count) - { -@@ -979,16 +943,28 @@ void CMMALVideo::Reset(void) - mmal_port_enable(m_dec_output, dec_output_port_cb_static); - } - // blow all ready video frames -- bool old_drop_state = m_drop_state; -- SetDropState(true); -+ while (1) -+ { -+ CMMALVideoBuffer *buffer = NULL; -+ pthread_mutex_lock(&m_output_mutex); -+ // fetch a output buffer and pop it off the ready list -+ if (!m_output_ready.empty()) -+ { -+ buffer = m_output_ready.front(); -+ m_output_ready.pop(); -+ } -+ pthread_mutex_unlock(&m_output_mutex); -+ if (buffer) -+ ReleaseBuffer(buffer); -+ else -+ break; -+ } -+ - pthread_mutex_lock(&m_output_mutex); - while (!m_demux_queue.empty()) - m_demux_queue.pop(); - m_demux_queue_length = 0; -- m_droppedPics = 0; - pthread_mutex_unlock(&m_output_mutex); -- if (!old_drop_state) -- SetDropState(false); - - if (!m_finished) - SendCodecConfigData(); -@@ -1122,14 +1098,8 @@ bool CMMALVideo::ClearPicture(DVDVideoPicture* pDvdVideoPicture) - - bool CMMALVideo::GetCodecStats(double &pts, int &droppedPics) - { -- pthread_mutex_lock(&m_output_mutex); -- pts = m_decoderPts; -- droppedPics = m_droppedPics; -- m_droppedPics = 0; -- pthread_mutex_unlock(&m_output_mutex); -- //if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -- // CLog::Log(LOGDEBUG, "%s::%s - pts:%.0f droppedPics:%d", CLASSNAME, __func__, pts, droppedPics); -- return true; -+ droppedPics= -1; -+ return false; - } - - void CMMALVideo::SetCodecControl(int flags) -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -index f5f664a..f79fed5 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -@@ -109,7 +109,6 @@ class CMMALVideo - bool DestroyDeinterlace(); - - // Video format -- bool m_drop_state; - int m_decoded_width; - int m_decoded_height; - unsigned int m_egl_buffer_count; -@@ -137,7 +136,6 @@ class CMMALVideo - EINTERLACEMETHOD m_interlace_method; - bool m_startframe; - double m_decoderPts; -- unsigned int m_droppedPics; - int m_speed; - bool m_preroll; - int m_codecControlFlags; - -From ff4c4b5773c669e0b7eb13919e246cbc5c3328fb Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Wed, 8 Apr 2015 12:47:04 +0100 -Subject: [PATCH 43/56] [players] Make use of new scheme to submit DTS - timestamps - -Latest firmware supports marking timestamps as DTS, -and it will reorder the timestamps with the decoded frame - -This avoids some of the current hacks of supporting PTS and DTS -timestamps in a single field. ---- - xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 35 +++++----------------- - xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h | 2 -- - xbmc/cores/omxplayer/OMXPlayerVideo.cpp | 28 ++++++----------- - xbmc/cores/omxplayer/OMXPlayerVideo.h | 1 - - xbmc/cores/omxplayer/OMXVideo.cpp | 25 ++++------------ - xbmc/cores/omxplayer/OMXVideo.h | 2 +- - 6 files changed, 23 insertions(+), 70 deletions(-) - -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -index ea93e32..ea85f25 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -@@ -57,7 +57,6 @@ CMMALVideoBuffer::CMMALVideoBuffer(CMMALVideo *omv) - height = 0; - m_aspect_ratio = 0.0f; - m_changed_count = 0; -- dts = DVD_NOPTS_VALUE; - } - - CMMALVideoBuffer::~CMMALVideoBuffer() -@@ -127,7 +126,6 @@ CMMALVideo::CMMALVideo() - m_preroll = true; - m_speed = DVD_PLAYSPEED_NORMAL; - m_codecControlFlags = 0; -- m_history_valid_pts = 0; - } - - CMMALVideo::~CMMALVideo() -@@ -256,17 +254,15 @@ void CMMALVideo::dec_output_port_cb(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buf - if (buffer->length > 0) - { - assert(!(buffer->flags & MMAL_BUFFER_HEADER_FLAG_DECODEONLY)); -- double dts = DVD_NOPTS_VALUE; - if (1)//(!(g_advancedSettings.m_omxDecodeStartWithValidFrame && (buffer->flags & MMAL_BUFFER_HEADER_FLAG_CORRUPTED))) - { - CMMALVideoBuffer *omvb = new CMMALVideoBuffer(this); - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) - CLog::Log(LOGDEBUG, "%s::%s - %p (%p) buffer_size(%u) dts:%.3f pts:%.3f flags:%x:%x frame:%d", -- CLASSNAME, __func__, buffer, omvb, buffer->length, dts*1e-6, buffer->pts*1e-6, buffer->flags, buffer->type->video.flags, omvb->m_changed_count); -+ CLASSNAME, __func__, buffer, omvb, buffer->length, buffer->dts*1e-6, buffer->pts*1e-6, buffer->flags, buffer->type->video.flags, omvb->m_changed_count); - omvb->mmal_buffer = buffer; - buffer->user_data = (void *)omvb; - omvb->m_changed_count = m_changed_count; -- omvb->dts = dts; - omvb->width = m_decoded_width; - omvb->height = m_decoded_height; - omvb->m_aspect_ratio = m_aspect_ratio; -@@ -279,7 +275,7 @@ void CMMALVideo::dec_output_port_cb(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buf - else - { - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -- CLog::Log(LOGDEBUG, "%s::%s - discarding %p dts:%.3f pts:%.3f (len:%d flags:%x)", CLASSNAME, __func__, buffer, dts*1e-6, buffer->pts*1e-6, buffer->length, buffer->flags); -+ CLog::Log(LOGDEBUG, "%s::%s - dropping %p dts:%.3f pts:%.3f (len:%d flags:%x)", CLASSNAME, __func__, buffer, buffer->dts*1e-6, buffer->pts*1e-6, buffer->length, buffer->flags); - } - } - } -@@ -632,7 +628,11 @@ bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options, MMALVide - if (status != MMAL_SUCCESS) - CLog::Log(LOGERROR, "%s::%s Failed to enable extra buffers on %s (status=%x %s)", CLASSNAME, __func__, m_dec_input->name, status, mmal_status_to_string(status)); - -- status = mmal_port_parameter_set_uint32(m_dec_input, MMAL_PARAMETER_VIDEO_TIMESTAMP_FIFO, 1); -+ status = mmal_port_parameter_set_uint32(m_dec_input, MMAL_PARAMETER_VIDEO_TIMESTAMP_FIFO, 0); -+ if (status != MMAL_SUCCESS) -+ CLog::Log(LOGERROR, "%s::%s Failed to enable timestamp fifo mode on %s (status=%x %s)", CLASSNAME, __func__, m_dec_input->name, status, mmal_status_to_string(status)); -+ -+ status = mmal_port_parameter_set_uint32(m_dec_input, MMAL_PARAMETER_VIDEO_INTERPOLATE_TIMESTAMPS, 0); - if (status != MMAL_SUCCESS) - CLog::Log(LOGERROR, "%s::%s Failed to enable timestamp fifo mode on %s (status=%x %s)", CLASSNAME, __func__, m_dec_input->name, status, mmal_status_to_string(status)); - -@@ -703,8 +703,6 @@ bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options, MMALVide - m_startframe = false; - m_preroll = !m_hints.stills; - m_speed = DVD_PLAYSPEED_NORMAL; -- // start from assuming all recent frames had valid pts -- m_history_valid_pts = ~0; - - return true; - } -@@ -733,14 +731,6 @@ void CMMALVideo::SetDropState(bool bDrop) - CLog::Log(LOGDEBUG, "%s::%s - bDrop(%d)", CLASSNAME, __func__, bDrop); - } - --static unsigned count_bits(int32_t value) --{ -- unsigned bits = 0; -- for(;value;++bits) -- value &= value - 1; -- return bits; --} -- - int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) - { - //if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -@@ -808,14 +798,6 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) - CLog::Log(LOGERROR, "%s::%s - mmal_queue_get failed", CLASSNAME, __func__); - return VC_ERROR; - } -- -- // some packed bitstream AVI files set almost all pts values to DVD_NOPTS_VALUE, but have a scattering of real pts values. -- // the valid pts values match the dts values. -- // if a stream has had more than 4 valid pts values in the last 16, the use UNKNOWN, otherwise use dts -- m_history_valid_pts = (m_history_valid_pts << 1) | (pts != DVD_NOPTS_VALUE); -- if (count_bits(m_history_valid_pts & 0xffff) < 4) -- pts = dts; -- - mmal_buffer_header_reset(buffer); - buffer->cmd = 0; - if (!m_startframe && pts == DVD_NOPTS_VALUE) -@@ -973,7 +955,6 @@ void CMMALVideo::Reset(void) - m_decoderPts = DVD_NOPTS_VALUE; - m_preroll = !m_hints.stills && (m_speed == DVD_PLAYSPEED_NORMAL || m_speed == DVD_PLAYSPEED_PAUSE); - m_codecControlFlags = 0; -- m_history_valid_pts = ~0; - } - - void CMMALVideo::SetSpeed(int iSpeed) -@@ -1059,7 +1040,7 @@ bool CMMALVideo::GetPicture(DVDVideoPicture* pDvdVideoPicture) - } - - // timestamp is in microseconds -- pDvdVideoPicture->dts = buffer->dts; -+ pDvdVideoPicture->dts = buffer->mmal_buffer->dts == MMAL_TIME_UNKNOWN || buffer->mmal_buffer->dts == 0 ? DVD_NOPTS_VALUE : buffer->mmal_buffer->dts; - pDvdVideoPicture->pts = buffer->mmal_buffer->pts == MMAL_TIME_UNKNOWN || buffer->mmal_buffer->pts == 0 ? DVD_NOPTS_VALUE : buffer->mmal_buffer->pts; - - pDvdVideoPicture->MMALBuffer->Acquire(); -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -index f79fed5..415f3e3 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -@@ -55,7 +55,6 @@ class CMMALVideoBuffer - int width; - int height; - float m_aspect_ratio; -- double dts; - uint32_t m_changed_count; - // reference counting - CMMALVideoBuffer* Acquire(); -@@ -139,7 +138,6 @@ class CMMALVideo - int m_speed; - bool m_preroll; - int m_codecControlFlags; -- uint32_t m_history_valid_pts; - - MMAL_COMPONENT_T *m_dec; - MMAL_PORT_T *m_dec_input; -diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -index f6c6eb0..d953b1c 100644 ---- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -+++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -@@ -105,7 +105,6 @@ OMXPlayerVideo::OMXPlayerVideo(OMXClock *av_clock, - m_iCurrentPts = DVD_NOPTS_VALUE; - m_nextOverlay = DVD_NOPTS_VALUE; - m_flush = false; -- m_history_valid_pts = 0; - } - - OMXPlayerVideo::~OMXPlayerVideo() -@@ -313,14 +312,6 @@ void OMXPlayerVideo::Output(double pts, bool bDropPacket) - g_renderManager.FlipPage(CThread::m_bStop, time/DVD_TIME_BASE); - } - --static unsigned count_bits(int32_t value) --{ -- unsigned bits = 0; -- for(;value;++bits) -- value &= value - 1; -- return bits; --} -- - void OMXPlayerVideo::Process() - { - double frametime = (double)DVD_TIME_BASE / m_fFrameRate; -@@ -495,18 +486,20 @@ void OMXPlayerVideo::Process() - m_stalled = false; - } - -- // some packed bitstream AVI files set almost all pts values to DVD_NOPTS_VALUE, but have a scattering of real pts values. -- // the valid pts values match the dts values. -- // if a stream has had more than 4 valid pts values in the last 16, the use UNKNOWN, otherwise use dts -- m_history_valid_pts = (m_history_valid_pts << 1) | (pPacket->pts != DVD_NOPTS_VALUE); -+ double dts = pPacket->dts; - double pts = pPacket->pts; -- if(count_bits(m_history_valid_pts & 0xffff) < 4) -- pts = pPacket->dts; -+ -+ if (dts != DVD_NOPTS_VALUE) -+ dts += m_iVideoDelay; - - if (pts != DVD_NOPTS_VALUE) - pts += m_iVideoDelay; - -- m_omxVideo.Decode(pPacket->pData, pPacket->iSize, pts); -+ m_omxVideo.Decode(pPacket->pData, pPacket->iSize, dts, pts); -+ -+ if (pts == DVD_NOPTS_VALUE) -+ pts = dts; -+ - Output(pts, bRequestDrop); - if(pts != DVD_NOPTS_VALUE) - m_iCurrentPts = pts; -@@ -582,9 +575,6 @@ bool OMXPlayerVideo::OpenDecoder() - m_codecname = m_omxVideo.GetDecoderName(); - } - -- // start from assuming all recent frames had valid pts -- m_history_valid_pts = ~0; -- - return bVideoDecoderOpen; - } - -diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.h b/xbmc/cores/omxplayer/OMXPlayerVideo.h -index 2748a41..3bd5625 100644 ---- a/xbmc/cores/omxplayer/OMXPlayerVideo.h -+++ b/xbmc/cores/omxplayer/OMXPlayerVideo.h -@@ -69,7 +69,6 @@ class OMXPlayerVideo : public CThread, public IDVDStreamPlayerVideo - RENDER_STEREO_MODE m_video_stereo_mode; - RENDER_STEREO_MODE m_display_stereo_mode; - bool m_StereoInvert; -- uint32_t m_history_valid_pts; - DllBcmHost m_DllBcmHost; - - CDVDOverlayContainer *m_pOverlayContainer; -diff --git a/xbmc/cores/omxplayer/OMXVideo.cpp b/xbmc/cores/omxplayer/OMXVideo.cpp -index bb4d572..1011b5d 100644 ---- a/xbmc/cores/omxplayer/OMXVideo.cpp -+++ b/xbmc/cores/omxplayer/OMXVideo.cpp -@@ -597,23 +597,6 @@ bool COMXVideo::Open(CDVDStreamInfo &hints, OMXClock *clock, EDEINTERLACEMODE de - return false; - } - -- // broadcom omx entension: -- // When enabled, the timestamp fifo mode will change the way incoming timestamps are associated with output images. -- // In this mode the incoming timestamps get used without re-ordering on output images. -- // recent firmware will actually automatically choose the timestamp stream with the least variance, so always enable -- { -- OMX_CONFIG_BOOLEANTYPE timeStampMode; -- OMX_INIT_STRUCTURE(timeStampMode); -- timeStampMode.bEnabled = OMX_TRUE; -- -- omx_err = m_omx_decoder.SetParameter((OMX_INDEXTYPE)OMX_IndexParamBrcmVideoTimestampFifo, &timeStampMode); -- if (omx_err != OMX_ErrorNone) -- { -- CLog::Log(LOGERROR, "COMXVideo::Open OMX_IndexParamBrcmVideoTimestampFifo error (0%08x)\n", omx_err); -- return false; -- } -- } -- - if(NaluFormatStartCodes(hints.codec, m_extradata, m_extrasize)) - { - OMX_NALSTREAMFORMATTYPE nalStreamFormat; -@@ -753,7 +736,7 @@ bool COMXVideo::GetPlayerInfo(double &match, double &phase, double &pll) - } - - --int COMXVideo::Decode(uint8_t *pData, int iSize, double pts) -+int COMXVideo::Decode(uint8_t *pData, int iSize, double dts, double pts) - { - CSingleLock lock (m_critSection); - OMX_ERRORTYPE omx_err; -@@ -778,6 +761,7 @@ int COMXVideo::Decode(uint8_t *pData, int iSize, double pts) - - omx_buffer->nFlags = 0; - omx_buffer->nOffset = 0; -+ omx_buffer->nTimeStamp = ToOMXTime((uint64_t)(pts != DVD_NOPTS_VALUE ? pts : dts != DVD_NOPTS_VALUE ? dts : 0)); - - if(m_setStartTime) - { -@@ -785,10 +769,11 @@ int COMXVideo::Decode(uint8_t *pData, int iSize, double pts) - CLog::Log(LOGDEBUG, "OMXVideo::Decode VDec : setStartTime %f\n", (pts == DVD_NOPTS_VALUE ? 0.0 : pts) / DVD_TIME_BASE); - m_setStartTime = false; - } -- if(pts == DVD_NOPTS_VALUE) -+ else if (pts == DVD_NOPTS_VALUE && dts == DVD_NOPTS_VALUE) - omx_buffer->nFlags |= OMX_BUFFERFLAG_TIME_UNKNOWN; -+ else if (pts == DVD_NOPTS_VALUE) -+ omx_buffer->nFlags |= OMX_BUFFERFLAG_TIME_IS_DTS; - -- omx_buffer->nTimeStamp = ToOMXTime((uint64_t)(pts == DVD_NOPTS_VALUE) ? 0 : pts); - omx_buffer->nFilledLen = std::min((OMX_U32)demuxer_bytes, omx_buffer->nAllocLen); - memcpy(omx_buffer->pBuffer, demuxer_content, omx_buffer->nFilledLen); - -diff --git a/xbmc/cores/omxplayer/OMXVideo.h b/xbmc/cores/omxplayer/OMXVideo.h -index 3ea02dc..86e94ce 100644 ---- a/xbmc/cores/omxplayer/OMXVideo.h -+++ b/xbmc/cores/omxplayer/OMXVideo.h -@@ -55,7 +55,7 @@ class COMXVideo - void Close(void); - unsigned int GetFreeSpace(); - unsigned int GetSize(); -- int Decode(uint8_t *pData, int iSize, double pts); -+ int Decode(uint8_t *pData, int iSize, double dts, double pts); - void Reset(void); - void SetDropState(bool bDrop); - std::string GetDecoderName() { return m_video_codec_name; }; - -From 8806ac18c5c1d43fef3357f5a15bd960f493cd51 Mon Sep 17 00:00:00 2001 +From 1d7052cf03293af8a4247348ae72b8ca07731a9f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 14 Apr 2015 20:51:14 +0100 -Subject: [PATCH 44/56] [gui] Also limit GUI updates when in non full-screen +Subject: [PATCH 56/61] [gui] Also limit GUI updates when in non full-screen video mode --- @@ -4227,7 +3021,7 @@ Subject: [PATCH 44/56] [gui] Also limit GUI updates when in non full-screen 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp -index 1141d7b..832b22d 100644 +index 9c6496b..01a711e 100644 --- a/xbmc/Application.cpp +++ b/xbmc/Application.cpp @@ -2495,7 +2495,7 @@ void CApplication::FrameMove(bool processEvents, bool processGUI) @@ -4249,1656 +3043,10 @@ index 1141d7b..832b22d 100644 g_windowManager.FrameMove(); } -From a9d65318b7758e3afcb8841999bc98e15117afeb Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Wed, 15 Apr 2015 22:57:45 +0100 -Subject: [PATCH 45/56] [mmalcodec] Return mmal buffers explicitly - ---- - xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 29 ++++++++++++++-------- - xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h | 1 + - 2 files changed, 20 insertions(+), 10 deletions(-) - -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -index ea85f25..5bdf145 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -@@ -133,7 +133,6 @@ CMMALVideo::~CMMALVideo() - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) - CLog::Log(LOGDEBUG, "%s::%s %p", CLASSNAME, __func__, this); - assert(m_finished); -- Reset(); - - pthread_mutex_destroy(&m_output_mutex); - -@@ -413,7 +412,7 @@ bool CMMALVideo::CreateDeinterlace(EINTERLACEMETHOD interlace_method) - - m_dec_output = m_deint->output[0]; - m_interlace_method = interlace_method; -- -+ Prime(); - return true; - } - -@@ -469,6 +468,7 @@ bool CMMALVideo::DestroyDeinterlace() - - m_dec_output = m_dec->output[0]; - m_interlace_method = VS_INTERLACEMETHOD_NONE; -+ Prime(); - return true; - } - -@@ -700,6 +700,7 @@ bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options, MMALVide - if (!SendCodecConfigData()) - return false; - -+ Prime(); - m_startframe = false; - m_preroll = !m_hints.stills; - m_speed = DVD_PLAYSPEED_NORMAL; -@@ -742,8 +743,6 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) - MMAL_BUFFER_HEADER_T *buffer; - MMAL_STATUS_T status; - -- while (buffer = mmal_queue_get(m_dec_output_pool->queue), buffer) -- Recycle(buffer); - // we need to queue then de-queue the demux packet, seems silly but - // mmal might not have an input buffer available when we are called - // and we must store the demuxer packet and try again later. -@@ -770,9 +769,6 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) - - while (1) - { -- while (buffer = mmal_queue_get(m_dec_output_pool->queue), buffer) -- Recycle(buffer); -- - space = mmal_queue_length(m_dec_input_pool->queue) * m_dec_input->buffer_size; - if (!demuxer_bytes && !m_demux_queue.empty()) - { -@@ -864,8 +860,6 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) - demuxer_content = NULL; - continue; - } -- while (buffer = mmal_queue_get(m_dec_output_pool->queue), buffer) -- Recycle(buffer); - } - } - if (!demuxer_bytes) -@@ -904,6 +898,13 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) - return ret; - } - -+void CMMALVideo::Prime() -+{ -+ MMAL_BUFFER_HEADER_T *buffer; -+ while (buffer = mmal_queue_get(m_dec_output_pool->queue), buffer) -+ Recycle(buffer); -+} -+ - void CMMALVideo::Reset(void) - { - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -@@ -949,8 +950,10 @@ void CMMALVideo::Reset(void) - pthread_mutex_unlock(&m_output_mutex); - - if (!m_finished) -+ { - SendCodecConfigData(); -- -+ Prime(); -+ } - m_startframe = false; - m_decoderPts = DVD_NOPTS_VALUE; - m_preroll = !m_hints.stills && (m_speed == DVD_PLAYSPEED_NORMAL || m_speed == DVD_PLAYSPEED_PAUSE); -@@ -970,6 +973,12 @@ void CMMALVideo::Recycle(MMAL_BUFFER_HEADER_T *buffer) - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) - CLog::Log(LOGDEBUG, "%s::%s %p", CLASSNAME, __func__, buffer); - -+ if (m_finished) -+ { -+ mmal_buffer_header_release(buffer); -+ return; -+ } -+ - MMAL_STATUS_T status; - mmal_buffer_header_reset(buffer); - buffer->cmd = 0; -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -index 415f3e3..011ae04 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -@@ -106,6 +106,7 @@ class CMMALVideo - void QueryCodec(void); - bool CreateDeinterlace(EINTERLACEMETHOD interlace_method); - bool DestroyDeinterlace(); -+ void Prime(); - - // Video format - int m_decoded_width; - -From 990f8994f15059962b6470b9ebf6469a3698b25b Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Wed, 15 Apr 2015 23:26:47 +0100 -Subject: [PATCH 46/56] [mmalcodec] Handle resolution change from callback - ---- - xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 26 +++++----------------- - xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h | 3 --- - 2 files changed, 6 insertions(+), 23 deletions(-) - -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -index 5bdf145..f20eac7 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -@@ -56,7 +56,6 @@ CMMALVideoBuffer::CMMALVideoBuffer(CMMALVideo *omv) - width = 0; - height = 0; - m_aspect_ratio = 0.0f; -- m_changed_count = 0; - } - - CMMALVideoBuffer::~CMMALVideoBuffer() -@@ -118,8 +117,6 @@ CMMALVideo::CMMALVideo() - - m_codingType = 0; - -- m_changed_count = 0; -- m_changed_count_dec = 0; - m_output_busy = 0; - m_demux_queue_length = 0; - m_es_format = mmal_format_alloc(); -@@ -183,7 +180,6 @@ void CMMALVideo::PortSettingsChanged(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *bu - { - MMAL_EVENT_FORMAT_CHANGED_T *fmt = mmal_event_format_changed_get(buffer); - mmal_format_copy(m_es_format, fmt->format); -- m_changed_count++; - - if (m_es_format->es->video.crop.width && m_es_format->es->video.crop.height) - { -@@ -192,10 +188,13 @@ void CMMALVideo::PortSettingsChanged(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *bu - m_decoded_width = m_es_format->es->video.crop.width; - m_decoded_height = m_es_format->es->video.crop.height; - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -- CLog::Log(LOGDEBUG, "%s::%s format changed: %dx%d %.2f frame:%d", CLASSNAME, __func__, m_decoded_width, m_decoded_height, m_aspect_ratio, m_changed_count); -+ CLog::Log(LOGDEBUG, "%s::%s format changed: %dx%d %.2f", CLASSNAME, __func__, m_decoded_width, m_decoded_height, m_aspect_ratio); - } - else - CLog::Log(LOGERROR, "%s::%s format changed: Unexpected %dx%d", CLASSNAME, __func__, m_es_format->es->video.crop.width, m_es_format->es->video.crop.height); -+ -+ if (!change_dec_output_format()) -+ CLog::Log(LOGERROR, "%s::%s - change_dec_output_format() failed", CLASSNAME, __func__); - } - - void CMMALVideo::dec_control_port_cb(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buffer) -@@ -257,11 +256,10 @@ void CMMALVideo::dec_output_port_cb(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buf - { - CMMALVideoBuffer *omvb = new CMMALVideoBuffer(this); - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -- CLog::Log(LOGDEBUG, "%s::%s - %p (%p) buffer_size(%u) dts:%.3f pts:%.3f flags:%x:%x frame:%d", -- CLASSNAME, __func__, buffer, omvb, buffer->length, buffer->dts*1e-6, buffer->pts*1e-6, buffer->flags, buffer->type->video.flags, omvb->m_changed_count); -+ CLog::Log(LOGDEBUG, "%s::%s - %p (%p) buffer_size(%u) dts:%.3f pts:%.3f flags:%x:%x", -+ CLASSNAME, __func__, buffer, omvb, buffer->length, buffer->dts*1e-6, buffer->pts*1e-6, buffer->flags, buffer->type->video.flags); - omvb->mmal_buffer = buffer; - buffer->user_data = (void *)omvb; -- omvb->m_changed_count = m_changed_count; - omvb->width = m_decoded_width; - omvb->height = m_decoded_height; - omvb->m_aspect_ratio = m_aspect_ratio; -@@ -313,7 +311,6 @@ bool CMMALVideo::change_dec_output_format() - else - CLog::Log(LOGERROR, "%s::%s Failed to query interlace type on %s (status=%x %s)", CLASSNAME, __func__, m_dec_output->name, status, mmal_status_to_string(status)); - -- // todo: if we don't disable/enable we can do this from callback - mmal_format_copy(m_dec_output->format, m_es_format); - status = mmal_port_format_commit(m_dec_output); - if (status != MMAL_SUCCESS) -@@ -827,17 +824,6 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) - pthread_mutex_lock(&m_output_mutex); - m_startframe = true; - pthread_mutex_unlock(&m_output_mutex); -- if (m_changed_count_dec != m_changed_count) -- { -- if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -- CLog::Log(LOGDEBUG, "%s::%s format changed frame:%d(%d)", CLASSNAME, __func__, m_changed_count_dec, m_changed_count); -- m_changed_count_dec = m_changed_count; -- if (!change_dec_output_format()) -- { -- CLog::Log(LOGERROR, "%s::%s - change_dec_output_format() failed", CLASSNAME, __func__); -- return VC_ERROR; -- } -- } - EDEINTERLACEMODE deinterlace_request = CMediaSettings::Get().GetCurrentVideoSettings().m_DeinterlaceMode; - EINTERLACEMETHOD interlace_method = g_renderManager.AutoInterlaceMethod(CMediaSettings::Get().GetCurrentVideoSettings().m_InterlaceMethod); - -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -index 011ae04..fcc6a15 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -@@ -55,7 +55,6 @@ class CMMALVideoBuffer - int width; - int height; - float m_aspect_ratio; -- uint32_t m_changed_count; - // reference counting - CMMALVideoBuffer* Acquire(); - long Release(); -@@ -99,8 +98,6 @@ class CMMALVideo - void dec_output_port_cb(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buffer); - void dec_control_port_cb(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buffer); - void dec_input_port_cb(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buffer); -- uint32_t m_changed_count; -- uint32_t m_changed_count_dec; - - protected: - void QueryCodec(void); - -From 1bc141b43b3995999f59422f2fb525c794c11b29 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Thu, 16 Apr 2015 17:27:27 +0100 -Subject: [PATCH 47/56] [mmal] Enable zero copy - -This is a bit subtle, but the reference counting of pictures is only shared -between arm side and gpu side when in zero copy mode. ---- - xbmc/cores/VideoRenderers/MMALRenderer.cpp | 6 ++++++ - xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 18 ++++++++++++++++-- - 2 files changed, 22 insertions(+), 2 deletions(-) - -diff --git a/xbmc/cores/VideoRenderers/MMALRenderer.cpp b/xbmc/cores/VideoRenderers/MMALRenderer.cpp -index c30de9c..cfceb78 100644 ---- a/xbmc/cores/VideoRenderers/MMALRenderer.cpp -+++ b/xbmc/cores/VideoRenderers/MMALRenderer.cpp -@@ -132,6 +132,12 @@ bool CMMALRenderer::init_vout(ERenderFormat format) - es_format->es->video.color_space = MMAL_COLOR_SPACE_SMPTE240M; - } - -+ if (m_format == RENDER_FMT_MMAL) -+ { -+ status = mmal_port_parameter_set_boolean(m_vout_input, MMAL_PARAMETER_ZERO_COPY, MMAL_TRUE); -+ if (status != MMAL_SUCCESS) -+ CLog::Log(LOGERROR, "%s::%s Failed to enable zero copy mode on %s (status=%x %s)", CLASSNAME, __func__, m_vout_input->name, status, mmal_status_to_string(status)); -+ } - status = mmal_port_format_commit(m_vout_input); - if (status != MMAL_SUCCESS) - { -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -index f20eac7..443e023 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -@@ -312,6 +312,11 @@ bool CMMALVideo::change_dec_output_format() - CLog::Log(LOGERROR, "%s::%s Failed to query interlace type on %s (status=%x %s)", CLASSNAME, __func__, m_dec_output->name, status, mmal_status_to_string(status)); - - mmal_format_copy(m_dec_output->format, m_es_format); -+ -+ status = mmal_port_parameter_set_boolean(m_dec_output, MMAL_PARAMETER_ZERO_COPY, MMAL_TRUE); -+ if (status != MMAL_SUCCESS) -+ CLog::Log(LOGERROR, "%s::%s Failed to enable zero copy mode on %s (status=%x %s)", CLASSNAME, __func__, m_dec_output->name, status, mmal_status_to_string(status)); -+ - status = mmal_port_format_commit(m_dec_output); - if (status != MMAL_SUCCESS) - { -@@ -383,6 +388,11 @@ bool CMMALVideo::CreateDeinterlace(EINTERLACEMETHOD interlace_method) - } - - mmal_format_copy(m_deint->output[0]->format, m_es_format); -+ -+ status = mmal_port_parameter_set_boolean(m_deint->output[0], MMAL_PARAMETER_ZERO_COPY, MMAL_TRUE); -+ if (status != MMAL_SUCCESS) -+ CLog::Log(LOGERROR, "%s::%s Failed to enable zero copy mode on %s (status=%x %s)", CLASSNAME, __func__, m_deint->output[0]->name, status, mmal_status_to_string(status)); -+ - status = mmal_port_format_commit(m_deint->output[0]); - if (status != MMAL_SUCCESS) - { -@@ -656,6 +666,10 @@ bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options, MMALVide - m_dec_output->format->encoding = MMAL_ENCODING_OPAQUE; - mmal_format_copy(m_es_format, m_dec_output->format); - -+ status = mmal_port_parameter_set_boolean(m_dec_output, MMAL_PARAMETER_ZERO_COPY, MMAL_TRUE); -+ if (status != MMAL_SUCCESS) -+ CLog::Log(LOGERROR, "%s::%s Failed to enable zero copy mode on %s (status=%x %s)", CLASSNAME, __func__, m_dec_output->name, status, mmal_status_to_string(status)); -+ - status = mmal_port_format_commit(m_dec_output); - if (status != MMAL_SUCCESS) - { -@@ -680,14 +694,14 @@ bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options, MMALVide - return false; - } - -- m_dec_input_pool = mmal_pool_create(m_dec_input->buffer_num, m_dec_input->buffer_size); -+ m_dec_input_pool = mmal_port_pool_create(m_dec_input, m_dec_input->buffer_num, m_dec_input->buffer_size); - if (!m_dec_input_pool) - { - CLog::Log(LOGERROR, "%s::%s Failed to create pool for decoder input port (status=%x %s)", CLASSNAME, __func__, status, mmal_status_to_string(status)); - return false; - } - -- m_dec_output_pool = mmal_pool_create(m_dec_output->buffer_num, m_dec_output->buffer_size); -+ m_dec_output_pool = mmal_port_pool_create(m_dec_output, m_dec_output->buffer_num, m_dec_output->buffer_size); - if(!m_dec_output_pool) - { - CLog::Log(LOGERROR, "%s::%s Failed to create pool for decode output port (status=%x %s)", CLASSNAME, __func__, status, mmal_status_to_string(status)); - -From 4deb049fc48343d69f5f736967cb922800baf439 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Thu, 16 Apr 2015 19:09:31 +0100 -Subject: [PATCH 48/56] [mmalcodec] flags debug - ---- - xbmc/cores/VideoRenderers/MMALRenderer.cpp | 11 ++++++----- - xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 2 ++ - 2 files changed, 8 insertions(+), 5 deletions(-) - -diff --git a/xbmc/cores/VideoRenderers/MMALRenderer.cpp b/xbmc/cores/VideoRenderers/MMALRenderer.cpp -index cfceb78..4b09b1f 100644 ---- a/xbmc/cores/VideoRenderers/MMALRenderer.cpp -+++ b/xbmc/cores/VideoRenderers/MMALRenderer.cpp -@@ -48,12 +48,13 @@ void CMMALRenderer::vout_input_port_cb(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T * - { - #if defined(MMAL_DEBUG_VERBOSE) - CMMALVideoBuffer *omvb = (CMMALVideoBuffer *)buffer->user_data; -- CLog::Log(LOGDEBUG, "%s::%s port:%p buffer %p (%p), len %d cmd:%x", CLASSNAME, __func__, port, buffer, omvb, buffer->length, buffer->cmd); -+ CLog::Log(LOGDEBUG, "%s::%s port:%p buffer %p (%p), len %d cmd:%x f:%x", CLASSNAME, __func__, port, buffer, omvb, buffer->length, buffer->cmd, buffer->flags); - #endif - -+ assert(!(buffer->flags & MMAL_BUFFER_HEADER_FLAG_TRANSMISSION_FAILED)); -+ buffer->flags &= ~MMAL_BUFFER_HEADER_FLAG_USER2; - if (m_format == RENDER_FMT_MMAL) - { -- buffer->flags &= ~MMAL_BUFFER_HEADER_FLAG_USER2; - mmal_queue_put(m_release_queue, buffer); - } - else if (m_format == RENDER_FMT_YUV420P) -@@ -376,7 +377,7 @@ void CMMALRenderer::RenderUpdate(bool clear, DWORD flags, DWORD alpha) - if (omvb) - { - #if defined(MMAL_DEBUG_VERBOSE) -- CLog::Log(LOGDEBUG, "%s::%s %p (%p)", CLASSNAME, __func__, omvb, omvb->mmal_buffer); -+ CLog::Log(LOGDEBUG, "%s::%s %p (%p) f:%x", CLASSNAME, __func__, omvb, omvb->mmal_buffer, omvb->mmal_buffer->flags); - #endif - // we only want to upload frames once - if (omvb->mmal_buffer->flags & MMAL_BUFFER_HEADER_FLAG_USER1) -@@ -390,14 +391,14 @@ void CMMALRenderer::RenderUpdate(bool clear, DWORD flags, DWORD alpha) - } - else if (m_format == RENDER_FMT_YUV420P) - { -- CLog::Log(LOGDEBUG, "%s::%s - %p %d", CLASSNAME, __func__, buffer->mmal_buffer, source); - if (buffer->mmal_buffer) - { -+ CLog::Log(LOGDEBUG, "%s::%s - %p %d f:%x", CLASSNAME, __func__, buffer->mmal_buffer, source, buffer->mmal_buffer->flags); - // we only want to upload frames once - if (buffer->mmal_buffer->flags & MMAL_BUFFER_HEADER_FLAG_USER1) - return; - // sanity check it is not on display -- buffer->mmal_buffer->flags |= MMAL_BUFFER_HEADER_FLAG_USER1; -+ buffer->mmal_buffer->flags |= MMAL_BUFFER_HEADER_FLAG_USER1 | MMAL_BUFFER_HEADER_FLAG_USER2; - mmal_port_send_buffer(m_vout_input, buffer->mmal_buffer); - } - else -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -index 443e023..6c6e05e 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -@@ -83,6 +83,7 @@ long CMMALVideoBuffer::Release() - { - m_omv->ReleaseBuffer(this); - } -+ else assert(count > 0); - return count; - } - -@@ -247,6 +248,7 @@ void CMMALVideo::dec_output_port_cb(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buf - - bool kept = false; - -+ assert(!(buffer->flags & MMAL_BUFFER_HEADER_FLAG_TRANSMISSION_FAILED)); - if (buffer->cmd == 0) - { - if (buffer->length > 0) - -From 768fa749d337b9016a5b7b561c77701b4008998d Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Thu, 16 Apr 2015 18:18:14 +0100 -Subject: [PATCH 49/56] [mmal] Move the image pool from decoder to renderer - ---- - xbmc/cores/VideoRenderers/BaseRenderer.h | 5 ++ - xbmc/cores/VideoRenderers/MMALRenderer.cpp | 78 ++++++++++++++++++---- - xbmc/cores/VideoRenderers/MMALRenderer.h | 4 ++ - xbmc/cores/VideoRenderers/RenderManager.cpp | 8 +++ - xbmc/cores/VideoRenderers/RenderManager.h | 5 ++ - xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 30 ++------- - xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h | 2 - - 7 files changed, 92 insertions(+), 40 deletions(-) - -diff --git a/xbmc/cores/VideoRenderers/BaseRenderer.h b/xbmc/cores/VideoRenderers/BaseRenderer.h -index 389695a..264f0ad 100644 ---- a/xbmc/cores/VideoRenderers/BaseRenderer.h -+++ b/xbmc/cores/VideoRenderers/BaseRenderer.h -@@ -112,6 +112,11 @@ class CBaseRenderer - - static void SettingOptionsRenderMethodsFiller(const CSetting *setting, std::vector< std::pair > &list, int ¤t, void *data); - -+ /** -+ * Magic api for communicating between codec and renderer -+ */ -+ virtual void *PassCookie(void *cookie) { return NULL; } -+ - protected: - void ChooseBestResolution(float fps); - bool FindResolutionFromOverride(float fps, float& weight, bool fallback); -diff --git a/xbmc/cores/VideoRenderers/MMALRenderer.cpp b/xbmc/cores/VideoRenderers/MMALRenderer.cpp -index 4b09b1f..5a65572 100644 ---- a/xbmc/cores/VideoRenderers/MMALRenderer.cpp -+++ b/xbmc/cores/VideoRenderers/MMALRenderer.cpp -@@ -39,6 +39,50 @@ - #define MMAL_DEBUG_VERBOSE - #endif - -+ -+ -+void CMMALRenderer::Prime() -+{ -+ #if defined(MMAL_DEBUG_VERBOSE) -+ CLog::Log(LOGDEBUG, "%s::%s format:%d dec:%p pool:%p", CLASSNAME, __func__, m_format, m_mmal_video, m_vout_input_pool); -+ #endif -+ -+ if (m_format != RENDER_FMT_MMAL || !m_vout_input_pool) -+ return; -+ -+ MMAL_BUFFER_HEADER_T *buffer; -+ while (buffer = mmal_queue_get(m_vout_input_pool->queue), buffer) -+ { -+ CLog::Log(LOGDEBUG, "%s::%s buffer:%p mmal_video:%p", CLASSNAME, __func__, buffer, m_mmal_video); -+ if (m_mmal_video) -+ { -+ m_mmal_video->Recycle(buffer); -+ } -+ else -+ { -+ mmal_buffer_header_release(buffer); -+ break; -+ } -+ } -+} -+ -+void *CMMALRenderer::PassCookie(void *cookie) -+{ -+ m_mmal_video = (CMMALVideo *)cookie; -+ #if defined(MMAL_DEBUG_VERBOSE) -+ CLog::Log(LOGDEBUG, "%s::%s cookie:%p", CLASSNAME, __func__, cookie); -+ #endif -+ -+ if (m_mmal_video) -+ { -+ bool formatChanged = m_format != RENDER_FMT_MMAL; -+ m_format = RENDER_FMT_MMAL; -+ m_bConfigured = init_vout(formatChanged); -+ Prime(); -+ } -+ return NULL; -+} -+ - static void vout_control_port_cb(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buffer) - { - mmal_buffer_header_release(buffer); -@@ -163,14 +207,11 @@ bool CMMALRenderer::init_vout(ERenderFormat format) - return false; - } - -- if (m_format == RENDER_FMT_YUV420P) -+ m_vout_input_pool = mmal_port_pool_create(m_vout_input , m_vout_input->buffer_num, m_vout_input->buffer_size); -+ if (!m_vout_input_pool) - { -- m_vout_input_pool = mmal_pool_create(m_vout_input->buffer_num, m_vout_input->buffer_size); -- if (!m_vout_input_pool) -- { -- CLog::Log(LOGERROR, "%s::%s Failed to create pool for decoder input port (status=%x %s)", CLASSNAME, __func__, status, mmal_status_to_string(status)); -- return false; -- } -+ CLog::Log(LOGERROR, "%s::%s Failed to create pool for decoder input port (status=%x %s)", CLASSNAME, __func__, status, mmal_status_to_string(status)); -+ return false; - } - return true; - } -@@ -178,10 +219,17 @@ bool CMMALRenderer::init_vout(ERenderFormat format) - void CMMALRenderer::Process() - { - MMAL_BUFFER_HEADER_T *buffer; -- while (buffer = mmal_queue_wait(m_release_queue), buffer && buffer != &m_quit_packet) -+ while (buffer = mmal_queue_timedwait(m_release_queue, 100), buffer != &m_quit_packet) - { -- CMMALVideoBuffer *omvb = (CMMALVideoBuffer *)buffer->user_data; -- omvb->Release(); -+ if (buffer) -+ { -+ CMMALVideoBuffer *omvb = (CMMALVideoBuffer *)buffer->user_data; -+ omvb->Release(); -+ } -+ else -+ { -+ Prime(); -+ } - } - m_sync.Set(); - } -@@ -198,6 +246,7 @@ CMMALRenderer::CMMALRenderer() - m_release_queue = mmal_queue_create(); - m_iFlags = 0; - m_format = RENDER_FMT_NONE; -+ m_mmal_video = NULL; - m_iYV12RenderBuffer = 0; - Create(); - } -@@ -381,7 +430,7 @@ void CMMALRenderer::RenderUpdate(bool clear, DWORD flags, DWORD alpha) - #endif - // we only want to upload frames once - if (omvb->mmal_buffer->flags & MMAL_BUFFER_HEADER_FLAG_USER1) -- return; -+ goto done; - omvb->Acquire(); - omvb->mmal_buffer->flags |= MMAL_BUFFER_HEADER_FLAG_USER1 | MMAL_BUFFER_HEADER_FLAG_USER2; - mmal_port_send_buffer(m_vout_input, omvb->mmal_buffer); -@@ -396,7 +445,7 @@ void CMMALRenderer::RenderUpdate(bool clear, DWORD flags, DWORD alpha) - CLog::Log(LOGDEBUG, "%s::%s - %p %d f:%x", CLASSNAME, __func__, buffer->mmal_buffer, source, buffer->mmal_buffer->flags); - // we only want to upload frames once - if (buffer->mmal_buffer->flags & MMAL_BUFFER_HEADER_FLAG_USER1) -- return; -+ goto done; - // sanity check it is not on display - buffer->mmal_buffer->flags |= MMAL_BUFFER_HEADER_FLAG_USER1 | MMAL_BUFFER_HEADER_FLAG_USER2; - mmal_port_send_buffer(m_vout_input, buffer->mmal_buffer); -@@ -405,6 +454,8 @@ void CMMALRenderer::RenderUpdate(bool clear, DWORD flags, DWORD alpha) - CLog::Log(LOGDEBUG, "%s::%s - No buffer to update", CLASSNAME, __func__); - } - else assert(0); -+done: -+ Prime(); - } - - void CMMALRenderer::FlipPage(int source) -@@ -466,6 +517,8 @@ void CMMALRenderer::UnInitMMAL() - m_vout_input = NULL; - } - -+ ReleaseBuffers(); -+ - if (m_vout_input_pool) - { - mmal_pool_destroy(m_vout_input_pool); -@@ -477,7 +530,6 @@ void CMMALRenderer::UnInitMMAL() - mmal_component_release(m_vout); - m_vout = NULL; - } -- ReleaseBuffers(); - - m_RenderUpdateCallBackFn = NULL; - m_RenderUpdateCallBackCtx = NULL; -diff --git a/xbmc/cores/VideoRenderers/MMALRenderer.h b/xbmc/cores/VideoRenderers/MMALRenderer.h -index 17b189e..f515d7a 100644 ---- a/xbmc/cores/VideoRenderers/MMALRenderer.h -+++ b/xbmc/cores/VideoRenderers/MMALRenderer.h -@@ -40,6 +40,7 @@ - - class CBaseTexture; - class CMMALVideoBuffer; -+class CMMALVideo; - - struct DVDVideoPicture; - -@@ -90,6 +91,7 @@ class CMMALRenderer : public CBaseRenderer, public CThread - virtual bool IsGuiLayer() { return false; } - - void vout_input_port_cb(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buffer); -+ virtual void *PassCookie(void *cookie); - protected: - int m_iYV12RenderBuffer; - int m_NumYV12Buffers; -@@ -116,8 +118,10 @@ class CMMALRenderer : public CBaseRenderer, public CThread - MMAL_QUEUE_T *m_release_queue; - CEvent m_sync; - MMAL_BUFFER_HEADER_T m_quit_packet; -+ CMMALVideo *m_mmal_video; - - bool init_vout(ERenderFormat format); - void ReleaseBuffers(); - void UnInitMMAL(); -+ void Prime(); - }; -diff --git a/xbmc/cores/VideoRenderers/RenderManager.cpp b/xbmc/cores/VideoRenderers/RenderManager.cpp -index 6de299e..dfd1072 100644 ---- a/xbmc/cores/VideoRenderers/RenderManager.cpp -+++ b/xbmc/cores/VideoRenderers/RenderManager.cpp -@@ -948,6 +948,14 @@ unsigned int CXBMCRenderManager::GetOptimalBufferSize() - return m_pRenderer->GetMaxBufferSize(); - } - -+void *CXBMCRenderManager::PassCookie(void *cookie) -+{ -+ if (m_pRenderer) -+ return m_pRenderer->PassCookie(cookie); -+ assert(0); -+} -+ -+ - // Supported pixel formats, can be called before configure - std::vector CXBMCRenderManager::SupportedFormats() - { -diff --git a/xbmc/cores/VideoRenderers/RenderManager.h b/xbmc/cores/VideoRenderers/RenderManager.h -index 4e553cb..606cbbd 100644 ---- a/xbmc/cores/VideoRenderers/RenderManager.h -+++ b/xbmc/cores/VideoRenderers/RenderManager.h -@@ -195,6 +195,11 @@ class CXBMCRenderManager - */ - void DiscardBuffer(); - -+ /** -+ * Magic api for communicating between codec and renderer -+ */ -+ void *PassCookie(void *cookie); -+ - protected: - - void PresentSingle(bool clear, DWORD flags, DWORD alpha); -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -index 6c6e05e..3fcd79b 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -@@ -111,7 +111,6 @@ CMMALVideo::CMMALVideo() - m_dec_input = NULL; - m_dec_output = NULL; - m_dec_input_pool = NULL; -- m_dec_output_pool = NULL; - - m_deint = NULL; - m_deint_connection = NULL; -@@ -162,10 +161,6 @@ CMMALVideo::~CMMALVideo() - mmal_pool_destroy(m_dec_input_pool); - m_dec_input_pool = NULL; - -- if (m_dec_output_pool) -- mmal_pool_destroy(m_dec_output_pool); -- m_dec_output_pool = NULL; -- - if (m_deint) - mmal_component_destroy(m_deint); - m_deint = NULL; -@@ -421,7 +416,7 @@ bool CMMALVideo::CreateDeinterlace(EINTERLACEMETHOD interlace_method) - - m_dec_output = m_deint->output[0]; - m_interlace_method = interlace_method; -- Prime(); -+ - return true; - } - -@@ -477,7 +472,7 @@ bool CMMALVideo::DestroyDeinterlace() - - m_dec_output = m_dec->output[0]; - m_interlace_method = VS_INTERLACEMETHOD_NONE; -- Prime(); -+ - return true; - } - -@@ -703,17 +698,9 @@ bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options, MMALVide - return false; - } - -- m_dec_output_pool = mmal_port_pool_create(m_dec_output, m_dec_output->buffer_num, m_dec_output->buffer_size); -- if(!m_dec_output_pool) -- { -- CLog::Log(LOGERROR, "%s::%s Failed to create pool for decode output port (status=%x %s)", CLASSNAME, __func__, status, mmal_status_to_string(status)); -- return false; -- } -- - if (!SendCodecConfigData()) - return false; - -- Prime(); - m_startframe = false; - m_preroll = !m_hints.stills; - m_speed = DVD_PLAYSPEED_NORMAL; -@@ -725,6 +712,7 @@ void CMMALVideo::Dispose() - { - // we are happy to exit, but let last shared pointer being deleted trigger the destructor - bool done = false; -+ g_renderManager.PassCookie(NULL); - m_finished = true; - Reset(); - pthread_mutex_lock(&m_output_mutex); -@@ -747,6 +735,7 @@ void CMMALVideo::SetDropState(bool bDrop) - - int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) - { -+ g_renderManager.PassCookie(this); - //if (g_advancedSettings.CanLogComponent(LOGVIDEO)) - // CLog::Log(LOGDEBUG, "%s::%s - %-8p %-6d dts:%.3f pts:%.3f ready_queue(%d) busy_queue(%d)", - // CLASSNAME, __func__, pData, iSize, dts == DVD_NOPTS_VALUE ? 0.0 : dts*1e-6, pts == DVD_NOPTS_VALUE ? 0.0 : pts*1e-6, m_output_ready.size(), m_output_busy); -@@ -900,13 +889,6 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) - return ret; - } - --void CMMALVideo::Prime() --{ -- MMAL_BUFFER_HEADER_T *buffer; -- while (buffer = mmal_queue_get(m_dec_output_pool->queue), buffer) -- Recycle(buffer); --} -- - void CMMALVideo::Reset(void) - { - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -@@ -952,10 +934,8 @@ void CMMALVideo::Reset(void) - pthread_mutex_unlock(&m_output_mutex); - - if (!m_finished) -- { - SendCodecConfigData(); -- Prime(); -- } -+ - m_startframe = false; - m_decoderPts = DVD_NOPTS_VALUE; - m_preroll = !m_hints.stills && (m_speed == DVD_PLAYSPEED_NORMAL || m_speed == DVD_PLAYSPEED_PAUSE); -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -index fcc6a15..204f004 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -@@ -103,7 +103,6 @@ class CMMALVideo - void QueryCodec(void); - bool CreateDeinterlace(EINTERLACEMETHOD interlace_method); - bool DestroyDeinterlace(); -- void Prime(); - - // Video format - int m_decoded_width; -@@ -141,7 +140,6 @@ class CMMALVideo - MMAL_PORT_T *m_dec_input; - MMAL_PORT_T *m_dec_output; - MMAL_POOL_T *m_dec_input_pool; -- MMAL_POOL_T *m_dec_output_pool; - - MMAL_ES_FORMAT_T *m_es_format; - MMAL_COMPONENT_T *m_deint; - -From 14e949b4786aec964686e1b14af0db1175f64bab Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Fri, 17 Apr 2015 16:07:40 +0100 -Subject: [PATCH 50/56] [mmalrenderer] Separate mmal and renderer configured - flags - ---- - xbmc/cores/VideoRenderers/MMALRenderer.cpp | 26 +++++++++++++++----------- - xbmc/cores/VideoRenderers/MMALRenderer.h | 1 + - 2 files changed, 16 insertions(+), 11 deletions(-) - -diff --git a/xbmc/cores/VideoRenderers/MMALRenderer.cpp b/xbmc/cores/VideoRenderers/MMALRenderer.cpp -index 5a65572..05ccbac 100644 ---- a/xbmc/cores/VideoRenderers/MMALRenderer.cpp -+++ b/xbmc/cores/VideoRenderers/MMALRenderer.cpp -@@ -73,13 +73,12 @@ void *CMMALRenderer::PassCookie(void *cookie) - CLog::Log(LOGDEBUG, "%s::%s cookie:%p", CLASSNAME, __func__, cookie); - #endif - -- if (m_mmal_video) -- { -- bool formatChanged = m_format != RENDER_FMT_MMAL; -- m_format = RENDER_FMT_MMAL; -- m_bConfigured = init_vout(formatChanged); -+ if (m_mmal_video && !m_bMMALConfigured) -+ m_bMMALConfigured = init_vout(RENDER_FMT_MMAL); -+ -+ if (m_mmal_video && m_bMMALConfigured) - Prime(); -- } -+ - return NULL; - } - -@@ -121,10 +120,10 @@ bool CMMALRenderer::init_vout(ERenderFormat format) - - CLog::Log(LOGDEBUG, "%s::%s configured:%d format:%d->%d", CLASSNAME, __func__, m_bConfigured, m_format, format); - -- if (m_bConfigured && formatChanged) -+ if (m_bMMALConfigured && formatChanged) - UnInitMMAL(); - -- if (m_bConfigured) -+ if (m_bMMALConfigured) - return true; - - m_format = RENDER_FMT_MMAL; -@@ -247,6 +246,8 @@ CMMALRenderer::CMMALRenderer() - m_iFlags = 0; - m_format = RENDER_FMT_NONE; - m_mmal_video = NULL; -+ m_bConfigured = false; -+ m_bMMALConfigured = false; - m_iYV12RenderBuffer = 0; - Create(); - } -@@ -297,8 +298,9 @@ bool CMMALRenderer::Configure(unsigned int width, unsigned int height, unsigned - SetViewMode(CMediaSettings::Get().GetCurrentVideoSettings().m_ViewMode); - ManageDisplay(); - -- m_bConfigured = init_vout(format); -- -+ m_bMMALConfigured = init_vout(format); -+ m_bConfigured = m_bMMALConfigured; -+ assert(m_bConfigured); - return m_bConfigured; - } - -@@ -361,7 +363,8 @@ int CMMALRenderer::GetImage(YV12Image *image, int source, bool readonly) - - void CMMALRenderer::ReleaseBuffer(int idx) - { -- if (!m_bConfigured || m_format == RENDER_FMT_BYPASS) -+ CSingleLock lock(m_sharedSection); -+ if (!m_bMMALConfigured || m_format == RENDER_FMT_BYPASS) - return; - - #if defined(MMAL_DEBUG_VERBOSE) -@@ -541,6 +544,7 @@ void CMMALRenderer::UnInitMMAL() - m_StereoInvert = false; - - m_bConfigured = false; -+ m_bMMALConfigured = false; - } - - void CMMALRenderer::UnInit() -diff --git a/xbmc/cores/VideoRenderers/MMALRenderer.h b/xbmc/cores/VideoRenderers/MMALRenderer.h -index f515d7a..a694182 100644 ---- a/xbmc/cores/VideoRenderers/MMALRenderer.h -+++ b/xbmc/cores/VideoRenderers/MMALRenderer.h -@@ -100,6 +100,7 @@ class CMMALRenderer : public CBaseRenderer, public CThread - - YUVBUFFER m_buffers[NUM_BUFFERS]; - bool m_bConfigured; -+ bool m_bMMALConfigured; - unsigned int m_extended_format; - unsigned int m_destWidth; - unsigned int m_destHeight; - -From 74db1bf9cffab54f174c5eddd63154228bab959f Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Thu, 16 Apr 2015 21:43:27 +0100 -Subject: [PATCH 51/56] [mmal] Separate the buffers from the decoder so decoder - can be destroyed first - ---- - .../DVDCodecs/Video/DVDVideoCodecMMAL.cpp | 4 +- - .../dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.h | 2 +- - xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 63 ++++++---------------- - xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h | 6 +-- - 4 files changed, 20 insertions(+), 55 deletions(-) - -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.cpp -index ee7d6f2..48e347c 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.cpp -@@ -44,11 +44,13 @@ CDVDVideoCodecMMAL::~CDVDVideoCodecMMAL() - { - CLog::Log(LOGDEBUG, "%s::%s %p\n", CLASSNAME, __func__, this); - Dispose(); -+ delete m_decoder; -+ m_decoder = NULL; - } - - bool CDVDVideoCodecMMAL::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options) - { -- return m_decoder->Open(hints, options, m_decoder); -+ return m_decoder->Open(hints, options); - } - - const char* CDVDVideoCodecMMAL::GetName(void) -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.h -index aa8e87f..6014363 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.h -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.h -@@ -46,7 +46,7 @@ class CDVDVideoCodecMMAL : public CDVDVideoCodec - virtual void SetSpeed(int iSpeed); - - protected: -- MMALVideoPtr m_decoder; -+ CMMALVideo *m_decoder; - }; - - #endif -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -index 3fcd79b..6110c32 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -@@ -81,7 +81,8 @@ long CMMALVideoBuffer::Release() - CLog::Log(LOGDEBUG, "%s::%s %p (%p) ref:%ld", CLASSNAME, __func__, this, mmal_buffer, count); - if (count == 0) - { -- m_omv->ReleaseBuffer(this); -+ mmal_buffer_header_release(mmal_buffer); -+ delete this; - } - else assert(count > 0); - return count; -@@ -117,7 +118,6 @@ CMMALVideo::CMMALVideo() - - m_codingType = 0; - -- m_output_busy = 0; - m_demux_queue_length = 0; - m_es_format = mmal_format_alloc(); - m_preroll = true; -@@ -261,7 +261,6 @@ void CMMALVideo::dec_output_port_cb(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buf - omvb->height = m_decoded_height; - omvb->m_aspect_ratio = m_aspect_ratio; - pthread_mutex_lock(&m_output_mutex); -- m_output_busy++; - m_output_ready.push(omvb); - pthread_mutex_unlock(&m_output_mutex); - kept = true; -@@ -505,7 +504,7 @@ bool CMMALVideo::SendCodecConfigData() - return true; - } - --bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options, MMALVideoPtr myself) -+bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options) - { - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) - CLog::Log(LOGDEBUG, "%s::%s usemmal:%d software:%d %dx%d", CLASSNAME, __func__, CSettings::Get().GetBool("videoplayer.usemmal"), hints.software, hints.width, hints.height); -@@ -518,7 +517,6 @@ bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options, MMALVide - MMAL_STATUS_T status; - MMAL_PARAMETER_BOOLEAN_T error_concealment; - -- m_myself = myself; - m_decoded_width = hints.width; - m_decoded_height = hints.height; - -@@ -710,21 +708,9 @@ bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options, MMALVide - - void CMMALVideo::Dispose() - { -- // we are happy to exit, but let last shared pointer being deleted trigger the destructor -- bool done = false; - g_renderManager.PassCookie(NULL); - m_finished = true; - Reset(); -- pthread_mutex_lock(&m_output_mutex); -- if (!m_output_busy) -- done = true; -- pthread_mutex_unlock(&m_output_mutex); -- if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -- CLog::Log(LOGDEBUG, "%s::%s ready_queue(%d) busy_queue(%d) done:%d", CLASSNAME, __func__, m_output_ready.size(), m_output_busy, done); -- if (done) -- { -- m_myself.reset(); -- } - } - - void CMMALVideo::SetDropState(bool bDrop) -@@ -737,8 +723,8 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) - { - g_renderManager.PassCookie(this); - //if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -- // CLog::Log(LOGDEBUG, "%s::%s - %-8p %-6d dts:%.3f pts:%.3f ready_queue(%d) busy_queue(%d)", -- // CLASSNAME, __func__, pData, iSize, dts == DVD_NOPTS_VALUE ? 0.0 : dts*1e-6, pts == DVD_NOPTS_VALUE ? 0.0 : pts*1e-6, m_output_ready.size(), m_output_busy); -+ // CLog::Log(LOGDEBUG, "%s::%s - %-8p %-6d dts:%.3f pts:%.3f ready_queue(%d)", -+ // CLASSNAME, __func__, pData, iSize, dts == DVD_NOPTS_VALUE ? 0.0 : dts*1e-6, pts == DVD_NOPTS_VALUE ? 0.0 : pts*1e-6, m_output_ready.size()); - - unsigned int demuxer_bytes = 0; - uint8_t *demuxer_content = NULL; -@@ -814,8 +800,8 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) - buffer->flags |= MMAL_BUFFER_HEADER_FLAG_FRAME_END; - - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -- CLog::Log(LOGDEBUG, "%s::%s - %-8p %-6d/%-6d dts:%.3f pts:%.3f flags:%x ready_queue(%d) busy_queue(%d) demux_queue(%d) space(%d)", -- CLASSNAME, __func__, buffer, buffer->length, demuxer_bytes, dts == DVD_NOPTS_VALUE ? 0.0 : dts*1e-6, pts == DVD_NOPTS_VALUE ? 0.0 : pts*1e-6, buffer->flags, m_output_ready.size(), m_output_busy, m_demux_queue_length, mmal_queue_length(m_dec_input_pool->queue) * m_dec_input->buffer_size); -+ CLog::Log(LOGDEBUG, "%s::%s - %-8p %-6d/%-6d dts:%.3f pts:%.3f flags:%x ready_queue(%d) demux_queue(%d) space(%d)", -+ CLASSNAME, __func__, buffer, buffer->length, demuxer_bytes, dts == DVD_NOPTS_VALUE ? 0.0 : dts*1e-6, pts == DVD_NOPTS_VALUE ? 0.0 : pts*1e-6, buffer->flags, m_output_ready.size(), m_demux_queue_length, mmal_queue_length(m_dec_input_pool->queue) * m_dec_input->buffer_size); - assert((int)buffer->length > 0); - status = mmal_port_send_buffer(m_dec_input, buffer); - if (status != MMAL_SUCCESS) -@@ -882,8 +868,8 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) - if (!ret) - { - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -- CLog::Log(LOGDEBUG, "%s::%s - Nothing to do: ready_queue(%d) busy_queue(%d) demux_queue(%d) space(%d) preroll(%d)", -- CLASSNAME, __func__, m_output_ready.size(), m_output_busy, m_demux_queue_length, mmal_queue_length(m_dec_input_pool->queue) * m_dec_input->buffer_size, m_preroll); -+ CLog::Log(LOGDEBUG, "%s::%s - Nothing to do: ready_queue(%d) demux_queue(%d) space(%d) preroll(%d)", -+ CLASSNAME, __func__, m_output_ready.size(), m_demux_queue_length, mmal_queue_length(m_dec_input_pool->queue) * m_dec_input->buffer_size, m_preroll); - Sleep(10); // otherwise we busy spin - } - return ret; -@@ -922,7 +908,10 @@ void CMMALVideo::Reset(void) - } - pthread_mutex_unlock(&m_output_mutex); - if (buffer) -- ReleaseBuffer(buffer); -+ { -+ buffer->Acquire(); -+ buffer->Release(); -+ } - else - break; - } -@@ -965,8 +954,8 @@ void CMMALVideo::Recycle(MMAL_BUFFER_HEADER_T *buffer) - mmal_buffer_header_reset(buffer); - buffer->cmd = 0; - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -- CLog::Log(LOGDEBUG, "%s::%s Send buffer %p from pool to decoder output port %p ready_queue(%d) busy_queue(%d)", CLASSNAME, __func__, buffer, m_dec_output, -- m_output_ready.size(), m_output_busy); -+ CLog::Log(LOGDEBUG, "%s::%s Send buffer %p from pool to decoder output port %p ready_queue(%d)", CLASSNAME, __func__, buffer, m_dec_output, -+ m_output_ready.size()); - status = mmal_port_send_buffer(m_dec_output, buffer); - if (status != MMAL_SUCCESS) - { -@@ -975,28 +964,6 @@ void CMMALVideo::Recycle(MMAL_BUFFER_HEADER_T *buffer) - } - } - --void CMMALVideo::ReleaseBuffer(CMMALVideoBuffer *buffer) --{ -- // remove from busy list -- pthread_mutex_lock(&m_output_mutex); -- assert(m_output_busy > 0); -- m_output_busy--; -- pthread_mutex_unlock(&m_output_mutex); -- // sanity check it is not on display -- assert(!(buffer->mmal_buffer->flags & MMAL_BUFFER_HEADER_FLAG_USER2)); -- Recycle(buffer->mmal_buffer); -- bool done = false; -- pthread_mutex_lock(&m_output_mutex); -- if (m_finished && !m_output_busy) -- done = true; -- pthread_mutex_unlock(&m_output_mutex); -- if (done) -- m_myself.reset(); -- if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -- CLog::Log(LOGDEBUG, "%s::%s %p (%p) ready_queue(%d) busy_queue(%d) done:%d", CLASSNAME, __func__, buffer, buffer->mmal_buffer, m_output_ready.size(), m_output_busy, done); -- delete buffer; --} -- - bool CMMALVideo::GetPicture(DVDVideoPicture* pDvdVideoPicture) - { - if (!m_output_ready.empty()) -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -index 204f004..ab6e958 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -@@ -42,7 +42,6 @@ - #include "cores/VideoRenderers/BaseRenderer.h" - - class CMMALVideo; --typedef std::shared_ptr MMALVideoPtr; - - // a mmal video frame - class CMMALVideoBuffer -@@ -77,7 +76,7 @@ class CMMALVideo - virtual ~CMMALVideo(); - - // Required overrides -- virtual bool Open(CDVDStreamInfo &hints, CDVDCodecOptions &options, MMALVideoPtr myself); -+ virtual bool Open(CDVDStreamInfo &hints, CDVDCodecOptions &options); - virtual void Dispose(void); - virtual int Decode(uint8_t *pData, int iSize, double dts, double pts); - virtual void Reset(void); -@@ -91,7 +90,6 @@ class CMMALVideo - virtual void SetSpeed(int iSpeed); - - // MMAL decoder callback routines. -- void ReleaseBuffer(CMMALVideoBuffer *buffer); - void Recycle(MMAL_BUFFER_HEADER_T *buffer); - - // MMAL decoder callback routines. -@@ -111,14 +109,12 @@ class CMMALVideo - bool m_finished; - float m_aspect_ratio; - const char *m_pFormatName; -- MMALVideoPtr m_myself; - - std::queue m_demux_queue; - unsigned m_demux_queue_length; - - // mmal output buffers (video frames) - pthread_mutex_t m_output_mutex; -- int m_output_busy; - std::queue m_output_ready; - - // initialize mmal and get decoder component - -From 8cf59f193e56c3e7eba46e729490f326b08659d1 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Thu, 16 Apr 2015 21:50:10 +0100 -Subject: [PATCH 52/56] [mmalcodec] Remove DVDVideoCodecMMAL wrapper - ---- - xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp | 4 +- - .../DVDCodecs/Video/DVDVideoCodecMMAL.cpp | 111 --------------------- - .../dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.h | 52 ---------- - xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 3 +- - xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h | 4 +- - xbmc/cores/dvdplayer/DVDCodecs/Video/Makefile.in | 1 - - 6 files changed, 6 insertions(+), 169 deletions(-) - delete mode 100644 xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.cpp - delete mode 100644 xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.h - -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp -index b77a168..4633c18 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp -@@ -40,7 +40,7 @@ - #if defined(HAS_IMXVPU) - #include "Video/DVDVideoCodecIMX.h" - #endif --#include "Video/DVDVideoCodecMMAL.h" -+#include "Video/MMALCodec.h" - #include "Video/DVDVideoCodecStageFright.h" - #if defined(HAS_LIBAMCODEC) - #include "utils/AMLUtils.h" -@@ -306,7 +306,7 @@ CDVDVideoCodec* CDVDFactoryCodec::CreateVideoCodec(CDVDStreamInfo &hint, unsigne - hint.codec == AV_CODEC_ID_VP6 || hint.codec == AV_CODEC_ID_VP6F || hint.codec == AV_CODEC_ID_VP6A || hint.codec == AV_CODEC_ID_VP8 || - hint.codec == AV_CODEC_ID_THEORA || hint.codec == AV_CODEC_ID_MJPEG || hint.codec == AV_CODEC_ID_MJPEGB || hint.codec == AV_CODEC_ID_VC1 || hint.codec == AV_CODEC_ID_WMV3) - { -- if ( (pCodec = OpenCodec(new CDVDVideoCodecMMAL(), hint, options)) ) return pCodec; -+ if ( (pCodec = OpenCodec(new CMMALVideo(), hint, options)) ) return pCodec; - } - } - #endif -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.cpp -deleted file mode 100644 -index 48e347c..0000000 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.cpp -+++ /dev/null -@@ -1,111 +0,0 @@ --/* -- * Copyright (C) 2010-2013 Team XBMC -- * http://xbmc.org -- * -- * This Program is free software; you can redistribute it and/or modify -- * it under the terms of the GNU General Public License as published by -- * the Free Software Foundation; either version 2, 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 General Public License for more details. -- * -- * You should have received a copy of the GNU General Public License -- * along with XBMC; see the file COPYING. If not, see -- * . -- * -- */ -- --#if (defined HAVE_CONFIG_H) && (!defined TARGET_WINDOWS) -- #include "config.h" --#elif defined(TARGET_WINDOWS) --#include "system.h" --#endif -- --#if defined(HAS_MMAL) --#include "DVDClock.h" --#include "DVDStreamInfo.h" --#include "DVDVideoCodecMMAL.h" --#include "settings/Settings.h" --#include "utils/log.h" -- --#define CLASSNAME "CDVDVideoCodecMMAL" --//////////////////////////////////////////////////////////////////////////////////////////// --//////////////////////////////////////////////////////////////////////////////////////////// --CDVDVideoCodecMMAL::CDVDVideoCodecMMAL() -- : m_decoder( new CMMALVideo ) --{ -- CLog::Log(LOGDEBUG, "%s::%s %p\n", CLASSNAME, __func__, this); --} -- --CDVDVideoCodecMMAL::~CDVDVideoCodecMMAL() --{ -- CLog::Log(LOGDEBUG, "%s::%s %p\n", CLASSNAME, __func__, this); -- Dispose(); -- delete m_decoder; -- m_decoder = NULL; --} -- --bool CDVDVideoCodecMMAL::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options) --{ -- return m_decoder->Open(hints, options); --} -- --const char* CDVDVideoCodecMMAL::GetName(void) --{ -- return m_decoder ? m_decoder->GetName() : "mmal-xxx"; --} -- --void CDVDVideoCodecMMAL::Dispose() --{ -- m_decoder->Dispose(); --} -- --void CDVDVideoCodecMMAL::SetDropState(bool bDrop) --{ -- m_decoder->SetDropState(bDrop); --} -- --int CDVDVideoCodecMMAL::Decode(uint8_t* pData, int iSize, double dts, double pts) --{ -- return m_decoder->Decode(pData, iSize, dts, pts); --} -- --unsigned CDVDVideoCodecMMAL::GetAllowedReferences() --{ -- return m_decoder->GetAllowedReferences(); --} -- --void CDVDVideoCodecMMAL::Reset(void) --{ -- m_decoder->Reset(); --} -- --bool CDVDVideoCodecMMAL::GetPicture(DVDVideoPicture* pDvdVideoPicture) --{ -- return m_decoder->GetPicture(pDvdVideoPicture); --} -- --bool CDVDVideoCodecMMAL::ClearPicture(DVDVideoPicture* pDvdVideoPicture) --{ -- return m_decoder->ClearPicture(pDvdVideoPicture); --} -- --bool CDVDVideoCodecMMAL::GetCodecStats(double &pts, int &droppedPics) --{ -- return m_decoder->GetCodecStats(pts, droppedPics); --} -- --void CDVDVideoCodecMMAL::SetCodecControl(int flags) --{ -- m_decoder->SetCodecControl(flags); --} -- --void CDVDVideoCodecMMAL::SetSpeed(int iSpeed) --{ -- m_decoder->SetSpeed(iSpeed); --} -- --#endif -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.h -deleted file mode 100644 -index 6014363..0000000 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.h -+++ /dev/null -@@ -1,52 +0,0 @@ --#pragma once --/* -- * Copyright (C) 2010-2013 Team XBMC -- * http://xbmc.org -- * -- * This Program is free software; you can redistribute it and/or modify -- * it under the terms of the GNU General Public License as published by -- * the Free Software Foundation; either version 2, 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 General Public License for more details. -- * -- * You should have received a copy of the GNU General Public License -- * along with XBMC; see the file COPYING. If not, see -- * . -- * -- */ -- --#if defined(HAS_MMAL) -- --#include "DVDVideoCodec.h" --#include "MMALCodec.h" -- --class CMMALVideo; --class CDVDVideoCodecMMAL : public CDVDVideoCodec --{ --public: -- CDVDVideoCodecMMAL(); -- virtual ~CDVDVideoCodecMMAL(); -- -- // Required overrides -- virtual bool Open(CDVDStreamInfo &hints, CDVDCodecOptions &options); -- virtual void Dispose(void); -- virtual int Decode(uint8_t *pData, int iSize, double dts, double pts); -- virtual void Reset(void); -- virtual bool GetPicture(DVDVideoPicture *pDvdVideoPicture); -- virtual bool ClearPicture(DVDVideoPicture* pDvdVideoPicture); -- virtual unsigned GetAllowedReferences(); -- virtual void SetDropState(bool bDrop); -- virtual const char* GetName(void); -- virtual bool GetCodecStats(double &pts, int &droppedPics); -- virtual void SetCodecControl(int flags); -- virtual void SetSpeed(int iSpeed); -- --protected: -- CMMALVideo *m_decoder; --}; -- --#endif -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -index 6110c32..1bf1940 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -@@ -129,7 +129,8 @@ CMMALVideo::~CMMALVideo() - { - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) - CLog::Log(LOGDEBUG, "%s::%s %p", CLASSNAME, __func__, this); -- assert(m_finished); -+ if (!m_finished) -+ Dispose(); - - pthread_mutex_destroy(&m_output_mutex); - -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -index ab6e958..3e444f7 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -@@ -62,7 +62,7 @@ class CMMALVideoBuffer - private: - }; - --class CMMALVideo -+class CMMALVideo : public CDVDVideoCodec - { - typedef struct mmal_demux_packet { - uint8_t *buff; -@@ -84,7 +84,7 @@ class CMMALVideo - virtual bool ClearPicture(DVDVideoPicture* pDvdVideoPicture); - virtual unsigned GetAllowedReferences() { return 3; } - virtual void SetDropState(bool bDrop); -- virtual const char* GetName(void) { return (const char*)m_pFormatName; } -+ virtual const char* GetName(void) { return m_pFormatName ? m_pFormatName:"mmal-xxx"; } - virtual bool GetCodecStats(double &pts, int &droppedPics); - virtual void SetCodecControl(int flags); - virtual void SetSpeed(int iSpeed); -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/Makefile.in b/xbmc/cores/dvdplayer/DVDCodecs/Video/Makefile.in -index 6f5d3e8..56ec6a3 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/Makefile.in -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/Makefile.in -@@ -39,7 +39,6 @@ endif - - ifeq (@USE_MMAL@,1) - SRCS += MMALCodec.cpp --SRCS += DVDVideoCodecMMAL.cpp - endif - - LIB=Video.a - -From 2ced0d8763938f359bd7920b037d7e969a3a06ed Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Fri, 17 Apr 2015 15:46:55 +0100 -Subject: [PATCH 53/56] [mmalcodec] Add shared lock around MMAL operations - ---- - xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 16 ++++++++++++++++ - xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h | 1 + - 2 files changed, 17 insertions(+) - -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -index 1bf1940..09d15fe88 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -@@ -127,6 +127,7 @@ CMMALVideo::CMMALVideo() - - CMMALVideo::~CMMALVideo() - { -+ CSingleLock lock(m_sharedSection); - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) - CLog::Log(LOGDEBUG, "%s::%s %p", CLASSNAME, __func__, this); - if (!m_finished) -@@ -175,6 +176,7 @@ CMMALVideo::~CMMALVideo() - - void CMMALVideo::PortSettingsChanged(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buffer) - { -+ CSingleLock lock(m_sharedSection); - MMAL_EVENT_FORMAT_CHANGED_T *fmt = mmal_event_format_changed_get(buffer); - mmal_format_copy(m_es_format, fmt->format); - -@@ -289,6 +291,7 @@ static void dec_output_port_cb_static(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *b - - bool CMMALVideo::change_dec_output_format() - { -+ CSingleLock lock(m_sharedSection); - MMAL_STATUS_T status; - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) - CLog::Log(LOGDEBUG, "%s::%s", CLASSNAME, __func__); -@@ -325,6 +328,7 @@ bool CMMALVideo::change_dec_output_format() - - bool CMMALVideo::CreateDeinterlace(EINTERLACEMETHOD interlace_method) - { -+ CSingleLock lock(m_sharedSection); - MMAL_STATUS_T status; - - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -@@ -422,6 +426,7 @@ bool CMMALVideo::CreateDeinterlace(EINTERLACEMETHOD interlace_method) - - bool CMMALVideo::DestroyDeinterlace() - { -+ CSingleLock lock(m_sharedSection); - MMAL_STATUS_T status; - - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -@@ -478,6 +483,7 @@ bool CMMALVideo::DestroyDeinterlace() - - bool CMMALVideo::SendCodecConfigData() - { -+ CSingleLock lock(m_sharedSection); - MMAL_STATUS_T status; - if (!m_dec_input_pool) - return true; -@@ -507,6 +513,7 @@ bool CMMALVideo::SendCodecConfigData() - - bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options) - { -+ CSingleLock lock(m_sharedSection); - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) - CLog::Log(LOGDEBUG, "%s::%s usemmal:%d software:%d %dx%d", CLASSNAME, __func__, CSettings::Get().GetBool("videoplayer.usemmal"), hints.software, hints.width, hints.height); - -@@ -710,6 +717,7 @@ bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options) - void CMMALVideo::Dispose() - { - g_renderManager.PassCookie(NULL); -+ CSingleLock lock(m_sharedSection); - m_finished = true; - Reset(); - } -@@ -723,6 +731,7 @@ void CMMALVideo::SetDropState(bool bDrop) - int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) - { - g_renderManager.PassCookie(this); -+ CSingleLock lock(m_sharedSection); - //if (g_advancedSettings.CanLogComponent(LOGVIDEO)) - // CLog::Log(LOGDEBUG, "%s::%s - %-8p %-6d dts:%.3f pts:%.3f ready_queue(%d)", - // CLASSNAME, __func__, pData, iSize, dts == DVD_NOPTS_VALUE ? 0.0 : dts*1e-6, pts == DVD_NOPTS_VALUE ? 0.0 : pts*1e-6, m_output_ready.size()); -@@ -871,6 +880,7 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) - CLog::Log(LOGDEBUG, "%s::%s - Nothing to do: ready_queue(%d) demux_queue(%d) space(%d) preroll(%d)", - CLASSNAME, __func__, m_output_ready.size(), m_demux_queue_length, mmal_queue_length(m_dec_input_pool->queue) * m_dec_input->buffer_size, m_preroll); -+ lock.Leave(); - Sleep(10); // otherwise we busy spin - } - return ret; -@@ -878,6 +888,7 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) - - void CMMALVideo::Reset(void) - { -+ CSingleLock lock(m_sharedSection); - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) - CLog::Log(LOGDEBUG, "%s::%s", CLASSNAME, __func__); - -@@ -942,6 +953,7 @@ void CMMALVideo::SetSpeed(int iSpeed) - - void CMMALVideo::Recycle(MMAL_BUFFER_HEADER_T *buffer) - { -+ CSingleLock lock(m_sharedSection); - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) - CLog::Log(LOGDEBUG, "%s::%s %p", CLASSNAME, __func__, buffer); - -@@ -967,6 +979,7 @@ void CMMALVideo::Recycle(MMAL_BUFFER_HEADER_T *buffer) - - bool CMMALVideo::GetPicture(DVDVideoPicture* pDvdVideoPicture) - { -+ CSingleLock lock(m_sharedSection); - if (!m_output_ready.empty()) - { - CMMALVideoBuffer *buffer; -@@ -1026,6 +1039,7 @@ bool CMMALVideo::GetPicture(DVDVideoPicture* pDvdVideoPicture) - - bool CMMALVideo::ClearPicture(DVDVideoPicture* pDvdVideoPicture) - { -+ CSingleLock lock(m_sharedSection); - if (pDvdVideoPicture->format == RENDER_FMT_MMAL) - { - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -@@ -1038,12 +1052,14 @@ bool CMMALVideo::ClearPicture(DVDVideoPicture* pDvdVideoPicture) - - bool CMMALVideo::GetCodecStats(double &pts, int &droppedPics) - { -+ CSingleLock lock(m_sharedSection); - droppedPics= -1; - return false; - } - - void CMMALVideo::SetCodecControl(int flags) - { -+ CSingleLock lock(m_sharedSection); - m_codecControlFlags = flags; - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) - CLog::Log(LOGDEBUG, "%s::%s flags:%x", CLASSNAME, __func__, flags); -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -index 3e444f7..e686b4b 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -@@ -132,6 +132,7 @@ class CMMALVideo : public CDVDVideoCodec - bool m_preroll; - int m_codecControlFlags; - -+ CCriticalSection m_sharedSection; - MMAL_COMPONENT_T *m_dec; - MMAL_PORT_T *m_dec_input; - MMAL_PORT_T *m_dec_output; - -From d693f1d572b85e7c2e0c230bd518d0e3c094d938 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Fri, 17 Apr 2015 15:59:12 +0100 -Subject: [PATCH 54/56] [mmalrenderer] Add shared lock around MMAL operations - ---- - xbmc/cores/VideoRenderers/MMALRenderer.cpp | 11 ++++++++++- - xbmc/cores/VideoRenderers/MMALRenderer.h | 1 + - 2 files changed, 11 insertions(+), 1 deletion(-) - -diff --git a/xbmc/cores/VideoRenderers/MMALRenderer.cpp b/xbmc/cores/VideoRenderers/MMALRenderer.cpp -index 05ccbac..270036d 100644 ---- a/xbmc/cores/VideoRenderers/MMALRenderer.cpp -+++ b/xbmc/cores/VideoRenderers/MMALRenderer.cpp -@@ -43,6 +43,7 @@ - - void CMMALRenderer::Prime() - { -+ CSingleLock lock(m_sharedSection); - #if defined(MMAL_DEBUG_VERBOSE) - CLog::Log(LOGDEBUG, "%s::%s format:%d dec:%p pool:%p", CLASSNAME, __func__, m_format, m_mmal_video, m_vout_input_pool); - #endif -@@ -68,6 +69,7 @@ void CMMALRenderer::Prime() - - void *CMMALRenderer::PassCookie(void *cookie) - { -+ CSingleLock lock(m_sharedSection); - m_mmal_video = (CMMALVideo *)cookie; - #if defined(MMAL_DEBUG_VERBOSE) - CLog::Log(LOGDEBUG, "%s::%s cookie:%p", CLASSNAME, __func__, cookie); -@@ -115,6 +117,7 @@ static void vout_input_port_cb_static(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *b - - bool CMMALRenderer::init_vout(ERenderFormat format) - { -+ CSingleLock lock(m_sharedSection); - bool formatChanged = m_format != format; - MMAL_STATUS_T status; - -@@ -254,6 +257,7 @@ CMMALRenderer::CMMALRenderer() - - CMMALRenderer::~CMMALRenderer() - { -+ CSingleLock lock(m_sharedSection); - CLog::Log(LOGDEBUG, "%s::%s", CLASSNAME, __func__); - // shutdown thread - mmal_queue_put(m_release_queue, &m_quit_packet); -@@ -276,6 +280,7 @@ void CMMALRenderer::AddProcessor(CMMALVideoBuffer *buffer, int index) - - bool CMMALRenderer::Configure(unsigned int width, unsigned int height, unsigned int d_width, unsigned int d_height, float fps, unsigned flags, ERenderFormat format, unsigned extended_format, unsigned int orientation) - { -+ CSingleLock lock(m_sharedSection); - ReleaseBuffers(); - - m_sourceWidth = width; -@@ -363,7 +368,6 @@ int CMMALRenderer::GetImage(YV12Image *image, int source, bool readonly) - - void CMMALRenderer::ReleaseBuffer(int idx) - { -- CSingleLock lock(m_sharedSection); - if (!m_bMMALConfigured || m_format == RENDER_FMT_BYPASS) - return; - -@@ -403,6 +407,7 @@ void CMMALRenderer::Update() - - void CMMALRenderer::RenderUpdate(bool clear, DWORD flags, DWORD alpha) - { -+ CSingleLock lock(m_sharedSection); - int source = m_iYV12RenderBuffer; - #if defined(MMAL_DEBUG_VERBOSE) - CLog::Log(LOGDEBUG, "%s::%s - %d %x %d %d", CLASSNAME, __func__, clear, flags, alpha, source); -@@ -463,6 +468,7 @@ void CMMALRenderer::RenderUpdate(bool clear, DWORD flags, DWORD alpha) - - void CMMALRenderer::FlipPage(int source) - { -+ CSingleLock lock(m_sharedSection); - if (!m_bConfigured || m_format == RENDER_FMT_BYPASS) - return; - -@@ -475,6 +481,7 @@ void CMMALRenderer::FlipPage(int source) - - unsigned int CMMALRenderer::PreInit() - { -+ CSingleLock lock(m_sharedSection); - m_bConfigured = false; - UnInit(); - -@@ -506,6 +513,7 @@ void CMMALRenderer::ReleaseBuffers() - - void CMMALRenderer::UnInitMMAL() - { -+ CSingleLock lock(m_sharedSection); - CLog::Log(LOGDEBUG, "%s::%s", CLASSNAME, __func__); - if (m_vout) - { -@@ -619,6 +627,7 @@ EINTERLACEMETHOD CMMALRenderer::AutoInterlaceMethod() - - void CMMALRenderer::SetVideoRect(const CRect& InSrcRect, const CRect& InDestRect) - { -+ CSingleLock lock(m_sharedSection); - assert(g_graphicsContext.GetStereoView() != RENDER_STEREO_VIEW_RIGHT); - - if (!m_vout_input) -diff --git a/xbmc/cores/VideoRenderers/MMALRenderer.h b/xbmc/cores/VideoRenderers/MMALRenderer.h -index a694182..6474c1b 100644 ---- a/xbmc/cores/VideoRenderers/MMALRenderer.h -+++ b/xbmc/cores/VideoRenderers/MMALRenderer.h -@@ -112,6 +112,7 @@ class CMMALRenderer : public CBaseRenderer, public CThread - RENDER_STEREO_MODE m_display_stereo_mode; - bool m_StereoInvert; - -+ CCriticalSection m_sharedSection; - MMAL_COMPONENT_T *m_vout; - MMAL_PORT_T *m_vout_input; - MMAL_POOL_T *m_vout_input_pool; - -From 055a522a3a5298ad53f3d0bad491d43d7f562ac8 Mon Sep 17 00:00:00 2001 +From 0768d7332735c93b675a7553c2f50988e10218cd Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 21 Apr 2015 14:32:07 +0100 -Subject: [PATCH 56/56] [mmalrenderer] Add sharpness control +Subject: [PATCH 57/61] [mmalrenderer] Add sharpness control --- addons/resource.language.en_gb/resources/strings.po | 2 +- @@ -5907,10 +3055,10 @@ Subject: [PATCH 56/56] [mmalrenderer] Add sharpness control 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po -index fa25d45..94679d8 100644 +index d8ffaf4..474ffef 100644 --- a/addons/resource.language.en_gb/resources/strings.po +++ b/addons/resource.language.en_gb/resources/strings.po -@@ -7492,7 +7492,7 @@ msgstr "" +@@ -7474,7 +7474,7 @@ msgstr "" #: xbmc/video/dialogs/GUIDialogVideoSettings.cpp msgctxt "#16313" @@ -5920,18 +3068,18 @@ index fa25d45..94679d8 100644 #: xbmc/video/dialogs/GUIDialogVideoSettings.cpp diff --git a/xbmc/cores/VideoRenderers/MMALRenderer.cpp b/xbmc/cores/VideoRenderers/MMALRenderer.cpp -index e73feed..30e62b9 100644 +index 8ffcf23..67daa9e 100644 --- a/xbmc/cores/VideoRenderers/MMALRenderer.cpp +++ b/xbmc/cores/VideoRenderers/MMALRenderer.cpp -@@ -252,6 +252,7 @@ CMMALRenderer::CMMALRenderer() +@@ -207,6 +207,7 @@ CMMALRenderer::CMMALRenderer() m_bConfigured = false; m_bMMALConfigured = false; m_iYV12RenderBuffer = 0; + m_sharpness = -2.0f; - Create(); } -@@ -422,6 +423,15 @@ void CMMALRenderer::RenderUpdate(bool clear, DWORD flags, DWORD alpha) + CMMALRenderer::~CMMALRenderer() +@@ -373,6 +374,15 @@ void CMMALRenderer::RenderUpdate(bool clear, DWORD flags, DWORD alpha) if (m_RenderUpdateCallBackFn) (*m_RenderUpdateCallBackFn)(m_RenderUpdateCallBackCtx, m_sourceRect, m_destRect); @@ -5947,7 +3095,7 @@ index e73feed..30e62b9 100644 if (m_format == RENDER_FMT_BYPASS) return; -@@ -610,7 +620,8 @@ bool CMMALRenderer::Supports(ERENDERFEATURE feature) +@@ -559,7 +569,8 @@ bool CMMALRenderer::Supports(ERENDERFEATURE feature) feature == RENDERFEATURE_ZOOM || feature == RENDERFEATURE_ROTATION || feature == RENDERFEATURE_VERTICAL_SHIFT || @@ -5958,10 +3106,10 @@ index e73feed..30e62b9 100644 return false; diff --git a/xbmc/cores/VideoRenderers/MMALRenderer.h b/xbmc/cores/VideoRenderers/MMALRenderer.h -index 6474c1b..8a22454 100644 +index 1404fb3..9bced7e 100644 --- a/xbmc/cores/VideoRenderers/MMALRenderer.h +++ b/xbmc/cores/VideoRenderers/MMALRenderer.h -@@ -111,6 +111,7 @@ class CMMALRenderer : public CBaseRenderer, public CThread +@@ -105,6 +105,7 @@ class CMMALRenderer : public CBaseRenderer RENDER_STEREO_MODE m_video_stereo_mode; RENDER_STEREO_MODE m_display_stereo_mode; bool m_StereoInvert; @@ -5969,3 +3117,58 @@ index 6474c1b..8a22454 100644 CCriticalSection m_sharedSection; MMAL_COMPONENT_T *m_vout; + +From bbc34ab2aff74da8ce3ba13dd6937ea5f00f1844 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Fri, 24 Apr 2015 13:49:51 +0100 +Subject: [PATCH 58/61] [dvdplayer] Add back required include + +--- + xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +index 55fa8b1..23edcd6 100644 +--- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp ++++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +@@ -33,6 +33,7 @@ + #include "DVDCodecs/Video/DVDVideoPPFFmpeg.h" + #include "DVDCodecs/Video/DVDVideoCodecFFmpeg.h" + #include "DVDDemuxers/DVDDemux.h" ++#include "DVDDemuxers/DVDDemuxUtils.h" + #include "DVDOverlayRenderer.h" + #include "guilib/GraphicContext.h" + #include + +From 93943251b2afa14881cd57ba1cc7a1b917e007b9 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Tue, 5 May 2015 23:58:06 +0100 +Subject: [PATCH 60/61] [screensaver] Leave GUI contents available for + screensaver + +--- + xbmc/guilib/GUIWindowManager.cpp | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +diff --git a/xbmc/guilib/GUIWindowManager.cpp b/xbmc/guilib/GUIWindowManager.cpp +index a22fb74..eb35710 100644 +--- a/xbmc/guilib/GUIWindowManager.cpp ++++ b/xbmc/guilib/GUIWindowManager.cpp +@@ -792,7 +792,16 @@ void CGUIWindowManager::ActivateWindow_Internal(int iWindowID, const vectorClose(true, iWindowID); ++ } ++ else ++ { ++ CloseWindowSync(pWindow, iWindowID); ++ } ++ } + g_infoManager.SetNextWindow(WINDOW_INVALID); + + // Add window to the history list (we must do this before we activate it, From 601ea067e7f1c50bc77d87957c2fdc9c8e2667dd Mon Sep 17 00:00:00 2001 From: Stefan Saraev Date: Sun, 10 May 2015 20:51:51 +0300 Subject: [PATCH 13/23] nano: buildsys cosmetics --- packages/tools/nano/package.mk | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/tools/nano/package.mk b/packages/tools/nano/package.mk index 3ce09e3794..d39f55e382 100644 --- a/packages/tools/nano/package.mk +++ b/packages/tools/nano/package.mk @@ -35,9 +35,11 @@ PKG_AUTORECONF="yes" PKG_CONFIGURE_OPTS_TARGET="--disable-utf8 \ --disable-nls" -export CFLAGS="$CFLAGS -I$SYSROOT_PREFIX/usr/include/ncurses" -export LDFLAGS=`echo $LDFLAGS | sed -e "s|-Wl,--as-needed||"` -export LIBS="$LIBS -lz" +pre_configure_target() { + export CFLAGS="$CFLAGS -I$SYSROOT_PREFIX/usr/include/ncurses" + export LDFLAGS=`echo $LDFLAGS | sed -e "s|-Wl,--as-needed||"` + export LIBS="$LIBS -lz" +} post_makeinstall_target() { rm -rf $INSTALL/usr/share/nano From 8e10e7a1c4befdae619aa23ab4c616bcae60fe01 Mon Sep 17 00:00:00 2001 From: Stefan Saraev Date: Sun, 10 May 2015 20:56:33 +0300 Subject: [PATCH 14/23] hdparm: buildsys cosmetics --- packages/tools/hdparm/package.mk | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/tools/hdparm/package.mk b/packages/tools/hdparm/package.mk index 4326d859c0..351c11e6fb 100644 --- a/packages/tools/hdparm/package.mk +++ b/packages/tools/hdparm/package.mk @@ -33,5 +33,3 @@ PKG_IS_ADDON="no" PKG_AUTORECONF="no" PKG_MAKE_OPTS_TARGET="binprefix=/usr sbindir=/usr/bin" - -export LDFLAGS="$CFLAGS $LDFLAGS -fwhole-program" From d6248d18b59700d97487109372e959950e7dc599 Mon Sep 17 00:00:00 2001 From: Stefan Saraev Date: Sun, 10 May 2015 20:58:48 +0300 Subject: [PATCH 15/23] squashfs: buildsys cosmetics --- packages/sysutils/squashfs/package.mk | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/sysutils/squashfs/package.mk b/packages/sysutils/squashfs/package.mk index 7f9d355dfb..5c47ba499a 100644 --- a/packages/sysutils/squashfs/package.mk +++ b/packages/sysutils/squashfs/package.mk @@ -33,8 +33,6 @@ PKG_LONGDESC="Squashfs is intended to be a general read-only filesystem, for arc PKG_IS_ADDON="no" PKG_AUTORECONF="no" -export LDFLAGS="$LDFLAGS -fwhole-program" - make_host() { make -C squashfs-tools mksquashfs \ XZ_SUPPORT=1 LZO_SUPPORT=1 \ From 1a64e316457bd47f2db2174a988e44d209fdd076 Mon Sep 17 00:00:00 2001 From: Stefan Saraev Date: Sun, 10 May 2015 21:04:56 +0300 Subject: [PATCH 16/23] enca: buildsys cosmetics --- packages/devel/enca/package.mk | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/devel/enca/package.mk b/packages/devel/enca/package.mk index 2d70c49b8a..9d69e3193e 100644 --- a/packages/devel/enca/package.mk +++ b/packages/devel/enca/package.mk @@ -32,8 +32,6 @@ PKG_LONGDESC="Enca detects the encoding of text files, on the basis of knowledge PKG_IS_ADDON="no" PKG_AUTORECONF="yes" -export CFLAGS="$CFLAGS -fPIC -DPIC" - PKG_MAKEINSTALL_OPTS_TARGET="-C lib" PKG_CONFIGURE_OPTS_TARGET="ac_cv_file__dev_random=yes \ ac_cv_file__dev_urandom=no \ @@ -47,6 +45,10 @@ PKG_CONFIGURE_OPTS_TARGET="ac_cv_file__dev_random=yes \ --disable-rpath \ --with-gnu-ld" +pre_configure_target() { + export CFLAGS="$CFLAGS -fPIC -DPIC" +} + pre_make_target() { make CC="$HOST_CC" \ CPPFLAGS="$HOST_CPPFLAGS" \ From fa1a2f74068f79fc094881df340a0e9346fb6082 Mon Sep 17 00:00:00 2001 From: Stefan Saraev Date: Sun, 10 May 2015 21:07:19 +0300 Subject: [PATCH 17/23] fribidi: buildsys cosmetics --- packages/devel/fribidi/package.mk | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/devel/fribidi/package.mk b/packages/devel/fribidi/package.mk index 5ba286fdc6..34cd38aef7 100644 --- a/packages/devel/fribidi/package.mk +++ b/packages/devel/fribidi/package.mk @@ -42,8 +42,10 @@ PKG_CONFIGURE_OPTS_TARGET="--disable-shared \ --with-gnu-ld \ --without-glib" -export CFLAGS="$CFLAGS -DFRIBIDI_CHUNK_SIZE=4080" -export CFLAGS="$CFLAGS -fPIC -DPIC" +pre_configure_target() { + export CFLAGS="$CFLAGS -DFRIBIDI_CHUNK_SIZE=4080" + export CFLAGS="$CFLAGS -fPIC -DPIC" +} post_makeinstall_target() { mkdir -p $ROOT/$TOOLCHAIN/bin From fe5af073330f89dced3ab9d6429bd9e2869eac23 Mon Sep 17 00:00:00 2001 From: Stefan Saraev Date: Sun, 10 May 2015 21:10:02 +0300 Subject: [PATCH 18/23] xorg-launch-helper: buildsys cosmetics --- packages/x11/util/xorg-launch-helper/package.mk | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/x11/util/xorg-launch-helper/package.mk b/packages/x11/util/xorg-launch-helper/package.mk index 6733e2d201..424f373dc7 100644 --- a/packages/x11/util/xorg-launch-helper/package.mk +++ b/packages/x11/util/xorg-launch-helper/package.mk @@ -32,7 +32,9 @@ PKG_LONGDESC="Xorg-launch-helper is a small utility that transforms the X server PKG_IS_ADDON="no" PKG_AUTORECONF="yes" -export LIBS="-lsystemd" +pre_configure_target() { + export LIBS="-lsystemd" +} post_makeinstall_target() { # do not install systemd services From 4986022b9f406b6298811c9019ddf811868ae935 Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Sun, 10 May 2015 22:09:25 +0200 Subject: [PATCH 19/23] sqlite: update to sqlite-autoconf-3081001 Signed-off-by: Stephan Raue --- packages/databases/sqlite/package.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/databases/sqlite/package.mk b/packages/databases/sqlite/package.mk index 01a2a473b9..bb1a13abbe 100644 --- a/packages/databases/sqlite/package.mk +++ b/packages/databases/sqlite/package.mk @@ -17,7 +17,7 @@ ################################################################################ PKG_NAME="sqlite" -PKG_VERSION="autoconf-3081000" +PKG_VERSION="autoconf-3081001" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="PublicDomain" From 6f00a01a24b28dc37b286dbd756fdb91f060ba3a Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Tue, 12 May 2015 10:03:32 +0200 Subject: [PATCH 20/23] mesa: update to mesa-10.5.5 Signed-off-by: Stephan Raue --- packages/graphics/mesa/package.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/graphics/mesa/package.mk b/packages/graphics/mesa/package.mk index 6fe7ca9d43..04c51f4666 100644 --- a/packages/graphics/mesa/package.mk +++ b/packages/graphics/mesa/package.mk @@ -17,7 +17,7 @@ ################################################################################ PKG_NAME="mesa" -PKG_VERSION="10.5.4" +PKG_VERSION="10.5.5" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="OSS" From e045e8e0dde2a3c3b700c35012aba568f6af8352 Mon Sep 17 00:00:00 2001 From: Daniel Schaal Date: Tue, 12 May 2015 10:14:38 +0200 Subject: [PATCH 21/23] projects/imx6/patches/linux: fix dvbsky driver --- .../imx6/patches/linux/linux-250-fix-dvbsky.patch | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 projects/imx6/patches/linux/linux-250-fix-dvbsky.patch diff --git a/projects/imx6/patches/linux/linux-250-fix-dvbsky.patch b/projects/imx6/patches/linux/linux-250-fix-dvbsky.patch new file mode 100644 index 0000000000..f72b138978 --- /dev/null +++ b/projects/imx6/patches/linux/linux-250-fix-dvbsky.patch @@ -0,0 +1,15 @@ +diff -Naur linux-cuboxi-3.14-ea83bda.orig/drivers/media/usb/dvb-usb-v2/dvbsky.c linux-cuboxi-3.14-ea83bda/drivers/media/usb/dvb-usb-v2/dvbsky.c +--- linux-cuboxi-3.14-ea83bda.orig/drivers/media/usb/dvb-usb-v2/dvbsky.c 2015-05-12 07:55:11.516604741 +0200 ++++ linux-cuboxi-3.14-ea83bda/drivers/media/usb/dvb-usb-v2/dvbsky.c 2015-05-12 07:58:19.750871492 +0200 +@@ -280,7 +280,11 @@ + .i2c_wr_max = 33, + .clock_out = 0, + .ts_mode = M88DS3103_TS_CI, ++ .ts_clk = 16000, ++ .ts_clk_pol = 0, + .agc = 0x99, ++ .lnb_hv_pol = 1, ++ .lnb_en_pol = 1, + }; + + static int dvbsky_s960_attach(struct dvb_usb_adapter *adap) From 50d086b1b21645b0baec881a72fc3c4476f7ade5 Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Tue, 12 May 2015 11:31:38 +0200 Subject: [PATCH 22/23] libbluray: update to libbluray-0.8.0, enable UDF support Signed-off-by: Stephan Raue --- packages/multimedia/libbluray/package.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/multimedia/libbluray/package.mk b/packages/multimedia/libbluray/package.mk index 5d399fd611..639d99883a 100644 --- a/packages/multimedia/libbluray/package.mk +++ b/packages/multimedia/libbluray/package.mk @@ -17,7 +17,7 @@ ################################################################################ PKG_NAME="libbluray" -PKG_VERSION="0.6.2" +PKG_VERSION="0.8.0" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="GPL" @@ -45,6 +45,7 @@ PKG_CONFIGURE_OPTS_TARGET="--disable-werror \ --disable-optimizations \ --disable-examples \ --disable-bdjava \ + --enable-udf \ --disable-doxygen-doc \ --disable-doxygen-dot \ --disable-doxygen-man \ From 6cacd6f73c859152ed22ab8471c1b0c76e9b868b Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Tue, 12 May 2015 11:35:18 +0200 Subject: [PATCH 23/23] libbdplus: update to libbdplus-0.1.2 Signed-off-by: Stephan Raue --- packages/multimedia/libbdplus/package.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/multimedia/libbdplus/package.mk b/packages/multimedia/libbdplus/package.mk index 2a80c835a0..4cbd80c633 100644 --- a/packages/multimedia/libbdplus/package.mk +++ b/packages/multimedia/libbdplus/package.mk @@ -17,7 +17,7 @@ ################################################################################ PKG_NAME="libbdplus" -PKG_VERSION="0.1.1" +PKG_VERSION="0.1.2" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="GPL"