~ubuntu-branches/ubuntu/saucy/gst-libav1.0/saucy-proposed

« back to all changes in this revision

Viewing changes to gst-libs/ext/libav/libavformat/gsmdec.c

  • Committer: Package Import Robot
  • Author(s): Sebastian Dröge
  • Date: 2013-07-30 09:00:15 UTC
  • mfrom: (1.1.16) (7.1.7 experimental)
  • Revision ID: package-import@ubuntu.com-20130730090015-sc1ou2yssu7q5w4e
Tags: 1.1.3-1
* New upstream development snapshot:
  + debian/control:
    - Build depend on GStreamer and gst-plugins-base >= 1.1.3.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20
20
 */
21
21
 
 
22
#include "libavutil/channel_layout.h"
22
23
#include "libavutil/mathematics.h"
23
24
#include "libavutil/opt.h"
24
25
#include "avformat.h"
54
55
    return 0;
55
56
}
56
57
 
57
 
static int gsm_read_header(AVFormatContext *s, AVFormatParameters *ap)
 
58
static int gsm_read_header(AVFormatContext *s)
58
59
{
59
60
    GSMDemuxerContext *c = s->priv_data;
60
61
    AVStream *st = avformat_new_stream(s, NULL);
62
63
        return AVERROR(ENOMEM);
63
64
 
64
65
    st->codec->codec_type  = AVMEDIA_TYPE_AUDIO;
65
 
    st->codec->codec_id    = s->iformat->value;
 
66
    st->codec->codec_id    = s->iformat->raw_codec_id;
66
67
    st->codec->channels    = 1;
 
68
    st->codec->channel_layout = AV_CH_LAYOUT_MONO;
67
69
    st->codec->sample_rate = c->sample_rate;
68
70
    st->codec->bit_rate    = GSM_BLOCK_SIZE * 8 * c->sample_rate / GSM_BLOCK_SAMPLES;
69
71
 
74
76
 
75
77
static const AVOption options[] = {
76
78
    { "sample_rate", "", offsetof(GSMDemuxerContext, sample_rate),
77
 
       AV_OPT_TYPE_INT, {.dbl = GSM_SAMPLE_RATE}, 1, INT_MAX / GSM_BLOCK_SIZE,
 
79
       AV_OPT_TYPE_INT, {.i64 = GSM_SAMPLE_RATE}, 1, INT_MAX / GSM_BLOCK_SIZE,
78
80
       AV_OPT_FLAG_DECODING_PARAM },
79
81
    { NULL },
80
82
};
94
96
    .read_packet    = gsm_read_packet,
95
97
    .flags          = AVFMT_GENERIC_INDEX,
96
98
    .extensions     = "gsm",
97
 
    .value          = CODEC_ID_GSM,
 
99
    .raw_codec_id   = AV_CODEC_ID_GSM,
98
100
    .priv_class     = &class,
99
101
};