예제 #1
0
static void
gst_trm_emit_signature (GstTRM * trm)
{
  char signature[17];
  char ascii_sig[37];

  if (trm->signature_available)
    return;

  if (trm_FinalizeSignature (trm->trm, signature, NULL) == 0) {
    GstTagList *tags;

    trm_ConvertSigToASCII (trm->trm, signature, ascii_sig);
    ascii_sig[36] = '\0';
    GST_DEBUG_OBJECT (trm, "Signature : %s", ascii_sig);

    tags = gst_tag_list_new ();
    gst_tag_list_add (tags, GST_TAG_MERGE_REPLACE,
        GST_TAG_MUSICBRAINZ_TRMID, ascii_sig, NULL);
    gst_element_found_tags_for_pad (GST_ELEMENT (trm), trm->srcpad, tags);

    trm->signature_available = TRUE;
  } else {
    /* FIXME: should we be throwing an error here? */
  }
}
예제 #2
0
파일: k3btrm.cpp 프로젝트: KDE/k3b
bool K3b::TRM::finalize()
{
    if( trm_FinalizeSignature( d->trm, d->rawSig.data(), 0 ) == 0 ) {
        trm_ConvertSigToASCII( d->trm, d->rawSig.data(), d->sig.data() );
        return true;
    }
    else
        return false;
}