Skip to content

Commit

Permalink
Add support for MP3
Browse files Browse the repository at this point in the history
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
  • Loading branch information
felipec committed Sep 11, 2010
1 parent b9df0b3 commit 6443d77
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions gstavdec.c
Expand Up @@ -310,6 +310,11 @@ sink_setcaps(GstPad *pad,
memcpy(self->av_ctx->extradata, buf->data, buf->size);
self->av_ctx->extradata_size = buf->size;
}
else if (strcmp(name, "audio/mpeg") == 0) {
codec_id = CODEC_ID_MP3;
gst_structure_get_int(in_struc, "rate", &self->av_ctx->sample_rate);
gst_structure_get_int(in_struc, "channels", &self->av_ctx->channels);
}
else
codec_id = CODEC_ID_NONE;

Expand Down Expand Up @@ -356,6 +361,14 @@ generate_sink_template(void)

gst_caps_append_structure(caps, struc);

struc = gst_structure_new("audio/mpeg",
"mpegversion", G_TYPE_INT, 1,
"layer", G_TYPE_INT, 3,
"parsed", G_TYPE_BOOLEAN, TRUE,
NULL);

gst_caps_append_structure(caps, struc);

return caps;
}

Expand Down

0 comments on commit 6443d77

Please sign in to comment.