isomp4: fixup after small api changes
authorWim Taymans <wim.taymans@collabora.co.uk>
Fri, 5 Aug 2011 06:59:59 +0000 (08:59 +0200)
committerWim Taymans <wim.taymans@collabora.co.uk>
Fri, 5 Aug 2011 10:07:50 +0000 (12:07 +0200)
Port to recently changed api so that it compiles again.

configure.ac
gst/isomp4/gstqtmux.c
gst/isomp4/qtdemux.c

index b6c47e3..1757731 100644 (file)
@@ -313,7 +313,7 @@ dnl *** plug-ins to include ***
 dnl Non ported plugins (non-dependant, then dependant)
 dnl Make sure you have a space before and after all plugins
 GST_PLUGINS_NONPORTED=" deinterlace flx goom2k1 icydemux id3demux \
- imagefreeze interleave isomp4 law matroska monoscope shapewipe smpte \
+ imagefreeze interleave law matroska monoscope shapewipe smpte \
  videobox videocrop videomixer \
  annodex apetag cairo cairo_gobject dv1394 flac gdk_pixbuf jpeg libdv libpng \
  oss oss4 shout2 \
index f9759ce..fa08a42 100644 (file)
@@ -1265,7 +1265,7 @@ gst_qt_mux_send_buffered_data (GstQTMux * qtmux, guint64 * offset)
     gsize size;
 
     buf = gst_buffer_new_and_alloc (bufsize);
-    gst_buffer_map (buf, &size, NULL, GST_MAP_WRITE);
+    data = gst_buffer_map (buf, &size, NULL, GST_MAP_WRITE);
     size = fread (data, sizeof (guint8), bufsize, qtmux->fast_start_file);
     if (size == 0) {
       gst_buffer_unmap (buf, data, -1);
@@ -2963,9 +2963,11 @@ gst_qt_mux_video_sink_set_caps (GstPad * pad, GstCaps * caps)
   if (strcmp (mimetype, "video/x-raw") == 0) {
     const gchar *format;
     GstVideoFormat fmt;
+    const GstVideoFormatInfo *vinfo;
 
     format = gst_structure_get_string (structure, "format");
     fmt = gst_video_format_from_string (format);
+    vinfo = gst_video_format_get_info (fmt);
 
     switch (fmt) {
       case GST_VIDEO_FORMAT_UYVY:
@@ -2976,9 +2978,9 @@ gst_qt_mux_video_sink_set_caps (GstPad * pad, GstCaps * caps)
         sync = FALSE;
         break;
       default:
-        if (gst_video_format_is_rgb (fmt)) {
+        if (GST_VIDEO_FORMAT_INFO_FLAGS (vinfo) & GST_VIDEO_FORMAT_FLAG_RGB) {
           entry.fourcc = FOURCC_raw_;
-          entry.depth = gst_video_format_get_pixel_stride (fmt, 0) * 8;
+          entry.depth = GST_VIDEO_FORMAT_INFO_PSTRIDE (vinfo, 0) * 8;
           sync = FALSE;
         }
         break;
index 5ce5476..d04be37 100644 (file)
@@ -3411,6 +3411,7 @@ gst_qtdemux_clip_buffer (GstQTDemux * qtdemux, QtDemuxStream * stream,
   guint offset;
 
   size = gst_buffer_get_size (buf);
+  offset = 0;
 
   /* depending on the type, setup the clip parameters */
   if (stream->subtype == FOURCC_soun) {
@@ -3529,6 +3530,8 @@ gst_qtdemux_process_buffer (GstQTDemux * qtdemux, QtDemuxStream * stream,
     return buf;
   }
 
+  data = gst_buffer_map (buf, &size, NULL, GST_MAP_READ);
+
   if (G_LIKELY (size >= 2)) {
     nsize = GST_READ_UINT16_BE (data);
     nsize = MIN (nsize, size - 2);
@@ -3538,7 +3541,6 @@ gst_qtdemux_process_buffer (GstQTDemux * qtdemux, QtDemuxStream * stream,
 
   /* takes care of UTF-8 validation or UTF-16 recognition,
    * no other encoding expected */
-  data = gst_buffer_map (buf, &size, NULL, GST_MAP_READ);
   str = gst_tag_freeform_string_to_utf8 ((gchar *) data + 2, nsize, NULL);
   gst_buffer_unmap (buf, data, size);
   if (str) {
@@ -5253,7 +5255,7 @@ qtdemux_stbl_init (GstQTDemux * qtdemux, QtDemuxStream * stream, GNode * stbl)
   /* sync sample atom */
   stream->stps_present = FALSE;
   if ((stream->stss_present =
-          !!qtdemux_tree_get_child_by_type_full (stbl, FOURCC_stss,
+          ! !qtdemux_tree_get_child_by_type_full (stbl, FOURCC_stss,
               &stream->stss) ? TRUE : FALSE) == TRUE) {
     /* copy atom data into a new buffer for later use */
     stream->stss.data = g_memdup (stream->stss.data, stream->stss.size);
@@ -5271,7 +5273,7 @@ qtdemux_stbl_init (GstQTDemux * qtdemux, QtDemuxStream * stream, GNode * stbl)
 
     /* partial sync sample atom */
     if ((stream->stps_present =
-            !!qtdemux_tree_get_child_by_type_full (stbl, FOURCC_stps,
+            ! !qtdemux_tree_get_child_by_type_full (stbl, FOURCC_stps,
                 &stream->stps) ? TRUE : FALSE) == TRUE) {
       /* copy atom data into a new buffer for later use */
       stream->stps.data = g_memdup (stream->stps.data, stream->stps.size);
@@ -5390,7 +5392,7 @@ qtdemux_stbl_init (GstQTDemux * qtdemux, QtDemuxStream * stream, GNode * stbl)
 
   /* composition time-to-sample */
   if ((stream->ctts_present =
-          !!qtdemux_tree_get_child_by_type_full (stbl, FOURCC_ctts,
+          ! !qtdemux_tree_get_child_by_type_full (stbl, FOURCC_ctts,
               &stream->ctts) ? TRUE : FALSE) == TRUE) {
     /* copy atom data into a new buffer for later use */
     stream->ctts.data = g_memdup (stream->ctts.data, stream->ctts.size);