~ubuntu-branches/ubuntu/precise/gst-plugins-bad0.10/precise-proposed

« back to all changes in this revision

Viewing changes to gst/nsf/gstnsf.c

Tags: upstream-0.10.5.3
Import upstream version 0.10.5.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
180
180
static void
181
181
gst_nsfdec_init (GstNsfDec * nsfdec)
182
182
{
183
 
  nsfdec->sinkpad =
184
 
      gst_pad_new_from_template (gst_static_pad_template_get (&sink_templ),
185
 
      "sink");
 
183
  nsfdec->sinkpad = gst_pad_new_from_static_template (&sink_templ, "sink");
186
184
  gst_pad_set_query_function (nsfdec->sinkpad, NULL);
187
185
  gst_pad_set_event_function (nsfdec->sinkpad, gst_nsfdec_sink_event);
188
186
  gst_pad_set_chain_function (nsfdec->sinkpad, gst_nsfdec_chain);
189
187
  gst_element_add_pad (GST_ELEMENT (nsfdec), nsfdec->sinkpad);
190
188
 
191
 
  nsfdec->srcpad =
192
 
      gst_pad_new_from_template (gst_static_pad_template_get (&src_templ),
193
 
      "src");
 
189
  nsfdec->srcpad = gst_pad_new_from_static_template (&src_templ, "src");
194
190
  gst_pad_set_event_function (nsfdec->srcpad, gst_nsfdec_src_event);
195
191
  gst_pad_set_query_function (nsfdec->srcpad, gst_nsfdec_src_query);
196
192
  gst_pad_use_fixed_caps (nsfdec->srcpad);
218
214
  if (nsfdec->tune_buffer)
219
215
    gst_buffer_unref (nsfdec->tune_buffer);
220
216
 
 
217
  if (nsfdec->taglist)
 
218
    gst_tag_list_free (nsfdec->taglist);
 
219
 
221
220
  G_OBJECT_CLASS (parent_class)->finalize (object);
222
221
}
223
222
 
374
373
  if (!nsfdec_negotiate (nsfdec))
375
374
    goto could_not_negotiate;
376
375
 
 
376
  nsfdec->taglist = gst_tag_list_new ();
 
377
  gst_tag_list_add (nsfdec->taglist, GST_TAG_MERGE_REPLACE,
 
378
      GST_TAG_AUDIO_CODEC, "NES Sound Format", NULL);
 
379
 
 
380
  if (nsfdec->nsf->artist_name)
 
381
    gst_tag_list_add (nsfdec->taglist, GST_TAG_MERGE_REPLACE,
 
382
        GST_TAG_ARTIST, nsfdec->nsf->artist_name, NULL);
 
383
 
 
384
  if (nsfdec->nsf->song_name)
 
385
    gst_tag_list_add (nsfdec->taglist, GST_TAG_MERGE_REPLACE,
 
386
        GST_TAG_TITLE, nsfdec->nsf->song_name, NULL);
 
387
 
 
388
  gst_element_post_message (GST_ELEMENT_CAST (nsfdec),
 
389
      gst_message_new_tag (GST_OBJECT (nsfdec),
 
390
          gst_tag_list_copy (nsfdec->taglist)));
 
391
 
377
392
  nsf_playtrack (nsfdec->nsf,
378
393
      nsfdec->tune_number, nsfdec->frequency, nsfdec->bits, nsfdec->stereo);
379
394
  nsf_setfilter (nsfdec->nsf, nsfdec->filter);