From: Stefan Agner <[email protected]> Add NXP specific patches from morty-4.9.51-mx8_beta branch. This allows to use imx-gst1.0-plugin 4.3.1 with gstreamer 1.12.2.
Signed-off-by: Stefan Agner <[email protected]> --- ...Need-to-check-if-pa-stream-is-still-valid.patch | 39 +++ .../0002-Fix-aacpase-error-tolerance-issue.patch | 34 +++ ...-MMFMWK-7274-mx8dv-Enable-camera-on-mx8dv.patch | 37 +++ ...-Fix-adif-aac-file-read-channel-progile-i.patch | 267 +++++++++++++++++++++ .../gstreamer1.0-plugins-good_1.12.%.bbappend | 11 + 5 files changed, 388 insertions(+) create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-good/0001-Need-to-check-if-pa-stream-is-still-valid.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-good/0002-Fix-aacpase-error-tolerance-issue.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-good/0003-MMFMWK-7274-mx8dv-Enable-camera-on-mx8dv.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-good/0004-gstaacparse-Fix-adif-aac-file-read-channel-progile-i.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.12.%.bbappend diff --git a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good/0001-Need-to-check-if-pa-stream-is-still-valid.patch b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good/0001-Need-to-check-if-pa-stream-is-still-valid.patch new file mode 100644 index 00000000..f2ee02ed --- /dev/null +++ b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good/0001-Need-to-check-if-pa-stream-is-still-valid.patch @@ -0,0 +1,39 @@ +From a4af947cb793cd3b9550c76d1ea8db7d3a94612a Mon Sep 17 00:00:00 2001 +From: Jian <[email protected]> +Date: Tue, 3 Feb 2015 17:08:40 +0800 +Subject: [PATCH 2/4] Need to check if pa stream is still valid + +Fixed the issue that will report pulse server is dead +when doing audio track switching. +Need to check if pa stream is valid as it may be released +by caps change. + +Upstream-Status: Submitted +https://bugzilla.gnome.org/show_bug.cgi?id=743912 + +Signed-off-by: Jian <[email protected]> +--- + ext/pulse/pulsesink.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/ext/pulse/pulsesink.c b/ext/pulse/pulsesink.c +index 521c4a6..931f1c8 100644 +--- a/ext/pulse/pulsesink.c ++++ b/ext/pulse/pulsesink.c +@@ -2022,6 +2022,13 @@ gst_pulsesink_get_time (GstClock * clock, GstAudioBaseSink * sink) + } + + pa_threaded_mainloop_lock (mainloop); ++ ++ /* Need to check if pa stream is valid as it may be released by caps change*/ ++ if (!pbuf->stream) { ++ pa_threaded_mainloop_unlock (mainloop); ++ return GST_CLOCK_TIME_NONE; ++ } ++ + if (gst_pulsering_is_dead (psink, pbuf, TRUE)) + goto server_dead; + +-- +1.9.1 + diff --git a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good/0002-Fix-aacpase-error-tolerance-issue.patch b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good/0002-Fix-aacpase-error-tolerance-issue.patch new file mode 100644 index 00000000..5430df95 --- /dev/null +++ b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good/0002-Fix-aacpase-error-tolerance-issue.patch @@ -0,0 +1,34 @@ +From db527a6db0c55322174ff6baa389ac8b110ec662 Mon Sep 17 00:00:00 2001 +From: Lyon Wang <[email protected]> +Date: Fri, 6 Feb 2015 11:27:47 +0800 +Subject: [PATCH 3/4] Fix aacpase error tolerance issue + +There is no need to check channel configure in adts header. +The channel could be output of decoder. +No need to return fatal error here. + +https://bugzilla.gnome.org/show_bug.cgi?id=743332 + +Upstream-Status: Pending + +Signed-off-by: Lyon Wang <[email protected]> +--- + gst/audioparsers/gstaacparse.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gst/audioparsers/gstaacparse.c b/gst/audioparsers/gstaacparse.c +index cabd961..09a53cc 100644 +--- a/gst/audioparsers/gstaacparse.c ++++ b/gst/audioparsers/gstaacparse.c +@@ -915,7 +915,7 @@ gst_aac_parse_detect_stream (GstAacParse * aacparse, + gst_aac_parse_parse_adts_header (aacparse, data, &rate, &channels, + &aacparse->object_type, &aacparse->mpegversion); + +- if (!channels || !framesize) { ++ if (!framesize) { + GST_DEBUG_OBJECT (aacparse, "impossible ADTS configuration"); + return FALSE; + } +-- +1.9.1 + diff --git a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good/0003-MMFMWK-7274-mx8dv-Enable-camera-on-mx8dv.patch b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good/0003-MMFMWK-7274-mx8dv-Enable-camera-on-mx8dv.patch new file mode 100644 index 00000000..66d8ec6b --- /dev/null +++ b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good/0003-MMFMWK-7274-mx8dv-Enable-camera-on-mx8dv.patch @@ -0,0 +1,37 @@ +From 4a37ac1ffc2952fb6dedec914dcd336dbaf5dff5 Mon Sep 17 00:00:00 2001 +From: Song Bing <[email protected]> +Date: Fri, 21 Oct 2016 11:24:05 +0800 +Subject: [PATCH 4/4] MMFMWK-7274 [mx8dv] Enable camera on mx8dv + +Set memory allocate by camera as physical continuoues. + +Signed-off-by: Song Bing [email protected] +--- + sys/v4l2/gstv4l2allocator.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/sys/v4l2/gstv4l2allocator.c b/sys/v4l2/gstv4l2allocator.c +index 2047383..ecab01e 100644 +--- a/sys/v4l2/gstv4l2allocator.c ++++ b/sys/v4l2/gstv4l2allocator.c +@@ -818,7 +818,7 @@ gst_v4l2_allocator_alloc_mmap (GstV4l2Allocator * allocator) + "mmap buffer length %d, data offset %d, plane %d", + group->planes[i].length, group->planes[i].data_offset, i); + +- group->mem[i] = (GstMemory *) _v4l2mem_new (0, GST_ALLOCATOR (allocator), ++ group->mem[i] = (GstMemory *) _v4l2mem_new (GST_MEMORY_FLAG_PHYSICALLY_CONTIGUOUS, GST_ALLOCATOR (allocator), + NULL, group->planes[i].length, 0, 0, group->planes[i].length, i, + data, -1, group); + } else { +@@ -879,7 +879,7 @@ gst_v4l2_allocator_alloc_dmabuf (GstV4l2Allocator * allocator, + GST_LOG_OBJECT (allocator, "exported DMABUF as fd %i plane %d", + expbuf.fd, i); + +- group->mem[i] = (GstMemory *) _v4l2mem_new (0, GST_ALLOCATOR (allocator), ++ group->mem[i] = (GstMemory *) _v4l2mem_new (GST_MEMORY_FLAG_PHYSICALLY_CONTIGUOUS, GST_ALLOCATOR (allocator), + NULL, group->planes[i].length, 0, 0, group->planes[i].length, i, + NULL, expbuf.fd, group); + } else { +-- +1.9.1 + diff --git a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good/0004-gstaacparse-Fix-adif-aac-file-read-channel-progile-i.patch b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good/0004-gstaacparse-Fix-adif-aac-file-read-channel-progile-i.patch new file mode 100644 index 00000000..a77917c7 --- /dev/null +++ b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good/0004-gstaacparse-Fix-adif-aac-file-read-channel-progile-i.patch @@ -0,0 +1,267 @@ +From b2c850f295a0fe49310fb60784ac6af4a29bceae Mon Sep 17 00:00:00 2001 +From: Lyon Wang <[email protected]> +Date: Fri, 9 Jun 2017 16:53:11 +0800 +Subject: [PATCH] gstaacparse: Fix adif aac file read channel/progile issue + +- parser adif program_config_element() to get correct channel +- Fix aacparse src pad caps wrong profile for ADIF file + +Upstream status: submitted. +Combined 2 bugzilla ticket: +https://bugzilla.gnome.org/show_bug.cgi?id=783583 +https://bugzilla.gnome.org/show_bug.cgi?id=785476 + +Signed-off-by: Lyon Wang <[email protected]> +--- + gst/audioparsers/gstaacparse.c | 203 ++++++++++++++++++++++++++++++----------- + 1 file changed, 152 insertions(+), 51 deletions(-) + +diff --git a/gst/audioparsers/gstaacparse.c b/gst/audioparsers/gstaacparse.c +index 16d66e2..e2c2bc9 100644 +--- a/gst/audioparsers/gstaacparse.c ++++ b/gst/audioparsers/gstaacparse.c +@@ -85,6 +85,35 @@ static const gint loas_channels_table[16] = { + 0, 0, 0, 7, 8, 0, 8, 0 + }; + ++typedef struct ++{ ++ guint32 num_ele; ++ guint32 ele_is_cpe[16]; ++ guint32 ele_tag[16]; ++} GstAacEleList; ++ ++typedef struct ++{ ++ guint32 present; ++ guint32 ele_tag; ++ guint32 pseudo_enab; ++} GstAacMIXdown; ++ ++typedef struct ++{ ++ guint32 profile; ++ guint32 sr_idx; ++ GstAacEleList front; ++ GstAacEleList side; ++ GstAacEleList back; ++ GstAacEleList data; ++ GstAacEleList lfe; ++ GstAacEleList coupling; ++ GstAacMIXdown mono_mix; ++ GstAacMIXdown stereo_mix; ++ GstAacMIXdown matrix_mix; ++} GstAacProgConfig; ++ + static gboolean gst_aac_parse_start (GstBaseParse * parse); + static gboolean gst_aac_parse_stop (GstBaseParse * parse); + +@@ -104,6 +133,9 @@ static gboolean gst_aac_parse_read_audio_specific_config (GstAacParse * + aacparse, GstBitReader * br, gint * object_type, gint * sample_rate, + gint * channels, gint * frame_samples); + ++static gboolean gst_aac_parse_read_program_config_element (GstAacProgConfig * ++ progConfig, GstBitReader * br); ++ + + #define gst_aac_parse_parent_class parent_class + G_DEFINE_TYPE (GstAacParse, gst_aac_parse, GST_TYPE_BASE_PARSE); +@@ -844,6 +876,87 @@ gst_aac_parse_parse_adts_header (GstAacParse * aacparse, const guint8 * data, + *object = ((data[2] & 0xc0) >> 6) + 1; + } + ++static void ++gst_aac_parse_get_ele_list (GstAacEleList * pList, gint32 cpe, ++ GstBitReader * br) ++{ ++ guint32 count, num_elem; ++ num_elem = pList->num_ele; ++ for (count = 0; count < num_elem; count++) { ++ if (cpe) { ++ gst_bit_reader_get_bits_uint32 (br, &(pList->ele_is_cpe[count]), 1); ++ } else { ++ pList->ele_is_cpe[count] = 0; ++ } ++ gst_bit_reader_get_bits_uint32 (br, &(pList->ele_tag[count]), 4); ++ } ++} ++ ++static gint32 ++gst_aac_parse_get_config_channels (GstAacEleList * pList) ++{ ++ guint32 count, num_elem, channels = 0; ++ num_elem = pList->num_ele; ++ for (count = 0; count < num_elem; count++) { ++ channels++; ++ if (pList->ele_is_cpe[count] == 1) { ++ /* CPE element channels++ */ ++ channels++; ++ } ++ } ++ return channels; ++} ++ ++/* Read program config element ++ISO/IEC 14496-3, 4.4.1.1 read program config element */ ++static gboolean ++gst_aac_parse_read_program_config_element (GstAacProgConfig * ++ progConfig, GstBitReader * br) ++{ ++ guint32 count = 0; ++ guint32 bytes = 0; ++ ++ gst_bit_reader_skip (br, 4); //element_instance_tag ++ ++ gst_bit_reader_get_bits_uint32 (br, &progConfig->profile, 2); ++ gst_bit_reader_get_bits_uint32 (br, &progConfig->sr_idx, 4); ++ gst_bit_reader_get_bits_uint32 (br, &(progConfig->front.num_ele), 4); ++ gst_bit_reader_get_bits_uint32 (br, &(progConfig->side.num_ele), 4); ++ gst_bit_reader_get_bits_uint32 (br, &(progConfig->back.num_ele), 4); ++ gst_bit_reader_get_bits_uint32 (br, &(progConfig->lfe.num_ele), 2); ++ gst_bit_reader_get_bits_uint32 (br, &(progConfig->data.num_ele), 3); ++ gst_bit_reader_get_bits_uint32 (br, &(progConfig->coupling.num_ele), 4); ++ ++ gst_bit_reader_get_bits_uint32 (br, &(progConfig->mono_mix.present), 1); ++ if (progConfig->mono_mix.present) { ++ gst_bit_reader_get_bits_uint32 (br, &(progConfig->mono_mix.ele_tag), 4); ++ } ++ gst_bit_reader_get_bits_uint32 (br, &(progConfig->stereo_mix.present), 1); ++ if (progConfig->mono_mix.present) { ++ gst_bit_reader_get_bits_uint32 (br, &(progConfig->stereo_mix.ele_tag), 4); ++ } ++ gst_bit_reader_get_bits_uint32 (br, &(progConfig->matrix_mix.present), 1); ++ if (progConfig->mono_mix.present) { ++ gst_bit_reader_get_bits_uint32 (br, &(progConfig->matrix_mix.ele_tag), 2); ++ gst_bit_reader_get_bits_uint32 (br, &(progConfig->matrix_mix.pseudo_enab), 1); ++ } ++ ++ gst_aac_parse_get_ele_list (&progConfig->front, 1, br); ++ gst_aac_parse_get_ele_list (&progConfig->side, 1, br); ++ gst_aac_parse_get_ele_list (&progConfig->back, 1, br); ++ gst_aac_parse_get_ele_list (&progConfig->data, 0, br); ++ gst_aac_parse_get_ele_list (&progConfig->lfe, 0, br); ++ gst_aac_parse_get_ele_list (&progConfig->coupling, 1, br); ++ ++ gst_bit_reader_skip_to_byte (br); // byte_alignment ++ ++ gst_bit_reader_get_bits_uint32 (br, &bytes, 8); //comment_field_bytes ++ for (count = 0; count < bytes; count++) { ++ gst_bit_reader_skip (br, 8); //skip comment data ++ } ++ return TRUE; ++} ++ + /** + * gst_aac_parse_detect_stream: + * @aacparse: #GstAacParse. +@@ -973,68 +1086,56 @@ gst_aac_parse_detect_stream (GstAacParse * aacparse, + return FALSE; + + if (memcmp (data + i, "ADIF", 4) == 0) { +- const guint8 *adif; +- int skip_size = 0; +- int bitstream_type; ++ GstBitReader br; ++ guint8 u8 = 0; ++ guint8 bitstream_type = 0; ++ guint num_elems = 0; ++ guint bitrate = 0; ++ guint count; + int sr_idx; + GstCaps *sinkcaps; +- ++ GstAacProgConfig *progConfig; + aacparse->header_type = DSPAAC_HEADER_ADIF; + aacparse->mpegversion = 4; +- +- /* Skip the "ADIF" bytes */ +- adif = data + i + 4; +- +- /* copyright string */ +- if (adif[0] & 0x80) +- skip_size += 9; /* skip 9 bytes */ +- +- bitstream_type = adif[0 + skip_size] & 0x10; +- aacparse->bitrate = +- ((unsigned int) (adif[0 + skip_size] & 0x0f) << 19) | +- ((unsigned int) adif[1 + skip_size] << 11) | +- ((unsigned int) adif[2 + skip_size] << 3) | +- ((unsigned int) adif[3 + skip_size] & 0xe0); +- +- /* CBR */ ++ gst_bit_reader_init (&br, data + i, avail - i); ++ /* skip sync word (adif 4 byte ) */ ++ gst_bit_reader_skip (&br, 32); ++ gst_bit_reader_get_bits_uint8 (&br, &u8, 1); ++ if (u8) { ++ gst_bit_reader_skip (&br, 72); //copyright_id ++ } ++ gst_bit_reader_skip (&br, 2); // original_copy and home ++ gst_bit_reader_get_bits_uint8 (&br, &bitstream_type, 1); ++ gst_bit_reader_get_bits_uint32 (&br, &bitrate, 23); ++ gst_bit_reader_get_bits_uint32 (&br, &num_elems, 4); + if (bitstream_type == 0) { +-#if 0 +- /* Buffer fullness parsing. Currently not needed... */ +- guint num_elems = 0; +- guint fullness = 0; +- +- num_elems = (adif[3 + skip_size] & 0x1e); +- GST_INFO ("ADIF num_config_elems: %d", num_elems); +- +- fullness = ((unsigned int) (adif[3 + skip_size] & 0x01) << 19) | +- ((unsigned int) adif[4 + skip_size] << 11) | +- ((unsigned int) adif[5 + skip_size] << 3) | +- ((unsigned int) (adif[6 + skip_size] & 0xe0) >> 5); +- +- GST_INFO ("ADIF buffer fullness: %d", fullness); +-#endif +- aacparse->object_type = ((adif[6 + skip_size] & 0x01) << 1) | +- ((adif[7 + skip_size] & 0x80) >> 7); +- sr_idx = (adif[7 + skip_size] & 0x78) >> 3; ++ gst_bit_reader_skip (&br, 20); //adif_buffer_fullness + } +- /* VBR */ +- else { +- aacparse->object_type = (adif[4 + skip_size] & 0x18) >> 3; +- sr_idx = ((adif[4 + skip_size] & 0x07) << 1) | +- ((adif[5 + skip_size] & 0x80) >> 7); ++ ++ progConfig = ++ (GstAacProgConfig *) g_malloc0 ((num_elems+1) * sizeof (GstAacProgConfig)); ++ for ( count = 0; count < num_elems + 1; count++) { ++ gst_aac_parse_read_program_config_element (&progConfig[count], &br); ++ aacparse->channels += ++ gst_aac_parse_get_config_channels (&(progConfig[count].front)); ++ aacparse->channels += ++ gst_aac_parse_get_config_channels (&(progConfig[count].side)); ++ aacparse->channels += ++ gst_aac_parse_get_config_channels (&(progConfig[count].back)); ++ aacparse->channels += ++ gst_aac_parse_get_config_channels (&(progConfig[count].lfe)); ++ aacparse->channels += ++ gst_aac_parse_get_config_channels (&(progConfig[count].coupling)); + } + +- /* FIXME: This gives totally wrong results. Duration calculation cannot +- be based on this */ ++ aacparse->bitrate = (gint)bitrate; ++ aacparse->object_type = progConfig[0].profile + 1; ++ sr_idx = progConfig[0].sr_idx; ++ g_free(progConfig); ++ + aacparse->sample_rate = + gst_codec_utils_aac_get_sample_rate_from_index (sr_idx); + +- /* baseparse is not given any fps, +- * so it will give up on timestamps, seeking, etc */ +- +- /* FIXME: Can we assume this? */ +- aacparse->channels = 2; +- + GST_INFO ("ADIF: br=%d, samplerate=%d, objtype=%d", + aacparse->bitrate, aacparse->sample_rate, aacparse->object_type); + +-- +1.9.1 + diff --git a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.12.%.bbappend b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.12.%.bbappend new file mode 100644 index 00000000..981428d7 --- /dev/null +++ b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.12.%.bbappend @@ -0,0 +1,11 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" + +SRC_URI_IMX_PATCHES = " \ + file://0001-Need-to-check-if-pa-stream-is-still-valid.patch \ + file://0002-Fix-aacpase-error-tolerance-issue.patch \ + file://0003-MMFMWK-7274-mx8dv-Enable-camera-on-mx8dv.patch \ + file://0004-gstaacparse-Fix-adif-aac-file-read-channel-progile-i.patch \ +" + +SRC_URI_append_mx6 = "${SRC_URI_IMX_PATCHES}" +SRC_URI_append_mx7 = "${SRC_URI_IMX_PATCHES}" -- 2.13.6 -- _______________________________________________ meta-freescale mailing list [email protected] https://lists.yoctoproject.org/listinfo/meta-freescale
