All pastes #99381 Raw Edit

Unnamed

public text v1 · immutable
#99381 ·published 2006-07-25 07:55 UTC
rendered paste body
  } else if (strcmp (tag, GST_ID3_DEMUX_TAG_ID3V2_FRAME) == 0) {
    const GValue *val;
    GstBuffer *frame_data;
    ID3v2::FrameFactory * framefactory;  
    ID3v2::Frame * frame; 
    const gchar *mime_type;
    GstStructure *s;

    GST_DEBUG ("Found a binary blob");

    val = gst_tag_list_get_value_index (list, tag, 0);
    frame_data = (GstBuffer *) gst_value_get_mini_object (val);

    s = gst_caps_get_structure (GST_BUFFER_CAPS (frame_data), 0);
    mime_type = gst_structure_get_name (s);
    
    GST_DEBUG("Length %u and MIME type %s", GST_BUFFER_DATA (frame_data), mime_type);

    framefactory = ID3v2::FrameFactory::instance(); 

    GST_DEBUG ("Created FrameFactory");
    frame = framefactory->createFrame (ByteVector ((const char *) GST_BUFFER_DATA (frame_data)));
    GST_DEBUG ("Created Frame");

    id3v2tag->addFrame (frame); 
    GST_DEBUG ("Add Frame"); 
  } 
  else {
    GST_WARNING ("Unsupported tag: %s", tag);
  }