tag: Update for taglist/tag event API changes
This commit is contained in:
parent
dd3ae904f9
commit
afd50a79f4
@ -151,7 +151,7 @@ gst_chromaprint_create_fingerprint (GstChromaprint * chromaprint)
|
|||||||
chromaprint->fingerprint, NULL);
|
chromaprint->fingerprint, NULL);
|
||||||
|
|
||||||
gst_pad_push_event (GST_BASE_TRANSFORM_SRC_PAD (chromaprint),
|
gst_pad_push_event (GST_BASE_TRANSFORM_SRC_PAD (chromaprint),
|
||||||
gst_event_new_tag ("chromaprint", tags));
|
gst_event_new_tag (tags));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -446,7 +446,7 @@ gme_setup (GstGmeDec * gme)
|
|||||||
gst_tag_list_add (taglist, GST_TAG_MERGE_REPLACE,
|
gst_tag_list_add (taglist, GST_TAG_MERGE_REPLACE,
|
||||||
GST_TAG_DURATION, total_duration, NULL);
|
GST_TAG_DURATION, total_duration, NULL);
|
||||||
|
|
||||||
gst_pad_push_event (gme->srcpad, gst_event_new_tag ("GstDecoder", taglist));
|
gst_pad_push_event (gme->srcpad, gst_event_new_tag (taglist));
|
||||||
|
|
||||||
g_free (info);
|
g_free (info);
|
||||||
|
|
||||||
|
@ -98,7 +98,7 @@ enum
|
|||||||
#define FORMATS "{ "GST_AUDIO_NE (S32)", "GST_AUDIO_NE (S16)", U8 }"
|
#define FORMATS "{ "GST_AUDIO_NE (S32)", "GST_AUDIO_NE (S16)", U8 }"
|
||||||
|
|
||||||
static GstStaticPadTemplate modplug_src_template_factory =
|
static GstStaticPadTemplate modplug_src_template_factory =
|
||||||
GST_STATIC_PAD_TEMPLATE ("src",
|
GST_STATIC_PAD_TEMPLATE ("src",
|
||||||
GST_PAD_SRC,
|
GST_PAD_SRC,
|
||||||
GST_PAD_ALWAYS,
|
GST_PAD_ALWAYS,
|
||||||
GST_STATIC_CAPS ("audio/x-raw,"
|
GST_STATIC_CAPS ("audio/x-raw,"
|
||||||
@ -451,7 +451,7 @@ gst_modplug_load_song (GstModPlug * modplug)
|
|||||||
GstCaps *newcaps;
|
GstCaps *newcaps;
|
||||||
GstStructure *structure;
|
GstStructure *structure;
|
||||||
GstMapInfo map;
|
GstMapInfo map;
|
||||||
const gchar * format;
|
const gchar *format;
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (modplug, "Setting caps");
|
GST_DEBUG_OBJECT (modplug, "Setting caps");
|
||||||
|
|
||||||
@ -461,22 +461,24 @@ gst_modplug_load_song (GstModPlug * modplug)
|
|||||||
}
|
}
|
||||||
newcaps = gst_caps_make_writable (newcaps);
|
newcaps = gst_caps_make_writable (newcaps);
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (modplug, "allowed caps %"GST_PTR_FORMAT, newcaps);
|
GST_DEBUG_OBJECT (modplug, "allowed caps %" GST_PTR_FORMAT, newcaps);
|
||||||
|
|
||||||
structure = gst_caps_get_structure (newcaps, 0);
|
structure = gst_caps_get_structure (newcaps, 0);
|
||||||
|
|
||||||
if (!gst_structure_fixate_field_string (structure, "format", GST_AUDIO_NE (S16)))
|
if (!gst_structure_fixate_field_string (structure, "format",
|
||||||
|
GST_AUDIO_NE (S16)))
|
||||||
GST_WARNING_OBJECT (modplug, "Failed to fixate format to S16NE");
|
GST_WARNING_OBJECT (modplug, "Failed to fixate format to S16NE");
|
||||||
if (!gst_structure_fixate_field_nearest_int (structure, "rate", 44100))
|
if (!gst_structure_fixate_field_nearest_int (structure, "rate", 44100))
|
||||||
GST_WARNING_OBJECT (modplug, "Failed to fixate rate to 44100");
|
GST_WARNING_OBJECT (modplug, "Failed to fixate rate to 44100");
|
||||||
if (!gst_structure_fixate_field_nearest_int (structure, "channels", 2))
|
if (!gst_structure_fixate_field_nearest_int (structure, "channels", 2))
|
||||||
GST_WARNING_OBJECT (modplug, "Failed to fixate number of channels to stereo");
|
GST_WARNING_OBJECT (modplug,
|
||||||
|
"Failed to fixate number of channels to stereo");
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (modplug, "normalized caps %"GST_PTR_FORMAT, newcaps);
|
GST_DEBUG_OBJECT (modplug, "normalized caps %" GST_PTR_FORMAT, newcaps);
|
||||||
|
|
||||||
newcaps = gst_caps_fixate (newcaps);
|
newcaps = gst_caps_fixate (newcaps);
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (modplug, "fixated caps %"GST_PTR_FORMAT, newcaps);
|
GST_DEBUG_OBJECT (modplug, "fixated caps %" GST_PTR_FORMAT, newcaps);
|
||||||
|
|
||||||
/* set up modplug to output the negotiated format */
|
/* set up modplug to output the negotiated format */
|
||||||
structure = gst_caps_get_structure (newcaps, 0);
|
structure = gst_caps_get_structure (newcaps, 0);
|
||||||
@ -676,7 +678,7 @@ gst_modplug_loop (GstModPlug * modplug)
|
|||||||
if (modplug->offset == modplug->song_size) {
|
if (modplug->offset == modplug->song_size) {
|
||||||
GstTagList *tags;
|
GstTagList *tags;
|
||||||
gboolean ok;
|
gboolean ok;
|
||||||
#define COMMENT_SIZE 16384
|
#define COMMENT_SIZE 16384
|
||||||
gchar comment[COMMENT_SIZE];
|
gchar comment[COMMENT_SIZE];
|
||||||
GstSegment seg;
|
GstSegment seg;
|
||||||
|
|
||||||
@ -706,7 +708,7 @@ gst_modplug_loop (GstModPlug * modplug)
|
|||||||
gst_tag_list_add (tags, GST_TAG_MERGE_APPEND,
|
gst_tag_list_add (tags, GST_TAG_MERGE_APPEND,
|
||||||
GST_TAG_COMMENT, comment, NULL);
|
GST_TAG_COMMENT, comment, NULL);
|
||||||
}
|
}
|
||||||
gst_pad_push_event (modplug->srcpad, gst_event_new_tag ("GstDecoder", tags));
|
gst_pad_push_event (modplug->srcpad, gst_event_new_tag (tags));
|
||||||
} else {
|
} else {
|
||||||
/* not fully loaded yet */
|
/* not fully loaded yet */
|
||||||
return;
|
return;
|
||||||
@ -729,7 +731,7 @@ gst_modplug_loop (GstModPlug * modplug)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* read and output a buffer */
|
/* read and output a buffer */
|
||||||
GST_LOG_OBJECT (modplug, "Read %d bytes", (gint)modplug->read_bytes);
|
GST_LOG_OBJECT (modplug, "Read %d bytes", (gint) modplug->read_bytes);
|
||||||
/* libmodplug 0.8.7 trashes memory */
|
/* libmodplug 0.8.7 trashes memory */
|
||||||
out = gst_buffer_new_allocate (NULL, modplug->read_bytes * 2, NULL);
|
out = gst_buffer_new_allocate (NULL, modplug->read_bytes * 2, NULL);
|
||||||
|
|
||||||
|
@ -427,7 +427,7 @@ gst_schrodec_send_tags (GstSchroDec * schro_dec)
|
|||||||
GST_TAG_VIDEO_CODEC, "Dirac", NULL);
|
GST_TAG_VIDEO_CODEC, "Dirac", NULL);
|
||||||
|
|
||||||
gst_pad_push_event (GST_VIDEO_DECODER_SRC_PAD (schro_dec),
|
gst_pad_push_event (GST_VIDEO_DECODER_SRC_PAD (schro_dec),
|
||||||
gst_event_new_tag ("GstDecoder", list));
|
gst_event_new_tag (list));
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstFlowReturn
|
static GstFlowReturn
|
||||||
|
@ -243,7 +243,7 @@ gst_bpm_detect_transform_ip (GstBaseTransform * trans, GstBuffer * in)
|
|||||||
|
|
||||||
gst_tag_list_add (tags, GST_TAG_MERGE_REPLACE_ALL, GST_TAG_BEATS_PER_MINUTE,
|
gst_tag_list_add (tags, GST_TAG_MERGE_REPLACE_ALL, GST_TAG_BEATS_PER_MINUTE,
|
||||||
bpm, (void *) NULL);
|
bpm, (void *) NULL);
|
||||||
gst_pad_push_event (trans->srcpad, gst_event_new_tag ("bpmdetect", tags));
|
gst_pad_push_event (trans->srcpad, gst_event_new_tag (tags));
|
||||||
|
|
||||||
GST_INFO_OBJECT (bpm_detect, "Detected BPM: %lf\n", bpm);
|
GST_INFO_OBJECT (bpm_detect, "Detected BPM: %lf\n", bpm);
|
||||||
bpm_detect->bpm = bpm;
|
bpm_detect->bpm = bpm;
|
||||||
|
@ -327,7 +327,7 @@ gst_vp8_dec_send_tags (GstVP8Dec * dec)
|
|||||||
GST_TAG_VIDEO_CODEC, "VP8 video", NULL);
|
GST_TAG_VIDEO_CODEC, "VP8 video", NULL);
|
||||||
|
|
||||||
gst_pad_push_event (GST_VIDEO_DECODER_SRC_PAD (dec),
|
gst_pad_push_event (GST_VIDEO_DECODER_SRC_PAD (dec),
|
||||||
gst_event_new_tag ("GstDecoder", list));
|
gst_event_new_tag (list));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -456,7 +456,7 @@ gst_camera_bin_start_capture (GstCameraBin2 * camerabin)
|
|||||||
active_pad = gst_element_get_static_pad (camerabin->src,
|
active_pad = gst_element_get_static_pad (camerabin->src,
|
||||||
GST_BASE_CAMERA_SRC_VIDEO_PAD_NAME);
|
GST_BASE_CAMERA_SRC_VIDEO_PAD_NAME);
|
||||||
gst_pad_push_event (active_pad,
|
gst_pad_push_event (active_pad,
|
||||||
gst_event_new_tag ("GstSrc", gst_tag_list_copy (taglist)));
|
gst_event_new_tag (gst_tag_list_copy (taglist)));
|
||||||
|
|
||||||
gst_object_unref (active_pad);
|
gst_object_unref (active_pad);
|
||||||
}
|
}
|
||||||
@ -1364,7 +1364,7 @@ gst_camera_bin_image_src_buffer_probe (GstPad * pad, GstPadProbeInfo * info,
|
|||||||
GST_PTR_FORMAT, tags);
|
GST_PTR_FORMAT, tags);
|
||||||
if (tags) {
|
if (tags) {
|
||||||
peer = gst_pad_get_peer (pad);
|
peer = gst_pad_get_peer (pad);
|
||||||
gst_pad_send_event (peer, gst_event_new_tag ("GstSrc", tags));
|
gst_pad_send_event (peer, gst_event_new_tag (tags));
|
||||||
gst_object_unref (peer);
|
gst_object_unref (peer);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -1479,8 +1479,7 @@ push_new_segment:
|
|||||||
if (stream->taglist) {
|
if (stream->taglist) {
|
||||||
GST_DEBUG_OBJECT (stream->pad, "Sending tags %" GST_PTR_FORMAT,
|
GST_DEBUG_OBJECT (stream->pad, "Sending tags %" GST_PTR_FORMAT,
|
||||||
stream->taglist);
|
stream->taglist);
|
||||||
gst_pad_push_event (stream->pad, gst_event_new_tag ("GstDemuxer",
|
gst_pad_push_event (stream->pad, gst_event_new_tag (stream->taglist));
|
||||||
stream->taglist));
|
|
||||||
stream->taglist = NULL;
|
stream->taglist = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -786,7 +786,7 @@ gst_mpegv_parse_pre_push_frame (GstBaseParse * parse, GstBaseParseFrame * frame)
|
|||||||
g_free (codec);
|
g_free (codec);
|
||||||
|
|
||||||
gst_pad_push_event (GST_BASE_PARSE_SRC_PAD (mpvparse),
|
gst_pad_push_event (GST_BASE_PARSE_SRC_PAD (mpvparse),
|
||||||
gst_event_new_tag ("GstParser", taglist));
|
gst_event_new_tag (taglist));
|
||||||
|
|
||||||
mpvparse->send_codec_tag = FALSE;
|
mpvparse->send_codec_tag = FALSE;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user