From: Gilbok Lee Date: Fri, 8 Dec 2017 09:16:39 +0000 (+0900) Subject: Merge missing tizen patch X-Git-Tag: accepted/tizen/unified/20220217.153506~2^2~10^2~9^2~14^2~3^2~62^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5f438c5ff5c156efa93bae97d90bd07ba0b6a11f;p=platform%2Fupstream%2Fgstreamer.git Merge missing tizen patch Change-Id: Id1a530971781516e8f5dde4b19a09634144446c2 --- diff --git a/gst/audioparsers/gstaacparse.c b/gst/audioparsers/gstaacparse.c index 755b8a9..e1f882d 100644 --- a/gst/audioparsers/gstaacparse.c +++ b/gst/audioparsers/gstaacparse.c @@ -171,11 +171,6 @@ gst_aac_parse_class_init (GstAacParseClass * klass) parse_class->pre_push_frame = GST_DEBUG_FUNCPTR (gst_aac_parse_pre_push_frame); parse_class->src_event = GST_DEBUG_FUNCPTR (gst_aac_parse_src_event); - -//#ifdef TIZEN_FEATURE_AACPARSE_MODIFICATION // FIXME - /* make full aac(adts) index table when seek */ -// parse_class->src_event = GST_DEBUG_FUNCPTR (gst_aac_parse_src_eventfunc); -//#endif } @@ -1730,8 +1725,16 @@ gst_aac_parse_src_event (GstBaseParse * parse, GstEvent * event) aacparse->last_parsed_channels = 0; aacparse->last_parsed_sample_rate = 0; } +#ifdef TIZEN_FEATURE_AACPARSE_MODIFICATION + GST_DEBUG ("Entering gst_aac_parse_src_eventfunc header type = %d", + aacparse->header_type); + if (aacparse->header_type == DSPAAC_HEADER_ADTS) + return gst_aac_parse_adts_src_eventfunc (parse, event); +aac_seek_null_exit: +#endif return GST_BASE_PARSE_CLASS (parent_class)->src_event (parse, event); + } #ifdef TIZEN_FEATURE_AACPARSE_MODIFICATION @@ -2088,26 +2091,6 @@ gst_aac_parse_adts_get_fast_frame_len (const guint8 * data) return length; } -static gboolean -gst_aac_parse_src_eventfunc (GstBaseParse * parse, GstEvent * event) -{ - gboolean handled = FALSE; - GstAacParse *aacparse; - aacparse = GST_AAC_PARSE (parse); - - GST_DEBUG ("Entering gst_aac_parse_src_eventfunc header type = %d", - aacparse->header_type); - if (aacparse->header_type == DSPAAC_HEADER_ADTS) - return gst_aac_parse_adts_src_eventfunc (parse, event); - else - goto aac_seek_null_exit; -aac_seek_null_exit: - - /* call baseparse src_event function to handle event */ - handled = GST_BASE_PARSE_CLASS (parent_class)->src_event (parse, event); - return handled; -} - /** * gst_aac_parse_adts_src_eventfunc: * @parse: #GstBaseParse. #event diff --git a/gst/flv/gstflvdemux.c b/gst/flv/gstflvdemux.c index 61f29d5..0feabf6 100644 --- a/gst/flv/gstflvdemux.c +++ b/gst/flv/gstflvdemux.c @@ -969,6 +969,15 @@ gst_flv_demux_push_tags (GstFlvDemux * demux) gst_flv_demux_push_src_event (demux, gst_event_new_tag (gst_tag_list_copy (demux->taglist))); +#ifdef TIZEN_FEATURE_FLVDEMUX_MODIFICATION + GST_DEBUG_OBJECT (demux, "post tag msg %" GST_PTR_FORMAT, demux->taglist); + + /* post message flv tag (for early recive application) */ + gst_element_post_message (GST_ELEMENT_CAST (demux), + gst_message_new_tag (GST_OBJECT_CAST (demux), + gst_tag_list_copy (demux->taglist))); +#endif + if (demux->audio_pad) { GST_DEBUG_OBJECT (demux->audio_pad, "pushing audio %" GST_PTR_FORMAT, demux->audio_tags); diff --git a/gst/isomp4/qtdemux.c b/gst/isomp4/qtdemux.c index 419d9e3..f801b8f 100644 --- a/gst/isomp4/qtdemux.c +++ b/gst/isomp4/qtdemux.c @@ -143,7 +143,6 @@ struct _QtDemuxSphericalMetadata QTDEMUX_AMBISONIC_ORDER ambisonic_order; }; -QtDemuxSphericalMetadata *spherical_metadata; #endif /* TIZEN_FEATURE_QTDEMUX_MODIFICATION */ /* Macros for converting to/from timescale */ @@ -704,29 +703,29 @@ gst_qtdemux_init (GstQTDemux * qtdemux) qtdemux->flowcombiner = gst_flow_combiner_new (); #ifdef TIZEN_FEATURE_QTDEMUX_MODIFICATION - spherical_metadata = (QtDemuxSphericalMetadata *) + qtdemux->spherical_metadata = (QtDemuxSphericalMetadata *) malloc (sizeof (QtDemuxSphericalMetadata)); - if (spherical_metadata) { - spherical_metadata->is_spherical = FALSE; - spherical_metadata->is_stitched = FALSE; - spherical_metadata->stitching_software = NULL; - spherical_metadata->projection_type = NULL; - spherical_metadata->stereo_mode = NULL; - spherical_metadata->source_count = 0; - spherical_metadata->init_view_heading = 0; - spherical_metadata->init_view_pitch = 0; - spherical_metadata->init_view_roll = 0; - spherical_metadata->timestamp = 0; - spherical_metadata->full_pano_width_pixels = 0; - spherical_metadata->full_pano_height_pixels = 0; - spherical_metadata->cropped_area_image_width = 0; - spherical_metadata->cropped_area_image_height = 0; - spherical_metadata->cropped_area_left = 0; - spherical_metadata->cropped_area_top = 0; - spherical_metadata->ambisonic_type = QTDEMUX_AMBISONIC_TYPE_UNKNOWN; - spherical_metadata->ambisonic_format = QTDEMUX_AMBISONIC_TYPE_UNKNOWN; - spherical_metadata->ambisonic_order = QTDEMUX_AMBISONIC_ORDER_UNKNOWN; + if (qtdemux->spherical_metadata) { + qtdemux->spherical_metadata->is_spherical = FALSE; + qtdemux->spherical_metadata->is_stitched = FALSE; + qtdemux->spherical_metadata->stitching_software = NULL; + qtdemux->spherical_metadata->projection_type = NULL; + qtdemux->spherical_metadata->stereo_mode = NULL; + qtdemux->spherical_metadata->source_count = 0; + qtdemux->spherical_metadata->init_view_heading = 0; + qtdemux->spherical_metadata->init_view_pitch = 0; + qtdemux->spherical_metadata->init_view_roll = 0; + qtdemux->spherical_metadata->timestamp = 0; + qtdemux->spherical_metadata->full_pano_width_pixels = 0; + qtdemux->spherical_metadata->full_pano_height_pixels = 0; + qtdemux->spherical_metadata->cropped_area_image_width = 0; + qtdemux->spherical_metadata->cropped_area_image_height = 0; + qtdemux->spherical_metadata->cropped_area_left = 0; + qtdemux->spherical_metadata->cropped_area_top = 0; + qtdemux->spherical_metadata->ambisonic_type = QTDEMUX_AMBISONIC_TYPE_UNKNOWN; + qtdemux->spherical_metadata->ambisonic_format = QTDEMUX_AMBISONIC_FORMAT_UNKNOWN; + qtdemux->spherical_metadata->ambisonic_order = QTDEMUX_AMBISONIC_ORDER_UNKNOWN; } #endif /* TIZEN_FEATURE_QTDEMUX_MODIFICATION */ @@ -739,14 +738,17 @@ gst_qtdemux_dispose (GObject * object) GstQTDemux *qtdemux = GST_QTDEMUX (object); #ifdef TIZEN_FEATURE_QTDEMUX_MODIFICATION - if (spherical_metadata->stitching_software) - free(spherical_metadata->stitching_software); - if (spherical_metadata->projection_type) - free(spherical_metadata->projection_type); - if (spherical_metadata->stereo_mode) - free(spherical_metadata->stereo_mode); - if (spherical_metadata) - free(spherical_metadata); + if (qtdemux->spherical_metadata) { + if (qtdemux->spherical_metadata->stitching_software) + free(qtdemux->spherical_metadata->stitching_software); + if (qtdemux->spherical_metadata->projection_type) + free(qtdemux->spherical_metadata->projection_type); + if (qtdemux->spherical_metadata->stereo_mode) + free(qtdemux->spherical_metadata->stereo_mode); + + free(qtdemux->spherical_metadata); + qtdemux->spherical_metadata = NULL; + } #endif /* TIZEN_FEATURE_QTDEMUX_MODIFICATION */ if (qtdemux->adapter) { @@ -2863,8 +2865,7 @@ _get_bool_value_from_xml_string (GstQTDemux * qtdemux, } static void -_parse_spatial_video_metadata_from_xml_string (GstQTDemux * qtdemux, - const char *xmlStr, QtDemuxSphericalMetadata * spherical_metadata) +_parse_spatial_video_metadata_from_xml_string (GstQTDemux * qtdemux, const char *xmlStr) { const char is_spherical_str[] = ""; const char is_stitched_str[] = ""; @@ -2885,6 +2886,8 @@ _parse_spatial_video_metadata_from_xml_string (GstQTDemux * qtdemux, const char cropped_area_left_str[] = ""; const char cropped_area_top_str[] = ""; + QtDemuxSphericalMetadata * spherical_metadata = qtdemux->spherical_metadata; + _get_bool_value_from_xml_string (qtdemux, xmlStr, is_spherical_str, (gboolean *) & spherical_metadata->is_spherical); _get_bool_value_from_xml_string (qtdemux, xmlStr, is_stitched_str, @@ -3030,10 +3033,10 @@ gst_tag_register_spherical_tags (void) { } static void -_send_message_to_bus (GstQTDemux * qtdemux, - QtDemuxSphericalMetadata * spherical_metadata) +_send_spherical_metadata_msg_to_bus (GstQTDemux * qtdemux) { GstTagList *taglist; + QtDemuxSphericalMetadata *spherical_metadata = qtdemux->spherical_metadata; GST_DEBUG_OBJECT (qtdemux, "is_spherical = %d", spherical_metadata->is_spherical); @@ -3162,23 +3165,23 @@ qtdemux_parse_SA3D (GstQTDemux * qtdemux, const guint8 * buffer, gint length) if (version == RFC_AMBISONIC_SA3DBOX_VERSION_SUPPORTED) { if (ambisonic_type == RFC_AMBISONIC_TYPE_PERIPHONIC) - spherical_metadata->ambisonic_type = QTDEMUX_AMBISONIC_TYPE_PERIPHONIC; + qtdemux->spherical_metadata->ambisonic_type = QTDEMUX_AMBISONIC_TYPE_PERIPHONIC; if (ambisonic_order == RFC_AMBISONIC_ORDER_FOA) { if (num_channels == 4) { - spherical_metadata->ambisonic_order = QTDEMUX_AMBISONIC_ORDER_FOA; + qtdemux->spherical_metadata->ambisonic_order = QTDEMUX_AMBISONIC_ORDER_FOA; if ((ambisonic_channel_ordering == RFC_AMBISONIC_CHANNEL_ORDERING_ACN) && (ambisonic_normalization == RFC_AMBISONIC_NORMALIZATION_SN3D) && (channel_map[0] == 0) && (channel_map[1] == 1) && (channel_map[2] == 2) && (channel_map[3] == 3)) - spherical_metadata->ambisonic_format = QTDEMUX_AMBISONIC_FORMAT_AMBIX; + qtdemux->spherical_metadata->ambisonic_format = QTDEMUX_AMBISONIC_FORMAT_AMBIX; if ((ambisonic_channel_ordering == RFC_AMBISONIC_CHANNEL_ORDERING_FUMA) && (ambisonic_normalization == RFC_AMBISONIC_NORMALIZATION_FUMA) && (channel_map[0] == 0) && (channel_map[1] == 3) && (channel_map[2] == 1) && (channel_map[3] == 2)) - spherical_metadata->ambisonic_format = QTDEMUX_AMBISONIC_FORMAT_AMB; + qtdemux->spherical_metadata->ambisonic_format = QTDEMUX_AMBISONIC_FORMAT_AMB; } } } @@ -3373,6 +3376,13 @@ qtdemux_parse_uuid (GstQTDemux * qtdemux, const guint8 * buffer, gint length) 0xa2, 0x44, 0x6c, 0x42, 0x7c, 0x64, 0x8d, 0xf4 }; +#ifdef TIZEN_FEATURE_QTDEMUX_MODIFICATION + static const guint8 spherical_uuid[] = { + 0xff, 0xcc, 0x82, 0x63, 0xf8, 0x55, 0x4a, 0x93, + 0x88, 0x14, 0x58, 0x7a, 0x02, 0x52, 0x1f, 0xdd + }; +#endif /* TIZEN_FEATURE_QTDEMUX_MODIFICATION */ + guint offset; /* counts as header data */ @@ -3385,6 +3395,21 @@ qtdemux_parse_uuid (GstQTDemux * qtdemux, const guint8 * buffer, gint length) return; } +#ifdef TIZEN_FEATURE_QTDEMUX_MODIFICATION + if (memcmp (buffer + offset, spherical_uuid, 16) == 0) { + const char *contents; + + GST_DEBUG_OBJECT (qtdemux, "spherical uuid was found"); + contents = (char *) (buffer + offset + 16); + GST_DEBUG_OBJECT (qtdemux, "contents: %s\n", contents); + + if (qtdemux->spherical_metadata) + _parse_spatial_video_metadata_from_xml_string (qtdemux, contents); + + return; + } +#endif /* TIZEN_FEATURE_QTDEMUX_MODIFICATION */ + if (memcmp (buffer + offset, xmp_uuid, 16) == 0) { GstBuffer *buf; GstTagList *taglist; @@ -5004,8 +5029,8 @@ beach: if (ret == GST_FLOW_EOS && (qtdemux->got_moov || qtdemux->media_caps)) { /* digested all data, show what we have */ #ifdef TIZEN_FEATURE_QTDEMUX_MODIFICATION - if (spherical_metadata) - _send_message_to_bus (qtdemux, spherical_metadata); + if (qtdemux->spherical_metadata) + _send_spherical_metadata_msg_to_bus (qtdemux); #endif /* TIZEN_FEATURE_QTDEMUX_MODIFICATION */ qtdemux_prepare_streams (qtdemux); ret = qtdemux_expose_streams (qtdemux); diff --git a/gst/isomp4/qtdemux.h b/gst/isomp4/qtdemux.h index ebd7258..fd4ef83 100644 --- a/gst/isomp4/qtdemux.h +++ b/gst/isomp4/qtdemux.h @@ -62,6 +62,10 @@ enum QtDemuxState QTDEMUX_STATE_BUFFER_MDAT /* Buffering the mdat atom */ }; +#ifdef TIZEN_FEATURE_QTDEMUX_MODIFICATION +typedef struct _QtDemuxSphericalMetadata QtDemuxSphericalMetadata; +#endif + struct _GstQTDemux { GstElement element; @@ -145,7 +149,7 @@ struct _GstQTDemux { /* Set to TRUE when all streams have been exposed */ gboolean exposed; - + gint64 chapters_track_id; /* protection support */ @@ -157,7 +161,7 @@ struct _GstQTDemux { /* - * ALL VARIABLES BELOW ARE ONLY USED IN PUSH-BASED MODE + * ALL VARIABLES BELOW ARE ONLY USED IN PUSH-BASED MODE */ GstAdapter *adapter; guint neededbytes; @@ -232,6 +236,9 @@ struct _GstQTDemux { * header start. * Note : This is not computed from the GST_BUFFER_OFFSET field */ guint64 fragment_start_offset; +#ifdef TIZEN_FEATURE_QTDEMUX_MODIFICATION + QtDemuxSphericalMetadata *spherical_metadata; +#endif }; struct _GstQTDemuxClass {