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

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Sebastian Dröge
  • Date: 2013-09-24 17:07:00 UTC
  • mfrom: (1.1.17) (7.1.9 experimental)
  • Revision ID: package-import@ubuntu.com-20130924170700-4dg62s3pwl0pdakz
Tags: 1.2.0-1
* New upstream stable release:
  + debian/control:
    - Build depend on GStreamer and gst-plugins-base >= 1.2.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
110
110
    return result;
111
111
}
112
112
 
113
 
static int rpl_read_header(AVFormatContext *s, AVFormatParameters *ap)
 
113
static int rpl_read_header(AVFormatContext *s)
114
114
{
115
115
    AVIOContext *pb = s->pb;
116
116
    RPLContext *rpl = s->priv_data;
156
156
    switch (vst->codec->codec_tag) {
157
157
#if 0
158
158
        case 122:
159
 
            vst->codec->codec_id = CODEC_ID_ESCAPE122;
 
159
            vst->codec->codec_id = AV_CODEC_ID_ESCAPE122;
160
160
            break;
161
161
#endif
162
162
        case 124:
163
 
            vst->codec->codec_id = CODEC_ID_ESCAPE124;
 
163
            vst->codec->codec_id = AV_CODEC_ID_ESCAPE124;
164
164
            // The header is wrong here, at least sometimes
165
165
            vst->codec->bits_per_coded_sample = 16;
166
166
            break;
167
167
#if 0
168
168
        case 130:
169
 
            vst->codec->codec_id = CODEC_ID_ESCAPE130;
 
169
            vst->codec->codec_id = AV_CODEC_ID_ESCAPE130;
170
170
            break;
171
171
#endif
172
172
        default:
173
173
            av_log(s, AV_LOG_WARNING,
174
174
                   "RPL video format %i not supported yet!\n",
175
175
                   vst->codec->codec_tag);
176
 
            vst->codec->codec_id = CODEC_ID_NONE;
 
176
            vst->codec->codec_id = AV_CODEC_ID_NONE;
177
177
    }
178
178
 
179
179
    // Audio headers
199
199
                               ast->codec->bits_per_coded_sample *
200
200
                               ast->codec->channels;
201
201
 
202
 
        ast->codec->codec_id = CODEC_ID_NONE;
 
202
        ast->codec->codec_id = AV_CODEC_ID_NONE;
203
203
        switch (audio_format) {
204
204
            case 1:
205
205
                if (ast->codec->bits_per_coded_sample == 16) {
206
206
                    // 16-bit audio is always signed
207
 
                    ast->codec->codec_id = CODEC_ID_PCM_S16LE;
 
207
                    ast->codec->codec_id = AV_CODEC_ID_PCM_S16LE;
208
208
                    break;
209
209
                }
210
210
                // There are some other formats listed as legal per the spec;
214
214
                if (ast->codec->bits_per_coded_sample == 8) {
215
215
                    // The samples with this kind of audio that I have
216
216
                    // are all unsigned.
217
 
                    ast->codec->codec_id = CODEC_ID_PCM_U8;
 
217
                    ast->codec->codec_id = AV_CODEC_ID_PCM_U8;
218
218
                    break;
219
219
                } else if (ast->codec->bits_per_coded_sample == 4) {
220
 
                    ast->codec->codec_id = CODEC_ID_ADPCM_IMA_EA_SEAD;
 
220
                    ast->codec->codec_id = AV_CODEC_ID_ADPCM_IMA_EA_SEAD;
221
221
                    break;
222
222
                }
223
223
                break;
224
224
        }
225
 
        if (ast->codec->codec_id == CODEC_ID_NONE) {
 
225
        if (ast->codec->codec_id == AV_CODEC_ID_NONE) {
226
226
            av_log(s, AV_LOG_WARNING,
227
227
                   "RPL audio format %i not supported yet!\n",
228
228
                   audio_format);
353
353
 
354
354
AVInputFormat ff_rpl_demuxer = {
355
355
    .name           = "rpl",
356
 
    .long_name      = NULL_IF_CONFIG_SMALL("RPL/ARMovie format"),
 
356
    .long_name      = NULL_IF_CONFIG_SMALL("RPL / ARMovie"),
357
357
    .priv_data_size = sizeof(RPLContext),
358
358
    .read_probe     = rpl_probe,
359
359
    .read_header    = rpl_read_header,