mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-02 21:48:55 +00:00
ofa: cleanup
Avoid repeating casting to GstAudioFilter when one will do Use object related logging to make it easier to get just the logs we want https://bugzilla.gnome.org/show_bug.cgi?id=656641
This commit is contained in:
parent
683fbaa81a
commit
6ef56f56d7
1 changed files with 12 additions and 8 deletions
|
@ -115,9 +115,11 @@ static void
|
||||||
create_fingerprint (GstOFA * ofa)
|
create_fingerprint (GstOFA * ofa)
|
||||||
{
|
{
|
||||||
GstBuffer *buf;
|
GstBuffer *buf;
|
||||||
gint rate = GST_AUDIO_FILTER (ofa)->format.rate;
|
GstAudioFilter *ofa_filter = GST_AUDIO_FILTER (ofa);
|
||||||
gint channels = GST_AUDIO_FILTER (ofa)->format.channels;
|
gint rate = ofa_filter->format.rate;
|
||||||
gint endianness;
|
gint channels = ofa_filter->format.channels;
|
||||||
|
gint endianness =
|
||||||
|
ofa_filter->format.bigend ? OFA_BIG_ENDIAN : OFA_LITTLE_ENDIAN;
|
||||||
GstTagList *tags;
|
GstTagList *tags;
|
||||||
guint available;
|
guint available;
|
||||||
|
|
||||||
|
@ -135,7 +137,7 @@ create_fingerprint (GstOFA * ofa)
|
||||||
endianness = OFA_LITTLE_ENDIAN;
|
endianness = OFA_LITTLE_ENDIAN;
|
||||||
|
|
||||||
|
|
||||||
GST_DEBUG ("Generating fingerprint");
|
GST_DEBUG_OBJECT (ofa, "Generating fingerprint");
|
||||||
|
|
||||||
buf = gst_adapter_take_buffer (ofa->adapter, available);
|
buf = gst_adapter_take_buffer (ofa->adapter, available);
|
||||||
|
|
||||||
|
@ -143,7 +145,7 @@ create_fingerprint (GstOFA * ofa)
|
||||||
endianness, GST_BUFFER_SIZE (buf) / 2, rate,
|
endianness, GST_BUFFER_SIZE (buf) / 2, rate,
|
||||||
(channels == 2) ? 1 : 0));
|
(channels == 2) ? 1 : 0));
|
||||||
|
|
||||||
GST_DEBUG ("Generated fingerprint");
|
GST_DEBUG_OBJECT (ofa, "Generated fingerprint");
|
||||||
|
|
||||||
gst_buffer_unref (buf);
|
gst_buffer_unref (buf);
|
||||||
|
|
||||||
|
@ -165,7 +167,8 @@ gst_ofa_event (GstBaseTransform * trans, GstEvent * event)
|
||||||
switch (GST_EVENT_TYPE (event)) {
|
switch (GST_EVENT_TYPE (event)) {
|
||||||
case GST_EVENT_FLUSH_STOP:
|
case GST_EVENT_FLUSH_STOP:
|
||||||
case GST_EVENT_NEWSEGMENT:
|
case GST_EVENT_NEWSEGMENT:
|
||||||
GST_DEBUG ("Got %s event, clearing buffer", GST_EVENT_TYPE_NAME (event));
|
GST_DEBUG_OBJECT (ofa, "Got %s event, clearing buffer",
|
||||||
|
GST_EVENT_TYPE_NAME (event));
|
||||||
gst_adapter_clear (ofa->adapter);
|
gst_adapter_clear (ofa->adapter);
|
||||||
ofa->record = TRUE;
|
ofa->record = TRUE;
|
||||||
g_free (ofa->fingerprint);
|
g_free (ofa->fingerprint);
|
||||||
|
@ -200,10 +203,11 @@ static GstFlowReturn
|
||||||
gst_ofa_transform_ip (GstBaseTransform * trans, GstBuffer * buf)
|
gst_ofa_transform_ip (GstBaseTransform * trans, GstBuffer * buf)
|
||||||
{
|
{
|
||||||
GstOFA *ofa = GST_OFA (trans);
|
GstOFA *ofa = GST_OFA (trans);
|
||||||
|
GstAudioFilter *ofa_filter = GST_AUDIO_FILTER (ofa);
|
||||||
guint64 nframes;
|
guint64 nframes;
|
||||||
GstClockTime duration;
|
GstClockTime duration;
|
||||||
gint rate = GST_AUDIO_FILTER (ofa)->format.rate;
|
gint rate = ofa_filter->format.rate;
|
||||||
gint channels = GST_AUDIO_FILTER (ofa)->format.channels;
|
gint channels = ofa_filter->format.channels;
|
||||||
|
|
||||||
g_return_val_if_fail (rate > 0 && channels > 0, GST_FLOW_NOT_NEGOTIATED);
|
g_return_val_if_fail (rate > 0 && channels > 0, GST_FLOW_NOT_NEGOTIATED);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue