rtpsrc, aacparse, mpegaudioparse: Fix build warning, check indent 30/130730/7
authorGilbok Lee <gilbok.lee@samsung.com>
Tue, 23 May 2017 12:18:17 +0000 (21:18 +0900)
committerGilbok Lee <gilbok.lee@samsung.com>
Wed, 24 May 2017 04:20:10 +0000 (13:20 +0900)
Change-Id: I2e4cff09dead99ed0ca5f365af6b1139032cb0de

gst/audioparsers/gstaacparse.c
gst/audioparsers/gstmpegaudioparse.c
gst/rtsp/gstrtspsrc.c
packaging/gst-plugins-good.spec

index 8177450..c1a57fb 100644 (file)
@@ -73,12 +73,12 @@ GST_DEBUG_CATEGORY_STATIC (aacparse_debug);
                                    headers prepended during raw to ADTS
                                    conversion */
 
-#ifdef TIZEN_FEATURE_AACPARSE_MODIFICATION /* to get more accurate duration */
-#define AAC_MAX_ESTIMATE_DURATION_BUF (1024 * 1024) /* use first 1 Mbyte */
+#ifdef TIZEN_FEATURE_AACPARSE_MODIFICATION      /* to get more accurate duration */
+#define AAC_MAX_ESTIMATE_DURATION_BUF (1024 * 1024)     /* use first 1 Mbyte */
 #define AAC_SAMPLE_PER_FRAME 1024
 
-#define AAC_MAX_PULL_RANGE_BUF  (1 * 1024 * 1024)   /* 1 MByte */
-#define AAC_LARGE_FILE_SIZE     (2 * 1024 * 1024)    /* 2 MByte */
+#define AAC_MAX_PULL_RANGE_BUF  (1 * 1024 * 1024)       /* 1 MByte */
+#define AAC_LARGE_FILE_SIZE     (2 * 1024 * 1024)       /* 2 MByte */
 #define gst_aac_parse_parent_class parent_class
 #endif
 
@@ -109,12 +109,12 @@ static GstFlowReturn gst_aac_parse_pre_push_frame (GstBaseParse * parse,
 
 #ifdef TIZEN_FEATURE_AACPARSE_MODIFICATION
 static guint gst_aac_parse_adts_get_fast_frame_len (const guint8 * data);
-static gboolean gst_aac_parse_src_eventfunc(GstBaseParse * parse,
+static gboolean gst_aac_parse_src_eventfunc (GstBaseParse * parse,
     GstEvent * event);
 /* make full aac(adts) index table when seek */
 static gboolean gst_aac_parse_adts_src_eventfunc (GstBaseParse * parse,
     GstEvent * event);
-int get_aac_parse_get_adts_frame_length (const unsigned chardata,
+int get_aac_parse_get_adts_frame_length (const unsigned char *data,
     gint64 offset);
 static gboolean gst_aac_parse_estimate_duration (GstBaseParse * parse);
 #endif
@@ -1339,7 +1339,7 @@ gst_aac_parse_handle_frame (GstBaseParse * parse,
       gboolean ret = FALSE;
       aacparse->first_frame = FALSE;
 
-      ret = gst_aac_parse_estimate_duration(parse);
+      ret = gst_aac_parse_estimate_duration (parse);
       if (!ret) {
         GST_WARNING_OBJECT (aacparse, "can not estimate total duration");
         ret = GST_FLOW_NOT_SUPPORTED;
@@ -1385,15 +1385,16 @@ gst_aac_parse_handle_frame (GstBaseParse * parse,
     }
   }
 #ifdef TIZEN_FEATURE_AACPARSE_MODIFICATION
-  else if(aacparse->header_type == DSPAAC_HEADER_ADIF)
-  {
-      /* to get more correct duration */
-      int file_size = 0;
-      float estimated_duration = 0;
-      gint64 total_file_size;
-      gst_base_parse_get_upstream_size(parse, &total_file_size);
-      estimated_duration = ((total_file_size * 8) / (float)(aacparse->bitrate * 1000))* GST_SECOND;
-      gst_base_parse_set_duration (parse, GST_FORMAT_TIME, estimated_duration * 1000, 0);
+  else if (aacparse->header_type == DSPAAC_HEADER_ADIF) {
+    /* to get more correct duration */
+    float estimated_duration = 0;
+    gint64 total_file_size;
+    gst_base_parse_get_upstream_size (parse, &total_file_size);
+    estimated_duration =
+        ((total_file_size * 8) / (float) (aacparse->bitrate * 1000)) *
+        GST_SECOND;
+    gst_base_parse_set_duration (parse, GST_FORMAT_TIME,
+        estimated_duration * 1000, 0);
   }
 #endif
 
@@ -1641,8 +1642,8 @@ gst_aac_parse_sink_getcaps (GstBaseParse * parse, GstCaps * filter)
  *
  * Returns: frame size
  */
-int get_aac_parse_get_adts_frame_length (const unsigned char* data,
-    gint64 offset)
+int
+get_aac_parse_get_adts_frame_length (const unsigned char *data, gint64 offset)
 {
   const gint adts_header_length_no_crc = 7;
   const gint adts_header_length_with_crc = 9;
@@ -1651,22 +1652,27 @@ int get_aac_parse_get_adts_frame_length (const unsigned char* data,
   gint head_size;
 
   /* check of syncword */
-  if ((data[offset+0] != 0xff) || ((data[offset+1] & 0xf6) != 0xf0)) {
-    GST_ERROR("check sync word is fail\n");
-    return  -1;
+  if ((data[offset + 0] != 0xff) || ((data[offset + 1] & 0xf6) != 0xf0)) {
+    GST_ERROR ("check sync word is fail\n");
+    return -1;
   }
 
   /* check of protection absent */
-  protection_absent = (data[offset+1] & 0x01);
+  protection_absent = (data[offset + 1] & 0x01);
 
   /*check of frame length */
-  frame_size = (data[offset+3] & 0x3) << 11 | data[offset+4] << 3 | data[offset+5] >> 5;
+  frame_size =
+      (data[offset + 3] & 0x3) << 11 | data[offset + 4] << 3 | data[offset +
+      5] >> 5;
 
   /* check of header size */
   /* protectionAbsent is 0 if there is CRC */
-  head_size = protection_absent ? adts_header_length_no_crc : adts_header_length_with_crc;
+  head_size =
+      protection_absent ? adts_header_length_no_crc :
+      adts_header_length_with_crc;
   if (head_size > frame_size) {
-    GST_ERROR("return frame length as 0 (frameSize %u < headSize %u)", frame_size, head_size);
+    GST_ERROR ("return frame length as 0 (frameSize %u < headSize %u)",
+        frame_size, head_size);
     return 0;
   }
 
@@ -1686,10 +1692,10 @@ gst_aac_parse_estimate_duration (GstBaseParse * parse)
 {
   gboolean ret = FALSE;
   GstFlowReturn res = GST_FLOW_OK;
-  gint64 pull_size = 0, file_size = 0, offset = 0, num_frames=0, duration=0;
-  guint profile = 0, sample_rate_index = 0, sample_rate = 0, channel = 0;
+  gint64 pull_size = 0, file_size = 0, offset = 0, num_frames = 0, duration = 0;
+  guint sample_rate_index = 0, sample_rate = 0, channel = 0;
   guint frame_size = 0, frame_duration_us = 0, estimated_bitrate = 0;
-  guint  lost_sync_count=0;
+  guint lost_sync_count = 0;
   GstClockTime estimated_duration = GST_CLOCK_TIME_NONE;
   GstBuffer *buffer = NULL;
   guint8 *buf = NULL;
@@ -1697,14 +1703,16 @@ gst_aac_parse_estimate_duration (GstBaseParse * parse)
   GstPadMode pad_mode = GST_PAD_MODE_NONE;
   GstAacParse *aacparse;
   gint64 buffer_size = 0;
+  GstMapInfo map;
 
   aacparse = GST_AAC_PARSE (parse);
   GST_LOG_OBJECT (aacparse, "gst_aac_parse_estimate_duration enter");
 
   /* check baseparse define these fuction */
-  gst_base_parse_get_pad_mode(parse, &pad_mode);
+  gst_base_parse_get_pad_mode (parse, &pad_mode);
   if (pad_mode != GST_PAD_MODE_PULL) {
-    GST_INFO_OBJECT (aacparse, "aac parser is not pull mode. can not estimate duration");
+    GST_INFO_OBJECT (aacparse,
+        "aac parser is not pull mode. can not estimate duration");
     return FALSE;
   }
 
@@ -1715,7 +1723,7 @@ gst_aac_parse_estimate_duration (GstBaseParse * parse)
     return FALSE;
   }
 
-  pull_size = MIN(file_size, AAC_MAX_ESTIMATE_DURATION_BUF);
+  pull_size = MIN (file_size, AAC_MAX_ESTIMATE_DURATION_BUF);
 
   res = gst_pad_pull_range (parse->sinkpad, 0, pull_size, &buffer);
   if (res != GST_FLOW_OK) {
@@ -1723,96 +1731,118 @@ gst_aac_parse_estimate_duration (GstBaseParse * parse)
     return FALSE;
   }
 
-  GstMapInfo map;
-  gst_buffer_map(buffer, &map, GST_MAP_READ);
+  gst_buffer_map (buffer, &map, GST_MAP_READ);
   buf = map.data;
   buffer_size = map.size;
   if (buffer_size != pull_size) {
-    GST_ERROR_OBJECT(aacparse, "We got different buffer_size(%d) with pull_size(%d).",
-        buffer_size, pull_size);
+    GST_ERROR_OBJECT (aacparse,
+        "We got different buffer_size(%" G_GINT64_FORMAT ") with pull_size(%"
+        G_GINT64_FORMAT ").", buffer_size, pull_size);
   }
 
   /* MODIFICATION : add defence codes for real buffer_size is different with pull_size */
-  for (i = 0; i < buffer_size; i ++) {
-    if ((buf[i] == 0xff) && ((buf[i+1] & 0xf6) == 0xf0)) { /* aac sync word */
-      profile = (buf[i+2] >> 6) & 0x3;
-      sample_rate_index = (buf[i+2] >> 2) & 0xf;
-      sample_rate = gst_aac_parse_get_sample_rate_from_index(sample_rate_index);
+  for (i = 0; i < buffer_size; i++) {
+    if ((buf[i] == 0xff) && ((buf[i + 1] & 0xf6) == 0xf0)) {    /* aac sync word */
+      //guint profile = (buf[i+2] >> 6) & 0x3;
+      sample_rate_index = (buf[i + 2] >> 2) & 0xf;
+      sample_rate =
+          gst_aac_parse_get_sample_rate_from_index (sample_rate_index);
       if (sample_rate == 0) {
-          GST_WARNING_OBJECT (aacparse, "Invalid sample rate index (0)");
-          goto EXIT;
+        GST_WARNING_OBJECT (aacparse, "Invalid sample rate index (0)");
+        goto EXIT;
       }
-      channel = (buf[i+2] & 0x1) << 2 | (buf[i+3] >> 6);
+      channel = (buf[i + 2] & 0x1) << 2 | (buf[i + 3] >> 6);
 
-      GST_INFO_OBJECT (aacparse, "found sync. aac fs=%d, ch=%d", sample_rate, channel);
+      GST_INFO_OBJECT (aacparse, "found sync. aac fs=%d, ch=%d", sample_rate,
+          channel);
 
       /* count number of frames */
-      /*MODIFICATION : add defence codes for real buffer_size is different with pull_size*/
+      /* MODIFICATION : add defence codes for real buffer_size is different with pull_size */
       //while (offset < pull_size) {
       while (offset < buffer_size) {
-        frame_size = get_aac_parse_get_adts_frame_length(buf, i + offset);
-        if (frame_size  == 0) {
-          GST_ERROR_OBJECT (aacparse, "framesize error at offset %"G_GINT64_FORMAT, offset);
+        frame_size = get_aac_parse_get_adts_frame_length (buf, i + offset);
+        if (frame_size == 0) {
+          GST_ERROR_OBJECT (aacparse,
+              "framesize error at offset %" G_GINT64_FORMAT, offset);
           break;
         } else if (frame_size == -1) {
           offset++;
           lost_sync_count++;    //  lost sync count limmitation 2K Bytes
-          if (lost_sync_count > (1024*2)) {
-            GST_WARNING_OBJECT (aacparse, "lost_sync_count is larger than 2048");
+          if (lost_sync_count > (1024 * 2)) {
+            GST_WARNING_OBJECT (aacparse,
+                "lost_sync_count is larger than 2048");
             goto EXIT;
           }
         } else {
           offset += frame_size;
           num_frames++;
-          lost_sync_count=0;
+          lost_sync_count = 0;
         }
-      } /* while */
+      }                         /* while */
 
       /* if we can got full file, we can calculate the accurate duration */
-      /*MODIFICATION : add defence codes for real buffer_size is different with pull_size*/
+      /* MODIFICATION : add defence codes for real buffer_size is different with pull_size */
       //if (pull_size == file_size) {
       if (buffer_size == file_size) {
         gfloat duration_for_one_frame = 0;
         GstClockTime calculated_duration = GST_CLOCK_TIME_NONE;
 
-        GST_INFO_OBJECT (aacparse, "we got total file (%d bytes). do not estimate but make Accurate total duration.", pull_size);
+        GST_INFO_OBJECT (aacparse,
+            "we got total file (%" G_GINT64_FORMAT
+            " bytes). do not estimate but make Accurate total duration.",
+            pull_size);
 
-        duration_for_one_frame = (gfloat)AAC_SAMPLE_PER_FRAME / (gfloat)sample_rate;
-        calculated_duration = num_frames * duration_for_one_frame * 1000 * 1000 * 1000;
+        duration_for_one_frame =
+            (gfloat) AAC_SAMPLE_PER_FRAME / (gfloat) sample_rate;
+        calculated_duration =
+            num_frames * duration_for_one_frame * 1000 * 1000 * 1000;
 
-        GST_INFO_OBJECT (aacparse, "duration_for_one_frame %f ms", duration_for_one_frame);
-        GST_INFO_OBJECT (aacparse, "calculated duration = %"GST_TIME_FORMAT,
-            GST_TIME_ARGS(calculated_duration));
+        GST_INFO_OBJECT (aacparse, "duration_for_one_frame %f ms",
+            duration_for_one_frame);
+        GST_INFO_OBJECT (aacparse, "calculated duration = %" GST_TIME_FORMAT,
+            GST_TIME_ARGS (calculated_duration));
         /* 0 means disable estimate */
-        gst_base_parse_set_duration (parse, GST_FORMAT_TIME, calculated_duration, 0);
+        gst_base_parse_set_duration (parse, GST_FORMAT_TIME,
+            calculated_duration, 0);
 
       } else {
-        GST_INFO_OBJECT (aacparse, "we got %d bytes in total file (%"G_GINT64_FORMAT
-            "). can not make accurate duration but Estimate.", pull_size, file_size);
-        frame_duration_us = (1024 * 1000000ll + (sample_rate - 1)) / sample_rate;
+        GST_INFO_OBJECT (aacparse,
+            "we got %" G_GUINT64_FORMAT " bytes in total file (%"
+            G_GINT64_FORMAT "). can not make accurate duration but Estimate.",
+            pull_size, file_size);
+        frame_duration_us =
+            (1024 * 1000000ll + (sample_rate - 1)) / sample_rate;
         duration = num_frames * frame_duration_us;
 
         if (duration == 0) {
           GST_WARNING_OBJECT (aacparse, "Invalid duration");
           goto EXIT;
         }
-        estimated_bitrate = (gint)((gfloat)(offset * 8) / (gfloat)(duration / 1000));
+        estimated_bitrate =
+            (gint) ((gfloat) (offset * 8) / (gfloat) (duration / 1000));
 
         if (estimated_bitrate == 0) {
           GST_WARNING_OBJECT (aacparse, "Invalid estimated_bitrate");
           goto EXIT;
         }
-        estimated_duration = (GstClockTime)((file_size * 8) / (estimated_bitrate * 1000)) * GST_SECOND;
-
-        GST_INFO_OBJECT (aacparse, "number of frame = %"G_GINT64_FORMAT, num_frames);
-        GST_INFO_OBJECT (aacparse, "duration = %"G_GINT64_FORMAT, duration / 1000000);
-        GST_INFO_OBJECT (aacparse, "byte = %"G_GINT64_FORMAT, offset);
-        GST_INFO_OBJECT (aacparse, "estimated bitrate = %d bps", estimated_bitrate);
-        GST_INFO_OBJECT (aacparse, "estimated duration = %"GST_TIME_FORMAT, GST_TIME_ARGS(estimated_duration));
+        estimated_duration =
+            (GstClockTime) ((file_size * 8) / (estimated_bitrate * 1000)) *
+            GST_SECOND;
+
+        GST_INFO_OBJECT (aacparse, "number of frame = %" G_GINT64_FORMAT,
+            num_frames);
+        GST_INFO_OBJECT (aacparse, "duration = %" G_GINT64_FORMAT,
+            duration / 1000000);
+        GST_INFO_OBJECT (aacparse, "byte = %" G_GINT64_FORMAT, offset);
+        GST_INFO_OBJECT (aacparse, "estimated bitrate = %d bps",
+            estimated_bitrate);
+        GST_INFO_OBJECT (aacparse, "estimated duration = %" GST_TIME_FORMAT,
+            GST_TIME_ARGS (estimated_duration));
 
         gst_base_parse_set_average_bitrate (parse, estimated_bitrate * 1000);
         /* set update_interval as duration(sec)/2 */
-        gst_base_parse_set_duration (parse, GST_FORMAT_TIME, estimated_duration, (gint)(duration/2));
+        gst_base_parse_set_duration (parse, GST_FORMAT_TIME, estimated_duration,
+            (gint) (duration / 2));
       }
 
       break;
@@ -1821,8 +1851,8 @@ gst_aac_parse_estimate_duration (GstBaseParse * parse)
   ret = TRUE;
 
 EXIT:
-  gst_buffer_unmap(buffer, &map);
-  gst_buffer_unref(buffer);
+  gst_buffer_unmap (buffer, &map);
+  gst_buffer_unref (buffer);
   return ret;
 }
 
@@ -1834,9 +1864,7 @@ static gboolean
 gst_aac_audio_parse_do_push_seek (GstBaseParse * parse,
     GstPad * pad, GstEvent * event)
 {
-  GstAacParse *aacparse;
-  aacparse = GST_AAC_PARSE(parse);
-
+  GstAacParse *aacparse = GST_AAC_PARSE (parse);
   gdouble rate;
   GstFormat format;
   GstSeekFlags flags;
@@ -1851,7 +1879,8 @@ gst_aac_audio_parse_do_push_seek (GstBaseParse * parse,
 
   GST_INFO_OBJECT (parse, "doing aac push-based seek");
 
-  gst_event_parse_seek (event, &rate, &format, &flags, &cur_type, &cur, &stop_type, &stop);
+  gst_event_parse_seek (event, &rate, &format, &flags, &cur_type, &cur,
+      &stop_type, &stop);
 
   /* FIXME, always play to the end */
   stop = -1;
@@ -1860,7 +1889,7 @@ gst_aac_audio_parse_do_push_seek (GstBaseParse * parse,
   if (rate <= 0)
     goto unsupported_seek;
 
-  if ( cur == 0 ) {
+  if (cur == 0) {
     /* handle rewind only */
     cur_type = GST_SEEK_TYPE_SET;
     byte_cur = 0;
@@ -1875,40 +1904,54 @@ gst_aac_audio_parse_do_push_seek (GstBaseParse * parse,
     flags |= GST_SEEK_FLAG_FLUSH;
 
     esimate_byte = (cur / (1000 * 1000)) * aacparse->frame_byte;
-    if (aacparse->sample_rate> 0)
+    if (aacparse->sample_rate > 0)
       frame_dur = (aacparse->spf * 1000) / aacparse->sample_rate;
     else
       goto unsupported_seek;
     if (frame_dur > 0)
-      byte_cur =  esimate_byte / (frame_dur);
+      byte_cur = esimate_byte / (frame_dur);
     else
       goto unsupported_seek;
 
-    GST_INFO_OBJECT(parse, "frame_byte(%d) spf(%d)  rate (%d) ", aacparse->frame_byte, aacparse->spf, aacparse->sample_rate);
-    GST_INFO_OBJECT(parse, "seek cur (%"G_GINT64_FORMAT") = (%"GST_TIME_FORMAT") ", cur, GST_TIME_ARGS (cur));
-    GST_INFO_OBJECT(parse, "esimate_byte(%"G_GINT64_FORMAT")  esimate_byte (%d)", esimate_byte, frame_dur );
+    GST_INFO_OBJECT (parse, "frame_byte(%d) spf(%d)  rate (%d) ",
+        aacparse->frame_byte, aacparse->spf, aacparse->sample_rate);
+    GST_INFO_OBJECT (parse,
+        "seek cur (%" G_GINT64_FORMAT ") = (%" GST_TIME_FORMAT ") ", cur,
+        GST_TIME_ARGS (cur));
+    GST_INFO_OBJECT (parse,
+        "esimate_byte(%" G_GINT64_FORMAT ")  esimate_byte (%d)", esimate_byte,
+        frame_dur);
   }
 
   /* obtain real upstream total bytes */
   if (!gst_pad_peer_query_duration (parse->sinkpad, fmt, &upstream_total_bytes))
     upstream_total_bytes = 0;
-    GST_INFO_OBJECT (aacparse, "gst_pad_query_peer_duration -upstream_total_bytes (%"G_GUINT64_FORMAT")", upstream_total_bytes);
-    aacparse->file_size = upstream_total_bytes;
-
-  if ( (byte_cur == -1) || (byte_cur > aacparse->file_size))
-  {
-    GST_INFO_OBJECT(parse, "[WEB-ERROR] seek cur (%"G_GINT64_FORMAT") > file_size (%"G_GINT64_FORMAT") ", cur, aacparse->file_size );
+  GST_INFO_OBJECT (aacparse,
+      "gst_pad_query_peer_duration -upstream_total_bytes (%" G_GUINT64_FORMAT
+      ")", upstream_total_bytes);
+  aacparse->file_size = upstream_total_bytes;
+
+  if ((byte_cur == -1) || (byte_cur > aacparse->file_size)) {
+    GST_INFO_OBJECT (parse,
+        "[WEB-ERROR] seek cur (%" G_GINT64_FORMAT ") > file_size (%"
+        G_GINT64_FORMAT ") ", cur, aacparse->file_size);
     goto abort_seek;
   }
 
-  GST_INFO_OBJECT (parse, "Pushing BYTE seek rate %g, "  "start %" G_GINT64_FORMAT ", stop %" G_GINT64_FORMAT, rate, byte_cur,  stop);
+  GST_INFO_OBJECT (parse,
+      "Pushing BYTE seek rate %g, " "start %" G_GINT64_FORMAT ", stop %"
+      G_GINT64_FORMAT, rate, byte_cur, stop);
 
   if (!(flags & GST_SEEK_FLAG_KEY_UNIT)) {
-    GST_INFO_OBJECT (parse, "Requested seek time: %" GST_TIME_FORMAT ", calculated seek offset: %" G_GUINT64_FORMAT, GST_TIME_ARGS (cur), byte_cur);
+    GST_INFO_OBJECT (parse,
+        "Requested seek time: %" GST_TIME_FORMAT ", calculated seek offset: %"
+        G_GUINT64_FORMAT, GST_TIME_ARGS (cur), byte_cur);
   }
 
   /* BYTE seek event */
-  event = gst_event_new_seek (rate, GST_FORMAT_BYTES, flags, cur_type, byte_cur, stop_type, stop);
+  event =
+      gst_event_new_seek (rate, GST_FORMAT_BYTES, flags, cur_type, byte_cur,
+      stop_type, stop);
   res = gst_pad_push_event (parse->sinkpad, event);
 
   return res;
@@ -1917,7 +1960,8 @@ gst_aac_audio_parse_do_push_seek (GstBaseParse * parse,
 
 abort_seek:
   {
-    GST_DEBUG_OBJECT (parse, "could not determine byte position to seek to, " "seek aborted.");
+    GST_DEBUG_OBJECT (parse,
+        "could not determine byte position to seek to, " "seek aborted.");
     return FALSE;
   }
 
@@ -1934,7 +1978,8 @@ gst_aac_parse_adts_get_fast_frame_len (const guint8 * data)
 {
   int length;
   if ((data[0] == 0xff) && ((data[1] & 0xf6) == 0xf0)) {
-    length = ((data[3] & 0x03) << 11) | (data[4] << 3) | ((data[5] & 0xe0) >> 5);
+    length =
+        ((data[3] & 0x03) << 11) | (data[4] << 3) | ((data[5] & 0xe0) >> 5);
   } else {
     length = 0;
   }
@@ -1942,14 +1987,15 @@ gst_aac_parse_adts_get_fast_frame_len (const guint8 * data)
 }
 
 static gboolean
-gst_aac_parse_src_eventfunc(GstBaseParse * parse, GstEvent * event)
+gst_aac_parse_src_eventfunc (GstBaseParse * parse, GstEvent * event)
 {
-  gboolean  handled = FALSE;
+  gboolean handled = FALSE;
   GstAacParse *aacparse;
-  aacparse = GST_AAC_PARSE(parse);
+  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)
+  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;
@@ -1972,195 +2018,205 @@ static gboolean
 gst_aac_parse_adts_src_eventfunc (GstBaseParse * parse, GstEvent * event)
 {
   gboolean handled = FALSE;
-  GstAacParse *aacparse;
-  aacparse = GST_AAC_PARSE (parse);
+  GstAacParse *aacparse = GST_AAC_PARSE (parse);
 
   switch (GST_EVENT_TYPE (event)) {
     case GST_EVENT_SEEK:
-      {
-        GstFlowReturn res = GST_FLOW_OK;
-        gint64 base_offset = 0, sync_offset = 0, cur = 0;
-        gint32 frame_count = 1;    /* do not add first frame because it is already in index table */
-        gint64 second_count = 0;   /* initial 1 second */
-        gint64 total_file_size = 0, start_offset = 0;
-        GstClockTime current_ts = GST_CLOCK_TIME_NONE;
-        GstPadMode pad_mode = GST_PAD_MODE_NONE;
-       gboolean large_file_flag = FALSE;
-
-        /* check baseparse define these fuction */
-        gst_base_parse_get_pad_mode(parse, &pad_mode);
-        if (pad_mode != GST_PAD_MODE_PULL) {
-          gboolean ret = FALSE;
-          GST_INFO_OBJECT (aacparse, "aac parser is PUSH MODE.");
-          GstPad* srcpad = parse->srcpad;
-          /* check NULL */
-          ret = gst_aac_audio_parse_do_push_seek(parse, srcpad, event);
-          gst_object_unref(srcpad);
-          return ret;
-        }
-        gst_base_parse_get_upstream_size(parse, &total_file_size);
-        gst_base_parse_get_index_last_offset(parse, &start_offset);
-        gst_base_parse_get_index_last_ts(parse, &current_ts);
-
-        if (total_file_size > AAC_LARGE_FILE_SIZE ) {
-           large_file_flag = TRUE;
-          gst_base_parse_set_seek_mode(parse, 0);
-          GST_INFO_OBJECT (aacparse, "larger than big size (2MB).");
-          goto aac_seek_null_exit;
-        }
+    {
+      GstFlowReturn res = GST_FLOW_OK;
+      gint64 base_offset = 0, cur = 0;
+      gint32 frame_count = 1;   /* do not add first frame because it is already in index table */
+      gint64 second_count = 0;  /* initial 1 second */
+      gint64 total_file_size = 0, start_offset = 0;
+      GstClockTime current_ts = GST_CLOCK_TIME_NONE;
+      GstPadMode pad_mode = GST_PAD_MODE_NONE;
+
+      /* check baseparse define these fuction */
+      gst_base_parse_get_pad_mode (parse, &pad_mode);
+      if (pad_mode != GST_PAD_MODE_PULL) {
+        gboolean ret = FALSE;
+        GstPad *srcpad = parse->srcpad;
+        GST_INFO_OBJECT (aacparse, "aac parser is PUSH MODE.");
+        /* check NULL */
+        ret = gst_aac_audio_parse_do_push_seek (parse, srcpad, event);
+        gst_object_unref (srcpad);
+        return ret;
+      }
+      gst_base_parse_get_upstream_size (parse, &total_file_size);
+      gst_base_parse_get_index_last_offset (parse, &start_offset);
+      gst_base_parse_get_index_last_ts (parse, &current_ts);
+
+      if (total_file_size > AAC_LARGE_FILE_SIZE) {
+        gst_base_parse_set_seek_mode (parse, 0);
+        GST_INFO_OBJECT (aacparse, "larger than big size (2MB).");
+        goto aac_seek_null_exit;
+      }
+
+      GST_DEBUG ("gst_aac_parse_adts_src_eventfunc GST_EVENT_SEEK enter");
 
-        GST_DEBUG("gst_aac_parse_adts_src_eventfunc GST_EVENT_SEEK enter");
+      if (total_file_size == 0 || start_offset >= total_file_size) {
+        GST_ERROR ("last index offset %" G_GINT64_FORMAT
+            " is larger than file size %" G_GINT64_FORMAT, start_offset,
+            total_file_size);
+        break;
+      }
 
-        if (total_file_size == 0 || start_offset >= total_file_size) {
-          GST_ERROR("last index offset %d is larger than file size %d", start_offset, total_file_size);
+      gst_event_parse_seek (event, NULL, NULL, NULL, NULL, &cur, NULL, NULL);
+      if (cur <= current_ts) {
+        GST_INFO ("seek to %" GST_TIME_FORMAT " within index table %"
+            GST_TIME_FORMAT ". do not make index table", GST_TIME_ARGS (cur),
+            GST_TIME_ARGS (current_ts));
+        break;
+      } else {
+        GST_INFO ("seek to %" GST_TIME_FORMAT " without index table %"
+            GST_TIME_FORMAT ". make index table", GST_TIME_ARGS (cur),
+            GST_TIME_ARGS (current_ts));
+      }
+
+      GST_INFO ("make AAC(ADTS) Index Table. file_size  = %" G_GINT64_FORMAT
+          " last idx offset=%" G_GINT64_FORMAT ", last idx ts=%"
+          GST_TIME_FORMAT, total_file_size, start_offset,
+          GST_TIME_ARGS (current_ts));
+
+      base_offset = start_offset;       /* set base by start offset */
+      second_count = current_ts + GST_SECOND;   /* 1sec */
+
+      /************************************/
+      /* STEP 0: Setting parse information */
+      /************************************/
+      aacparse->spf = aacparse->frame_samples;
+      aacparse->frame_duration = (aacparse->spf * 1000 * 100) / aacparse->sample_rate;  /* duration per frame (msec) */
+      aacparse->frame_per_sec = (aacparse->sample_rate) / aacparse->spf;        /* frames per second (ea) */
+
+      /************************************/
+      /* STEP 1: MAX_PULL_RANGE_BUF cycle */
+      /************************************/
+      while (total_file_size - base_offset >= AAC_MAX_PULL_RANGE_BUF) {
+        gint64 offset = 0;
+        GstBuffer *buffer = NULL;
+        guint8 *buf = NULL;
+        GstMapInfo map;
+        GST_INFO ("gst_pad_pull_range %d bytes (from %" G_GINT64_FORMAT
+            ") use max size", AAC_MAX_PULL_RANGE_BUF, base_offset);
+        res =
+            gst_pad_pull_range (parse->sinkpad, base_offset,
+            base_offset + AAC_MAX_PULL_RANGE_BUF, &buffer);
+        if (res != GST_FLOW_OK) {
+          GST_ERROR ("gst_pad_pull_range failed!");
           break;
         }
 
-        gst_event_parse_seek (event, NULL, NULL, NULL, NULL, &cur, NULL, NULL);
-        if (cur <= current_ts) {
-          GST_INFO("seek to %"GST_TIME_FORMAT" within index table %"GST_TIME_FORMAT". do not make index table",
-              GST_TIME_ARGS(cur), GST_TIME_ARGS(current_ts));
-          break;
-        } else {
-          GST_INFO("seek to %"GST_TIME_FORMAT" without index table %"GST_TIME_FORMAT". make index table",
-              GST_TIME_ARGS(cur), GST_TIME_ARGS(current_ts));
+        gst_buffer_map (buffer, &map, GST_MAP_READ);
+        buf = map.data;
+        if (buf == NULL) {
+          gst_buffer_unmap (buffer, &map);
+          GST_WARNING ("buffer is NULL in make aac seek table's STEP1");
+          gst_buffer_unref (buffer);
+          goto aac_seek_null_exit;
         }
 
-        GST_INFO("make AAC(ADTS) Index Table. file_size  = %"G_GINT64_FORMAT" last idx offset=%"G_GINT64_FORMAT
-            ", last idx ts=%"GST_TIME_FORMAT, total_file_size, start_offset, GST_TIME_ARGS(current_ts));
-
-        base_offset = start_offset; /* set base by start offset */
-        second_count = current_ts + GST_SECOND; /* 1sec */
-
-        /************************************/
-        /* STEP 0: Setting parse information */
-        /************************************/
-          aacparse->spf = aacparse->frame_samples;
-          aacparse->frame_duration = (aacparse->spf * 1000 * 100) / aacparse->sample_rate;  /* duration per frame (msec) */
-          aacparse->frame_per_sec = (aacparse->sample_rate) / aacparse->spf;          /* frames per second (ea) */
-
-        /************************************/
-        /* STEP 1: MAX_PULL_RANGE_BUF cycle */
-        /************************************/
-        while (total_file_size - base_offset >= AAC_MAX_PULL_RANGE_BUF) {
-          gint64 offset = 0;
-          GstBuffer *buffer = NULL;
-          guint8 *buf = NULL;
-
-         GST_INFO("gst_pad_pull_range %d bytes (from %"G_GINT64_FORMAT") use max size", AAC_MAX_PULL_RANGE_BUF, base_offset);
-          res = gst_pad_pull_range (parse->sinkpad, base_offset, base_offset + AAC_MAX_PULL_RANGE_BUF, &buffer);
-          if (res != GST_FLOW_OK) {
-            GST_ERROR ("gst_pad_pull_range failed!");
-            break;
-          }
+        while (offset <= AAC_MAX_PULL_RANGE_BUF) {
+          gint frame_size = 0;
 
-          GstMapInfo map;
-          gst_buffer_map(buffer, &map, GST_MAP_READ);
-          buf = map.data;
-          if (buf == NULL) {
-            gst_buffer_unmap(buffer, &map);
-            GST_WARNING("buffer is NULL in make aac seek table's STEP1");
-            gst_buffer_unref (buffer);
-            goto aac_seek_null_exit;
-          }
+          /* make sure the values in the frame header look sane */
+          frame_size = gst_aac_parse_adts_get_fast_frame_len (buf);
 
-          while (offset <= AAC_MAX_PULL_RANGE_BUF) {
-            gint frame_size = 0;
-            guint32 header;
-
-            /* make sure the values in the frame header look sane */
-            frame_size = gst_aac_parse_adts_get_fast_frame_len (buf);
-
-            if ((frame_size > 0) && (frame_size < (AAC_MAX_PULL_RANGE_BUF - offset))) {
-              if (current_ts > second_count)  { /* 1 sec == xx frames. we make idx per sec */
-                gst_base_parse_add_index_entry (parse, base_offset +offset, current_ts, TRUE, TRUE); /* force */
-                GST_DEBUG("Adding  index ts=%"GST_TIME_FORMAT" offset %"G_GINT64_FORMAT,
-                    GST_TIME_ARGS(current_ts), base_offset + offset);
-                second_count += GST_SECOND;    /* 1sec */
-              }
-
-              current_ts += (aacparse->frame_duration * GST_MSECOND) / 100; /* each frame is (frame_duration) ms */
-              offset += frame_size;
-              buf += frame_size;
-              frame_count++;
-            } else if (frame_size >= (AAC_MAX_PULL_RANGE_BUF - offset)) {
-              GST_DEBUG("we need refill buffer");
-              break;
-            } else {
-              GST_WARNING("we lost sync");
-              buf++;
-              offset++;
+          if ((frame_size > 0)
+              && (frame_size < (AAC_MAX_PULL_RANGE_BUF - offset))) {
+            if (current_ts > second_count) {    /* 1 sec == xx frames. we make idx per sec */
+              gst_base_parse_add_index_entry (parse, base_offset + offset, current_ts, TRUE, TRUE);     /* force */
+              GST_DEBUG ("Adding  index ts=%" GST_TIME_FORMAT " offset %"
+                  G_GINT64_FORMAT, GST_TIME_ARGS (current_ts),
+                  base_offset + offset);
+              second_count += GST_SECOND;       /* 1sec */
             }
-          } /* while */
-
-          base_offset = base_offset + offset;
 
-          gst_buffer_unmap(buffer, &map);
-          gst_buffer_unref (buffer);
-        } /* end MAX buffer cycle */
-
-        /*******************************/
-        /* STEP 2: Remain Buffer cycle */
-        /*******************************/
-        if (total_file_size - base_offset > 0) {
-          gint64 offset = 0;
-          GstBuffer *buffer = NULL;
-          guint8 *buf = NULL;
-
-          GST_INFO("gst_pad_pull_range %"G_GINT64_FORMAT" bytes (from %"G_GINT64_FORMAT") use remain_buf size",
-              total_file_size - base_offset, base_offset);
-          res = gst_pad_pull_range (parse->sinkpad, base_offset, total_file_size, &buffer);
-          if (res != GST_FLOW_OK) {
-            GST_ERROR ("gst_pad_pull_range failed!");
+            current_ts += (aacparse->frame_duration * GST_MSECOND) / 100;       /* each frame is (frame_duration) ms */
+            offset += frame_size;
+            buf += frame_size;
+            frame_count++;
+          } else if (frame_size >= (AAC_MAX_PULL_RANGE_BUF - offset)) {
+            GST_DEBUG ("we need refill buffer");
             break;
+          } else {
+            GST_WARNING ("we lost sync");
+            buf++;
+            offset++;
           }
+        }                       /* while */
+
+        base_offset = base_offset + offset;
+
+        gst_buffer_unmap (buffer, &map);
+        gst_buffer_unref (buffer);
+      }                         /* end MAX buffer cycle */
+
+      /*******************************/
+      /* STEP 2: Remain Buffer cycle */
+      /*******************************/
+      if (total_file_size - base_offset > 0) {
+        gint64 offset = 0;
+        GstBuffer *buffer = NULL;
+        guint8 *buf = NULL;
+        GstMapInfo map;
+
+        GST_INFO ("gst_pad_pull_range %" G_GINT64_FORMAT " bytes (from %"
+            G_GINT64_FORMAT ") use remain_buf size",
+            total_file_size - base_offset, base_offset);
+        res =
+            gst_pad_pull_range (parse->sinkpad, base_offset, total_file_size,
+            &buffer);
+        if (res != GST_FLOW_OK) {
+          GST_ERROR ("gst_pad_pull_range failed!");
+          break;
+        }
 
-          GstMapInfo map;
-          gst_buffer_map(buffer, &map, GST_MAP_READ);
-          buf = map.data;
-          if (buf == NULL) {
-            gst_buffer_unmap(buffer, &map);
-            GST_WARNING("buffer is NULL in make aac seek table's STEP2");
-            gst_buffer_unref (buffer);
-            goto aac_seek_null_exit;
-          }
+        gst_buffer_map (buffer, &map, GST_MAP_READ);
+        buf = map.data;
+        if (buf == NULL) {
+          gst_buffer_unmap (buffer, &map);
+          GST_WARNING ("buffer is NULL in make aac seek table's STEP2");
+          gst_buffer_unref (buffer);
+          goto aac_seek_null_exit;
+        }
+
+        while (base_offset + offset < total_file_size) {
+          gint frame_size = 0;
+
+          /* make sure the values in the frame header look sane */
+          frame_size = gst_aac_parse_adts_get_fast_frame_len (buf);
 
-          while (base_offset + offset < total_file_size) {
-            gint frame_size = 0;
-            guint32 header;
-
-            /* make sure the values in the frame header look sane */
-            frame_size = gst_aac_parse_adts_get_fast_frame_len (buf);
-
-            if ((frame_size > 0) && (frame_size <= (total_file_size - (base_offset + offset)))) {
-              if (current_ts > second_count) {  /* 1 sec == xx frames. we make idx per sec */
-                gst_base_parse_add_index_entry (parse, base_offset +offset, current_ts, TRUE, TRUE); /* force */
-                GST_DEBUG("Adding  index ts=%"GST_TIME_FORMAT" offset %"G_GINT64_FORMAT,
-                    GST_TIME_ARGS(current_ts), base_offset + offset);
-                second_count += GST_SECOND;    /* 1sec */
-              }
-
-              current_ts += (aacparse->frame_duration * GST_MSECOND) / 100; /* each frame is (frame_duration) ms */
-              offset += frame_size;
-              buf += frame_size;
-              frame_count++;
-            } else if (frame_size == 0) {
-              GST_DEBUG("Frame size is 0 so, Decoding end..");
-              break;
-            } else {
-              GST_WARNING("we lost sync");
-              buf++;
-              offset++;
+          if ((frame_size > 0)
+              && (frame_size <= (total_file_size - (base_offset + offset)))) {
+            if (current_ts > second_count) {    /* 1 sec == xx frames. we make idx per sec */
+              gst_base_parse_add_index_entry (parse, base_offset + offset, current_ts, TRUE, TRUE);     /* force */
+              GST_DEBUG ("Adding  index ts=%" GST_TIME_FORMAT " offset %"
+                  G_GINT64_FORMAT, GST_TIME_ARGS (current_ts),
+                  base_offset + offset);
+              second_count += GST_SECOND;       /* 1sec */
             }
-          } /* while */
 
-          gst_buffer_unmap(buffer, &map);
-          gst_buffer_unref (buffer);
-        } /* end remain_buf buffer cycle */
+            current_ts += (aacparse->frame_duration * GST_MSECOND) / 100;       /* each frame is (frame_duration) ms */
+            offset += frame_size;
+            buf += frame_size;
+            frame_count++;
+          } else if (frame_size == 0) {
+            GST_DEBUG ("Frame size is 0 so, Decoding end..");
+            break;
+          } else {
+            GST_WARNING ("we lost sync");
+            buf++;
+            offset++;
+          }
+        }                       /* while */
 
-        GST_DEBUG("gst_aac_parse_adts_src_eventfunc GST_EVENT_SEEK leave");
+        gst_buffer_unmap (buffer, &map);
+        gst_buffer_unref (buffer);
       }
-     break;
+      /* end remain_buf buffer cycle */
+      GST_DEBUG ("gst_aac_parse_adts_src_eventfunc GST_EVENT_SEEK leave");
+    }
+      break;
 
     default:
       break;
@@ -2172,4 +2228,4 @@ aac_seek_null_exit:
   handled = GST_BASE_PARSE_CLASS (parent_class)->src_event (parse, event);
   return handled;
 }
-#endif //end of #ifdef TIZEN_FEATURE_AACPARSE_MODIFICATION
\ No newline at end of file
+#endif //end of #ifdef TIZEN_FEATURE_AACPARSE_MODIFICATION
index bb56d3d..a0b0a09 100644 (file)
@@ -108,8 +108,9 @@ static gboolean gst_mpeg_audio_parse_stop (GstBaseParse * parse);
 static void gst_mpeg_audio_parse_set_property (GObject * object, guint prop_id,
     const GValue * value, GParamSpec * pspec);
 static void gst_mpeg_audio_parse_get_property (GObject * object, guint prop_id,
-    const GValue * value, GParamSpec * pspec);
-static gboolean gst_mpeg_audio_parse_src_eventfunc (GstBaseParse * parse, GstEvent * event);
+    GValue * value, GParamSpec * pspec);
+static gboolean gst_mpeg_audio_parse_src_eventfunc (GstBaseParse * parse,
+    GstEvent * event);
 #endif
 
 static GstFlowReturn gst_mpeg_audio_parse_handle_frame (GstBaseParse * parse,
@@ -187,14 +188,15 @@ gst_mpeg_audio_parse_class_init (GstMpegAudioParseClass * klass)
       GST_DEBUG_FUNCPTR (gst_mpeg_audio_parse_get_sink_caps);
 
 #ifdef TIZEN_FEATURE_MP3PARSE_MODIFICATION
-  object_class->set_property = gst_mpeg_audio_parse_set_property;
-  object_class->get_property = gst_mpeg_audio_parse_get_property;
+  object_class->set_property =
+      GST_DEBUG_FUNCPTR (gst_mpeg_audio_parse_set_property);
+  object_class->get_property =
+      GST_DEBUG_FUNCPTR (gst_mpeg_audio_parse_get_property);
 
   g_object_class_install_property (object_class, PROP_CHECK_HTTP_SEEK,
-         g_param_spec_boolean ("http-pull-mp3dec", "enable/disable",
-        "enable/disable mp3dec http seek pull mode",
-        DEFAULT_CHECK_HTTP_SEEK,
-        G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+      g_param_spec_boolean ("http-pull-mp3dec", "enable/disable",
+          "enable/disable mp3dec http seek pull mode",
+          DEFAULT_CHECK_HTTP_SEEK, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
   /* T.B.D : make full mp3 index table when seek */
   parse_class->src_event = gst_mpeg_audio_parse_src_eventfunc;
 #endif
@@ -300,11 +302,12 @@ gst_mpeg_audio_parse_set_property (GObject * object, guint prop_id,
     const GValue * value, GParamSpec * pspec)
 {
   GstMpegAudioParse *mp3parse = GST_MPEG_AUDIO_PARSE (object);
-  GST_INFO_OBJECT (mp3parse, "set_property() START- prop_id(%d)",prop_id);
+  GST_INFO_OBJECT (mp3parse, "set_property() START- prop_id(%d)", prop_id);
   switch (prop_id) {
     case PROP_CHECK_HTTP_SEEK:
       mp3parse->http_seek_flag = g_value_get_boolean (value);
-      GST_INFO_OBJECT (mp3parse, "http_seek_flag(%d)", mp3parse->http_seek_flag);
+      GST_INFO_OBJECT (mp3parse, "http_seek_flag(%d)",
+          mp3parse->http_seek_flag);
       break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@@ -314,14 +317,15 @@ gst_mpeg_audio_parse_set_property (GObject * object, guint prop_id,
 
 static void
 gst_mpeg_audio_parse_get_property (GObject * object, guint prop_id,
-    const GValue * value, GParamSpec * pspec)
+    GValue * value, GParamSpec * pspec)
 {
   GstMpegAudioParse *mp3parse = GST_MPEG_AUDIO_PARSE (object);
-  GST_INFO_OBJECT (mp3parse, "get_property() START- prop_id(%d)",prop_id);
+  GST_INFO_OBJECT (mp3parse, "get_property() START- prop_id(%d)", prop_id);
   switch (prop_id) {
     case PROP_CHECK_HTTP_SEEK:
       g_value_set_boolean (value, mp3parse->http_seek_flag);
-      GST_INFO_OBJECT (mp3parse, "http_seek_flag(%d)", mp3parse->http_seek_flag);
+      GST_INFO_OBJECT (mp3parse, "http_seek_flag(%d)",
+          mp3parse->http_seek_flag);
       break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@@ -1547,9 +1551,10 @@ gst_mpeg_audio_parse_src_eventfunc (GstBaseParse * parse, GstEvent * event)
     {
       GST_INFO_OBJECT (mp3parse, "GST_EVENT_SEEK enter");
       if (mp3parse->http_seek_flag) {
-        GST_INFO_OBJECT (mp3parse, "souphttpsrc is PULL MODE (so accurate seek mode is OFF)");
+        GST_INFO_OBJECT (mp3parse,
+            "souphttpsrc is PULL MODE (so accurate seek mode is OFF)");
         /* Check the declaration of this function in the baseparse */
-        gst_base_parse_set_seek_mode(parse, 0);
+        gst_base_parse_set_seek_mode (parse, 0);
         goto mp3_seek_null_exit;
       }
       GST_INFO_OBJECT (mp3parse, "GST_EVENT_SEEK leave");
@@ -1566,4 +1571,3 @@ mp3_seek_null_exit:
   return handled;
 }
 #endif
-
index 01a8535..5ba69c8 100644 (file)
@@ -409,25 +409,27 @@ cmd_to_string (guint cmd)
 
 #ifdef TIZEN_FEATURE_RTSP_MODIFICATION
 static void
-gst_rtspsrc_post_error_message ( GstRTSPSrc * src, GstRTSPSrcError error_id, gchar * error_string )
+gst_rtspsrc_post_error_message (GstRTSPSrc * src, GstRTSPSrcError error_id,
+    const gchar * error_string)
 {
-       GstMessage *message;
-       GstStructure *structure;
-       gboolean ret = TRUE;
+  GstMessage *message;
+  GstStructure *structure;
+  gboolean ret = TRUE;
 
-       GST_ERROR_OBJECT ( src, "[%d] %s",  error_id, error_string );
+  GST_ERROR_OBJECT (src, "[%d] %s", error_id, error_string);
 
-       structure = gst_structure_new ("streaming_error",
-               "error_id", G_TYPE_UINT, error_id,
-               "error_string", G_TYPE_STRING, error_string, NULL);
+  structure = gst_structure_new ("streaming_error",
+      "error_id", G_TYPE_UINT, error_id,
+      "error_string", G_TYPE_STRING, error_string, NULL);
 
-       message = gst_message_new_custom ( GST_MESSAGE_ERROR, GST_OBJECT(src), structure );
+  message =
+      gst_message_new_custom (GST_MESSAGE_ERROR, GST_OBJECT (src), structure);
 
-       ret = gst_element_post_message ( GST_ELEMENT (src), message );
-       if ( !ret )
-               GST_ERROR_OBJECT ( src, "fail to post error message." );
+  ret = gst_element_post_message (GST_ELEMENT (src), message);
+  if (!ret)
+    GST_ERROR_OBJECT (src, "fail to post error message.");
 
-       return;
+  return;
 }
 #endif
 
@@ -964,20 +966,17 @@ gst_rtspsrc_finalize (GObject * object)
 #ifdef TIZEN_FEATURE_RTSP_MODIFICATION
   rtspsrc->is_audio_codec_supported = FALSE;
   rtspsrc->is_video_codec_supported = FALSE;
-  if (rtspsrc->audio_codec)
-  {
-       g_free(rtspsrc->audio_codec);
-       rtspsrc->audio_codec = NULL;
+  if (rtspsrc->audio_codec) {
+    g_free (rtspsrc->audio_codec);
+    rtspsrc->audio_codec = NULL;
   }
-  if (rtspsrc->video_codec)
-  {
-       g_free(rtspsrc->video_codec);
-       rtspsrc->video_codec = NULL;
+  if (rtspsrc->video_codec) {
+    g_free (rtspsrc->video_codec);
+    rtspsrc->video_codec = NULL;
   }
-  if (rtspsrc->video_frame_size)
-  {
-       g_free(rtspsrc->video_frame_size);
-       rtspsrc->video_frame_size = NULL;
+  if (rtspsrc->video_frame_size) {
+    g_free (rtspsrc->video_frame_size);
+    rtspsrc->video_frame_size = NULL;
   }
 #endif
   gst_rtsp_ext_list_free (rtspsrc->extensions);
@@ -1132,7 +1131,8 @@ gst_rtspsrc_set_property (GObject * object, guint prop_id, const GValue * value,
       break;
     case PROP_RESUME_POSITION:
       rtspsrc->last_pos = g_value_get_uint64 (value);
-      GST_DEBUG_OBJECT (rtspsrc, "src->last_pos value set to %"GST_TIME_FORMAT,GST_TIME_ARGS (rtspsrc->last_pos));
+      GST_DEBUG_OBJECT (rtspsrc, "src->last_pos value set to %" GST_TIME_FORMAT,
+          GST_TIME_ARGS (rtspsrc->last_pos));
       break;
 #endif
     case PROP_TCP_TIMEOUT:
@@ -1612,7 +1612,7 @@ gst_rtspsrc_collect_payloads (GstRTSPSrc * src, const GstSDPMessage * sdp,
     const gchar *enc;
     PtMapItem item;
 #ifdef TIZEN_FEATURE_RTSP_MODIFICATION
-    gchar *encoder , *mediatype;
+    const gchar *encoder, *mediatype;
 #endif
     pt = atoi (gst_sdp_media_get_format (media, i));
 
@@ -1632,57 +1632,49 @@ gst_rtspsrc_collect_payloads (GstRTSPSrc * src, const GstSDPMessage * sdp,
       if (strcmp (enc, "X-ASF-PF") == 0)
         stream->container = TRUE;
     }
-
 #ifdef TIZEN_FEATURE_RTSP_MODIFICATION
-    if ((mediatype = gst_structure_get_string (s, "media")))
-    {
-       GST_DEBUG_OBJECT (src, " mediatype : %s",mediatype);
-       if(!strcmp(mediatype, "video"))
-       {
-               if ((encoder = gst_structure_get_string (s, "encoding-name")))
-               {
-                       GST_DEBUG_OBJECT (src, " encoder : %s",encoder);
-                       if((!strcmp(encoder,"H261")) ||
-                               (!strcmp(encoder,"H263")) ||
-                               (!strcmp(encoder,"H263-1998")) ||  (!strcmp(encoder,"H263-2000")) ||
-                               (!strcmp(encoder,"H264")) ||
-                               (!strcmp(encoder,"MP4V-ES")))
-                       {
-                               src->is_video_codec_supported = TRUE;
-                               GST_DEBUG_OBJECT (src, "Supported Video Codec %s",encoder);
-                       }
-                       else
-                       {
-                               GST_DEBUG_OBJECT (src, "Unsupported Video Codec %s",encoder);
-                       }
-               }
-
-               src->video_codec = g_strdup(encoder);
-               src->video_frame_size = g_strdup(gst_structure_get_string(s, "a-framesize"));
-               GST_DEBUG_OBJECT (src, "video_codec %s , video_frame_size %s ",src->video_codec,src->video_frame_size);
-       }
-       else if (!strcmp(mediatype, "audio"))
-       {
-               if ((encoder = gst_structure_get_string (s, "encoding-name")))
-               {
-                       GST_DEBUG_OBJECT (src, " encoder : %s",encoder);
-                       if((!strcmp(encoder,"MP4A-LATM")) ||
-                               (!strcmp(encoder,"AMR")) ||(!strcmp(encoder,"AMR-WB")) ||(!strcmp(encoder,"AMR-NB")) ||
-                               (!strcmp(encoder,"mpeg4-generic")) ||(!strcmp(encoder,"MPEG4-GENERIC")) ||
-                               (!strcmp(encoder,"QCELP")) || ((strstr(encoder, "G726"))||(strstr(encoder, "PCMU"))))
-                       {
-                               src->is_audio_codec_supported = TRUE;
-                               GST_DEBUG_OBJECT (src, "Supported Audio Codec %s",encoder);
-                       }
-                       else
-                       {
-                               GST_DEBUG_OBJECT (src, "Unsupported Audio Codec %s",encoder);
-                       }
-               }
-
-               src->audio_codec = g_strdup(encoder);
-               GST_DEBUG_OBJECT (src, "audio_codec %s ",src->audio_codec);
-       }
+    if ((mediatype = gst_structure_get_string (s, "media"))) {
+      GST_DEBUG_OBJECT (src, " mediatype : %s", mediatype);
+      if (!strcmp (mediatype, "video")) {
+        if ((encoder = gst_structure_get_string (s, "encoding-name"))) {
+          GST_DEBUG_OBJECT (src, " encoder : %s", encoder);
+          if ((!strcmp (encoder, "H261")) ||
+              (!strcmp (encoder, "H263")) ||
+              (!strcmp (encoder, "H263-1998"))
+              || (!strcmp (encoder, "H263-2000")) || (!strcmp (encoder, "H264"))
+              || (!strcmp (encoder, "MP4V-ES"))) {
+            src->is_video_codec_supported = TRUE;
+            GST_DEBUG_OBJECT (src, "Supported Video Codec %s", encoder);
+          } else {
+            GST_DEBUG_OBJECT (src, "Unsupported Video Codec %s", encoder);
+          }
+        }
+
+        src->video_codec = g_strdup (encoder);
+        src->video_frame_size =
+            g_strdup (gst_structure_get_string (s, "a-framesize"));
+        GST_DEBUG_OBJECT (src, "video_codec %s , video_frame_size %s ",
+            src->video_codec, src->video_frame_size);
+      } else if (!strcmp (mediatype, "audio")) {
+        if ((encoder = gst_structure_get_string (s, "encoding-name"))) {
+          GST_DEBUG_OBJECT (src, " encoder : %s", encoder);
+          if ((!strcmp (encoder, "MP4A-LATM")) ||
+              (!strcmp (encoder, "AMR")) || (!strcmp (encoder, "AMR-WB"))
+              || (!strcmp (encoder, "AMR-NB"))
+              || (!strcmp (encoder, "mpeg4-generic"))
+              || (!strcmp (encoder, "MPEG4-GENERIC"))
+              || (!strcmp (encoder, "QCELP")) || ((strstr (encoder, "G726"))
+                  || (strstr (encoder, "PCMU")))) {
+            src->is_audio_codec_supported = TRUE;
+            GST_DEBUG_OBJECT (src, "Supported Audio Codec %s", encoder);
+          } else {
+            GST_DEBUG_OBJECT (src, "Unsupported Audio Codec %s", encoder);
+          }
+        }
+
+        src->audio_codec = g_strdup (encoder);
+        GST_DEBUG_OBJECT (src, "audio_codec %s ", src->audio_codec);
+      }
     }
 #endif
 
@@ -2605,7 +2597,9 @@ gst_rtspsrc_set_state (GstRTSPSrc * src, GstState state)
 {
   GList *walk;
 
-  GST_WARNING_OBJECT(src, "Setting [%s] element state to: %s \n", GST_ELEMENT_NAME(GST_ELEMENT_CAST (src)),gst_element_state_get_name(state));
+  GST_WARNING_OBJECT (src, "Setting [%s] element state to: %s \n",
+      GST_ELEMENT_NAME (GST_ELEMENT_CAST (src)),
+      gst_element_state_get_name (state));
   if (src->manager)
     gst_element_set_state (GST_ELEMENT_CAST (src->manager), state);
 
@@ -5196,8 +5190,8 @@ receive_error:
     gchar *str = gst_rtsp_strresult (res);
 
 #ifdef TIZEN_FEATURE_RTSP_MODIFICATION
-    gst_rtspsrc_post_error_message ( src,
-                               GST_RTSPSRC_ERROR_BAD_SERVER,"Could not receive message.");
+    gst_rtspsrc_post_error_message (src, GST_RTSPSRC_ERROR_BAD_SERVER,
+        "Could not receive message.");
 #else
     GST_ELEMENT_ERROR (src, RESOURCE, READ, (NULL),
         ("Could not receive message. (%s)", str));
@@ -5212,8 +5206,8 @@ handle_request_failed:
     gchar *str = gst_rtsp_strresult (res);
 
 #ifdef TIZEN_FEATURE_RTSP_MODIFICATION
-    gst_rtspsrc_post_error_message ( src,
-                               GST_RTSPSRC_ERROR_SERVICE_UNAVAILABLE,"Could not handle server message.");
+    gst_rtspsrc_post_error_message (src, GST_RTSPSRC_ERROR_SERVICE_UNAVAILABLE,
+        "Could not handle server message.");
 #else
     GST_ELEMENT_ERROR (src, RESOURCE, WRITE, (NULL),
         ("Could not handle server message. (%s)", str));
@@ -5341,10 +5335,10 @@ connect_error:
     src->conninfo.connected = FALSE;
     if (res != GST_RTSP_EINTR) {
 #ifdef TIZEN_FEATURE_RTSP_MODIFICATION
-    gst_rtspsrc_post_error_message ( src,
-                               GST_RTSPSRC_ERROR_CONNECTION_FAIL,"Could not connect to server.");
+      gst_rtspsrc_post_error_message (src, GST_RTSPSRC_ERROR_CONNECTION_FAIL,
+          "Could not connect to server.");
 #else
-    GST_ELEMENT_ERROR (src, RESOURCE, OPEN_READ_WRITE, (NULL),
+      GST_ELEMENT_ERROR (src, RESOURCE, OPEN_READ_WRITE, (NULL),
           ("Could not connect to server. (%s)", str));
 #endif
       g_free (str);
@@ -5359,8 +5353,8 @@ receive_error:
     gchar *str = gst_rtsp_strresult (res);
 
 #ifdef TIZEN_FEATURE_RTSP_MODIFICATION
-    gst_rtspsrc_post_error_message ( src,
-                               GST_RTSPSRC_ERROR_SERVER_DISCONNECTED,"Could not receive message.");
+    gst_rtspsrc_post_error_message (src, GST_RTSPSRC_ERROR_SERVER_DISCONNECTED,
+        "Could not receive message.");
 #else
     GST_ELEMENT_ERROR (src, RESOURCE, READ, (NULL),
         ("Could not receive message. (%s)", str));
@@ -5376,11 +5370,12 @@ handle_request_failed:
     gst_rtsp_message_unset (&message);
     if (res != GST_RTSP_EINTR) {
 #ifdef TIZEN_FEATURE_RTSP_MODIFICATION
-      gst_rtspsrc_post_error_message ( src,
-            GST_RTSPSRC_ERROR_SERVICE_UNAVAILABLE,"Could not handle server message.");
+      gst_rtspsrc_post_error_message (src,
+          GST_RTSPSRC_ERROR_SERVICE_UNAVAILABLE,
+          "Could not handle server message.");
 #else
       GST_ELEMENT_ERROR (src, RESOURCE, WRITE, (NULL),
-            ("Could not handle server message. (%s)", str));
+          ("Could not handle server message. (%s)", str));
 #endif
       g_free (str);
       ret = GST_FLOW_ERROR;
@@ -5454,8 +5449,8 @@ no_protocols:
     src->cur_protocols = 0;
     /* no transport possible, post an error and stop */
 #ifdef TIZEN_FEATURE_RTSP_MODIFICATION
-    gst_rtspsrc_post_error_message ( src,
-                               GST_RTSPSRC_ERROR_BAD_TRANSPORT,"Could not receive any UDP packets for seconds, maybe your firewall is blocking it. No other protocols to try.");
+    gst_rtspsrc_post_error_message (src, GST_RTSPSRC_ERROR_BAD_TRANSPORT,
+        "Could not receive any UDP packets for seconds, maybe your firewall is blocking it. No other protocols to try.");
 #else
     GST_ELEMENT_ERROR (src, RESOURCE, READ, (NULL),
         ("Could not receive any UDP packets for %.4f seconds, maybe your "
@@ -5501,32 +5496,36 @@ static void
 gst_rtspsrc_loop_complete_cmd (GstRTSPSrc * src, gint cmd)
 {
 #ifdef TIZEN_FEATURE_RTSP_MODIFICATION
-  GstStructure *s;
+  GstMessage *s;
 #endif
   GST_WARNING_OBJECT (src, "Got cmd %s", cmd_to_string (cmd));
 
   switch (cmd) {
     case CMD_OPEN:
 #ifdef TIZEN_FEATURE_RTSP_MODIFICATION
-       GST_DEBUG_OBJECT (src, "rtsp_duration %"GST_TIME_FORMAT", rtsp_audio_codec %s , rtsp_video_codec %s , rtsp_video_frame_size %s",
-                                                                               GST_TIME_ARGS(src->segment.duration),src->audio_codec,src->video_codec,src->video_frame_size);
-
-       /* post message */
-       s = gst_message_new_element (GST_OBJECT_CAST (src),
-         gst_structure_new ("rtspsrc_properties",
-             "rtsp_duration",G_TYPE_UINT64,src->segment.duration,
-             "rtsp_audio_codec", G_TYPE_STRING, src->audio_codec,
-             "rtsp_video_codec", G_TYPE_STRING, src->video_codec,
-             "rtsp_video_frame_size", G_TYPE_STRING, src->video_frame_size,NULL));
-
-       gst_element_post_message (GST_ELEMENT_CAST (src), s);
+      GST_DEBUG_OBJECT (src,
+          "rtsp_duration %" GST_TIME_FORMAT
+          ", rtsp_audio_codec %s , rtsp_video_codec %s , rtsp_video_frame_size %s",
+          GST_TIME_ARGS (src->segment.duration), src->audio_codec,
+          src->video_codec, src->video_frame_size);
+
+      /* post message */
+      s = gst_message_new_element (GST_OBJECT_CAST (src),
+          gst_structure_new ("rtspsrc_properties",
+              "rtsp_duration", G_TYPE_UINT64, src->segment.duration,
+              "rtsp_audio_codec", G_TYPE_STRING, src->audio_codec,
+              "rtsp_video_codec", G_TYPE_STRING, src->video_codec,
+              "rtsp_video_frame_size", G_TYPE_STRING, src->video_frame_size,
+              NULL));
+
+      gst_element_post_message (GST_ELEMENT_CAST (src), s);
 #endif
       GST_ELEMENT_PROGRESS (src, COMPLETE, "open", ("Opened Stream"));
 #ifdef TIZEN_FEATURE_RTSP_MODIFICATION
       /* rtspsrc PAUSE state should be here for parsing sdp before PAUSE state changed. */
-      g_mutex_lock(&(src)->pause_lock);
+      g_mutex_lock (&(src)->pause_lock);
       g_cond_signal (&(src)->open_end);
-      g_mutex_unlock(&(src)->pause_lock);
+      g_mutex_unlock (&(src)->pause_lock);
 #endif
       break;
     case CMD_PLAY:
@@ -5571,11 +5570,12 @@ gst_rtspsrc_loop_error_cmd (GstRTSPSrc * src, gint cmd)
     case CMD_OPEN:
       GST_ELEMENT_PROGRESS (src, ERROR, "open", ("Open failed"));
 #ifdef TIZEN_FEATURE_RTSP_MODIFICATION
-/* Ending conditional wait for pause when open fails.*/
-      g_mutex_lock(&(src)->pause_lock);
+      /* Ending conditional wait for pause when open fails.*/
+      g_mutex_lock (&(src)->pause_lock);
       g_cond_signal (&(src)->open_end);
-      g_mutex_unlock(&(src)->pause_lock);
-      GST_WARNING_OBJECT (src, "ending conditional wait for pause as open is failed.");
+      g_mutex_unlock (&(src)->pause_lock);
+      GST_WARNING_OBJECT (src,
+          "ending conditional wait for pause as open is failed.");
 #endif
       break;
     case CMD_PLAY:
@@ -5976,8 +5976,8 @@ no_auth_available:
     /* Output an error indicating that we couldn't connect because there were
      * no supported authentication protocols */
 #ifdef TIZEN_FEATURE_RTSP_MODIFICATION
-    gst_rtspsrc_post_error_message ( src,
-                               GST_RTSPSRC_ERROR_NOT_AUTHORIZED,"No supported authentication protocol was found");
+    gst_rtspsrc_post_error_message (src, GST_RTSPSRC_ERROR_NOT_AUTHORIZED,
+        "No supported authentication protocol was found");
 #else
     GST_ELEMENT_ERROR (src, RESOURCE, OPEN_READ, (NULL),
         ("No supported authentication protocol was found"));
@@ -6078,10 +6078,10 @@ send_error:
 
     if (res != GST_RTSP_EINTR) {
 #ifdef TIZEN_FEATURE_RTSP_MODIFICATION
-    gst_rtspsrc_post_error_message ( src,
-                               GST_RTSPSRC_ERROR_CONNECTION_FAIL,"Could not send message.");
+      gst_rtspsrc_post_error_message (src, GST_RTSPSRC_ERROR_CONNECTION_FAIL,
+          "Could not send message.");
 #else
-     GST_ELEMENT_ERROR (src, RESOURCE, WRITE, (NULL),
+      GST_ELEMENT_ERROR (src, RESOURCE, WRITE, (NULL),
           ("Could not send message. (%s)", str));
 #endif
     } else {
@@ -6110,8 +6110,9 @@ receive_error:
 
         if (res != GST_RTSP_EINTR) {
 #ifdef TIZEN_FEATURE_RTSP_MODIFICATION
-          gst_rtspsrc_post_error_message ( src,
-                                       GST_RTSPSRC_ERROR_SERVER_DISCONNECTED,"Could not receive message.");
+          gst_rtspsrc_post_error_message (src,
+              GST_RTSPSRC_ERROR_SERVER_DISCONNECTED,
+              "Could not receive message.");
 #else
           GST_ELEMENT_ERROR (src, RESOURCE, READ, (NULL),
               ("Could not receive message. (%s)", str));
@@ -6226,8 +6227,8 @@ error_response:
     switch (response->type_data.response.code) {
       case GST_RTSP_STS_NOT_FOUND:
 #ifdef TIZEN_FEATURE_RTSP_MODIFICATION
-        gst_rtspsrc_post_error_message ( src,
-                                       GST_RTSPSRC_ERROR_BAD_REQUEST,"STS NOT FOUND");
+        gst_rtspsrc_post_error_message (src, GST_RTSPSRC_ERROR_BAD_REQUEST,
+            "STS NOT FOUND");
 #else
         GST_ELEMENT_ERROR (src, RESOURCE, NOT_FOUND, (NULL), ("%s",
                 response->type_data.response.reason));
@@ -6235,8 +6236,8 @@ error_response:
         break;
       case GST_RTSP_STS_UNAUTHORIZED:
 #ifdef TIZEN_FEATURE_RTSP_MODIFICATION
-        gst_rtspsrc_post_error_message ( src,
-                                       GST_RTSPSRC_ERROR_NOT_AUTHORIZED,"STS NOT AUTHORIZED");
+        gst_rtspsrc_post_error_message (src, GST_RTSPSRC_ERROR_NOT_AUTHORIZED,
+            "STS NOT AUTHORIZED");
 #else
         GST_ELEMENT_ERROR (src, RESOURCE, NOT_AUTHORIZED, (NULL), ("%s",
                 response->type_data.response.reason));
@@ -6286,8 +6287,8 @@ error_response:
         break;
       default:
 #ifdef TIZEN_FEATURE_RTSP_MODIFICATION
-        gst_rtspsrc_post_error_message ( src,
-                                       GST_RTSPSRC_ERROR_UNEXPECTED_MSG,"Got error response from Server");
+        gst_rtspsrc_post_error_message (src, GST_RTSPSRC_ERROR_UNEXPECTED_MSG,
+            "Got error response from Server");
 #else
         GST_ELEMENT_ERROR (src, RESOURCE, READ, (NULL),
             ("Got error response: %d (%s).", response->type_data.response.code,
@@ -6369,8 +6370,8 @@ gst_rtspsrc_parse_methods (GstRTSPSrc * src, GstRTSPMessage * response)
 no_describe:
   {
 #ifdef TIZEN_FEATURE_RTSP_MODIFICATION
-    gst_rtspsrc_post_error_message ( src,
-                                       GST_RTSPSRC_ERROR_METHOD_NOT_ALLOWED,"Server does not support DESCRIBE.");
+    gst_rtspsrc_post_error_message (src, GST_RTSPSRC_ERROR_METHOD_NOT_ALLOWED,
+        "Server does not support DESCRIBE.");
 #else
     GST_ELEMENT_ERROR (src, RESOURCE, OPEN_READ, (NULL),
         ("Server does not support DESCRIBE."));
@@ -6380,8 +6381,8 @@ no_describe:
 no_setup:
   {
 #ifdef TIZEN_FEATURE_RTSP_MODIFICATION
-    gst_rtspsrc_post_error_message ( src,
-                                       GST_RTSPSRC_ERROR_METHOD_NOT_ALLOWED,"Server does not support SETUP.");
+    gst_rtspsrc_post_error_message (src, GST_RTSPSRC_ERROR_METHOD_NOT_ALLOWED,
+        "Server does not support SETUP.");
 #else
     GST_ELEMENT_ERROR (src, RESOURCE, OPEN_READ, (NULL),
         ("Server does not support SETUP."));
@@ -7085,8 +7086,8 @@ gst_rtspsrc_setup_streams (GstRTSPSrc * src, gboolean async)
 no_protocols:
   {
 #ifdef TIZEN_FEATURE_RTSP_MODIFICATION
-    gst_rtspsrc_post_error_message ( src,
-                                       GST_RTSPSRC_ERROR_INVALID_PROTOCOL,"Could not connect to server, no protocols left");
+    gst_rtspsrc_post_error_message (src, GST_RTSPSRC_ERROR_INVALID_PROTOCOL,
+        "Could not connect to server, no protocols left");
 #else
     /* no transport possible, post an error and stop */
     GST_ELEMENT_ERROR (src, RESOURCE, READ, (NULL),
@@ -7097,8 +7098,8 @@ no_protocols:
 no_streams:
   {
 #ifdef TIZEN_FEATURE_RTSP_MODIFICATION
-    gst_rtspsrc_post_error_message ( src,
-                                       GST_RTSPSRC_ERROR_CONTENT_NOT_FOUND,"SDP contains no streams");
+    gst_rtspsrc_post_error_message (src, GST_RTSPSRC_ERROR_CONTENT_NOT_FOUND,
+        "SDP contains no streams");
 #else
     GST_ELEMENT_ERROR (src, RESOURCE, SETTINGS, (NULL),
         ("SDP contains no streams"));
@@ -7110,8 +7111,8 @@ create_request_failed:
     gchar *str = gst_rtsp_strresult (res);
 
 #ifdef TIZEN_FEATURE_RTSP_MODIFICATION
-    gst_rtspsrc_post_error_message ( src,
-                                       GST_RTSPSRC_ERROR_BAD_REQUEST,"Could not create request.");
+    gst_rtspsrc_post_error_message (src, GST_RTSPSRC_ERROR_BAD_REQUEST,
+        "Could not create request.");
 #else
     GST_ELEMENT_ERROR (src, LIBRARY, INIT, (NULL),
         ("Could not create request. (%s)", str));
@@ -7122,8 +7123,8 @@ create_request_failed:
 setup_transport_failed:
   {
 #ifdef TIZEN_FEATURE_RTSP_MODIFICATION
-    gst_rtspsrc_post_error_message ( src,
-                                       GST_RTSPSRC_ERROR_BAD_REQUEST,"Could not setup transport.");
+    gst_rtspsrc_post_error_message (src, GST_RTSPSRC_ERROR_BAD_REQUEST,
+        "Could not setup transport.");
 #else
     GST_ELEMENT_ERROR (src, RESOURCE, SETTINGS, (NULL),
         ("Could not setup transport."));
@@ -7133,11 +7134,13 @@ setup_transport_failed:
   }
 response_error:
   {
+#ifndef TIZEN_FEATURE_RTSP_MODIFICATION
     const gchar *str = gst_rtsp_status_as_text (code);
+#endif
 
 #ifdef TIZEN_FEATURE_RTSP_MODIFICATION
-    gst_rtspsrc_post_error_message ( src,
-                                       GST_RTSPSRC_ERROR_UNEXPECTED_MSG,"Error from Server .");
+    gst_rtspsrc_post_error_message (src, GST_RTSPSRC_ERROR_UNEXPECTED_MSG,
+        "Error from Server .");
 #else
     GST_ELEMENT_ERROR (src, RESOURCE, WRITE, (NULL),
         ("Error (%d): %s", code, GST_STR_NULL (str)));
@@ -7151,8 +7154,8 @@ send_error:
 
     if (res != GST_RTSP_EINTR) {
 #ifdef TIZEN_FEATURE_RTSP_MODIFICATION
-      gst_rtspsrc_post_error_message ( src,
-                                       GST_RTSPSRC_ERROR_CONNECTION_FAIL,"Could not send message.");
+      gst_rtspsrc_post_error_message (src, GST_RTSPSRC_ERROR_CONNECTION_FAIL,
+          "Could not send message.");
 #else
       GST_ELEMENT_ERROR (src, RESOURCE, WRITE, (NULL),
           ("Could not send message. (%s)", str));
@@ -7166,8 +7169,8 @@ send_error:
 no_transport:
   {
 #ifdef TIZEN_FEATURE_RTSP_MODIFICATION
-    gst_rtspsrc_post_error_message ( src,
-                                       GST_RTSPSRC_ERROR_BAD_TRANSPORT,"Server did not select transport.");
+    gst_rtspsrc_post_error_message (src, GST_RTSPSRC_ERROR_BAD_TRANSPORT,
+        "Server did not select transport.");
 #else
     GST_ELEMENT_ERROR (src, RESOURCE, SETTINGS, (NULL),
         ("Server did not select transport."));
@@ -7180,8 +7183,9 @@ nothing_to_activate:
     /* none of the available error codes is really right .. */
     if (unsupported_real) {
 #ifdef TIZEN_FEATURE_RTSP_MODIFICATION
-      gst_rtspsrc_post_error_message ( src,
-                                       GST_RTSPSRC_ERROR_UNSUPPORTED_MEDIA_TYPE,"No supported stream was found. You might need to install a GStreamer RTSP extension plugin for Real media streams.");
+      gst_rtspsrc_post_error_message (src,
+          GST_RTSPSRC_ERROR_UNSUPPORTED_MEDIA_TYPE,
+          "No supported stream was found. You might need to install a GStreamer RTSP extension plugin for Real media streams.");
 #else
       GST_ELEMENT_ERROR (src, STREAM, CODEC_NOT_FOUND,
           (_("No supported stream was found. You might need to install a "
@@ -7190,8 +7194,9 @@ nothing_to_activate:
 #endif
     } else {
 #ifdef TIZEN_FEATURE_RTSP_MODIFICATION
-      gst_rtspsrc_post_error_message ( src,
-                                       GST_RTSPSRC_ERROR_UNSUPPORTED_MEDIA_TYPE,"No supported stream was found. You might need to allow more transport protocols or may otherwise be missing the right GStreamer RTSP extension plugin.");
+      gst_rtspsrc_post_error_message (src,
+          GST_RTSPSRC_ERROR_UNSUPPORTED_MEDIA_TYPE,
+          "No supported stream was found. You might need to allow more transport protocols or may otherwise be missing the right GStreamer RTSP extension plugin.");
 #else
       GST_ELEMENT_ERROR (src, STREAM, CODEC_NOT_FOUND,
           (_("No supported stream was found. You might need to allow "
@@ -7450,14 +7455,11 @@ gst_rtspsrc_open_from_sdp (GstRTSPSrc * src, GstSDPMessage * sdp,
   src->state = GST_RTSP_STATE_INIT;
 #ifdef TIZEN_FEATURE_RTSP_MODIFICATION
   /* Check for the support for the Media codecs */
-  if ((!src->is_audio_codec_supported)&&(!src->is_video_codec_supported))
-  {
-       GST_ERROR_OBJECT (src, "UnSupported Media Type !!!! \n");
-       goto unsupported_file_type;
-  }
-  else
-  {
-       GST_DEBUG_OBJECT (src, "Supported Media Type. \n");
+  if ((!src->is_audio_codec_supported) && (!src->is_video_codec_supported)) {
+    GST_ERROR_OBJECT (src, "UnSupported Media Type !!!! \n");
+    goto unsupported_file_type;
+  } else {
+    GST_DEBUG_OBJECT (src, "Supported Media Type. \n");
   }
 #endif
   /* setup streams */
@@ -7480,10 +7482,11 @@ setup_failed:
     return res;
   }
 #ifdef TIZEN_FEATURE_RTSP_MODIFICATION
-  unsupported_file_type:
+unsupported_file_type:
   {
-    gst_rtspsrc_post_error_message ( src,
-                                       GST_RTSPSRC_ERROR_UNSUPPORTED_MEDIA_TYPE,"No supported stream was found");
+    gst_rtspsrc_post_error_message (src,
+        GST_RTSPSRC_ERROR_UNSUPPORTED_MEDIA_TYPE,
+        "No supported stream was found");
     res = GST_RTSP_ERROR;
     gst_rtspsrc_cleanup (src);
     return res;
@@ -7607,8 +7610,8 @@ restart:
 no_url:
   {
 #ifdef TIZEN_FEATURE_RTSP_MODIFICATION
-    gst_rtspsrc_post_error_message ( src,
-                                       GST_RTSPSRC_ERROR_INVALID_URL,"No valid RTSP URL was provided");
+    gst_rtspsrc_post_error_message (src, GST_RTSPSRC_ERROR_INVALID_URL,
+        "No valid RTSP URL was provided");
 #else
     GST_ELEMENT_ERROR (src, RESOURCE, NOT_FOUND, (NULL),
         ("No valid RTSP URL was provided"));
@@ -7621,8 +7624,8 @@ connect_failed:
 
     if (res != GST_RTSP_EINTR) {
 #ifdef TIZEN_FEATURE_RTSP_MODIFICATION
-      gst_rtspsrc_post_error_message ( src,
-                                       GST_RTSPSRC_ERROR_CONNECTION_FAIL,"Failed to connect.");
+      gst_rtspsrc_post_error_message (src, GST_RTSPSRC_ERROR_CONNECTION_FAIL,
+          "Failed to connect.");
 #else
       GST_ELEMENT_ERROR (src, RESOURCE, OPEN_READ_WRITE, (NULL),
           ("Failed to connect. (%s)", str));
@@ -7638,8 +7641,8 @@ create_request_failed:
     gchar *str = gst_rtsp_strresult (res);
 
 #ifdef TIZEN_FEATURE_RTSP_MODIFICATION
-    gst_rtspsrc_post_error_message ( src,
-                                       GST_RTSPSRC_ERROR_BAD_REQUEST,"Could not create request.");
+    gst_rtspsrc_post_error_message (src, GST_RTSPSRC_ERROR_BAD_REQUEST,
+        "Could not create request.");
 #else
     GST_ELEMENT_ERROR (src, LIBRARY, INIT, (NULL),
         ("Could not create request. (%s)", str));
@@ -7662,8 +7665,8 @@ methods_error:
 wrong_content_type:
   {
 #ifdef TIZEN_FEATURE_RTSP_MODIFICATION
-    gst_rtspsrc_post_error_message ( src,
-                                       GST_RTSPSRC_ERROR_OPTION_NOT_SUPPORTED,"Server does not support SDP. ");
+    gst_rtspsrc_post_error_message (src, GST_RTSPSRC_ERROR_OPTION_NOT_SUPPORTED,
+        "Server does not support SDP. ");
 #else
     GST_ELEMENT_ERROR (src, RESOURCE, SETTINGS, (NULL),
         ("Server does not support SDP, got %s.", respcont));
@@ -7674,8 +7677,8 @@ wrong_content_type:
 no_describe:
   {
 #ifdef TIZEN_FEATURE_RTSP_MODIFICATION
-    gst_rtspsrc_post_error_message ( src,
-                                       GST_RTSPSRC_ERROR_METHOD_NOT_ALLOWED,"Server can not provide an SDP.");
+    gst_rtspsrc_post_error_message (src, GST_RTSPSRC_ERROR_METHOD_NOT_ALLOWED,
+        "Server can not provide an SDP.");
 #else
     GST_ELEMENT_ERROR (src, RESOURCE, SETTINGS, (NULL),
         ("Server can not provide an SDP."));
@@ -7829,8 +7832,8 @@ create_request_failed:
     gchar *str = gst_rtsp_strresult (res);
 
 #ifdef TIZEN_FEATURE_RTSP_MODIFICATION
-    gst_rtspsrc_post_error_message ( src,
-                                       GST_RTSPSRC_ERROR_BAD_REQUEST,"Could not create request.");
+    gst_rtspsrc_post_error_message (src, GST_RTSPSRC_ERROR_BAD_REQUEST,
+        "Could not create request.");
 #else
     GST_ELEMENT_ERROR (src, LIBRARY, INIT, (NULL),
         ("Could not create request. (%s)", str));
@@ -7845,8 +7848,8 @@ send_error:
     gst_rtsp_message_unset (&request);
     if (res != GST_RTSP_EINTR) {
 #ifdef TIZEN_FEATURE_RTSP_MODIFICATION
-      gst_rtspsrc_post_error_message ( src,
-                                       GST_RTSPSRC_ERROR_CONNECTION_FAIL,"Could not send message.");
+      gst_rtspsrc_post_error_message (src, GST_RTSPSRC_ERROR_CONNECTION_FAIL,
+          "Could not send message.");
 #else
       GST_ELEMENT_ERROR (src, RESOURCE, WRITE, (NULL),
           ("Could not send message. (%s)", str));
@@ -7991,7 +7994,7 @@ gen_range_header (GstRTSPSrc * src, GstSegment * segment)
 {
   gchar val_str[G_ASCII_DTOSTR_BUF_SIZE] = { 0, };
 #ifdef TIZEN_FEATURE_RTSP_MODIFICATION
-  if (src->start_position !=0 && segment->position == 0) {
+  if (src->start_position != 0 && segment->position == 0) {
     segment->position = src->start_position;
     src->start_position = 0;
   }
@@ -8007,7 +8010,7 @@ gen_range_header (GstRTSPSrc * src, GstSegment * segment)
     }
   }
 #ifdef TIZEN_FEATURE_RTSP_MODIFICATION
-  GST_DEBUG_OBJECT (src, "Range Header Added : npt=%s-",val_str);
+  GST_DEBUG_OBJECT (src, "Range Header Added : npt=%s-", val_str);
 #endif
   return g_strdup_printf ("npt=%s-", val_str);
 }
@@ -8129,13 +8132,15 @@ gst_rtspsrc_play (GstRTSPSrc * src, GstSegment * segment, gboolean async)
       src->need_segment = TRUE;
     }
 #ifdef TIZEN_FEATURE_RTSP_MODIFICATION
-    else
-    {
+    else {
 /*
  Updating position with the MSL current position as gst_rtspsrc_get_position() does not return correct position.
 */
-      GST_DEBUG_OBJECT (src, " During normal pause-resume , segment->position=%" GST_TIME_FORMAT",src->start_position=%"GST_TIME_FORMAT,
-      GST_TIME_ARGS (segment->position),GST_TIME_ARGS (src->start_position));
+      GST_DEBUG_OBJECT (src,
+          " During normal pause-resume , segment->position=%" GST_TIME_FORMAT
+          ",src->start_position=%" GST_TIME_FORMAT,
+          GST_TIME_ARGS (segment->position),
+          GST_TIME_ARGS (src->start_position));
       segment->position = src->last_pos;
     }
 
@@ -8275,8 +8280,8 @@ create_request_failed:
     gchar *str = gst_rtsp_strresult (res);
 
 #ifdef TIZEN_FEATURE_RTSP_MODIFICATION
-      gst_rtspsrc_post_error_message ( src,
-                                       GST_RTSPSRC_ERROR_BAD_REQUEST,"Could not create request. ");
+    gst_rtspsrc_post_error_message (src, GST_RTSPSRC_ERROR_BAD_REQUEST,
+        "Could not create request. ");
 #else
     GST_ELEMENT_ERROR (src, LIBRARY, INIT, (NULL),
         ("Could not create request. (%s)", str));
@@ -8291,8 +8296,8 @@ send_error:
     gst_rtsp_message_unset (&request);
     if (res != GST_RTSP_EINTR) {
 #ifdef TIZEN_FEATURE_RTSP_MODIFICATION
-      gst_rtspsrc_post_error_message ( src,
-                                       GST_RTSPSRC_ERROR_CONNECTION_FAIL,"Could not send message.");
+      gst_rtspsrc_post_error_message (src, GST_RTSPSRC_ERROR_CONNECTION_FAIL,
+          "Could not send message.");
 #else
       GST_ELEMENT_ERROR (src, RESOURCE, WRITE, (NULL),
           ("Could not send message. (%s)", str));
@@ -8405,8 +8410,8 @@ create_request_failed:
     gchar *str = gst_rtsp_strresult (res);
 
 #ifdef TIZEN_FEATURE_RTSP_MODIFICATION
-      gst_rtspsrc_post_error_message ( src,
-                                       GST_RTSPSRC_ERROR_BAD_REQUEST,"Could not create request.");
+    gst_rtspsrc_post_error_message (src, GST_RTSPSRC_ERROR_BAD_REQUEST,
+        "Could not create request.");
 #else
     GST_ELEMENT_ERROR (src, LIBRARY, INIT, (NULL),
         ("Could not create request. (%s)", str));
@@ -8421,8 +8426,8 @@ send_error:
     gst_rtsp_message_unset (&request);
     if (res != GST_RTSP_EINTR) {
 #ifdef TIZEN_FEATURE_RTSP_MODIFICATION
-      gst_rtspsrc_post_error_message ( src,
-                                       GST_RTSPSRC_ERROR_CONNECTION_FAIL,"Could not send message. ");
+      gst_rtspsrc_post_error_message (src, GST_RTSPSRC_ERROR_CONNECTION_FAIL,
+          "Could not send message. ");
 #else
       GST_ELEMENT_ERROR (src, RESOURCE, WRITE, (NULL),
           ("Could not send message. (%s)", str));
@@ -8646,7 +8651,7 @@ gst_rtspsrc_change_state (GstElement * element, GstStateChange transition)
 #endif
 
   rtspsrc = GST_RTSPSRC (element);
-  GST_WARNING_OBJECT(rtspsrc, "State change transition: %d \n", transition);
+  GST_WARNING_OBJECT (rtspsrc, "State change transition: %d \n", transition);
 
   switch (transition) {
     case GST_STATE_CHANGE_NULL_TO_READY:
@@ -8689,13 +8694,15 @@ gst_rtspsrc_change_state (GstElement * element, GstStateChange transition)
     case GST_STATE_CHANGE_READY_TO_PAUSED:
 #ifdef TIZEN_FEATURE_RTSP_MODIFICATION
       /* don't change to PAUSE state before complete stream opend.
-              see gst_rtspsrc_loop_complete_cmd() */
-      g_mutex_lock(&(rtspsrc)->pause_lock);
+         see gst_rtspsrc_loop_complete_cmd() */
+      g_mutex_lock (&(rtspsrc)->pause_lock);
       end_time = g_get_monotonic_time () + 10 * G_TIME_SPAN_SECOND;
-      if (!g_cond_wait_until (&(rtspsrc)->open_end, &(rtspsrc)->pause_lock, end_time)) {
-        GST_WARNING_OBJECT(rtspsrc, "time out: stream opend is not completed yet..");
+      if (!g_cond_wait_until (&(rtspsrc)->open_end, &(rtspsrc)->pause_lock,
+              end_time)) {
+        GST_WARNING_OBJECT (rtspsrc,
+            "time out: stream opend is not completed yet..");
       }
-      g_mutex_unlock(&(rtspsrc)->pause_lock);
+      g_mutex_unlock (&(rtspsrc)->pause_lock);
 #endif
       ret = GST_STATE_CHANGE_NO_PREROLL;
       break;
index 1b7aef3..277d913 100644 (file)
@@ -76,7 +76,8 @@ export CFLAGS+=" -DTIZEN_FEATURE_V4L2SRC_MODIFICATION\
                -DTIZEN_FEATURE_GST_UPSTREAM\
                 -DTIZEN_FEATURE_RTSP_MODIFICATION\
                -DTIZEN_FEATURE_GST_MUX_ENHANCEMENT\
-               -DTIZEN_FEATURE_SOUP_MODIFICATION"
+               -DTIZEN_FEATURE_SOUP_MODIFICATION\
+               -DTIZEN_FEATURE_BASEPARSE_MODIFICATION"
 %configure\
 %if ! 0%{?ENABLE_AALIB}
        --disable-aalib\